private void GenerateChan(Chan chanNode)
{
Expression ns = null;
string chanStyle = null;
switch (GetTypeClassification(chanNode.ChannelType))
{
case TypeClassification.Simple:
ns = chanNode.ChannelType.Namespace;
chanStyle = "SimpleChan"; break;
case TypeClassification.Enum:
chanStyle = "EnumChan"; break;
case TypeClassification.Struct:
chanStyle = "StructChan"; break;
case TypeClassification.Heap:
if (chanNode.ChannelType == SystemTypes.Object)
ns = chanNode.ChannelType.Namespace;
chanStyle = "ComplexChan"; break;
}
Class chanClass = (Class)Templates.GetTypeTemplateByName(chanStyle);
if (ns == null)
ns = new QualifiedIdentifier(new Identifier("Microsoft.Zing"), new Identifier("Application"));
Replacer.Replace(chanClass, chanStyle, chanNode.Name);
Replacer.Replace(chanClass, "_ElementType", new QualifiedIdentifier(ns, chanNode.ChannelType.Name));
SetTypeId(chanClass);
InstallType(chanClass);
}