本文整理汇总了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);
}
示例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);
}
}
}
示例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);
}
示例4: GetValueFromAttribute
public int GetValueFromAttribute(Attribute attr) {
return GetValueFromTag (attr.ToString ());
}
示例5: AddValueToAttribute
public void AddValueToAttribute(Attribute attr, int value) {
AddValueToTag (attr.ToString (), value);
}
示例6: AttributeWrapper
public AttributeWrapper(Attribute attribute)
{
_AttributeString = attribute.ToString();
}
示例7: AllocatePoints
public JObject AllocatePoints(Attribute attr, string charId)
{
return RunCommand("allocatepoints", attr.ToString().ToLowerInvariant(), charId);
}
示例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);
}
示例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);
}
}
示例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);
}
}
示例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);
}
}