本文整理汇总了C#中TypeParameters.GetAllNames方法的典型用法代码示例。如果您正苦于以下问题:C# TypeParameters.GetAllNames方法的具体用法?C# TypeParameters.GetAllNames怎么用?C# TypeParameters.GetAllNames使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TypeParameters
的用法示例。
在下文中一共展示了TypeParameters.GetAllNames方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateTypeParameters
string[] CreateTypeParameters (TypeParameters parentAllTypeParameters)
{
string[] names;
int parent_offset = 0;
if (parentAllTypeParameters != null) {
if (CurrentTypeParameters == null) {
all_type_parameters = parentAllTypeParameters;
return parentAllTypeParameters.GetAllNames ();
}
names = new string[parentAllTypeParameters.Count + CurrentTypeParameters.Count];
all_type_parameters = new TypeParameters (names.Length);
all_type_parameters.Add (parentAllTypeParameters);
parent_offset = all_type_parameters.Count;
for (int i = 0; i < parent_offset; ++i)
names[i] = all_type_parameters[i].MemberName.Name;
} else {
names = new string[CurrentTypeParameters.Count];
}
for (int i = 0; i < CurrentTypeParameters.Count; ++i) {
if (all_type_parameters != null)
all_type_parameters.Add (MemberName.TypeParameters[i]);
var name = CurrentTypeParameters[i].MemberName.Name;
names[parent_offset + i] = name;
for (int ii = 0; ii < parent_offset + i; ++ii) {
if (names[ii] != name)
continue;
var tp = CurrentTypeParameters[i];
var conflict = all_type_parameters[ii];
tp.WarningParentNameConflict (conflict);
}
}
if (all_type_parameters == null)
all_type_parameters = CurrentTypeParameters;
return names;
}