public static GeneratorLayoutElement Convert(ILayoutElement element) { GeneratorLayoutElement Result; if (element is Empty AsEmpty) { Result = new GeneratorEmpty(AsEmpty); } else if (element is Control AsControl) { Result = new GeneratorControl(AsControl); } else if (element is TextDecoration AsTextDecoration) { Result = new GeneratorTextDecoration(AsTextDecoration); } else if (element is Panel AsPanel) { Result = GeneratorPanel.Convert(AsPanel); } else { throw new InvalidOperationException(); } GeneratorLayoutElementMap.Add(element, Result); return(Result); }
public bool Connect(IGeneratorDomain domain, IGeneratorArea area) { bool IsConnected = false; if (Content == null) { IsConnected = true; Content = GeneratorPanel.Convert(LayoutBase.Content); } IsConnected |= Content.Connect(domain, area.Components); return(IsConnected); }