当前位置: 首页>>代码示例>>C#>>正文


C# System.Enums类代码示例

本文整理汇总了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();
 }
开发者ID:prog-moh,项目名称:Palringo-Bot-Engine,代码行数:29,代码来源:ImagePacket.cs

示例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;
 }
开发者ID:andreiretezan,项目名称:Csharp-training,代码行数:7,代码来源:Luxury.cs

示例3: RolDialog

 public RolDialog(String _descripcion, Enums.tipoDialog tipoDialog)
 {
     InitializeComponent();
     this.tipo = tipoDialog;
     this.descripcionTextbox.Text = _descripcion;
     this.dr = DialogResult.Cancel;
 }
开发者ID:leopaglia,项目名称:TP-2C-2015-GDD,代码行数:7,代码来源:RolDialog.cs

示例4: ProcessTurnOutcome

 private void ProcessTurnOutcome(Enums.TurnOutcome turnOutcome)
 {
     if (turnOutcome != Enums.TurnOutcome.MoveMadeAndPointScored)
         _numberOfTurnsWithNoPointsGained++;
     else
         _numberOfTurnsWithNoPointsGained = 0;
 }
开发者ID:Timothy-Berwyn-Taylor,项目名称:2014-PacMan-TestHarness,代码行数:7,代码来源:GameMarshaller.cs

示例5: FileManagerForm

 public FileManagerForm(Enums.TypePath tp, long id_controller)
 {
     InitializeComponent();
     path_work = getPath(tp, id_controller);
     searchFiles();
     webBrowser.DocumentText = TruckSystem.Properties.Resources.SelectOneFile;
 }
开发者ID:cadore,项目名称:TruckSystem,代码行数:7,代码来源:FileManagerForm.cs

示例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);
     }
 }
开发者ID:blastboy,项目名称:Client,代码行数:7,代码来源:NpcRenderer.cs

示例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);
        }
开发者ID:GrupaSzachowa,项目名称:BasicBlue,代码行数:29,代码来源:Hetman.cs

示例8: ManageFormResponse

 public ManageFormResponse(Enums.ManageFormState responseCommand, string name, string picture, string newName)
 {
     Name = name;
     NewName = newName;
     Picture = picture;
     RespondCommand = responseCommand;
 }
开发者ID:darthrado,项目名称:LoLoLoL,代码行数:7,代码来源:ManageFormResponse.cs

示例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;
     }
 }
开发者ID:MandL27,项目名称:Server,代码行数:33,代码来源:MissionManager.cs

示例10: CreateCounty

 public County CreateCounty(string name, Enums.Provinces province)
 {
     using (countyViewContext)
     {
         return countyViewContext.CreateCounty(name, province);
     }
 }
开发者ID:BarryOCathain,项目名称:GAA_Paper_Templates,代码行数:7,代码来源:CountyWindow.cs

示例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;
                }
            }
        }
开发者ID:scheshan,项目名称:JobConsole,代码行数:33,代码来源:JobDAO.cs

示例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;
        }
开发者ID:nirshandileep,项目名称:RHP,代码行数:25,代码来源:PhotoDAO.cs

示例13: GameRound

 public GameRound(Player player, IEnumerable<Enums.Colors> choices, Enums.Colors answer)
 {
     _player = player;
     _date = DateTime.Now;
     _choices = convertFrom(choices);
     _answer = answer;
 }
开发者ID:joeyshipley,项目名称:ColorTime,代码行数:7,代码来源:GameRound.cs

示例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;
        }
开发者ID:zapalap,项目名称:Explorer,代码行数:33,代码来源:EntityMoveHelper.cs

示例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;
 }
开发者ID:edude03,项目名称:PokemonTCG,代码行数:7,代码来源:Energy.cs


注:本文中的System.Enums类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。