コード例 #1
0
        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);
        }
コード例 #2
0
        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);
            }));
        }
コード例 #3
0
        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);
                }
            }
        }
コード例 #4
0
        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);
            }
        }
コード例 #5
0
        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);
        }
コード例 #6
0
        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);
        }
コード例 #7
0
        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);
        }
コード例 #8
0
        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);
        }
コード例 #9
0
 public bool HasContainer(FlowWindow predicate)
 {
     return(this.attaches.Any((id) => id == predicate.id && FlowSystem.GetWindow(id).isContainer));
 }
コード例 #10
0
 public bool HasContainer()
 {
     return(this.attaches.Any((id) => FlowSystem.GetWindow(id).isContainer));
 }
コード例 #11
0
 public FlowWindow GetContainer()
 {
     return(ME.Utilities.CacheByFrame("FlowWindow." + this.id.ToString() + ".GetContainer", () => FlowSystem.GetWindow(this.attaches.FirstOrDefault((id) => FlowSystem.GetWindow(id).isContainer))));
 }
コード例 #12
0
 public bool HasContainer(FlowWindow predicate)
 {
     return(this.attachItems.Any((item) => item.targetId == predicate.id && FlowSystem.GetWindow(item.targetId).IsContainer()));
 }
コード例 #13
0
 public bool HasContainer()
 {
     return(this.attachItems.Any((item) => FlowSystem.GetWindow(item.targetId).IsContainer()));
 }