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

C# TypeRef类代码示例

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

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



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

示例1: ValidateTypeRef

        public void ValidateTypeRef(Element element, TypeRef typeref)
        {

            // Test if the Surrect was able to link to the target structure.
            if (typeref.Structure != null)
            {
                Log(Group.Reference, Status.Valid, "Type reference to structure [{0}] is valid", typeref.Code);
                
                // Genest structuren valideren hoeft niet. Want alle structures worden al op hoofdniveau gevalideerd
                //ValidateStructure(typeref.Structure);

            }

            // Test if there is a reference at all
            else if (typeref.Code == null)
            {
                Log(Group.Reference, Status.Failed, "Missing a reference to a structure in element [{0}]", element.Name);
            }

            // Test if code is itself valid? If so, the reference valid but the target is missing.
            else if (Regex.IsMatch(typeref.Code, "[A-Za-z][A-Za-z0-9]*"))
            {
                // Collect first to avoid duplicates
                missingStructureNames.Add(typeref.Code);
            }

            // The code contains invalid characters
            else
            {
                Log(Group.Reference, Status.Failed, "Invalid structure reference '{0}' in {1}", typeref.Code, element.Path);
            }
        }
开发者ID:wdebeau1,项目名称:fhir-net-api,代码行数:32,代码来源:SpecificationValidator.cs


示例2: ResolvingUri

        /*
        public static Uri ResolvingUri(TypeRef typeref)
        {
            if (typeref.ProfileUri == null)
            {
                return BaseProfileUriFor(typeref.Code);
            }
            else
            {
                return new Uri(typeref.ProfileUri);
            }
        }
        */

        public static Uri Identify(Structure structure, TypeRef typeref)
        {
            string name = typeref.Code;
            Uri uri;

            if ((name == "ResourceReference"))
            {
                uri = BaseProfileUriFor(name);
            }
            else if (typeref.ProfileUri != null)
            {
                
                if (typeref.ProfileUri.StartsWith("#"))
                {
                    uri = new Uri(structure.ProfileUri + typeref.ProfileUri);
                }
                else if (typeref.ProfileUri != null)
                {
                    uri = new Uri(typeref.ProfileUri);
                }
                else 
                {
                    uri = BaseProfileUriFor(name);
                }
            }
            else // typeref.profileuri == null
            {
                uri = BaseProfileUriFor(name);
            }

            return uri;
        }
开发者ID:wdebeau1,项目名称:fhir-net-api,代码行数:46,代码来源:UriHelper.cs


示例3: ExtensionPointInfo

		/// <summary>
		/// Internal constructor.
		/// </summary>
		internal ExtensionPointInfo(TypeRef extensionPointClass, TypeRef extensionInterface, string name, string description)
		{
			_extensionPointClass = extensionPointClass;
			_extensionInterface = extensionInterface;
			_name = name;
			_description = description;
		}
开发者ID:UIKit0,项目名称:ClearCanvas,代码行数:10,代码来源:ExtensionPointInfo.cs


示例4: Resolve

		/// <inheritdoc/>
		public TypeDef Resolve(TypeRef typeRef) {
			if (typeRef == null)
				return null;

			var nonNestedTypeRef = TypeRef.GetNonNestedTypeRef(typeRef);
			if (nonNestedTypeRef == null)
				return null;

			var asmRef = nonNestedTypeRef.ResolutionScope as AssemblyRef;
			if (asmRef != null) {
				var asm = assemblyResolver.Resolve(asmRef, nonNestedTypeRef.Module);
				return asm == null ? null : asm.Find(typeRef);
			}

			var moduleDef = nonNestedTypeRef.ResolutionScope as ModuleDef;
			if (moduleDef != null)
				return moduleDef.Find(typeRef);

			var moduleRef = nonNestedTypeRef.ResolutionScope as ModuleRef;
			if (moduleRef != null) {
				if (nonNestedTypeRef.Module == null)
					return null;
				if (new SigComparer().Equals(moduleRef, nonNestedTypeRef.Module))
					return nonNestedTypeRef.Module.Find(typeRef);
				if (nonNestedTypeRef.Module.Assembly == null)
					return null;
				var resolvedModule = nonNestedTypeRef.Module.Assembly.FindModule(moduleRef.Name);
				return resolvedModule == null ? null : resolvedModule.Find(typeRef);
			}

			return null;
		}
开发者ID:SAD1992,项目名称:justdecompile-plugins,代码行数:33,代码来源:Resolver.cs


示例5: EmittedParameter

 internal EmittedParameter(int index, string name, TypeRef type)
 {
     this.Index = index;
     this.Name = name;
     this.ParameterType = type;
     this.Attributes = ParameterAttributes.None;
 }
开发者ID:rreynolds-yp,项目名称:csharp-swift-consoleclient,代码行数:7,代码来源:EmittedParameter.cs


示例6: EmittedProperty

        public EmittedProperty(EmittedClass type, string name, TypeRef propertyType, bool isStatic)
            : base(type, name)
        {
            Contracts.Require.IsNotNull("propertyType", propertyType);

            this.PropertyType = propertyType;
            this._isStatic = isStatic;
        }
开发者ID:rreynolds-yp,项目名称:csharp-swift-consoleclient,代码行数:8,代码来源:EmittedProperty.cs


示例7: ExtensionInfo

		public ExtensionInfo(TypeRef extensionClass, TypeRef pointExtended, string name, string description, bool enabled, string featureToken)
		{
			_extensionClass = extensionClass;
			_pointExtended = pointExtended;
			_name = name;
			_description = description;
			_enabled = enabled;
			_featureToken = featureToken;
		}
开发者ID:6563000,项目名称:ClearCanvas,代码行数:9,代码来源:ExtensionInfo.cs


示例8: EmittedField

        public EmittedField(EmittedClass type, string name, TypeRef fieldType)
            : base(type, name)
        {
            Contracts.Require.IsNotNull("type", type);
            Contracts.Require.IsNotNull("name", name);

            this.FieldType = fieldType;
            this.Attributes = FieldAttributes.Private;
        }
开发者ID:rreynolds-yp,项目名称:csharp-swift-consoleclient,代码行数:9,代码来源:EmittedField.cs


示例9: TypeDefOrRefRowFromTypeRef

        // ----------------------------------------------------------------------
        // Type references
        // ----------------------------------------------------------------------

        private PE.Row TypeDefOrRefRowFromTypeRef(DllSaveContext ctxt, TypeRef typeRef)
        {
            var row = default(PE.Row);
            if (!ctxt.TypeRefToRowCache.TryGetValue(typeRef, out row))
            {
                if (typeRef.Arguments.Count == 0)
                    row = TypeDefOrRefRowFromQualifiedTypeName(ctxt, typeRef.QualifiedTypeName);
                else
                    row = new PE.TypeSpecRow { Signature = { Value = TypeSigFromTypeRef(ctxt, typeRef) } };
                ctxt.TypeRefToRowCache.Add(typeRef, row);
            }
            return row;
        }
开发者ID:modulexcite,项目名称:IL2JS,代码行数:17,代码来源:PESaver.cs


示例10: AddExtensionElement

 public static void AddExtensionElement(Structure structure, Element parent = null)
 {
     parent = parent  ?? structure.Root;
     string path = string.Format("{0}.extension", parent.Path); 
     Element element = new Element();
     element.Path = new Path(path);
     element.Name = "extension";
     element.Cardinality = new Cardinality { Min = "0", Max = "*" };
     TypeRef typeref = new TypeRef("Extension");
     UriHelper.SetTypeRefIdentification(structure, typeref);
     element.TypeRefs.Add(typeref);
     structure.Elements.Add(element);
 }
开发者ID:wdebeau1,项目名称:fhir-net-api,代码行数:13,代码来源:StructureFactory.cs


示例11: Unify

        public void Unify(RootEnvironment rootEnv, StackEntryState other, BoolRef changed)
        {
            var type = Type.Lub(rootEnv, other.Type, changed);

            var upperBound = default(TypeRef);
            if (UpperBound != null && other.UpperBound != null)
                upperBound = UpperBound.Glb(rootEnv, other.UpperBound, changed);
            else if (other.UpperBound != null)
            {
                upperBound = other.UpperBound;
                changed.Set();
            }
            else
                upperBound = UpperBound;

            if (upperBound != null && !type.IsAssignableTo(rootEnv, upperBound))
                throw new InvalidOperationException("stack entries are not unifiable");

            var pointsTo = PointsTo.Lub(other.PointsTo, changed);

            UpperBound = upperBound;
            Type = type;
            PointsTo = pointsTo;
        }
开发者ID:modulexcite,项目名称:IL2JS,代码行数:24,代码来源:MachineState.cs


示例12: ConstInt

 public unsafe static ValueRef ConstInt(TypeRef IntTy, ulong N, bool SignExtend) {
   ValueRef ret = new ValueRef(LLVMPINVOKE.ConstInt(IntTy.Value, N, SignExtend));
   return ret;
 }
开发者ID:RainsSoft,项目名称:SharpLang,代码行数:4,代码来源:LLVM.cs


示例13: ConstPointerNull

 public unsafe static ValueRef ConstPointerNull(TypeRef Ty) {
   ValueRef ret = new ValueRef(LLVMPINVOKE.ConstPointerNull(Ty.Value));
   return ret;
 }
开发者ID:RainsSoft,项目名称:SharpLang,代码行数:4,代码来源:LLVM.cs


示例14: GetUndef

 public unsafe static ValueRef GetUndef(TypeRef Ty) {
   ValueRef ret = new ValueRef(LLVMPINVOKE.GetUndef(Ty.Value));
   return ret;
 }
开发者ID:RainsSoft,项目名称:SharpLang,代码行数:4,代码来源:LLVM.cs


示例15: ConstAllOnes

 public unsafe static ValueRef ConstAllOnes(TypeRef Ty) {
   ValueRef ret = new ValueRef(LLVMPINVOKE.ConstAllOnes(Ty.Value));
   return ret;
 }
开发者ID:RainsSoft,项目名称:SharpLang,代码行数:4,代码来源:LLVM.cs


示例16: TypeOf

 public unsafe static TypeRef TypeOf(ValueRef Val) {
   TypeRef ret = new TypeRef(LLVMPINVOKE.TypeOf(Val.Value));
   return ret;
 }
开发者ID:RainsSoft,项目名称:SharpLang,代码行数:4,代码来源:LLVM.cs


示例17: X86MMXType

 public unsafe static TypeRef X86MMXType() {
   TypeRef ret = new TypeRef(LLVMPINVOKE.X86MMXType());
   return ret;
 }
开发者ID:RainsSoft,项目名称:SharpLang,代码行数:4,代码来源:LLVM.cs


示例18: CustomModAnnotation

 public CustomModAnnotation(bool isRequired, TypeRef type)
 {
     IsRequired = isRequired;
     Type = type;
 }
开发者ID:modulexcite,项目名称:IL2JS,代码行数:5,代码来源:Annotation.cs


示例19: ConstRealOfString

 public unsafe static ValueRef ConstRealOfString(TypeRef RealTy, string Text) {
   ValueRef ret = new ValueRef(LLVMPINVOKE.ConstRealOfString(RealTy.Value, Text));
   return ret;
 }
开发者ID:RainsSoft,项目名称:SharpLang,代码行数:4,代码来源:LLVM.cs


示例20: ConstIntOfStringAndSize

 public unsafe static ValueRef ConstIntOfStringAndSize(TypeRef IntTy, string Text, uint SLen, byte Radix) {
   ValueRef ret = new ValueRef(LLVMPINVOKE.ConstIntOfStringAndSize(IntTy.Value, Text, SLen, Radix));
   return ret;
 }
开发者ID:RainsSoft,项目名称:SharpLang,代码行数:4,代码来源:LLVM.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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