Beispiel #1
0
        internal static List <DirectWindow> GetWindows(DirectEve directEve)
        {
            var windows = new List <DirectWindow>();

            var pySharp   = directEve.PySharp;
            var builtin   = pySharp.Import("__builtin__");
            var pyWindows = builtin.Attribute("uicore").Attribute("registry").Call("GetWindows").ToList();

            foreach (var pyWindow in pyWindows)
            {
                // Ignore destroyed windows
                if ((bool)pyWindow.Attribute("destroyed"))
                {
                    continue;
                }

                DirectWindow window = null;
                foreach (var windowType in _windowTypes)
                {
                    if ((string)pyWindow.Attribute(windowType.Attribute) != windowType.Value)
                    {
                        continue;
                    }

                    window = windowType.Creator(directEve, pyWindow);
                }

                if (window == null)
                {
                    window = new DirectWindow(directEve, pyWindow);
                }

                windows.Add(window);
            }

            return(windows);
        }
Beispiel #2
0
        public bool Say()
        {
            var btn = DirectWindow.FindChildWithPath(_container, (Right ? _responseButtonsPathRight : _responseButtonsPathLeft).Concat(new[] { Button }));

            return(DirectEve.ThreadedCall(btn.Attribute("OnClick")));
        }
Beispiel #3
0
        internal static List<DirectWindow> GetWindows(DirectEve directEve)
        {
            var windows = new List<DirectWindow>();

            var pySharp = directEve.PySharp;
            var builtin = pySharp.Import("__builtin__");
            var pyWindows = builtin.Attribute("uicore").Attribute("registry").Call("GetWindows").ToList();
            foreach (var pyWindow in pyWindows)
            {
                // Ignore destroyed windows
                if ((bool) pyWindow.Attribute("destroyed"))
                    continue;

                DirectWindow window = null;
                foreach (var windowType in _windowTypes)
                {
                    if ((string) pyWindow.Attribute(windowType.Attribute) != windowType.Value)
                        continue;

                    window = windowType.Creator(directEve, pyWindow);
                }

                if (window == null)
                    window = new DirectWindow(directEve, pyWindow);

                windows.Add(window);
            }

            return windows;
        }