本文整理汇总了C#中Structure.GetName方法的典型用法代码示例。如果您正苦于以下问题:C# Structure.GetName方法的具体用法?C# Structure.GetName怎么用?C# Structure.GetName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Structure
的用法示例。
在下文中一共展示了Structure.GetName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddType
public void AddType(Structure type)
{
// Find the previous group.
ScopeMember oldMember = FindMember(type.GetName());
if(oldMember != null)
{
if(!oldMember.IsTypeGroup())
throw new ModuleException("expected type group.");
// Find the previous definition.
TypeGroup oldGroup = (TypeGroup)oldMember;
if(oldGroup.Find(type.GetGenericPrototype()) != null)
throw new ModuleException("matching type already exists.");
// Add the type into the group.
oldGroup.Insert(type);
}
else
{
// Create a new type group.
TypeGroup newGroup = new TypeGroup(type.GetName(), this);
newGroup.Insert(type);
AddMember(newGroup);
}
}
示例2: Initialize
private void Initialize(Structure template, GenericInstance instance)
{
// Copy the template name and flags.
this.name = template.GetName();
this.flags = template.flags;
// Store the template and the generic instance.
this.template = template;
this.genericInstance = instance;
// Copy the prototype if this is not the final instance.
SetGenericPrototype(template.GetGenericPrototype());
// Use the factory
this.parentScope = (Scope)factory;
template.genericInstanceList.Add(this);
// Register myself in the module.
GetModule().RegisterGenericInstance(this);
// Get the complete instance.
GetFullGenericInstance();
}