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


C# IAttribute类代码示例

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


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

示例1: pMixinAttributeResolvedResult

 /// <summary>
 /// Creates a new <see cref="pMixinAttributeResolvedResult"/>
 /// </summary>
 /// <param name="attribute">
 /// Reference to the <see cref="CopaceticSoftware.pMixin"/>'s source code.
 /// </param>
 public pMixinAttributeResolvedResult(IAttribute attribute)
     : base(attribute)
 {
     Masks = new List<IType>(0);
     Interceptors = new List<IType>(0);
     EnableSharedRequirementsInterface = new pMixinAttribute().EnableSharedRequirementsInterface;
 }
开发者ID:prescottadam,项目名称:pMixins,代码行数:13,代码来源:pMixinAttributeResolvedResult.cs

示例2: GetTargetModifierList

 private static IAssociations GetTargetModifierList(IAttribute target, string modifierType)
 {
     switch (modifierType)
     {
         case "ModAdd":
             return target.AdditionAssociations;
         case "ModSub":
             return target.SubstractionAssociations;
         case "PostAssignment":
             return target.PostAssignmentAssociations;
         case "PostDiv":
             return target.PostDivisionAssociations;
         case "PostMul":
             return target.PostMultiplicationAssociations;
         case "PostPercent":
             return target.PostPercentAssociations;
         case "PreAssignment":
             return target.PreAssignmentAssociations;
         case "PreDiv":
             return target.PreDivisionAssociations;
         case "PreMul":
             return target.PreMultiplicationAssociations;
         case "9":
             //skilllevel modifier
             return new DummyAssociations();
         default://TODO richtiger exceptiontyp
             throw new Exception("unknown modifier type: " + modifierType);
     }
 }
开发者ID:rischwa,项目名称:eve-fast-fitting-assessment,代码行数:29,代码来源:GetItemModifierExpression.cs

示例3: Resolve

		public IList<IAttribute> Resolve(IAssembly currentAssembly)
		{
			// TODO: make this a per-assembly cache
//				CacheManager cache = currentAssembly.Compilation.CacheManager;
//				IList<IAttribute> result = (IList<IAttribute>)cache.GetShared(this);
//				if (result != null)
//					return result;
			
			ITypeResolveContext context = new SimpleTypeResolveContext(currentAssembly);
			BlobReader reader = new BlobReader(blob, currentAssembly);
			if (reader.ReadByte() != '.') {
				// should not use UnresolvedSecurityDeclaration for XML secdecls
				throw new InvalidOperationException();
			}
			ResolveResult securityActionRR = securityAction.Resolve(context);
			uint attributeCount = reader.ReadCompressedUInt32();
			IAttribute[] attributes = new IAttribute[attributeCount];
			try {
				ReadSecurityBlob(reader, attributes, context, securityActionRR);
			} catch (NotSupportedException) {
				// ignore invalid blobs
				//Debug.WriteLine(ex.ToString());
			}
			for (int i = 0; i < attributes.Length; i++) {
				if (attributes[i] == null)
					attributes[i] = new CecilResolvedAttribute(context, SpecialType.UnknownType);
			}
			return attributes;
//				return (IList<IAttribute>)cache.GetOrAddShared(this, attributes);
		}
开发者ID:0xd4d,项目名称:NRefactory,代码行数:30,代码来源:UnresolvedSecurityDeclarationBlob.cs

示例4: GetConditionalResourceExpression

 private ConditionalExpression GetConditionalResourceExpression(IAttribute fromAttribute)
 {
     string targetResource = fromAttribute.GetTextValue();
     string nullCheck = _syntaxProvider.CreateNullCheckExpression(targetResource);
     string uriExpression = _syntaxProvider.CreateUriExpression(targetResource);
     return new ConditionalExpression(nullCheck, uriExpression);
 }
开发者ID:drlongnecker,项目名称:openrasta-sparkcodec,代码行数:7,代码来源:CreateUriActionModifier.cs

示例5: Modify

 public void Modify(IAttribute originalAttribute, IAttribute newAttribute)
 {
     ICodeExpressionNode codeExpressionNode = newAttribute.AddCodeExpressionNode();
     codeExpressionNode.SetExpressionBody(new CodeExpression("true"));
     IConditionalExpressionNodeWrapper conditionalExpressionNodeWrapper = newAttribute.AddConditionalExpressionNode();
     conditionalExpressionNodeWrapper.SetExpressionBody(new ConditionalExpression(_syntaxProvider.CreateNullCheckAndEvalExpression(originalAttribute.GetTextValue()), originalAttribute.GetTextValue()));
 }
开发者ID:jennifersmith,项目名称:openrasta-sparkcodec,代码行数:7,代码来源:ValueToConditionalAttribute.cs

示例6: WriteAttribute

 protected virtual void WriteAttribute(IXhtmlWriter writer, IAttribute attribute)
 {
     if (!attribute.IsDefault || attribute.RendersOnDefaultValue)
     {
         writer.WriteAttributeString(attribute.Name.ToLowerInvariant(), attribute.SerializedValue);
     }
 }
开发者ID:endjin,项目名称:openrasta-stable,代码行数:7,代码来源:XhtmlNodeWriter.cs

示例7: EventInfo

 internal EventInfo(Type declaringType, string name, MethodInfo addMethod, MethodInfo removeMethod, IAttribute[] attributes)
 {
     _declaringType = declaringType;
     _name = name;
     _addMethod = addMethod;
     _removeMethod = removeMethod;
     _attributes = attributes;
 }
开发者ID:sebastianhaba,项目名称:api,代码行数:8,代码来源:EventInfo.cs

示例8: Modify

 public void Modify(IAttribute originalAttribute, IAttribute newAttribute)
 {
     ICodeExpressionNode node = newAttribute.AddCodeExpressionNode();
     string expression = _syntaxProvider.CreateGetPropertyPathExpression(originalAttribute.GetTextValue());
     node.SetExpressionBody(
         new CodeExpression(expression)
         );
 }
开发者ID:jennifersmith,项目名称:openrasta-sparkcodec,代码行数:8,代码来源:PropertyPathActionModifier.cs

示例9: AddAssemblyAttribute

		public override void AddAssemblyAttribute(IProject targetProject, IAttribute attribute)
		{
			// FIXME : will fail if there are no assembly attributes
			ICompilation compilation = SD.ParserService.GetCompilation(targetProject);
			IAttribute target = compilation.MainAssembly.AssemblyAttributes.LastOrDefault();
			if (target == null)
				throw new InvalidOperationException("no assembly attributes found, cannot continue!");
			AddAttribute(target.Region, attribute, "assembly");
		}
开发者ID:Paccc,项目名称:SharpDevelop,代码行数:9,代码来源:CSharpCodeGenerator.cs

示例10: TryAttribute

 public bool TryAttribute(string name, out IAttribute attr) {
     if (Attributes.Any()) {
         if (Attributes.Exists(a => a.Name == name)) {
             attr = Attributes.First(a => a.Name == name);
             return true;
         }
     }
     attr = null;
     return false;
 }
开发者ID:modulexcite,项目名称:Transformalize,代码行数:10,代码来源:XDocumentNode.cs

示例11: CreateValue

        public IAttributeValue CreateValue(IAttribute attribute, String value)
        {
            //            checkArgument(value != null, "Value cannot be null.");
            throw new NotImplementedException();
            //AttributeValue rv = new AttributeValue(attribute);
            //rv.setValue(value);
            //_List.Add(rv);

            //return rv;
        }
开发者ID:Vanaheimr,项目名称:Walkyr,代码行数:10,代码来源:AttributeValueList.cs

示例12: IsRefined

 public static bool IsRefined(this IClass @class, IAttribute attribute)
 {
     var refine = @class.AttributeConstraints.Any(c => c.Constrains == attribute) || @class.Attributes.Any(r => r.Refines == attribute);
     if (refine) return true;
     foreach (var baseType in @class.BaseTypes)
     {
         if (baseType == attribute.DeclaringType) return false;
         if (IsRefined(baseType, attribute)) return true;
     }
     return false;
 }
开发者ID:NMFCode,项目名称:NMF,代码行数:11,代码来源:ClassExtensions.cs

示例13: CreateAttribute

		public void CreateAttribute(string fullName, string shortName)
		{
			var returnTypeHelper = new ReturnTypeHelper();
			returnTypeHelper.CreateReturnType(fullName);
			returnTypeHelper.AddShortName(shortName);
			AttributeType = returnTypeHelper.ReturnType;
			
			Attribute = MockRepository.GenerateStub<IAttribute>();
			Attribute.Stub(a => a.AttributeType).Return(AttributeType);
			Attribute.Stub(a => a.PositionalArguments).Return(PositionalArguments);
			Attribute.Stub(a => a.NamedArguments).Return(NamedArguments);
		}
开发者ID:GMRyujin,项目名称:SharpDevelop,代码行数:12,代码来源:AttributeHelper.cs

示例14: ToString

 public static string ToString(IAttribute attribute)
 {
     var builder = new StringBuilder();
     var attributeType = attribute.GetType();
     builder.Append("  - ").Append(attributeType.Name).AppendLine();
     foreach (var eachProperty in attributeType.GetProperties())
     {
         var propertyValue = eachProperty.GetValue(attribute);
         builder.Append("    - ").Append(eachProperty.Name).Append('=').Append(propertyValue).AppendLine();
     }
     return builder.ToString();
 }
开发者ID:ktj007,项目名称:mmo,代码行数:12,代码来源:AttributeHelper.cs

示例15: Assign

        public static void Assign(this IAttribute attribute, IAttribute other)
        {
            Debug.Assert(attribute != null);
            if (other == null)
                return;

            Debug.Assert(attribute.GetType() == other.GetType());
            foreach (var eachProperty in attribute.GetType().GetProperties())
            {
                eachProperty.SetValue(attribute, eachProperty.GetValue(other));
            }
        }
开发者ID:ktj007,项目名称:mmo,代码行数:12,代码来源:AttributeExtension.cs


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