public void TemplateSetup() { //Ctx.TryAddNamespace("Invert.Core.GraphDesigner"); Ctx.TryAddNamespace("uFrame.Editor.Configurations"); Ctx.TryAddNamespace("uFrame.Editor.Core"); Ctx.TryAddNamespace("uFrame.Editor.Graphs.Data"); var i = new CodeTypeDeclaration(Ctx.Data.ReferenceClassName) { IsInterface = true, Attributes = MemberAttributes.Public, IsPartial = true, }; i.BaseTypes.Add(new CodeTypeReference(typeof(IDiagramNodeItem))); i.BaseTypes.Add(new CodeTypeReference(typeof(IConnectable))); Ctx.Namespace.Types.Add(i); if (Ctx.IsDesignerFile) { if (Ctx.Data.IsTyped) { Ctx.SetBaseType(typeof(GenericTypedChildItem)); } foreach (var item in Ctx.Data.IncludedInSections) { Ctx.AddInterface(item.ReferenceClassName); } } }
public void TemplateSetup() { Ctx.TryAddNamespace("Invert.Core.GraphDesigner"); if (Ctx.IsDesignerFile) { if (Ctx.Data["Typed"] && Ctx.Data.BaseNode == null) { Ctx.SetBaseType(typeof(GenericTypedChildItem)); } foreach (var item in Ctx.Data.IncludedInSections) { Ctx.AddInterface(item.ReferenceClassName); } } }
public void TemplateSetup() { //Ctx.TryAddNamespace("Invert.Core.GraphDesigner"); Ctx.TryAddNamespace("uFrame.Editor.Database.Data"); Ctx.TryAddNamespace("uFrame.Editor.Graphs.Data"); var i = new CodeTypeDeclaration(Ctx.Data.ReferenceClassName) { IsInterface = true, Attributes = MemberAttributes.Public, IsPartial = true, }; i.BaseTypes.Add(new CodeTypeReference(typeof(IDiagramNodeItem))); i.BaseTypes.Add(new CodeTypeReference(typeof(IConnectable))); Ctx.Namespace.Types.Add(i); if (Ctx.IsDesignerFile) { if (Ctx.Data.IsOutput) { if (Ctx.Data.AllowMultiple) { Ctx.SetBaseType("MultiOutputSlot<{0}>", Ctx.Data.ReferenceClassName); } else { Ctx.SetBaseType("SingleOutputSlot<{0}>", Ctx.Data.ReferenceClassName); } } else { if (Ctx.Data.AllowMultiple) { Ctx.SetBaseType("MultiInputSlot<{0}>", Ctx.Data.ReferenceClassName); } else { Ctx.SetBaseType("SingleInputSlot<{0}>", Ctx.Data.ReferenceClassName); } } foreach (var item in Ctx.Data.IncludedInSections) { Ctx.AddInterface(item.ReferenceClassName); } } }
public void TemplateSetup() { Ctx.TryAddNamespace("Invert.Core.GraphDesigner"); var i = new CodeTypeDeclaration("I" + Ctx.Data.Name) { IsInterface = true, Attributes = MemberAttributes.Public, IsPartial = true, }; i.BaseTypes.Add(new CodeTypeReference(typeof(IDiagramNodeItem))); i.BaseTypes.Add(new CodeTypeReference(typeof(IConnectable))); Ctx.Namespace.Types.Add(i); if (Ctx.IsDesignerFile) { Ctx.SetBaseTypeArgument(Ctx.Data.ReferenceClassName); foreach (var item in Ctx.Data.IncludedInSections) { Ctx.AddInterface(item.ReferenceClassName); } } }