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


C# Kind类代码示例

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


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


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