本文整理汇总了C#中IParameter.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# IParameter.ToString方法的具体用法?C# IParameter.ToString怎么用?C# IParameter.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IParameter
的用法示例。
在下文中一共展示了IParameter.ToString方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Add
/// <summary>
/// Adds the given orphan instance into this collection.
/// </summary>
/// <param name="member">The orphan instance to add into this collection.</param>
public void Add(IParameter member)
{
if (IsDisposed) throw new ObjectDisposedException(this.ToString());
if (member == null) throw new ArgumentNullException("member", "Member cannot be null.");
if (member.IsDisposed) throw new ObjectDisposedException(member.ToString());
if (object.ReferenceEquals(this, member.Owner)) return;
if (member.Owner != null) throw new NotOrphanException(
"Cannot add member '{0}' into this '{1}' because it is not orphan."
.FormatWith(member, this));
Core.Parameter.ValidateName(member.Name);
var temp = FindName(member.Name);
if (temp != null) throw new DuplicateException(
"Cannot add member '{0}' into this '{1}' because its name is already used."
.FormatWith(member, this));
_Members.Add(member); // To intercept re-entrant operation...
member.Owner = this;
}