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


C# Attribute.ToString方法代码示例

本文整理汇总了C#中System.Attribute.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# Attribute.ToString方法的具体用法?C# Attribute.ToString怎么用?C# Attribute.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Attribute的用法示例。


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

示例1: AppendEdgeAttribute

 /// <summary>
 /// Adds a new attribute to edges
 /// </summary>
 /// <param name="a"></param>
 private void AppendEdgeAttribute(Attribute a)
 {
     Console.WriteLine(a.ToString());
     if (this.edgeattr == null)
         this.edgeattr = new LinkedList<Attribute>();
     this.edgeattr.AddLast(a);
 }
开发者ID:ciavy,项目名称:ProjectONE,代码行数:11,代码来源:CreateTreeForm.cs

示例2: catch

 public string this[Attribute attr]
 {
     get
     {
         try
         {
             return this.attributes[attr];
         }
         catch (KeyNotFoundException)
         {
             string message = String.Format("Attribute \"{0}\" not found in element <{1}>",
                 attr.ToString().ToLower(), this.tag.ToString().ToLower());
             throw new KeyNotFoundException(message);
         }
     }
 }
开发者ID:mtimmerman,项目名称:vikingwallet-pos,代码行数:16,代码来源:Element.cs

示例3: ShowAttribute

 /// <summary>
 /// Add all the properties that match an attribute to the list of properties to be displayed in the PropertyGrid.
 /// </summary>
 private void ShowAttribute(Attribute attribute) 
 {
     PropertyDescriptorCollection filteredoriginalpropertydescriptors = TypeDescriptor.GetProperties(m_Wrapper.SelectedObject,new Attribute[] { attribute });
     if (filteredoriginalpropertydescriptors == null || filteredoriginalpropertydescriptors.Count == 0) throw new ArgumentException("Attribute not found", attribute.ToString());
     foreach(PropertyDescriptor propertydescriptor in filteredoriginalpropertydescriptors) ShowProperty(propertydescriptor);
 }
开发者ID:zpLin,项目名称:flashdevelop,代码行数:9,代码来源:FilteredGrid.cs

示例4: GetValueFromAttribute

		public int GetValueFromAttribute(Attribute attr) {
			return GetValueFromTag (attr.ToString ());
		}
开发者ID:TobiasMorell,项目名称:Game2Grow-Wizard,代码行数:3,代码来源:ItemDatabase.cs

示例5: AddValueToAttribute

		public void AddValueToAttribute(Attribute attr, int value) {
			AddValueToTag (attr.ToString (), value);
		}
开发者ID:TobiasMorell,项目名称:Game2Grow-Wizard,代码行数:3,代码来源:ItemDatabase.cs

示例6: AttributeWrapper

 public AttributeWrapper(Attribute attribute)
 {
     _AttributeString = attribute.ToString();
 }
开发者ID:JessieArr,项目名称:Ntegrity,代码行数:4,代码来源:AttributeWrapper.cs

示例7: AllocatePoints

		public JObject AllocatePoints(Attribute attr, string charId)
		{
			return RunCommand("allocatepoints", attr.ToString().ToLowerInvariant(), charId);
		}
开发者ID:CaptainJiNX,项目名称:Escape.From.NullReferenceException,代码行数:4,代码来源:ClientWrapper.cs

示例8: ExecuteAttributeHandler

 private object ExecuteAttributeHandler(Attribute attr, PropertyInfo property)
 {
     var attributeHandler = SelectHandlerForNavigationAttribute(attr, property);
     var key = string.IsNullOrWhiteSpace(attr.ToString()) ? property.Name : attr.ToString();
     return attributeHandler.FindAllMatches(key, _driver);
 }
开发者ID:kevinjpluck,项目名称:Passenger,代码行数:6,代码来源:ElementSelectionHandler.cs

示例9: GetShortAttribute

 public short GetShortAttribute(Attribute attr)
 {
     string value = this[attr];
     try
     {
         return Convert.ToInt16(value);
     }
     catch (FormatException)
     {
         string message = String.Format("Element <{0}>, attribute \"{1}\": expected short, found \"{2}\"",
             this.tag.ToString().ToLower(), attr.ToString().ToLower(), value);
         throw new FormatException(message);
     }
 }
开发者ID:mtimmerman,项目名称:vikingwallet-pos,代码行数:14,代码来源:Element.cs

示例10: GetDecimalAttribute

 public decimal GetDecimalAttribute(Attribute attr)
 {
     string value = this[attr];
     try
     {
         return Convert.ToDecimal(value, System.Globalization.NumberFormatInfo.InvariantInfo);
     }
     catch (FormatException)
     {
         string message = String.Format("Element <{0}>, attribute \"{1}\": expected decimal, found \"{2}\"",
             this.tag.ToString().ToLower(), attr.ToString().ToLower(), value);
         throw new FormatException(message);
     }
 }
开发者ID:mtimmerman,项目名称:vikingwallet-pos,代码行数:14,代码来源:Element.cs

示例11: GetDateTimeAttribute

 public DateTime GetDateTimeAttribute(Attribute attr)
 {
     string value = this[attr];
     try
     {
         return DateTime.ParseExact(value, DateTimeFormat, System.Globalization.DateTimeFormatInfo.InvariantInfo);
     }
     catch (FormatException)
     {
         string message = String.Format("Element <{0}>, attribute \"{1}\": expected datetime, found \"{2}\"",
             this.tag.ToString().ToLower(), attr.ToString().ToLower(), value);
         throw new FormatException(message);
     }
 }
开发者ID:mtimmerman,项目名称:vikingwallet-pos,代码行数:14,代码来源:Element.cs


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