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

C# THashSet类代码示例

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

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



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

示例1: AddExprerience

 public static void AddExprerience(GameUser user, int experience)
 {
     string userID = user.UserID;
     var userEmbattleList = new GameDataCacheSet<UserEmbattle>().FindAll(userID, m => m.MagicID == user.UseMagicID);
     THashSet<int> generalHash = new THashSet<int>();
     foreach (UserEmbattle userEmbattle in userEmbattleList)
     {
         //wuzf 8-18 修复多个相同佣兵阵形数据
         if (generalHash.Contains(userEmbattle.GeneralID))
         {
             userEmbattle.GeneralID = 0;
             //userEmbattle.Update();
             continue;
         }
         else
         {
             generalHash.Add(userEmbattle.GeneralID);
         }
         //UserGeneral userGeneral = new GameDataCacheSet<UserGeneral>().FindKey(userID, userEmbattle.GeneralID);
         //if (userGeneral != null)
         //{
         //    userGeneral.CurrExperience = MathUtils.Addition(userGeneral.CurrExperience, experience);
         //}
     }
     //UserHelper.UserGeneralExp(user.UserID, experience);
 }
开发者ID:rongxiong,项目名称:Scut,代码行数:26,代码来源:PlotHelper.cs


示例2: Read

 public void Read (TProtocol iprot)
 {
   TField field;
   iprot.ReadStructBegin();
   while (true)
   {
     field = iprot.ReadFieldBegin();
     if (field.Type == TType.Stop) { 
       break;
     }
     switch (field.ID)
     {
       case 1:
         if (field.Type == TType.Set) {
           {
             KeysOnly = new THashSet<string>();
             TSet _set8 = iprot.ReadSetBegin();
             for( int _i9 = 0; _i9 < _set8.Count; ++_i9)
             {
               string _elem10 = null;
               _elem10 = iprot.ReadString();
               KeysOnly.Add(_elem10);
             }
             iprot.ReadSetEnd();
           }
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 2:
         if (field.Type == TType.Map) {
           {
             FullMap = new Dictionary<string, string>();
             TMap _map11 = iprot.ReadMapBegin();
             for( int _i12 = 0; _i12 < _map11.Count; ++_i12)
             {
               string _key13;
               string _val14;
               _key13 = iprot.ReadString();
               _val14 = iprot.ReadString();
               FullMap[_key13] = _val14;
             }
             iprot.ReadMapEnd();
           }
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       default: 
         TProtocolUtil.Skip(iprot, field.Type);
         break;
     }
     iprot.ReadFieldEnd();
   }
   iprot.ReadStructEnd();
 }
开发者ID:Glympse,项目名称:evernote-sdk-csharp,代码行数:56,代码来源:LazyMap.cs


示例3: Read

 public void Read (TProtocol iprot)
 {
   bool isset_node = false;
   bool isset_port = false;
   TField field;
   iprot.ReadStructBegin();
   while (true)
   {
     field = iprot.ReadFieldBegin();
     if (field.Type == TType.Stop) { 
       break;
     }
     switch (field.ID)
     {
       case 1:
         if (field.Type == TType.String) {
           Node = iprot.ReadString();
           isset_node = true;
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 2:
         if (field.Type == TType.Set) {
           {
             Port = new THashSet<long>();
             TSet _set181 = iprot.ReadSetBegin();
             for( int _i182 = 0; _i182 < _set181.Count; ++_i182)
             {
               long _elem183;
               _elem183 = iprot.ReadI64();
               Port.Add(_elem183);
             }
             iprot.ReadSetEnd();
           }
           isset_port = true;
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       default: 
         TProtocolUtil.Skip(iprot, field.Type);
         break;
     }
     iprot.ReadFieldEnd();
   }
   iprot.ReadStructEnd();
   if (!isset_node)
     throw new TProtocolException(TProtocolException.INVALID_DATA);
   if (!isset_port)
     throw new TProtocolException(TProtocolException.INVALID_DATA);
 }
开发者ID:bcardi,项目名称:storm-net-adapter,代码行数:52,代码来源:NodeInfo.cs


示例4: TThreadedServer

		public TThreadedServer(TProcessor processor,
								 TServerTransport serverTransport,
								 TTransportFactory inputTransportFactory,
								 TTransportFactory outputTransportFactory,
								 TProtocolFactory inputProtocolFactory,
								 TProtocolFactory outputProtocolFactory,
								 int maxThreads, LogDelegate logDel)
			: base(processor, serverTransport, inputTransportFactory, outputTransportFactory,
				  inputProtocolFactory, outputProtocolFactory, logDel)
		{
			this.maxThreads = maxThreads;
			clientQueue = new Queue<TTransport>();
			clientLock = new object();
			clientThreads = new THashSet<Thread>();
		}
开发者ID:kenangell,项目名称:fluentcassandra,代码行数:15,代码来源:TThreadedServer.cs


示例5: send_findContactsByPhone

 public IAsyncResult send_findContactsByPhone(AsyncCallback callback, object state, THashSet<string> phones)
开发者ID:Banandana,项目名称:LineSharp,代码行数:1,代码来源:TalkService.cs


示例6: findContactsByPhone

      public Dictionary<string, Contact> findContactsByPhone(THashSet<string> phones)
      {
        #if !SILVERLIGHT
        send_findContactsByPhone(phones);
        return recv_findContactsByPhone();

        #else
        var asyncResult = Begin_findContactsByPhone(null, null, phones);
        return End_findContactsByPhone(asyncResult);

        #endif
      }
开发者ID:Banandana,项目名称:LineSharp,代码行数:12,代码来源:TalkService.cs


示例7: acceptProximityMatches

      public void acceptProximityMatches(string sessionId, THashSet<string> ids)
      {
        #if !SILVERLIGHT
        send_acceptProximityMatches(sessionId, ids);
        recv_acceptProximityMatches();

        #else
        var asyncResult = Begin_acceptProximityMatches(null, null, sessionId, ids);
        End_acceptProximityMatches(asyncResult);

        #endif
      }
开发者ID:Banandana,项目名称:LineSharp,代码行数:12,代码来源:TalkService.cs


示例8: testSet

 public THashSet<int> testSet(THashSet<int> thing)
 {
     reusableStringBuilder.Clear();
     reusableStringBuilder.Append("testSet({{");
     bool first = true;
     foreach (int elem in thing)
     {
         if (first)
         {
             first = false;
         }
         else
         {
             reusableStringBuilder.Append(", ");
         }
         reusableStringBuilder.AppendFormat("{0}", elem);
     }
     reusableStringBuilder.Append("}})");
     testLogDelegate.Invoke(reusableStringBuilder.ToString());
     return thing;
 }
开发者ID:ConfusedReality,项目名称:pkg_serialization_thrift,代码行数:21,代码来源:TestServer.cs


示例9: testSet

 public THashSet<int> testSet(THashSet<int> thing)
 {
     Console.WriteLine("testSet({");
     bool first = true;
     foreach (int elem in thing)
     {
         if (first)
         {
             first = false;
         }
         else
         {
             Console.WriteLine(", ");
         }
         Console.WriteLine(elem);
     }
     Console.WriteLine("})");
     return thing;
 }
开发者ID:rayqiu,项目名称:thrift,代码行数:19,代码来源:TestServer.cs


示例10: ClientTest


//.........这里部分代码省略.........
            foreach (int j in listout)
            {
                if (first)
                {
                    first = false;
                }
                else
                {
                    Console.Write(", ");
                }
                Console.Write(j);
            }
            Console.Write("})");

            List<int> listin = client.testList(listout);

            Console.Write(" = {");
            first = true;
            foreach (int j in listin)
            {
                if (first)
                {
                    first = false;
                }
                else
                {
                    Console.Write(", ");
                }
                Console.Write(j);
            }
            Console.WriteLine("}");

            //set
            THashSet<int> setout = new THashSet<int>();
            for (int j = -2; j < 3; j++)
            {
                setout.Add(j);
            }
            Console.Write("testSet({");
            first = true;
            foreach (int j in setout)
            {
                if (first)
                {
                    first = false;
                }
                else
                {
                    Console.Write(", ");
                }
                Console.Write(j);
            }
            Console.Write("})");

            THashSet<int> setin = client.testSet(setout);

            Console.Write(" = {");
            first = true;
            foreach (int j in setin)
            {
                if (first)
                {
                    first = false;
                }
                else
                {
开发者ID:vicaya,项目名称:thrift,代码行数:67,代码来源:TestClient.cs


示例11: ExecuteClientTest


//.........这里部分代码省略.........
            {
                if (first)
                {
                    first = false;
                }
                else
                {
                    Console.Write(", ");
                }
                Console.Write(j);
            }
            Console.Write("})");

            List<int> listin = client.testList(listout);

            Console.Write(" = {");
            first = true;
            foreach (int j in listin)
            {
                if (first)
                {
                    first = false;
                }
                else
                {
                    Console.Write(", ");
                }
                Console.Write(j);
            }
            Console.WriteLine("}");

            //set
            // TODO: Validate received message
            THashSet<int> setout = new THashSet<int>();
            for (int j = -2; j < 3; j++)
            {
                setout.Add(j);
            }
            Console.Write("testSet({");
            first = true;
            foreach (int j in setout)
            {
                if (first)
                {
                    first = false;
                }
                else
                {
                    Console.Write(", ");
                }
                Console.Write(j);
            }
            Console.Write("})");

            THashSet<int> setin = client.testSet(setout);

            Console.Write(" = {");
            first = true;
            foreach (int j in setin)
            {
                if (first)
                {
                    first = false;
                }
                else
                {
开发者ID:ChristopherRogers,项目名称:thrift,代码行数:67,代码来源:TestClient.cs


示例12: Read

 public void Read (TProtocol iprot)
 {
   TField field;
   iprot.ReadStructBegin();
   while (true)
   {
     field = iprot.ReadFieldBegin();
     if (field.Type == TType.Stop) { 
       break;
     }
     switch (field.ID)
     {
       case 0:
         if (field.Type == TType.Set) {
           {
             Success = new THashSet<string>();
             TSet _set222 = iprot.ReadSetBegin();
             for( int _i223 = 0; _i223 < _set222.Count; ++_i223)
             {
               string _elem224 = null;
               _elem224 = iprot.ReadString();
               Success.Add(_elem224);
             }
             iprot.ReadSetEnd();
           }
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 1:
         if (field.Type == TType.Struct) {
           E = new TalkException();
           E.Read(iprot);
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       default: 
         TProtocolUtil.Skip(iprot, field.Type);
         break;
     }
     iprot.ReadFieldEnd();
   }
   iprot.ReadStructEnd();
 }
开发者ID:Banandana,项目名称:LineSharp,代码行数:45,代码来源:TalkService.cs


示例13: send_acceptProximityMatches

 public void send_acceptProximityMatches(string sessionId, THashSet<string> ids)
 #endif
 {
   oprot_.WriteMessageBegin(new TMessage("acceptProximityMatches", TMessageType.Call, seqid_));
   acceptProximityMatches_args args = new acceptProximityMatches_args();
   args.SessionId = sessionId;
   args.Ids = ids;
   args.Write(oprot_);
   oprot_.WriteMessageEnd();
   #if SILVERLIGHT
   return oprot_.Transport.BeginFlush(callback, state);
   #else
   oprot_.Transport.Flush();
   #endif
 }
开发者ID:Banandana,项目名称:LineSharp,代码行数:15,代码来源:TalkService.cs


示例14: send_findAndAddContactsByEmail

 public void send_findAndAddContactsByEmail(int reqSeq, THashSet<string> emails)
 #endif
 {
   oprot_.WriteMessageBegin(new TMessage("findAndAddContactsByEmail", TMessageType.Call, seqid_));
   findAndAddContactsByEmail_args args = new findAndAddContactsByEmail_args();
   args.ReqSeq = reqSeq;
   args.Emails = emails;
   args.Write(oprot_);
   oprot_.WriteMessageEnd();
   #if SILVERLIGHT
   return oprot_.Transport.BeginFlush(callback, state);
   #else
   oprot_.Transport.Flush();
   #endif
 }
开发者ID:Banandana,项目名称:LineSharp,代码行数:15,代码来源:TalkService.cs


示例15: Read


//.........这里部分代码省略.........
         case 4:
           if (field.Type == TType.I32) {
             IntVal = iprot.ReadI32();
           } else { 
             TProtocolUtil.Skip(iprot, field.Type);
           }
           break;
         case 5:
           if (field.Type == TType.Double) {
             DoubleVal = iprot.ReadDouble();
           } else { 
             TProtocolUtil.Skip(iprot, field.Type);
           }
           break;
         case 6:
           if (field.Type == TType.String) {
             StrVal = iprot.ReadString();
           } else { 
             TProtocolUtil.Skip(iprot, field.Type);
           }
           break;
         case 7:
           if (field.Type == TType.String) {
             ByteArrVal = iprot.ReadBinary();
           } else { 
             TProtocolUtil.Skip(iprot, field.Type);
           }
           break;
         case 8:
           if (field.Type == TType.Map) {
             {
               MapVal = new Dictionary<BaseMsg, BaseMsg>();
               TMap _map0 = iprot.ReadMapBegin();
               for( int _i1 = 0; _i1 < _map0.Count; ++_i1)
               {
                 BaseMsg _key2;
                 BaseMsg _val3;
                 _key2 = new BaseMsg();
                 _key2.Read(iprot);
                 _val3 = new BaseMsg();
                 _val3.Read(iprot);
                 MapVal[_key2] = _val3;
               }
               iprot.ReadMapEnd();
             }
           } else { 
             TProtocolUtil.Skip(iprot, field.Type);
           }
           break;
         case 9:
           if (field.Type == TType.List) {
             {
               ListVal = new List<BaseMsg>();
               TList _list4 = iprot.ReadListBegin();
               for( int _i5 = 0; _i5 < _list4.Count; ++_i5)
               {
                 BaseMsg _elem6;
                 _elem6 = new BaseMsg();
                 _elem6.Read(iprot);
                 ListVal.Add(_elem6);
               }
               iprot.ReadListEnd();
             }
           } else { 
             TProtocolUtil.Skip(iprot, field.Type);
           }
           break;
         case 10:
           if (field.Type == TType.Set) {
             {
               SetVal = new THashSet<BaseMsg>();
               TSet _set7 = iprot.ReadSetBegin();
               for( int _i8 = 0; _i8 < _set7.Count; ++_i8)
               {
                 BaseMsg _elem9;
                 _elem9 = new BaseMsg();
                 _elem9.Read(iprot);
                 SetVal.Add(_elem9);
               }
               iprot.ReadSetEnd();
             }
           } else { 
             TProtocolUtil.Skip(iprot, field.Type);
           }
           break;
         default: 
           TProtocolUtil.Skip(iprot, field.Type);
           break;
       }
       iprot.ReadFieldEnd();
     }
     iprot.ReadStructEnd();
     if (!isset_msgType)
       throw new TProtocolException(TProtocolException.INVALID_DATA);
   }
   finally
   {
     iprot.DecrementRecursionDepth();
   }
 }
开发者ID:wsycarlos,项目名称:ARIA,代码行数:101,代码来源:BaseMsg.cs


示例16: Begin_findContactsByEmail

 public IAsyncResult Begin_findContactsByEmail(AsyncCallback callback, object state, THashSet<string> emails)
 {
   return send_findContactsByEmail(callback, state, emails);
 }
开发者ID:Banandana,项目名称:LineSharp,代码行数:4,代码来源:TalkService.cs


示例17: findContactsByEmail

      public Dictionary<string, Contact> findContactsByEmail(THashSet<string> emails)
      {
        #if !SILVERLIGHT
        send_findContactsByEmail(emails);
        return recv_findContactsByEmail();

        #else
        var asyncResult = Begin_findContactsByEmail(null, null, emails);
        return End_findContactsByEmail(asyncResult);

        #endif
      }
开发者ID:Banandana,项目名称:LineSharp,代码行数:12,代码来源:TalkService.cs


示例18: NodeInfo

 public NodeInfo(string node, THashSet<long> port) : this() {
   this.Node = node;
   this.Port = port;
 }
开发者ID:bcardi,项目名称:storm-net-adapter,代码行数:4,代码来源:NodeInfo.cs


示例19: testSetAsync

 public Task<THashSet<int>> testSetAsync(THashSet<int> thing, CancellationToken cancellationToken)
 {
     sb.Clear();
     sb.Append("testSet({{");
     var first = true;
     foreach (int elem in thing)
     {
         if (first)
         {
             first = false;
         }
         else
         {
             sb.Append(", ");
         }
         sb.AppendFormat("{0}", elem);
     }
     sb.Append("}})");
     logger.Invoke(sb.ToString());
     return Task.FromResult(thing);
 }
开发者ID:nsuke,项目名称:thrift,代码行数:21,代码来源:TestServer.cs


示例20: send_getFailProductInspectNums

 public void send_getFailProductInspectNums(string accessKey, THashSet<string> entityIds, long startTime, long endTime)
 #endif
 {
   oprot_.WriteMessageBegin(new TMessage("getFailProductInspectNums", TMessageType.Call, seqid_));
   getFailProductInspectNums_args args = new getFailProductInspectNums_args();
   args.AccessKey = accessKey;
   args.EntityIds = entityIds;
   args.StartTime = startTime;
   args.EndTime = endTime;
   args.Write(oprot_);
   oprot_.WriteMessageEnd();
   #if SILVERLIGHT
   return oprot_.Transport.BeginFlush(callback, state);
   #else
   oprot_.Transport.Flush();
   #endif
 }
开发者ID:shentianyi,项目名称:ifDataHouse,代码行数:17,代码来源:Datahouse.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# TIMEUNIT类代码示例发布时间:2022-05-24
下一篇:
C# TFQMR类代码示例发布时间: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