本文整理汇总了C#中ItemType类的典型用法代码示例。如果您正苦于以下问题:C# ItemType类的具体用法?C# ItemType怎么用?C# ItemType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ItemType类属于命名空间,在下文中一共展示了ItemType类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Item
public Item(ItemType type, Vector2 pos)
{
Type = type;
Position = pos;
Active = true;
Rotation = (float)Helper.Random.NextDouble() * MathHelper.Pi;
}
开发者ID:GarethIW,项目名称:Hunted,代码行数:7,代码来源:Item.cs
示例2: CreateItemsFromAFolder
public void CreateItemsFromAFolder(
string storageConnectionString,
string storeName,
string applicationName,
string folderPath,
string searchPattern,
ItemType itemType)
{
using (IAzManStorage storage = new SqlAzManStorage(storageConnectionString))
{
storage.OpenConnection();
storage.BeginTransaction();
try
{
IAzManApplication app = storage.GetStore(storeName).GetApplication(applicationName);
DirectoryInfo di = new DirectoryInfo(folderPath);
foreach (FileInfo fi in di.GetFiles(searchPattern))
{
//Use some recursive function to get subfolder files
app.CreateItem(fi.Name, String.Empty, itemType);
}
storage.CommitTransaction();
}
catch
{
storage.RollBackTransaction();
}
finally
{
storage.Dispose();
}
}
}
开发者ID:JamesTryand,项目名称:NetSqlAzMan,代码行数:33,代码来源:Form1.cs
示例3: PhotoStub
public PhotoStub(
string guid,
ItemType type,
string dateTime,
string roomGuid,
int width,
int height,
string url,
string web,
string icon,
string thumb,
int thumbWidth,
int thumbHeight,
bool buddyAlert)
: base(guid, type, dateTime, roomGuid)
{
this.width = width;
this.height = height;
this.url = url;
this.web = web;
this.icon = icon;
this.thumb = thumb;
this.thumbWidth = thumbWidth;
this.thumbHeight = thumbHeight;
this.buddyAlert = buddyAlert;
}
开发者ID:davelondon,项目名称:dontstayin,代码行数:26,代码来源:PhotoStub.cs
示例4: SetDefault
private void SetDefault(ItemType choice)
{
if (choice != ItemType.Customized)
{
if (choice == ItemType.Normal)
{
this.Parts.Add(Job.Function.LaserCutter);
this.Parts.Add(Job.Function.Bending);
this.Parts.Add(Job.Function.Assembling);
}
else if (choice == ItemType.Bread)
{
this.Parts.Add(Job.Function.Milling);
this.Parts.Add(Job.Function.LaserCutter);
this.Parts.Add(Job.Function.Bending);
this.Parts.Add(Job.Function.Assembling);
}
else if (choice == ItemType.Toast)
{
this.Parts.Add(Job.Function.Milling);
this.Parts.Add(Job.Function.Punching);
this.Parts.Add(Job.Function.LaserCutter);
this.Parts.Add(Job.Function.Shears);
this.Parts.Add(Job.Function.Bending);
this.Parts.Add(Job.Function.Assembling);
}
else if (choice == ItemType.Press)
{
this.Parts.Add(Job.Function.Milling);
this.Parts.Add(Job.Function.Bending);
this.Parts.Add(Job.Function.Assembling);
}
}
}
开发者ID:enchman,项目名称:jobboard,代码行数:34,代码来源:Item.cs
示例5: ChangeRequest
public ChangeRequest(string path, string target, RequestType requestType, ItemType itemType)
{
this.item = new ItemSpec(path, RecursionType.None);
this.target = target;
this.requestType = requestType;
this.itemType = itemType;
}
开发者ID:Jeff-Lewis,项目名称:opentf,代码行数:7,代码来源:ChangeRequest.cs
示例6: GetLatest
public IEnumerable<Item> GetLatest(ItemType? type, DateTime? fromDate, DateTime? toDate, int? limit)
{
var query = this.Items.AsQueryable();
if (type.HasValue)
{
query = query.Where(i => i.ItemType == type.Value);
}
if (fromDate.HasValue)
{
query = query.Where(i => i.Published > fromDate.Value);
}
if (toDate.HasValue)
{
query = query.Where(i => i.Published < toDate.Value);
}
query = query.OrderByDescending(i => i.Published);
if (limit.HasValue)
{
query = query.Take(limit.Value);
}
return query.ToList();
}
开发者ID:mmozuras,项目名称:DotNetGroup,代码行数:28,代码来源:StreamStorage.cs
示例7: LoadYears
public System.Collections.Generic.IEnumerable<Int32> LoadYears(ItemType itemType)
{
System.Collections.Generic.List<DateTime> source = (from p in
(from p in ViewModelLocator.AccountItemViewModel.AccountBookDataContext.AccountItems
where ((int)p.Type) == ((int)itemType)
select p.CreateTime.Date).Distinct<System.DateTime>()
orderby p.Year descending
select p).ToList<System.DateTime>();
System.Collections.Generic.List<Int32> list2 = (from p in source select p.Year).Distinct<int>().ToList<int>();
System.Collections.Generic.List<Int32> list3 = null;
using (System.Collections.Generic.List<int>.Enumerator enumerator = list2.GetEnumerator())
{
System.Func<DateTime, Boolean> predicate = null;
int year;
while (enumerator.MoveNext())
{
year = enumerator.Current;
if (predicate == null)
{
predicate = p => p.Year == year;
}
list3 = (from p in
(from p in source.Where<System.DateTime>(predicate) select p.Month).Distinct<int>()
orderby p descending
select p).ToList<int>();
if (list3.Count != 0)
{
this.yearWithMonths[year] = list3;
}
}
}
return list2;
}
开发者ID:RukaiYu,项目名称:TinyMoneyManager.WP8,代码行数:33,代码来源:DateConfigViewModel.cs
示例8: GetIcon
public static Icon GetIcon(string path, ItemType type, IconSize size, ItemState state)
{
var flags = (uint)(Interop.SHGFI_ICON | Interop.SHGFI_USEFILEATTRIBUTES);
var attribute = (uint)(object.Equals(type, ItemType.Folder) ? Interop.FILE_ATTRIBUTE_DIRECTORY : Interop.FILE_ATTRIBUTE_FILE);
if (object.Equals(type, ItemType.Folder) && object.Equals(state, ItemState.Open))
{
flags += Interop.SHGFI_OPENICON;
}
if (object.Equals(size, IconSize.Small))
{
flags += Interop.SHGFI_SMALLICON;
}
else
{
flags += Interop.SHGFI_LARGEICON;
}
var shfi = new SHFileInfo();
var res = Interop.SHGetFileInfo(path, attribute, out shfi, (uint)Marshal.SizeOf(shfi), flags);
if (object.Equals(res, IntPtr.Zero)) throw Marshal.GetExceptionForHR(Marshal.GetHRForLastWin32Error());
try
{
Icon.FromHandle(shfi.hIcon);
return (Icon)Icon.FromHandle(shfi.hIcon).Clone();
}
catch
{
throw;
}
finally
{
Interop.DestroyIcon(shfi.hIcon);
}
}
开发者ID:rickflagg,项目名称:public,代码行数:33,代码来源:ShellManager.cs
示例9: RemoveDemand
public void RemoveDemand(ItemType supply, decimal amountToRemove)
{
var totalRemoved = 0.0m;
var amountRemainingToRemove = amountToRemove;
while (totalRemoved < amountToRemove
&& HasDemand(supply)) {
var demandsFound = (from d in Demands
where d.Supply == supply
&& d.Amount > 0
select d).ToArray();
if (demandsFound.Length > 0) {
var demandFound = demandsFound [0];
if (demandFound.Amount > amountToRemove) {
demandFound.Amount -= amountRemainingToRemove;
totalRemoved += amountToRemove;
}
else {
Demands.Remove (demandFound);
amountRemainingToRemove -= demandFound.Amount;
totalRemoved += demandFound.Amount;
}
}
}
}
开发者ID:CompulsiveCoder,项目名称:TileSim,代码行数:30,代码来源:DemandList.cs
示例10: get
/// <summary>
/// Get item for type and identifier.
/// </summary>
/// <param name="type">Type of item.</param>
/// <param name="ident">Identifier of item.</param>
/// <returns>Unspecified common item.</returns>
public IItem get(ItemType type, Ident ident)
{
bool isFull = (ident.guid != null && ident.item != null);
switch(type)
{
case ItemType.EW:
{
// check with part from identifier
IItem item = itemEW.FirstOrDefault(i => (isFull && ident.guid.CompareGuids(i.Key.guid) && ident.item == i.Key.item)
|| (!isFull && ident.guid != null && ident.guid.CompareGuids(i.Key.guid))
|| (!isFull && ident.item != null && ident.item == i.Key.item)
).Value;
if(item == null && isFull) {
itemEW[ident] = new ItemEW();
return itemEW[ident];
}
else if(item == null && ident.item == Settings._.DefaultOWPItem) { //TODO:
return new ItemEW();
}
else if(item == null) {
throw new NotFoundException("OWP Items-EW: The '{0}:{1}' is not found.", ident.guid, ident.item);
}
return item;
}
}
throw new NotFoundException("OWP Items: Type '{0}' is not supported.", type);
}
开发者ID:3F,项目名称:vsCommandEvent,代码行数:34,代码来源:Items.cs
示例11: Stat
public Stat(string name, Range<float> range, ItemType itemType, ItemModTier parentTier)
{
Name = name;
Range = range;
ParentTier = parentTier;
ItemType = itemType;
}
开发者ID:mihailim,项目名称:PoESkillTree,代码行数:7,代码来源:Stat.cs
示例12: ReadUIDItem
private static string ReadUIDItem(DICOMBinaryReader dr, string itemName, ItemType iType)
{
AssertItemType(dr, itemName, iType);
dr.Skip(2); // PDU ID and Reserved Null Byte
int length = LengthReader.ReadBigEndian(dr, 2);
return dr.ReadString(length).Trim();
}
开发者ID:DMIAOCHEN,项目名称:Evil-DICOM,代码行数:7,代码来源:ItemReader.cs
示例13: Item
public Item(string itemName, string itemDesc, int itemID, ItemType itemType)
{
this.itemName = itemName;
this.itemDesc = itemDesc;
this.itemID = itemID;
this.itemType = itemType;
}
开发者ID:Patchthesock,项目名称:RoosClues,代码行数:7,代码来源:Item.cs
示例14: MapItem
internal MapItem(ItemType type, uint count, uint offset)
{
Type = type;
Count = count;
Offset = offset;
return;
}
开发者ID:BlueSkeye,项目名称:ApkRe,代码行数:7,代码来源:MapItem.cs
示例15: Init
/// <summary>
/// Init the specified type, amt, rangeminx, rangemaxx, rangeminy, rangemaxy and emit.
/// </summary>
/// <param name="type">Type.</param>
/// <param name="amt">Amount.</param>
/// <param name="rangeminx">Minimum Range of X value.</param>
/// <param name="rangemaxx">Maximum Range of X value.</param>
/// <param name="rangeminy">Minimum Range of Y value.</param>
/// <param name="rangemaxy">Minimum Range of Y value.</param>
/// <param name="emit">Type of Emission.</param>
public void Init(ItemType[] type, int[] amt, float rangeminx, float rangemaxx, float rangeminy, float rangemaxy,
EmitType emit = EmitType.Impulse)
{
if(type.Length != amt.Length)
{
Debug.LogError("Total number of types and total number of amounts are different");
return;
}
for(int i = 0; i < type.Length; ++i)
{
map.Add(type[i], amt[i]);
}
m_rangeMinX = rangeminx;
m_rangeMaxX = rangemaxx;
m_rangeMinY = rangeminy;
m_rangeMaxY = rangemaxy;
List<ItemType> keys = new List<ItemType>(map.Keys);
m_type = emit;
foreach(ItemType tp in keys)
{
if(m_type == EmitType.Impulse)
ImpulseFire(tp, map[tp]);
else
StartCoroutine(CreateItemsWithInterval(tp, map[tp]));
}
}
开发者ID:kreeds,项目名称:TestProjectDemo,代码行数:41,代码来源:Emitter.cs
示例16: GetColor
private ColorScheme GetColor(ItemType item)
{
if (craft.Stores[item] > 0)
return ColorScheme.White;
var isAmmo = item.Metadata().AmmoForWeapon != null;
return isAmmo ? ColorScheme.Purple : ColorScheme.Blue;
}
开发者ID:jmfb,项目名称:XComGenerations,代码行数:7,代码来源:CraftEquipment.cs
示例17: FileItem
public FileItem(string fullPath, ItemType type, FilesystemItemProvider provider)
{
FullPath = fullPath;
ItemType = type;
_itemProvider = provider;
SetNameFromFullPath();
}
开发者ID:glupschta,项目名称:Kex,代码行数:7,代码来源:FileItem.cs
示例18: Scenario
private int width = 0; // Level width in items
#endregion Fields
#region Constructors
/// <summary>
/// Constructor.
/// </summary>
/// <param name="aName">Level name</param>
/// <param name="aLevelMap">Level map</param>
/// <param name="aWidth">Level width</param>
/// <param name="aHeight">Level height</param>
/// <param name="aNrOfGoals">Number of goals</param>
/// <param name="aLevelNr">Level number</param>
/// <param name="aLevelSetName">Set name that level belongs to</param>
public Scenario(string aName, ItemType[,] aLevelMap, int aWidth, int aHeight)
{
name = aName;
width = aWidth;
height = aHeight;
levelMap = aLevelMap;
}
开发者ID:superliujian,项目名称:Sxta,代码行数:23,代码来源:Scenario.cs
示例19: Item
public Item(ItemType typeGet, Player playerGet, Sadako sadakoGet, Rectangle hitBoxGet)
{
type = typeGet;
player = playerGet;
sadako = sadakoGet;
hitBox = hitBoxGet;
}
开发者ID:darrensapalo,项目名称:HorrorGame,代码行数:7,代码来源:Item.cs
示例20: Item
public Item(ItemType itemType)
{
ObjectType = DrawableObjectType.Item;
this.type = itemType;
Collidable = false;
LoadContent();
}
开发者ID:bobrathgeber,项目名称:StormGame,代码行数:7,代码来源:Item.cs
注:本文中的ItemType类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论