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

C# TType类代码示例

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

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



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

示例1: TMap

		public TMap(TType keyType, TType valueType, int count)
			:this()
		{
			this.keyType = keyType;
			this.valueType = valueType;
			this.count = count;
		}
开发者ID:jango2015,项目名称:Thrift.Net,代码行数:7,代码来源:TMap.cs


示例2: isUnknownType

        public static bool isUnknownType(TType type)
        {
            var types = new HashSet<string>(new string[] {
                "Boolean",
                "int",
                "uint",
                "Object",
                "Number",
                "Array",
                "String",
                "void",
                "*",
                "Function"
            });

            string typeName = type.name;

            //if (type.name == "sequence") typeName = "Vector.<" + type.genericType.name + ">";

            if (types.Contains(typeName)) return false;

            var fType = Generator.findFileType(type.name);
            if ((fType != null) && fType.CheckExport())
            {
                return false;
            }
            return true;
        }
开发者ID:RandoriAS,项目名称:randori-tools,代码行数:28,代码来源:Parser.cs


示例3: TMap

 public TMap(TType keyType, TType valueType, int count)
     : this()
 {
     KeyType = keyType;
     ValueType = valueType;
     Count = count;
 }
开发者ID:shigin,项目名称:thrift,代码行数:7,代码来源:TMap.cs


示例4: Trainer

 public Trainer(IQuestion[] questions, TType trainingType)
 {
     _questions = new List<IQuestion>(questions);
     _trainingType = trainingType;
     _isFinished = false;
     _isStarted = false;
 }
开发者ID:verdigos,项目名称:MnemonicTrainer,代码行数:7,代码来源:Trainer.cs


示例5: Field

 public Field(string name, TType type, short id)
     : this()
 {
     this.name = name;
     this.type = type;
     this.id = id;
 }
开发者ID:tritao,项目名称:flood,代码行数:7,代码来源:Field.cs


示例6: GetTypeNameForTypeID

 private static byte[] GetTypeNameForTypeID(TType typeID)
 {
     switch (typeID)
     {
         case TType.Bool:
             return NAME_BOOL;
         case TType.Byte:
             return NAME_BYTE;
         case TType.I16:
             return NAME_I16;
         case TType.I32:
             return NAME_I32;
         case TType.I64:
             return NAME_I64;
         case TType.Double:
             return NAME_DOUBLE;
         case TType.String:
             return NAME_STRING;
         case TType.Struct:
             return NAME_STRUCT;
         case TType.Map:
             return NAME_MAP;
         case TType.Set:
             return NAME_SET;
         case TType.List:
             return NAME_LIST;
         default:
             throw new TProtocolException(TProtocolException.NOT_IMPLEMENTED,
                                          "Unrecognized type");
     }
 }
开发者ID:ppdai,项目名称:TripSerializer.Net,代码行数:31,代码来源:TJSONProtocol.cs


示例7: Skip

 public static void Skip(Serializer prot, TType type)
 {
     switch (type)
     {
         case TType.Bool:
             prot.ReadBool();
             break;
         case TType.Byte:
             prot.ReadByte();
             break;
         case TType.I16:
             prot.ReadI16();
             break;
         case TType.I32:
             prot.ReadI32();
             break;
         case TType.I64:
             prot.ReadI64();
             break;
         case TType.Double:
             prot.ReadDouble();
             break;
         case TType.String:
             // Don't try to decode the string, just skip it.
             prot.ReadBinary();
             break;
         case TType.DataObject:
             prot.ReadDataObjectBegin();
             while (true)
             {
                 Field field = prot.ReadFieldBegin();
                 if (field.Type == TType.Stop)
                 {
                     break;
                 }
                 Skip(prot, field.Type);
                 prot.ReadFieldEnd();
             }
             prot.ReadDataObjectEnd();
             break;
         case TType.Map:
             TMap map = prot.ReadMapBegin();
             for (int i = 0; i < map.Count; i++)
             {
                 Skip(prot, map.KeyType);
                 Skip(prot, map.ValueType);
             }
             prot.ReadMapEnd();
             break;
         case TType.List:
             TList list = prot.ReadListBegin();
             for (int i = 0; i < list.Count; i++)
             {
                 Skip(prot, list.ElementType);
             }
             prot.ReadListEnd();
             break;
     }
 }
开发者ID:chartly,项目名称:flood,代码行数:59,代码来源:SerializerUtil.cs


示例8: Test

 public Test(TType type, IQuestion[] questions, DateTime timeToStart, string description)
 {
     _type = type;
     _questions=new List<IQuestion>(questions);
     _isStarted = false;
     _isFinished = false;
     _timeToStart = timeToStart;
     _description = description;
 }
开发者ID:verdigos,项目名称:MnemonicTrainer,代码行数:9,代码来源:Test.cs


示例9: GetDMVinfo

        public void GetDMVinfo(string GetQueryInfo,string Method, string parametrs, string Table, string Extra)
        {
            int StructCount = 0;
            string connectionString = @"Data Source=(local)\SERVER2012;
                            Initial Catalog=AdventureWorks2012;
                            Integrated Security=True";
            string DMVString = "SELECT query_hash, st.text,total_worker_time,cp.objtype,qs.execution_count,qp.query_plan,qs.query_hash FROM sys.dm_exec_query_stats qs " +
                              "CROSS APPLY sys.dm_exec_sql_text(qs.sql_handle) st " +
                              "CROSS APPLY sys.dm_exec_query_plan(qs.plan_handle) qp " +
                              "JOIN sys.dm_exec_cached_plans cp " +
                              "ON cp.plan_handle = qs.plan_handle " +
                              "WHERE  (st.text like'%" + Method + "%%"+ parametrs+"%%" + Table + "%%" + Extra + "%' AND st.text NOT like '%st.text%')";

            //Console.WriteLine(DMVString);
            using (SqlConnection connection = new SqlConnection(connectionString))
            {
                Console.WriteLine("GetDMVInfo Connection Success \n");
                SqlCommand command = new SqlCommand(DMVString, connection);
                try
                {
                    connection.Open();
                    SqlDataReader reader = command.ExecuteReader();
                    Console.WriteLine("Select info from DMV");
                    Console.ForegroundColor = ConsoleColor.Cyan;
                    while (reader.Read())
                    {
                        TType newTType = new TType();
                        Console.WriteLine("--------------->  New Query has been searshed  <------------ \n");
                        Console.WriteLine("\t{0}\t{1}\t{2}\t{3}", reader[0], reader[1], reader[2], reader[3]);
                        Console.WriteLine("");
                        newTType.query_hash = reader[0].ToString();
                        newTType.QueryText = reader[1].ToString();
                        newTType.CPUTime = Int32.Parse(reader[2].ToString());
                        newTType.ObjType = reader[3].ToString();
                        newTType.ExecCount = Int32.Parse(reader[4].ToString());
                        newTType.QueryPlan = reader[5].ToString();
                        newTType.QueryHash = (byte[])reader[6];
                        newTType.temp = reader[6].ToString();
                        if (newTType.ObjType != "Adhoc")
                        {
                            InfoStruct.Add(newTType);
                            StructCount++;
                        }
                    }

                    Console.ForegroundColor = ConsoleColor.Green;
                    Console.WriteLine("GetDMVinfo: Status -----> Complete \n");
                    Console.ForegroundColor = ConsoleColor.White;
                    reader.Close();
                }
                catch (Exception ex)
                {
                    Console.ForegroundColor = ConsoleColor.Red;
                    Console.WriteLine("Не удалось получить DMVinfo \n");
                }
            }
        }
开发者ID:VioleGreis,项目名称:BDrepositry,代码行数:57,代码来源:GetDMV.cs


示例10: Tile

        //advanced constructor
        public Tile(Rectangle r, Texture2D asset, Int16 i)
        {
            dirt = asset;
            rect = r;
            switch (i)
            {
                default:
                    type = TType.air;
                    drawme = false;
                    break;

                case 1:
                    type = TType.ground;
                    drawme = true;
                    break;

                case 2:
                    type = TType.misha;
                    drawme = true;
                    break;
            }
        }
开发者ID:scarbunkle,项目名称:spnmario,代码行数:23,代码来源:Tile.cs


示例11: readType

        private TType readType()
        {
            var type = new TType();
            //Program.allTypes.Add(type);
            type.name = currentToken.value;
            if (type.name == "unsigned") type.name += " " + getNextToken().value;
            getNextToken();
            if (currentToken.value == "long")
            {
                type.name += " long";
                getNextToken();
            }

            if (currentToken.token == ECodeToken.blLessThan)
            {
                getNextToken();
                type.genericType = readType();
                getNextToken();
            }

            if (currentToken.token == ECodeToken.brSmallBraceBegin)
            {
                type.isArray = true;
                getNextToken();
                getNextToken();
            }
            if (currentToken.token == ECodeToken.syQuestionmark)
            {
                type.isNullable = true;
                getNextToken();
            }
            type.name = getTypeName(type.name);
            return type;
        }
开发者ID:fjgandrade,项目名称:sharpkit,代码行数:34,代码来源:Parser.cs


示例12: TField

 public TField(string name, TType type, short id)
 {
     Name = name;
     Type = type;
     ID = id;
 }
开发者ID:nsuke,项目名称:thrift,代码行数:6,代码来源:TField.cs


示例13: isUnknownType

        public static bool isUnknownType(TType type)
        {

            var types = new HashSet<string>(new string[] {
				"bool",
				"int",
				"float",
				"double",
				"short",
				"ushort",
				"uint",
				"long",
				"ulong",
				"object",
				"Array",
				"byte",
				"JsString",
				"string",
				"JsObject",
				"JsArray",
				"void",
			});

            string typeName = type.name;
            if (type.name == "sequence") typeName = type.genericType.name;

            //if (typeName.EndsWith("Constructor")) return true;

            if (types.Contains(typeName)) return false;
            foreach (var pFile in Generator.parsedFiles)
            {
                foreach (var ns in pFile.nsList)
                {
                    foreach (var t in ns.types)
                    {
                        if (t.name == typeName)
                        {
                            return false;
                        }
                    }
                }
            }

            return true;
        }
开发者ID:fjgandrade,项目名称:sharpkit,代码行数:45,代码来源:Parser.cs


示例14: WriteCollectionBegin

        //
        // Internal writing methods
        //

        /**
         * Abstract method for writing the start of lists and sets. List and sets on 
         * the wire differ only by the type indicator.
         */
        protected void WriteCollectionBegin(TType elemType, int size)
        {
            if (size <= 14)
            {
                WriteByteDirect(size << 4 | getCompactType(elemType));
            }
            else
            {
                WriteByteDirect(0xf0 | getCompactType(elemType));
                WriteVarint32((uint)size);
            }
        }
开发者ID:kenangell,项目名称:fluentcassandra,代码行数:20,代码来源:TCompactProtocol.cs


示例15: getCompactType

 /**
  * Given a TType value, find the appropriate TCompactProtocol.Types constant.
  */
 private byte getCompactType(TType ttype)
 {
     return ttypeToCompactType[(int)ttype];
 }
开发者ID:kenangell,项目名称:fluentcassandra,代码行数:7,代码来源:TCompactProtocol.cs


示例16: OpExprOrType

 public OpExprOrType(TType type)
 {
     _type = type; _which = which.Type;
 }
开发者ID:buptkang,项目名称:MathCog,代码行数:4,代码来源:Syntax.cs


示例17: Next

        //~ Methods ----------------------------------------------------------------
        /// <summary>
        ///  Returns the next token in the stream, or null at EOS.
        /// </summary>
        /// <returns>Token</returns>
        public override Token Next()
        {
            /** how many character(s) has been stored in buffer */
            int length = 0;

            /** the position used to create Token */
            int start = offset;

            while (true)
            {
                /** current charactor */
                char c;

                /** unicode block of current charactor for detail */
                //Character.UnicodeBlock ub;

                offset++;

                if (bufferIndex >= dataLen)
                {
                    dataLen = input.Read(ioBuffer, 0, ioBuffer.Length);
                    bufferIndex = 0;
                }

                if (dataLen == -1)
                {
                    if (length > 0)
                    {
                        if (preIsTokened == true)
                        {
                            length = 0;
                            preIsTokened = false;
                        }

                        break;
                    }
                    else
                    {
                        return null;
                    }
                }
                else
                {
                    //get current character
                    c = Char.ToLowerInvariant(ioBuffer[bufferIndex++]);

                    //get the UnicodeBlock of the current character
                    //ub = Character.UnicodeBlock.of(c);
                }

                //if the current character is ASCII or Extend ASCII
                if (('\u0000' <= c && c <= '\u007F') ||
                    ('\uFF00' <= c && c <= '\uFFEF'))
                {
                    if ('\uFF00' <= c && c <= '\uFFEF')
                    {
                        /** convert  HALFWIDTH_AND_FULLWIDTH_FORMS to BASIC_LATIN */
                        int i = (int) c;
                        i = i - 65248;
                        c = (char) i;
                    }

                    // if the current character is a letter or "_" "+" "#"
                    if (Char.IsLetterOrDigit(c)
                        || ((c == '_') || (c == '+') || (c == '#'))
                        )
                    {
                        if (length == 0)
                        {
                            // "javaC1C2C3C4linux" <br>
                            //      ^--: the current character begin to token the ASCII
                            // letter
                            start = offset - 1;
                        }
                        else if (tokenType == TType.Double)
                        {
                            // "javaC1C2C3C4linux" <br>
                            //              ^--: the previous non-ASCII
                            // : the current character
                            offset--;
                            bufferIndex--;
                            tokenType = TType.Single;

                            if (preIsTokened == true)
                            {
                                // there is only one non-ASCII has been stored
                                length = 0;
                                preIsTokened = false;

                                break;
                            }
                            else
                            {
                                break;
                            }
//.........这里部分代码省略.........
开发者ID:synhershko,项目名称:BzReader,代码行数:101,代码来源:CJKTokenizer.cs


示例18: Skip

        public static void Skip(TProtocol prot, TType type)
        {
            prot.IncrementRecursionDepth();
            try
            {
                switch (type)
                {
                    case TType.Bool:
                        prot.ReadBool();
                        break;
                    case TType.Byte:
                        prot.ReadByte();
                        break;
                    case TType.I16:
                        prot.ReadI16();
                        break;
                    case TType.I32:
                        prot.ReadI32();
                        break;
                    case TType.I64:
                        prot.ReadI64();
                        break;
                    case TType.Double:
                        prot.ReadDouble();
                        break;
                    case TType.String:
                        // Don't try to decode the string, just skip it.
                        prot.ReadBinary();
                        break;
                    case TType.Struct:
                        prot.ReadStructBegin();
                        while (true)
                        {
                            TField field = prot.ReadFieldBegin();
                            if (field.Type == TType.Stop)
                            {
                                break;
                            }
                            Skip(prot, field.Type);
                            prot.ReadFieldEnd();
                        }
                        prot.ReadStructEnd();
                        break;
                    case TType.Map:
                        TMap map = prot.ReadMapBegin();
                        for (int i = 0; i < map.Count; i++)
                        {
                            Skip(prot, map.KeyType);
                            Skip(prot, map.ValueType);
                        }
                        prot.ReadMapEnd();
                        break;
                    case TType.Set:
                        TSet set = prot.ReadSetBegin();
                        for (int i = 0; i < set.Count; i++)
                        {
                            Skip(prot, set.ElementType);
                        }
                        prot.ReadSetEnd();
                        break;
                    case TType.List:
                        TList list = prot.ReadListBegin();
                        for (int i = 0; i < list.Count; i++)
                        {
                            Skip(prot, list.ElementType);
                        }
                        prot.ReadListEnd();
                        break;
                }

            }
            finally
            {
                prot.DecrementRecursionDepth();
            }
        }
开发者ID:ConfusedReality,项目名称:pkg_serialization_thrift,代码行数:76,代码来源:TProtocolUtil.cs


示例19: CharWKSOrT

 public CharWKSOrT(TType t)
 {
     C = null; WKS = null; T = t;
 }
开发者ID:buptkang,项目名称:MathCog,代码行数:4,代码来源:Syntax.cs


示例20: OpRel

 public OpRel(K kind, TType type, params OpExprOrType[] ooes)
     : this(kind, null, type, ooes)
 {
 }
开发者ID:buptkang,项目名称:MathCog,代码行数:4,代码来源:Syntax.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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