當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。