public WindowBase GetScreen() { if (this.storeType == StoreType.ReUseScreen) { var win = FlowSystem.GetWindow(this.screenWindowId); if (win == null) { return(null); } return(win.GetScreen()); } if (this.IsFunction() == true) { var func = FlowSystem.GetWindow(this.GetFunctionId()); if (func != null) { var win = FlowSystem.GetWindow(func.functionExitId); if (win == null) { return(null); } return(win.GetScreen()); } } return(this.screen); }
public FlowWindow GetContainer() { return(ME.Utilities.CacheByFrame("FlowWindow." + this.id.ToString() + ".GetContainer", () => { var container = this.attachItems.FirstOrDefault((item) => FlowSystem.GetWindow(item.targetId).IsContainer()); if (container == null) { return null; } return FlowSystem.GetWindow(container.targetId); })); }
public static void ForEachContainer(int startId, System.Func <FlowWindow, string, string> each, string accumulate = "") { var window = FlowSystem.GetWindow(startId); if (window.IsContainer() == true) { accumulate += each(window, accumulate); var childs = window.attachItems; foreach (var child in childs) { FlowSystem.ForEachContainer(child.targetId, each, accumulate); } } }
public static void MoveContainerOrWindow(int id, Vector2 delta) { var window = FlowSystem.GetWindow(id); if (window.IsContainer() == true) { var childs = window.attachItems; foreach (var child in childs) { FlowSystem.MoveContainerOrWindow(child.targetId, delta); } } else { window.Move(delta); } }
public List <FlowWindow> GetAttachedWindows() { List <FlowWindow> output = new List <FlowWindow>(); foreach (var attachId in this.attaches) { var window = FlowSystem.GetWindow(attachId); if (window.isContainer == true) { continue; } output.Add(window); } return(output); }
public FlowWindow GetFunctionContainer() { // If current window attached to function var attaches = this.attachItems; foreach (var attachItem in attaches) { var win = FlowSystem.GetWindow(attachItem.targetId); if (win.IsContainer() == true && win.IsFunction() == true) { // We are inside a function return(win); } } return(null); }
public bool Attach(int id, bool oneWay = false, WindowLayoutElement component = null) { if (this.id == id) { return(false); } var result = false; if (component != null) { if (this.attachedComponents.Any((c) => c.targetWindowId == id && c.sourceComponentTag == component.tag) == false) { this.attachedComponents.Add(new ComponentLink(id, component.tag, component.comment)); // If we attaching component - try to attach window if not oneWay = true; result = true; } else { return(false); } } if (this.attaches.Contains(id) == false) { this.attaches.Add(id); if (oneWay == false) { var window = FlowSystem.GetWindow(id); window.Attach(this.id, oneWay: true); } return(true); } return(result); }
public bool Detach(int id, bool oneWay = false, WindowLayoutElement component = null) { if (this.id == id) { return(false); } var result = false; if (component != null) { if (this.attachedComponents.Any((c) => c.targetWindowId == id && c.sourceComponentTag == component.tag) == true) { this.attachedComponents.RemoveAll((c) => c.targetWindowId == id && c.sourceComponentTag == component.tag); result = true; } } else { if (this.attaches.Contains(id) == true) { this.attaches.Remove(id); this.attachedComponents.RemoveAll((c) => c.targetWindowId == id); result = true; } if (oneWay == false) { var window = FlowSystem.GetWindow(id); if (window != null) { result = window.Detach(this.id, oneWay: true); } } } return(result); }
public bool HasContainer(FlowWindow predicate) { return(this.attaches.Any((id) => id == predicate.id && FlowSystem.GetWindow(id).isContainer)); }
public bool HasContainer() { return(this.attaches.Any((id) => FlowSystem.GetWindow(id).isContainer)); }
public FlowWindow GetContainer() { return(ME.Utilities.CacheByFrame("FlowWindow." + this.id.ToString() + ".GetContainer", () => FlowSystem.GetWindow(this.attaches.FirstOrDefault((id) => FlowSystem.GetWindow(id).isContainer)))); }
public bool HasContainer(FlowWindow predicate) { return(this.attachItems.Any((item) => item.targetId == predicate.id && FlowSystem.GetWindow(item.targetId).IsContainer())); }
public bool HasContainer() { return(this.attachItems.Any((item) => FlowSystem.GetWindow(item.targetId).IsContainer())); }