本文整理汇总了C#中Structure.GetGenericPrototype方法的典型用法代码示例。如果您正苦于以下问题:C# Structure.GetGenericPrototype方法的具体用法?C# Structure.GetGenericPrototype怎么用?C# Structure.GetGenericPrototype使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Structure
的用法示例。
在下文中一共展示了Structure.GetGenericPrototype方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: Insert
public void Insert(Structure type)
{
TypeGroupName gname = new TypeGroupName(type, type.GetGenericPrototype());
types.Add (gname);
}
示例3: ReadData
private void ReadData()
{
// Only read once the data.
if(readedData)
return;
readedData = true;
ModuleReader reader = new ModuleReader(new MemoryStream(rawData));
// Get the module.
ChelaModule module = GetModule();
// Read the template.
template = (Structure)module.GetMember(reader.ReadUInt());
// Read the factory.
factory = (Scope)module.GetMember(reader.ReadUInt());
// Read the generic instance.
genericInstance = GenericInstance.Read(template.GetGenericPrototype(), reader, module);
// Initialize.
Initialize(template, genericInstance);
rawData = null;
}
示例4: 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();
}