Esempio n. 1
0
        public void Window_Closed(object sender, EventArgs e)
        {
            var remWd = (from wd in WinCollection
                         where (wd.Win == sender)
                         select wd).FirstOrDefault();

            WinCollection.Remove(remWd);
            if (remWd.WinType == WindowType.GlobalSetting)
            {
                isGlobalSettingWindowOpen = false;
                gSW = null;
            }
            if (activeWindow is graphWindow)
            {
                activeGraphCanvas = ((graphWindow)activeWindow).graphGUI;
            }
            else if (activeWindow is ruleWindow)
            {
                activeGraphCanvas = ((ruleWindow)activeWindow).graphCanvasK;
            }
            else
            {
                activeGraphCanvas = null;
            }
            main.propertyUpdate();
        }
Esempio n. 2
0
        public void AddandShowWindow(Window w)
        {
            if (w is graphWindow)
            {
                WinCollection.Insert(0, new WinData(w, WindowType.Graph, ((graphWindow)w).filename));
                activeGraphCanvas = ((graphWindow)w).graphGUI;
            }
            else if (w is ruleWindow)
            {
                WinCollection.Insert(0, new WinData(w, WindowType.Rule, ((ruleWindow)w).filename));
                activeGraphCanvas = ((ruleWindow)w).graphCanvasK;
            }
            else if (w is ruleSetWindow)
            {
                WinCollection.Insert(0, new WinData(w, WindowType.RuleSet, ((ruleSetWindow)w).Filename));
            }
            else if (w is searchProcessController)
            {
                WinCollection.Insert(0, new WinData(w, WindowType.SearchProcessController,
                                                    "SearchProcessController" + _searchProcessID));
            }
            else if (w is GlobalSettingWindow)
            {
                gSW = (GlobalSettingWindow)w;
                WinCollection.Insert(0, new WinData(w, WindowType.GlobalSetting,
                                                    "GlobalSettingWindow"));
            }
            w.Closed += Window_Closed;

            w.Show();
        }
Esempio n. 3
0
        public static WinCollection GetCollection(int winId)
        {
            WinCollection tempList = null;
            using (SqlConnection myConnection = new SqlConnection(AppConfiguration.ConnectionString))
            {
                using (SqlCommand myCommand = new SqlCommand("usp_GetWin", myConnection))
                {
                    myCommand.CommandType = CommandType.StoredProcedure;
                    myCommand.Parameters.AddWithValue("@QueryId", SelectTypeEnum.GetCollection);
                    myCommand.Parameters.AddWithValue("@WinId", winId);

                    myConnection.Open();
                    using (SqlDataReader myReader = myCommand.ExecuteReader())
                    {
                        if (myReader.HasRows)
                        {
                            tempList = new WinCollection();
                            while (myReader.Read())
                            {
                                tempList.Add(FillDataRecord(myReader));
                            }
                        }
                        myReader.Close();
                    }

                }
            }
            return tempList;
        }
Esempio n. 4
0
        public void RemoveWindow(Window w)
        {
            var remWd = (from wd in WinCollection
                         where (wd.Win == w)
                         select wd).FirstOrDefault();

            WinCollection.Remove(remWd);
        }
Esempio n. 5
0
        internal void FocusNextWindow()
        {
            ignoreSelectionChange = true;
            var lastWd = WinCollection[0];

            WinCollection.RemoveAt(0);
            WinCollection.Insert(NumberOfWindows, lastWd);
            activeWindow.Focus();
            ignoreSelectionChange = false;
        }
Esempio n. 6
0
        internal void SetAsActive(Window win)
        {
            main.MoveFocus(new TraversalRequest(FocusNavigationDirection.Last));
            var activeWd = (from wd in WinCollection
                            where (wd.Win == win)
                            select wd).FirstOrDefault();

            if (WinCollection[0] == activeWd)
            {
                return;
            }
            ignoreSelectionChange = true;
            WinCollection.Remove(activeWd);
            WinCollection.Insert(0, activeWd);
            ignoreSelectionChange = false;
        }
Esempio n. 7
0
 internal Boolean AllWindowsMinimized()
 {
     return(WinCollection.All(w => (w.Win.WindowState == WindowState.Minimized)));
 }