本文整理汇总了C#中IParameter.GetType方法的典型用法代码示例。如果您正苦于以下问题:C# IParameter.GetType方法的具体用法?C# IParameter.GetType怎么用?C# IParameter.GetType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IParameter
的用法示例。
在下文中一共展示了IParameter.GetType方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ProcessParameter
private void ProcessParameter(IParameter parameter, int index, StringBuilder preMemberCodeBulider)
{
// Dispatch to the typed parameter handler method.
Type key = parameter.GetType().GetInterfaces().First(t => t.Namespace == typeof(IParameter).Namespace && t.Name.StartsWith("I") && t.Name.EndsWith("Parameter"));
Action<IParameter, int, StringBuilder> method = _parameterCodeGeneratorMethodMap[key];
method(parameter, index, preMemberCodeBulider);
}
示例2: Equals
/// <summary>
/// Indicates whether the current object is equal to another object of the same type.
/// </summary>
/// <param name="other">An object to compare with this object.</param>
/// <returns><c>True</c> if the objects are equal; otherwise <c>false</c></returns>
public bool Equals(IParameter other)
{
return other.GetType() == GetType() && other.Name.Equals(Name);
}
示例3: Equals
/// <summary>
/// Indicates whether the current object is equal to another object of the same type.
/// </summary>
/// <param name="other">An object to compare with this object.</param>
/// <returns><c>True</c> if the objects are equal; otherwise <c>false</c></returns>
public bool Equals(IParameter other)
{
var argument = other as TypeMatchingConstructorArgument;
return argument != null && other.GetType() == this.type;
}