• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# Kind类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Kind的典型用法代码示例。如果您正苦于以下问题:C# Kind类的具体用法?C# Kind怎么用?C# Kind使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Kind类属于命名空间,在下文中一共展示了Kind类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: ChangeKind

		public static int ChangeKind(int sourceKId, Kind kind)
		{
			if (sourceKId == InvalidKId)
				return InvalidKId;

			return sourceKId & 0x00ffffff | (int)kind;
		}
开发者ID:hungdluit,项目名称:sipserver,代码行数:7,代码来源:Transaction.cs


示例2: Card

 public Card(int kind, int rank)
 {
     _kind = (Kind)kind;
     _rank = (CardRank)rank;
     _image = new Image();
     _image.Stretch = Stretch.Fill;
 }
开发者ID:KristjanLuik,项目名称:projektTurakas,代码行数:7,代码来源:Card.cs


示例3: TranslateSkinString

    /// <summary>
    /// Translate the skin string, create the skin string if not found.
    /// </summary>
    /// <param name="line"></param>
    /// <param name="kind"></param>
    /// <returns></returns>
    public static int TranslateSkinString(string line, Kind kind)
    {
      Dictionary<int, SkinString>.Enumerator enumer = _skinStringSettings.GetEnumerator();
      while (enumer.MoveNext())
      {
        SkinString skin = enumer.Current.Value;
        if (skin.Name == line)
        {
          return enumer.Current.Key;
        }
      }

      SkinString newString = new SkinString();
      newString.Name = line;
      newString.Value = line;
      newString.Kind = kind;

      // Create the setting as a property if not already present.
      if (!GUIPropertyManager.PropertyIsDefined(newString.Name))
      {
        GUIPropertyManager.SetProperty(newString.Name, newString.Value);
      }
      else
      {
        newString.Value = GUIPropertyManager.GetProperty(newString.Name);
      }

      int key;
      lock (_skinStringSettings) //Lock the dictionary, it might be getting saved at the moment
      {
        key = _skinStringSettings.Count;
        _skinStringSettings[key] = newString;
      }
      return key;
    }
开发者ID:arangas,项目名称:MediaPortal-1,代码行数:41,代码来源:SkinSettings.cs


示例4: AddStat

        public void AddStat(Kind kind, int amount, int turn)
        {
            if(turn >= MAX_TURNS)
                throw new Exception("Statistic can have only " + MAX_TURNS + " columns");

            statistic[(int)kind][turn] += amount;
        }
开发者ID:alenkacz,项目名称:Expanze,代码行数:7,代码来源:Statistic.cs


示例5: CreateSinkOrSource

 private object CreateSinkOrSource(Kind kind, bool isOut)
 { 
     switch (kind)
     {
         case Kind.Stream:
             return isOut ? new MemoryStream() : new MemoryStream(Encoding.Default.GetBytes(Content));
         case Kind.File:
             var path = GetPath(isOut);
             if (!isOut)
             {
                 File.WriteAllText(path, Content);
             }
             return new FileInfo(path);
         case Kind.ReaderWriter:
             return isOut ? new StringWriter() : new StringReader(Content).As<object>();
         case Kind.String:
             return Content;
         case Kind.Chars:
             return isOut ? new List<char>() : Content.ToCharArray().As<object>();
         case Kind.Lines:
             return isOut ? new List<string>() : Content.Split(new[] { Environment.NewLine }, StringSplitOptions.None).As<object>();
         default:
             throw new InvalidOperationException();
     }
 }
开发者ID:rivy,项目名称:MedallionShell,代码行数:25,代码来源:PipeTest.cs


示例6: StopEmotion

 public void StopEmotion(Kind k)
 {
     if( emotionRequests.Contains(k) ) {
         emotionRequests.RemoveAll(x => x == k);
         _PlayEmotionOfLastCapables();
     }
 }
开发者ID:choirdesign,项目名称:onelinerrogue-src,代码行数:7,代码来源:Emotion.cs


示例7: SwitchKind

 internal void SwitchKind()
 {
     if (!changed)
     {
         if ((int)kind < 2)
         {
             kind++;
         }
         else
         {
             kind = (Kind)0;
         }
         switch (kind)
         {
             case Kind.Rock:
                 couleur = Color.Red;
                 chiffre = 0;
                 break;
             case Kind.Turret:
                 couleur = Color.Green;
                 chiffre = 2;
                 break;
             case Kind.Creep:
                 couleur = Color.White;
                 chiffre = 1;
                 break;
             default:
                 break;
         }
         changed = true;
     }
 }
开发者ID:qwertyuu,项目名称:TowerDefense,代码行数:32,代码来源:Cell.cs


示例8: _IsOnceAnimation

 private bool _IsOnceAnimation(Kind k)
 {
     switch(k) {
     case Kind.Exclamation:
         return true;
     case Kind.Question:
         return true;
     case Kind.Berserk:
         return false;
     case Kind.Hungry:
         return false;
     case Kind.Kirakira:
         return false;
     case Kind.Ohana:
         return false;
     case Kind.Onpu:
         return true;
     case Kind.Paralize:
         return false;
     case Kind.Poison:
         return false;
     case Kind.Sleep:
         return false;
     case Kind.Star:
         return false;
     case Kind.Wakatta:
         return true;
     }
     return false;
 }
开发者ID:choirdesign,项目名称:onelinerrogue-src,代码行数:30,代码来源:Emotion.cs


示例9: BinWrite

 /// <summary>
 /// Writes a binary field to data file.
 /// </summary>
 /// <param name="stream"></param>
 /// <param name="kind"></param>
 /// <param name="offset"></param>
 /// <param name="v"></param>
 public static void BinWrite(FileStream stream, Kind kind, long offset, object v)
 {
     var v_str = v.ToString();
     stream.Position = offset;
     var writer = new BinaryWriter(stream);
     switch (kind)
     {
         case Kind.Byte:
             writer.Write(byte.Parse(v_str));
             break;
         case Kind.Int16:
             writer.Write(short.Parse(v_str));
             break;
         case Kind.Int32:
             writer.Write(int.Parse(v_str));
             break;
         case Kind.Int64:
             writer.Write(long.Parse(v_str));
             break;
         case Kind.Single:
             writer.Write(float.Parse(v_str));
             break;
         case Kind.Double:
             writer.Write(double.Parse(v_str));
             break;
         default:
             throw new Exception("Invalid type code.");
     }
     writer.Flush();
 }
开发者ID:GregRos,项目名称:FieldEditor,代码行数:37,代码来源:FileManager.cs


示例10: SetIterator

 //     INITIALIZATION
 //_________________________________________________________________________________________
 /// <summary>
 /// Creates a new set iterator.
 /// </summary>
 /// <param name="prototype"> The next object in the prototype chain. </param>
 /// <param name="set"> The set to iterate over. </param>
 /// <param name="list"> The linked list to iterate over. </param>
 /// <param name="kind"> The type of values to return. </param>
 internal SetIterator(ObjectInstance prototype, SetInstance set, LinkedList<object> list, Kind kind)
     : base(prototype)
 {
     this.set = set;
     this.set.BeforeDelete += Set_BeforeDelete;
     this.list = list;
     this.kind = kind;
 }
开发者ID:paulbartrum,项目名称:jurassic,代码行数:17,代码来源:SetIterator.cs


示例11: VariableDeclaration

 public VariableDeclaration(string name, string type, bool isArray,
     Kind kind, int row, int col)
     : base(name, type, isArray, row, col)
 {
     VariableKind = kind;
     LocalIndex = 0;
     Used = false;
 }
开发者ID:Lateks,项目名称:MiniJavaCompiler,代码行数:8,代码来源:VariableDeclaration.cs


示例12: Outcome

 public Outcome(string type, Kind kind, Vector vector, string message, int nesting = 0)
 {
     this.Type = type;
     this.Kind = kind;
     this.Vector = vector;
     this.Message = message;
     this.Nesting = nesting;
 }
开发者ID:nagyistoce,项目名称:Fhir.Profiling,代码行数:8,代码来源:Report.cs


示例13: MapIterator

 //     INITIALIZATION
 //_________________________________________________________________________________________
 /// <summary>
 /// Creates a new map iterator.
 /// </summary>
 /// <param name="prototype"> The next object in the prototype chain. </param>
 /// <param name="map"> The map to iterate over. </param>
 /// <param name="list"> The linked list to iterate over. </param>
 /// <param name="kind"> The type of values to return. </param>
 internal MapIterator(ObjectInstance prototype, MapInstance map, LinkedList<KeyValuePair<object, object>> list, Kind kind)
     : base(prototype)
 {
     this.map = map;
     this.map.BeforeDelete += Map_BeforeDelete;
     this.list = list;
     this.kind = kind;
 }
开发者ID:paulbartrum,项目名称:jurassic,代码行数:17,代码来源:MapIterator.cs


示例14: Concept

        public Concept(string name, Kind kind)
        {
            id = 0;
            this.name = name;

            this.kind = kind;

            loaded = false;
        }
开发者ID:killix,项目名称:Virsona-ChatBot-Tools,代码行数:9,代码来源:Concept.cs


示例15: CleanupWorkItem

 public CleanupWorkItem(Kind task, string relativePath, string physicalPath)
 {
     this.task = task;
     this.relativePath = relativePath;
     this.physicalPath = physicalPath;
     if (this.relativePath.StartsWith("/")) {
         Debug.WriteLine("Invalid relativePath value - should never have leading slash!");
     }
 }
开发者ID:stukalin,项目名称:ImageResizer,代码行数:9,代码来源:CleanupWorkItem.cs


示例16: Add

 public void Add(string type, Kind kind, Vector vector, string message, params object[] args)
 {
     Outcome outcome;
     outcome.Type = type;
     outcome.Vector = vector;
     outcome.Message = string.Format(message, args);
     outcome.Kind = kind;
     outcome.Nesting = this.nesting;
     Outcomes.Add(outcome);
 }
开发者ID:nagyistoce,项目名称:Fhir.Profiling,代码行数:10,代码来源:Report.cs


示例17: Weapon

 public Weapon(Kind kind, string name, string modelName, int baseDamage, float attackInterval, string attackSound, Vector3 firstPersonPosition)
 {
     this.WeaponKind = kind;
     this.Name = name;
     this.ModelName = modelName;
     this.BaseDamage = baseDamage;
     this.AttackInterval = attackInterval;
     this.AttackSound = attackSound;
     this.FirstPersonPosition = firstPersonPosition;
 }
开发者ID:nigelchanyk,项目名称:Archetype,代码行数:10,代码来源:Weapon.cs


示例18: RangedWeapon

        public RangedWeapon(Kind kind, string name, string modelName, int baseDamage, float attackInterval, string attackSound, Vector3 firstPersonPosition,
			float minInaccuracy, float maxInaccuracy, float inaccuracyGrowth, float maxRecoil, float recoilGrowth, Vector3 MuzzleFlashPosition)
            : base(kind, name, modelName, baseDamage, attackInterval, attackSound, firstPersonPosition)
        {
            this.MinInaccuracy = minInaccuracy;
            this.MaxInaccuracy = maxInaccuracy;
            this.InaccuracyGrowth = inaccuracyGrowth;
            this.MaxRecoil = maxRecoil;
            this.RecoilGrowth = recoilGrowth;
            this.MuzzleFlashPosition = MuzzleFlashPosition;
        }
开发者ID:nigelchanyk,项目名称:Archetype,代码行数:11,代码来源:RangedWeapon.cs


示例19: FromString

        public override Style FromString(string s)
        {
            s = s.Trim();

            Kind result;
            if (!Enum.TryParse<Kind>(s, true, out result))
                throw new Exception("Invalid white-space value: " + s);

            this.Value = result;
            return this;
        }
开发者ID:Fedorm,项目名称:core-master,代码行数:11,代码来源:WhiteSpace.cs


示例20: Move

 public Move(string name, string description, int damage, int accuracy, int uses, Kind kind, Type type)
 {
     Name = name;
     Description = description;
     BaseDamage = damage;
     Accuracy = accuracy;
     Uses = uses;
     MaxUses = uses;
     Kind = kind;
     Type = type;
 }
开发者ID:DuckDefense,项目名称:duck,代码行数:11,代码来源:Move.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# KinectGestures类代码示例发布时间:2022-05-24
下一篇:
C# Keywords类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap