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


C# DotNet.PropertyDef类代码示例

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


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

示例1: FindBaseProperties

        /// <summary>
        /// Finds all properties from base types overridden or hidden by the specified property.
        /// </summary>
        /// <param name="property">The property which overrides or hides properties from base types.</param>
        /// <returns>Properties overriden or hidden by the specified property.</returns>
        public static IEnumerable<PropertyDef> FindBaseProperties(PropertyDef property)
        {
            if (property == null)
                yield break;

            var accMeth = property.GetMethod ?? property.SetMethod;
            if (accMeth != null && accMeth.HasOverrides)
                yield break;

            bool isIndexer = property.IsIndexer();

            foreach (var baseType in BaseTypes(property.DeclaringType)) {
                var baseTypeDef = baseType.Resolve();
                if (baseTypeDef == null)
                    continue;
                foreach (var baseProperty in baseTypeDef.Properties) {
                    if (MatchProperty(baseProperty, Resolve(baseProperty.PropertySig, baseType), property)
                            && IsVisibleFromDerived(baseProperty, property.DeclaringType)) {
                        if (isIndexer != baseProperty.IsIndexer())
                            continue;
                        yield return baseProperty;
                        var anyPropertyAccessor = baseProperty.GetMethod ?? baseProperty.SetMethod;
                        if (anyPropertyAccessor != null && anyPropertyAccessor.IsNewSlot == anyPropertyAccessor.IsVirtual)
                            yield break;
                    }
                }
            }
        }
开发者ID:lovebanyi,项目名称:dnSpy,代码行数:33,代码来源:TypesHierarchyHelpers.cs

示例2: InterfacePropertyImplementedByNode

		public InterfacePropertyImplementedByNode(PropertyDef analyzedProperty) {
			if (analyzedProperty == null)
				throw new ArgumentNullException(nameof(analyzedProperty));

			this.analyzedProperty = analyzedProperty;
			analyzedMethod = this.analyzedProperty.GetMethod ?? this.analyzedProperty.SetMethod;
		}
开发者ID:manojdjoshi,项目名称:dnSpy,代码行数:7,代码来源:InterfacePropertyImplementedByNode.cs

示例3: AnalyzedInterfacePropertyImplementedByTreeNode

		public AnalyzedInterfacePropertyImplementedByTreeNode(PropertyDef analyzedProperty) {
			if (analyzedProperty == null)
				throw new ArgumentNullException("analyzedProperty");

			this.analyzedProperty = analyzedProperty;
			this.analyzedMethod = this.analyzedProperty.GetMethod ?? this.analyzedProperty.SetMethod;
		}
开发者ID:arkanoid1,项目名称:dnSpy,代码行数:7,代码来源:AnalyzedInterfacePropertyImplementedByTreeNode.cs

示例4: PropertyNode

		public PropertyNode(PropertyDef analyzedProperty, bool hidesParent = false) {
			if (analyzedProperty == null)
				throw new ArgumentNullException(nameof(analyzedProperty));
			isIndexer = analyzedProperty.IsIndexer();
			this.analyzedProperty = analyzedProperty;
			this.hidesParent = hidesParent;
		}
开发者ID:manojdjoshi,项目名称:dnSpy,代码行数:7,代码来源:PropertyNode.cs

示例5: AnalyzedPropertyOverridesTreeNode

        public AnalyzedPropertyOverridesTreeNode(PropertyDef analyzedProperty)
        {
            if (analyzedProperty == null)
                throw new ArgumentNullException("analyzedProperty");

            this.analyzedProperty = analyzedProperty;
        }
开发者ID:jorik041,项目名称:dnSpy-retired,代码行数:7,代码来源:AnalyzedPropertyOverridesTreeNode.cs

示例6: DeletedPropertyUpdater

		public DeletedPropertyUpdater(ModuleDocumentNode modNode, PropertyDef originalProperty) {
			ownerNode = modNode.Context.DocumentTreeView.FindNode(originalProperty);
			if (ownerNode == null)
				throw new InvalidOperationException();
			parentNode = ownerNode.TreeNode.Parent.Data;
			ownerType = originalProperty.DeclaringType;
			property = originalProperty;
		}
开发者ID:manojdjoshi,项目名称:dnSpy,代码行数:8,代码来源:DeletedPropertyUpdater.cs

示例7: AnalyzedPropertyTreeNode

		public AnalyzedPropertyTreeNode(PropertyDef analyzedProperty, bool hidesParent = false) {
			if (analyzedProperty == null)
				throw new ArgumentNullException("analyzedProperty");
			this.isIndexer = analyzedProperty.IsIndexer();
			this.analyzedProperty = analyzedProperty;
			this.hidesParent = hidesParent;
			this.LazyLoading = true;
		}
开发者ID:arkanoid1,项目名称:dnSpy,代码行数:8,代码来源:AnalyzedPropertyTreeNode.cs

示例8: EditedPropertyUpdater

		public EditedPropertyUpdater(ModuleDocumentNode modNode, PropertyDef originalProperty, PropertyDefOptions propertyDefOptions) {
			ownerNode = modNode.Context.DocumentTreeView.FindNode(originalProperty);
			if (ownerNode == null)
				throw new InvalidOperationException();
			property = originalProperty;
			originalPropertyDefOptions = new PropertyDefOptions(originalProperty);
			newPropertyDefOptions = propertyDefOptions;
		}
开发者ID:manojdjoshi,项目名称:dnSpy,代码行数:8,代码来源:EditedPropertyUpdater.cs

示例9: GetMethodsAndSelf

		public static IEnumerable<IMemberDef> GetMethodsAndSelf(PropertyDef p) {
			yield return p;
			foreach (var m in p.GetMethods)
				yield return m;
			foreach (var m in p.SetMethods)
				yield return m;
			foreach (var m in p.OtherMethods)
				yield return m;
		}
开发者ID:manojdjoshi,项目名称:dnSpy,代码行数:9,代码来源:DotNetUtils.cs

示例10: AnalyzedPropertyTreeNode

 public AnalyzedPropertyTreeNode(PropertyDef analyzedProperty, string prefix = "")
 {
     if (analyzedProperty == null)
         throw new ArgumentNullException("analyzedProperty");
     this.isIndexer = analyzedProperty.IsIndexer();
     this.analyzedProperty = analyzedProperty;
     this.prefix = prefix;
     this.LazyLoading = true;
 }
开发者ID:jorik041,项目名称:dnSpy-retired,代码行数:9,代码来源:AnalyzedPropertyTreeNode.cs

示例11: Write

		public static ITextOutput Write(ITextOutput output, PropertyDef property, Language language, bool? isIndexer = null) {
			language.FormatPropertyName(output, property, isIndexer);
			output.WriteSpace();
			output.Write(':', TextTokenType.Operator);
			output.WriteSpace();
			language.TypeToString(output, property.PropertySig.GetRetType().ToTypeDefOrRef(), false, property);
			property.MDToken.WriteSuffixString(output);
			return output;
		}
开发者ID:arkanoid1,项目名称:dnSpy,代码行数:9,代码来源:PropertyTreeNode.cs

示例12: PropertyDefOptions

		public PropertyDefOptions(PropertyDef prop) {
			Attributes = prop.Attributes;
			Name = prop.Name;
			PropertySig = prop.PropertySig;
			Constant = prop.Constant;
			GetMethods.AddRange(prop.GetMethods);
			SetMethods.AddRange(prop.SetMethods);
			OtherMethods.AddRange(prop.OtherMethods);
			CustomAttributes.AddRange(prop.CustomAttributes);
		}
开发者ID:manojdjoshi,项目名称:dnSpy,代码行数:10,代码来源:PropertyDefOptions.cs

示例13: PropertyDefOptions

		public PropertyDefOptions(PropertyDef prop) {
			this.Attributes = prop.Attributes;
			this.Name = prop.Name;
			this.PropertySig = prop.PropertySig;
			this.Constant = prop.Constant;
			this.GetMethods.AddRange(prop.GetMethods);
			this.SetMethods.AddRange(prop.SetMethods);
			this.OtherMethods.AddRange(prop.OtherMethods);
			this.CustomAttributes.AddRange(prop.CustomAttributes);
		}
开发者ID:arkanoid1,项目名称:dnSpy,代码行数:10,代码来源:PropertyDefOptions.cs

示例14: PropertyEquals

        public bool PropertyEquals(PropertyDef pd, PropertyInfo pi)
        {
            if (!MemberEquals(pd, pi) || TypeEquals(pd.PropertySig.RetType, pi.PropertyType) || (int)pd.Attributes != (int)pi.Attributes)
                return false;

            var gm = pi.GetGetMethod();
            var sm = pi.GetSetMethod();

            if (gm == null ^ pd.GetMethod == null) return false;
            if (sm == null ^ pd.SetMethod == null) return false;

            return (gm == null || MethodEquals(pd.GetMethod, gm))
                && (sm == null || MethodEquals(pd.SetMethod, sm));
        }
开发者ID:TerrariaPrismTeam,项目名称:Prism,代码行数:14,代码来源:DNReflectionComparer.cs

示例15: CopyTo

		public PropertyDef CopyTo(PropertyDef prop) {
			prop.Attributes = this.Attributes;
			prop.Name = this.Name ?? UTF8String.Empty;
			prop.PropertySig = this.PropertySig;
			prop.Constant = this.Constant;
			prop.GetMethods.Clear();
			prop.GetMethods.AddRange(this.GetMethods);
			prop.SetMethods.Clear();
			prop.SetMethods.AddRange(this.SetMethods);
			prop.OtherMethods.Clear();
			prop.OtherMethods.AddRange(this.OtherMethods);
			prop.CustomAttributes.Clear();
			prop.CustomAttributes.AddRange(CustomAttributes);
			return prop;
		}
开发者ID:arkanoid1,项目名称:dnSpy,代码行数:15,代码来源:PropertyDefOptions.cs


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