本文整理汇总了C#中System.Enums类的典型用法代码示例。如果您正苦于以下问题:C# Enums类的具体用法?C# Enums怎么用?C# Enums使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Enums类属于System命名空间,在下文中一共展示了Enums类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Package
public static Packet[] Package(int id, Enums.MessageTarget target, byte[] img)
{
int totalPackets = img.Length % 512 > 1 ? img.Length / 512 : (img.Length / 512) - 1;
bool first = true;
var packets = new List<Packet>();
while (true)
{
if (first)
{
packets.Add(ProcessFirstChunk(img.Length, img.Take(512).ToArray(), id, target));
first = false;
img = img.Skip(512).ToArray();
}
else
{
if (img.Length > 512)
{
packets.Add(ProcessBodyChunk(img.Take(512).ToArray(), id, target));
img = img.Skip(512).ToArray();
}
else
{
packets.Add(ProcessLastChunk(img, id, target));
break;
}
}
}
return packets.ToArray();
}
示例2: Luxury
public Luxury(string aer, string sistem, string enterain, string marca, int nrUsi, Enums.Culori culoare, Categorie categ, string serieSasiu)
: base(marca, nrUsi, culoare, categ, serieSasiu)
{
this.AerConditionatC = aer;
this.SistemParktronic = sistem;
this.EntertainmentSystem = enterain;
}
示例3: RolDialog
public RolDialog(String _descripcion, Enums.tipoDialog tipoDialog)
{
InitializeComponent();
this.tipo = tipoDialog;
this.descripcionTextbox.Text = _descripcion;
this.dr = DialogResult.Cancel;
}
示例4: ProcessTurnOutcome
private void ProcessTurnOutcome(Enums.TurnOutcome turnOutcome)
{
if (turnOutcome != Enums.TurnOutcome.MoveMadeAndPointScored)
_numberOfTurnsWithNoPointsGained++;
else
_numberOfTurnsWithNoPointsGained = 0;
}
示例5: FileManagerForm
public FileManagerForm(Enums.TypePath tp, long id_controller)
{
InitializeComponent();
path_work = getPath(tp, id_controller);
searchFiles();
webBrowser.DocumentText = TruckSystem.Properties.Resources.SelectOneFile;
}
示例6: DrawNpc
public static void DrawNpc(RendererDestinationData destData, Map activeMap, Enums.MapID targetMapID, int npcSlot)
{
MapNpc npc = activeMap.MapNpcs[npcSlot];
if (npc != null && npc.Num > 0 && npc.ScreenActive) {
SpriteRenderer.DrawSprite(destData, activeMap, targetMapID, npc);
}
}
示例7: Hetman
public Hetman(Enums.Kolor_pionków kolor, int x, int y, bool ruch)
{
if (kolor == Enums.Kolor_pionków.Biale)
{
this.grafika = BasicBlue.Properties.Resources.HetmanWhite;
this.kolor = Enums.Kolor_pionków.Biale;
}
else
{
this.grafika = BasicBlue.Properties.Resources.hetmanBlack;
this.kolor = Enums.Kolor_pionków.Czarne;
}
this.pozycjaX = x;
this.pozycjaY = y;
this.zasieg = 8;
this.punkty = 400;// Paweł Potera & Krzysztof Sakowicz
this.litera = "Q";
this.bylRuch = ruch;
kierunkiRuchu.Add(Enums.KierunekRuchu.Skos);
kierunkiRuchu.Add(Enums.KierunekRuchu.Gora);
kierunkiRuchu.Add(Enums.KierunekRuchu.Dol);
kierunkiRuchu.Add(Enums.KierunekRuchu.Bok);
kierunekBicia.Add(Enums.KierunekRuchu.Gora);
kierunekBicia.Add(Enums.KierunekRuchu.Dol);
kierunekBicia.Add(Enums.KierunekRuchu.Bok);
kierunekBicia.Add(Enums.KierunekRuchu.Skos);
}
示例8: ManageFormResponse
public ManageFormResponse(Enums.ManageFormState responseCommand, string name, string picture, string newName)
{
Name = name;
NewName = newName;
Picture = picture;
RespondCommand = responseCommand;
}
示例9: DetermineMissionExpRequirement
public static int DetermineMissionExpRequirement(Enums.ExplorerRank rank)
{
switch (rank) {
case Enums.ExplorerRank.Normal:
return 0;
case Enums.ExplorerRank.Bronze:
return 100;
case Enums.ExplorerRank.Silver:
return 300;
case Enums.ExplorerRank.Gold:
return 1600;
case Enums.ExplorerRank.Diamond:
return 3200;
case Enums.ExplorerRank.Super:
return 5000;
case Enums.ExplorerRank.Ultra:
return 7500;
case Enums.ExplorerRank.Hyper:
return 10500;
case Enums.ExplorerRank.Master:
return 13500;
case Enums.ExplorerRank.MasterX:
return 17000;
case Enums.ExplorerRank.MasterXX:
return 21000;
case Enums.ExplorerRank.MasterXXX:
return 25000;
case Enums.ExplorerRank.Guildmaster:
return 100000;
default:
return -1;
}
}
示例10: CreateCounty
public County CreateCounty(string name, Enums.Provinces province)
{
using (countyViewContext)
{
return countyViewContext.CreateCounty(name, province);
}
}
示例11: Edit
public bool Edit(Guid id, string description, bool active, Enums.StartType startType, string trigger, string className, out string message)
{
using (var conn = this.OpenConnection())
{
string sql = @"
UPDATE TOP(1) [Job]
SET [email protected],[email protected],[email protected],[email protected],[Trigger][email protected]
WHERE [email protected]
";
var para = new
{
ID = id,
Description = description,
Active = active,
StartType = (byte)startType,
Trigger = trigger,
ClassName = className
};
var rows = conn.Execute(sql, para);
if (rows > 0)
{
message = null;
return true;
}
else
{
message = "Job不存在";
return false;
}
}
}
示例12: GetAllByFieldValue
public static List<Photo> GetAllByFieldValue(string fieldName, Guid fieldValue, string fieldName2, Guid fieldValue2,Enums.ContextSubType ContextSubTypeId, Enums.PhotoCategory PhotoCategoryId)
{
List<Photo> returnEntityCollection = new List<Photo>();
Database db = DatabaseFactory.CreateDatabase(Constants.CONNECTIONSTRING);
DbCommand dbCommand = db.GetStoredProcCommand("usp_PhotoSelectAllBy" + fieldName2);
db.AddInParameter(dbCommand, fieldName, DbType.Guid, fieldValue);
db.AddInParameter(dbCommand, fieldName2, DbType.Guid, fieldValue2);
db.AddInParameter(dbCommand, "ContextSubTypeId", DbType.Int32, (int)ContextSubTypeId);
db.AddInParameter(dbCommand, "PhotoCategoryId", DbType.Int32, (int)PhotoCategoryId);
using (IDataReader dataReader = db.ExecuteReader(dbCommand))
{
while (dataReader.Read())
{
Photo entity = new Photo();
Utility.Generic.AssignDataReaderToEntity(dataReader, entity);
returnEntityCollection.Add(entity);
}
}
return returnEntityCollection;
}
示例13: GameRound
public GameRound(Player player, IEnumerable<Enums.Colors> choices, Enums.Colors answer)
{
_player = player;
_date = DateTime.Now;
_choices = convertFrom(choices);
_answer = answer;
}
示例14: Move
public bool Move(BaseEntity entity, Enums.Intent action)
{
entity.OldY = entity.Y;
entity.OldX = entity.X;
switch (action)
{
case Infrastructure.Enums.Intent.Idle:
break;
case Infrastructure.Enums.Intent.MoveUp:
entity.Y -= 1;
break;
case Infrastructure.Enums.Intent.MoveDown:
entity.Y += 1;
break;
case Infrastructure.Enums.Intent.MoveRight:
entity.X += 1;
break;
case Infrastructure.Enums.Intent.MoveLeft:
entity.X -= 1;
break;
default: return false;
}
if (!IsLegal(entity.X, entity.Y))
{
entity.X = entity.OldX;
entity.Y = entity.OldY;
return false;
}
return true;
}
示例15: Energy
public Energy(int value, Enums.Element type, bool special, int BOGUS_ID)
: base(BOGUS_ID)
{
this.value = value;
this.type = type;
this.special = special;
}