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

C# TypeSpec类代码示例

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

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



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

示例1: EnumToBoolMapping

        public EnumToBoolMapping(XmlElement element, TypeSpec fcsType)
        {
            enumValue = element.GetAttribute("FCSValue");
            boolMemberName = element.GetAttribute("ForeignMember");
            FCSType = fcsType;

        }
开发者ID:killbug2004,项目名称:WSProf,代码行数:7,代码来源:EnumToBoolMapping.cs


示例2: Type

            /// <summary>
            /// Read ctor
            /// </summary>
            internal Type(TypeSpec parent, ResReader reader)
                : base(reader, ChunkTypes.RES_TABLE_TYPE_TYPE)
            {
                this.parent = parent;

                var id = reader.ReadByte();
                reader.Skip(3); // reserved
                if (id != parent.Id)
                {
                    throw new IOException("Type id (" + id + ") " + "doesn't match parent id (" + parent.Id + ").");
                }
                var entryCount = reader.ReadInt32();
                if (entryCount != parent.EntryCount)
                {
                    throw new IOException(string.Format("Type entry count ({0}) doesn't match parent entry count ({1})", entryCount, parent.EntryCount));
                }
                var entriesStart = reader.ReadInt32();
                configuration = new Configuration(reader);
                // Data
                var offsets = reader.ReadIntArray(entryCount);
                var dataSize = (Size - entriesStart);
                if ((dataSize % 4) != 0)
                {
                    throw new IOException("Type data size (" + dataSize + ") is not multiple of 4.");
                }
                for (var i = 0; i < entryCount; i++ )
                {
                    if (offsets[i] != NO_ENTRY)
                    {
                        var actualOffset = reader.Position;
                        var instance = EntryInstance.Read(this, reader);
                        parent.GetEntry(i).Add(instance);
                    } 
                }
            }
开发者ID:Xtremrules,项目名称:dot42,代码行数:38,代码来源:Table.Type.cs


示例3: RequestMsg

 /// <summary>
 /// This .ctor is handy for message inspectors.
 /// Creates a substitute message for the original one with new values.
 /// Binding-specific context is cloned and headers/correlation data are cloned conditionaly
 /// </summary>
 protected RequestMsg(RequestMsg inspectedOriginal,
                   TypeSpec contract, MethodSpec method, bool oneWay, Guid? instance, 
                   bool cloneHeaders = true, bool cloneCorrelation = true) : this(contract, method, oneWay, instance)
 {
   m_ServerTransport = inspectedOriginal.m_ServerTransport;
   CloneState(inspectedOriginal, cloneHeaders, cloneCorrelation);
 }
开发者ID:vlapchenko,项目名称:nfx,代码行数:12,代码来源:RequestMsg.cs


示例4: InitializeTypes

        private static void InitializeTypes(SymbolTableStack symtabstack)
        {
            // int
            IntegerId = symtabstack.CreateInLocal("integer");
            IntegerType = TypeSpec.CreateType(TypeForm.Scalar);
            IntegerType.Identifier = IntegerId;
            IntegerId.Definition = Definition.TYPE;
            IntegerId.Type = IntegerType;

            // real
            RealId = symtabstack.CreateInLocal("real");
            RealType = TypeSpec.CreateType(TypeForm.Scalar);
            RealType.Identifier = RealId;
            RealId.Definition = Definition.TYPE;
            RealId.Type = RealType;

            // boolean
            BooleanId = symtabstack.CreateInLocal("boolean");
            BooleanType = TypeSpec.CreateType(TypeForm.Enumeration);
            BooleanType.Identifier = BooleanId;
            BooleanId.Definition = Definition.TYPE;
            BooleanId.Type = BooleanType;

            // char
            CharId = symtabstack.CreateInLocal("char");
            CharType = TypeSpec.CreateType(TypeForm.Scalar);
            CharType.Identifier = CharId;
            CharId.Definition = Definition.TYPE;
            CharId.Type = CharType;

            //
            UndefinedType = TypeSpec.CreateType(TypeForm.Scalar);
        }
开发者ID:jstark,项目名称:dradis,代码行数:33,代码来源:Predefined.cs


示例5: RequestAnyMsg

 /// <summary>
 /// This .ctor is handy for message inspectors.
 /// Creates a substitute message for the original one with new values.
 /// Binding-specific context is cloned and headers/correlation data are cloned conditionaly
 /// </summary>
 public RequestAnyMsg(RequestMsg inspectedOriginal,
     TypeSpec contract, MethodSpec method, bool oneWay, Guid? instance, object[] args,
     bool cloneHeaders = true, bool cloneCorrelation = true)
     : base(inspectedOriginal, contract, method, oneWay, instance, cloneHeaders, cloneCorrelation)
 {
     m_Arguments = args;
 }
开发者ID:itadapter,项目名称:nfx,代码行数:12,代码来源:RequestMsg.cs


示例6: BaseClassMapping

        protected BaseClassMapping(XmlElement node)
        {
            FCSType = new TypeSpec(node.GetAttribute("FCSType"), TypeSpec.TypeSpecCategories.FCSType);
            ForeignType = new TypeSpec(node.GetAttribute("ForeignType"), TypeSpec.TypeSpecCategories.ForeignType);

            ForeignType.HeaderFile = XmlUtils.GetOptionalAttribute(node, "HeaderFile");
        }
开发者ID:killbug2004,项目名称:WSProf,代码行数:7,代码来源:BaseClassMapping.cs


示例7: CreateNestedDelta

 protected virtual object CreateNestedDelta(object propValue, TypeSpec propValueType, Type propertyType)
 {
     if (propValueType.SerializationMode == TypeSerializationMode.Structured)
         return new ObjectDelta(propValue, propValueType, TypeMapper, this);
     if (propValueType.IsCollection)
         return new CollectionDelta(propValue, propValueType, TypeMapper, this);
     throw new NotImplementedException();
 }
开发者ID:Pomona,项目名称:Pomona,代码行数:8,代码来源:Delta.cs


示例8: AuthServiceClient

 //static .ctor
 static AuthServiceClient()
 {
     var t = typeof(IAuthService);
     s_ts_CONTRACT = new TypeSpec(t);
     s_ms_CloseSession = new MethodSpec(t.GetMethod("CloseSession", new Type[] { typeof(Guid) }));
     s_ms_CreateSession = new MethodSpec(t.GetMethod("CreateSession", new Type[] { typeof(long) }));
     s_ms_GetSessionUser = new MethodSpec(t.GetMethod("GetSessionUser", new Type[] { typeof(Guid) }));
 }
开发者ID:Axaprj,项目名称:BLService,代码行数:9,代码来源:AuthServiceClient.cs


示例9: PomonaJsonSerializerTypeEntry

        public PomonaJsonSerializerTypeEntry(TypeSpec type)
        {
            if (type == null)
                throw new ArgumentNullException(nameof(type));
            this.type = type;

            BuildAcceleratedPropertyWritingAction();
        }
开发者ID:Pomona,项目名称:Pomona,代码行数:8,代码来源:PomonaJsonSerializerTypeEntry.cs


示例10: TestContractAClient

 //static .ctor
 static TestContractAClient()
 {
     var t = typeof(NFX.NUnit.Glue.ITestContractA);
      s_ts_CONTRACT = new TypeSpec(t);
      @s_ms_Method1_0 = new MethodSpec(t.GetMethod("Method1", new Type[]{ typeof(@[email protected]) }));
      @s_ms_Method2_1 = new MethodSpec(t.GetMethod("Method2", new Type[]{ typeof(@[email protected]) }));
      @s_ms_Sleeper_2 = new MethodSpec(t.GetMethod("Sleeper", new Type[]{ typeof(@[email protected]) }));
 }
开发者ID:vlapchenko,项目名称:nfx,代码行数:9,代码来源:TestObjects_A.cs


示例11: Delta

 protected Delta(object original, TypeSpec type, ITypeMapper typeMapper, Delta parent = null)
 {
     if (original == null) throw new ArgumentNullException("original");
     if (type == null) throw new ArgumentNullException("type");
     if (typeMapper == null) throw new ArgumentNullException("typeMapper");
     Original = original;
     Type = type;
     TypeMapper = typeMapper;
     this.parent = parent;
 }
开发者ID:BeeWarloc,项目名称:Pomona,代码行数:10,代码来源:Delta.cs


示例12: Error_InvalidConstantType

 public static void Error_InvalidConstantType(TypeSpec t, Location loc, Report Report)
 {
     if (t.IsGenericParameter) {
         Report.Error (1959, loc,
             "Type parameter `{0}' cannot be declared const", TypeManager.CSharpName (t));
     } else {
         Report.Error (283, loc,
             "The type `{0}' cannot be declared const", TypeManager.CSharpName (t));
     }
 }
开发者ID:RainsSoft,项目名称:MonoCompilerAsAService,代码行数:10,代码来源:const.cs


示例13: ItemValueDeserializerNode

 public ItemValueDeserializerNode(TypeSpec expectedBaseType,
                                  IDeserializationContext context,
                                  string expandPath = "",
                                  IDeserializerNode parent = null)
 {
     Parent = parent;
     ExpectedBaseType = expectedBaseType;
     Context = context;
     ExpandPath = expandPath;
     this.valueType = expectedBaseType;
 }
开发者ID:Pomona,项目名称:Pomona,代码行数:11,代码来源:ItemValueDeserializerNode.cs


示例14: MemberSpec

        public MemberSpec(string specText, TypeSpec.TypeSpecCategories typeCategory)
        {
            int index = specText.LastIndexOf(' ');
            string[] bits = new string[2];
            bits[0] = specText.Substring(0, index);
            bits[1] = specText.Substring(index + 1);

            Type = new TypeSpec(bits[0], typeCategory);
            Name = bits[1];

        }
开发者ID:killbug2004,项目名称:WSProf,代码行数:11,代码来源:MemberSpec.cs


示例15: JokeContractClient

 //static .ctor
 static JokeContractClient()
 {
     var t = typeof(@[email protected]);
      s_ts_CONTRACT = new TypeSpec(t);
      @s_ms_Echo_0 = new MethodSpec(t.GetMethod("Echo", new Type[]{ typeof(@[email protected]) }));
      @s_ms_UnsecureEcho_1 = new MethodSpec(t.GetMethod("UnsecureEcho", new Type[]{ typeof(@[email protected]) }));
      @s_ms_UnsecEchoMar_2 = new MethodSpec(t.GetMethod("UnsecEchoMar", new Type[]{ typeof(@[email protected]) }));
      @s_ms_SimpleWorkAny_3 = new MethodSpec(t.GetMethod("SimpleWorkAny", new Type[]{ typeof(@[email protected]), typeof(@[email protected]), typeof(@[email protected]), typeof(@[email protected]), typeof(@[email protected]) }));
      @s_ms_SimpleWorkMar_4 = new MethodSpec(t.GetMethod("SimpleWorkMar", new Type[]{ typeof(@[email protected]), typeof(@[email protected]), typeof(@[email protected]), typeof(@[email protected]), typeof(@[email protected]) }));
      @s_ms_DBWork_5 = new MethodSpec(t.GetMethod("DBWork", new Type[]{ typeof(@[email protected]), typeof(@[email protected]), typeof(@[email protected]) }));
      @s_ms_Notify_6 = new MethodSpec(t.GetMethod("Notify", new Type[]{ typeof(@[email protected]) }));
      @s_ms_ObjectWork_7 = new MethodSpec(t.GetMethod("ObjectWork", new Type[]{ typeof(@[email protected]) }));
 }
开发者ID:itadapter,项目名称:nfx,代码行数:14,代码来源:JokeContractClient.cs


示例16: Match

 public RouteAction Match(HttpMethod method, PathNodeType nodeType, TypeSpec resourceType)
 {
     switch (nodeType)
     {
         case PathNodeType.Collection:
             return MatchCollectionNodeRequest(method, (ResourceType)resourceType);
         case PathNodeType.Resource:
             if (!MethodInfo.Name.StartsWith(method.ToString()))
                 return null;
             return MatchResourceNodeRequest(method, (ResourceType)resourceType);
     }
     return null;
 }
开发者ID:Pomona,项目名称:Pomona,代码行数:13,代码来源:HandlerMethod.cs


示例17: Delta

 protected Delta(object original, TypeSpec type, ITypeResolver typeMapper, Delta parent = null)
 {
     if (original == null)
         throw new ArgumentNullException(nameof(original));
     if (type == null)
         throw new ArgumentNullException(nameof(type));
     if (typeMapper == null)
         throw new ArgumentNullException(nameof(typeMapper));
     Original = original;
     Type = type;
     TypeMapper = typeMapper;
     Parent = parent;
 }
开发者ID:Pomona,项目名称:Pomona,代码行数:13,代码来源:Delta.cs


示例18: ResolveField

		/// <summary>
		/// Resolve an IField from its name and a declaring TypeSpec.
		/// </summary>
		/// <param name="declaringType">Declaring TypeSpec</param>
		/// <param name="fieldName">Field name</param>
		/// <returns>IField, or null if none found</returns>
		public IField ResolveField(TypeSpec declaringType, String fieldName)
		{
			TypeDef typeDef = declaringType.ResolveTypeDef();
			if (typeDef == null)
				return null;

			FieldDef fieldDef = typeDef.FindField(fieldName);
			if (fieldDef == null)
				return null;

			MemberRef memberRef = new MemberRefUser(_module, fieldDef.Name, fieldDef.FieldSig, declaringType);
			return this.Importer.Import(memberRef);
		}
开发者ID:misharcrack,项目名称:eazdevirt,代码行数:19,代码来源:NameResolver.cs


示例19: TypeSpec

        //
        private TypeSpec(string value)
        {
            form = TypeForm.Array;

            TypeSpec indexType = new TypeSpec(TypeForm.Subrange);
            // FIXME: Predefined
            // indexType.SetAttribute(TypeKey.SubrangeBaseType, Predefined.IntegerType);
            indexType.SetAttribute(TypeKey.SubrangeMinValue, 1);
            indexType.SetAttribute(TypeKey.SubrangeMaxValue, value.Length);
            SetAttribute(TypeKey.ArrayIndexType, indexType);
            // FIXME: Predefined
            // SetAttribute(TypeKey.ArrayElementType, Predefined.CharType);
            SetAttribute(TypeKey.ArrayElementCount, value.Length);
        }
开发者ID:jstark,项目名称:dradis,代码行数:15,代码来源:Type.cs


示例20: TryGetJsonWriterMethodForWritingType

        private static bool TryGetJsonWriterMethodForWritingType(TypeSpec type, out MethodInfo method)
        {
            method = null;
            if (type.SerializationMode != TypeSerializationMode.Value)
                return false;

            method = typeof(JsonWriter)
                .GetMethods(BindingFlags.Instance | BindingFlags.Public)
                .Where(x => x.Name == "WriteValue")
                .FirstOrDefault(
                    x => x.GetParameters().Length == 1 && x.GetParameters()[0].ParameterType == type.Type);

            return method != null;
        }
开发者ID:Pomona,项目名称:Pomona,代码行数:14,代码来源:PomonaJsonSerializerTypeEntry.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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