本文整理汇总了C#中ItemType类的典型用法代码示例。如果您正苦于以下问题:C# ItemType类的具体用法?C# ItemType怎么用?C# ItemType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ItemType类属于命名空间,在下文中一共展示了ItemType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Item
public Item(ItemType type, Vector2 pos)
{
Type = type;
Position = pos;
Active = true;
Rotation = (float)Helper.Random.NextDouble() * MathHelper.Pi;
}
示例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();
}
}
}
示例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;
}
示例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);
}
}
}
示例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;
}
示例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();
}
示例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;
}
示例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);
}
}
示例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;
}
}
}
}
示例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);
}
示例11: Stat
public Stat(string name, Range<float> range, ItemType itemType, ItemModTier parentTier)
{
Name = name;
Range = range;
ParentTier = parentTier;
ItemType = itemType;
}
示例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();
}
示例13: Item
public Item(string itemName, string itemDesc, int itemID, ItemType itemType)
{
this.itemName = itemName;
this.itemDesc = itemDesc;
this.itemID = itemID;
this.itemType = itemType;
}
示例14: MapItem
internal MapItem(ItemType type, uint count, uint offset)
{
Type = type;
Count = count;
Offset = offset;
return;
}
示例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]));
}
}