Beispiel #1
0
    private void OnToggleSelected(ToggleComp toggle)
    {
        int index = toggles.Toggles.IndexOf(toggle);

        activeWindow?.Close();
        //Debugger.Log("toggle index " + index + " " + windows.Length);
        if (index >= 0 && index < windows.Length)
        {
            activeWindow = windows[index];
            activeWindow.Open();
        }
    }
Beispiel #2
0
 /// <summary>
 /// Closes the active window(if any).
 /// </summary>
 public void Close()
 {
     if (_currentWindowID != EWindows.None)
     {
         BaseWindow window = GetWindow(WindowToListID(_currentWindowID));
         if (window != null && window.gameObject.activeSelf)
         {
             window.Close();
             _currentWindowID = EWindows.None;
         }
     }
 }
 /// <summary>
 /// Closes the active window(if any).
 /// </summary>
 public void Close()
 {
     if (_currentWindowIndex > 0 && _currentWindowIndex < _windows.Length)
     {
         BaseWindow window = GetWindow(_currentWindowIndex);
         if (window != null && window.gameObject.activeSelf)
         {
             window.Close();
             _currentWindowIndex = -1;
         }
     }
 }
Beispiel #4
0
        public void workflowContextMenuItem_Click(object sender, System.EventArgs e)
        {

            if (sender is MenuItem)
            {
                MenuItem menuItem = (MenuItem)sender;
                if (menuItem.Text.Trim().Equals(FormDesignerConstants.DeleteBaseWindow))
                {
                    DialogResult result = MessageBox.Show("Do you want to delete the current workflowpattern", "Exit Window", MessageBoxButtons.OKCancel);
                    if (result == DialogResult.OK)
                    {
                        TreeNode selecetdTreeNode = this.treeView1.SelectedNode;
                        if (selecetdTreeNode != null)
                        {
                            if (FormDesigner.listWorkBaseWindow.ContainsKey(selecetdTreeNode.Text))
                            {
                                BaseWindow workWindow = FormDesigner.listWorkBaseWindow[selecetdTreeNode.Text];
                                FormDesigner.listWorkBaseWindow.Remove(selecetdTreeNode.Text);
                                if (FormDesigner.listBaseWindow.Contains(workWindow))
                                {
                                    FormDesigner.listBaseWindow.Remove(workWindow);
                                }
                                workWindow.Close();

                            }
                            XmlDocument document = designerForm.applicationDoc;
                            XmlNode formXmlNode = document.FirstChild.SelectSingleNode(FormDesignerConstants.WorkflowPattern);
                            foreach (XmlNode xmlNode in formXmlNode.ChildNodes)
                            {
                                if (xmlNode.Attributes[XMLServicesConstants.XmlNodeNameAtt].Value.Trim().Equals(selecetdTreeNode.Text))
                                {
                                    formXmlNode.RemoveChild(xmlNode);
                                }
                            }
                            designerForm.saveToolStripMenuItem_Click(null, null);
                        }
                    }
                }
                else
                {


                    designerForm.initBaseWindow(FormDesignerConstants.WorkflowDesigner, null, false);
                    designerForm.propertyEditorToolStripMenuItem_Click(null, null);
                    designerForm.datapatternExplorerToolStripMenuItem_Click(null, null);
                    designerForm.projectExplorerShowToolStrip();
                    designerForm.toolBoxToolStripMenuItem_Click(null, null);
                    designerForm.toolBoxWindow.tabControl.SelectedIndex = 2;
                    designerForm.baseWindowDefaultToolClick(null, null);
                }
            }
        }
Beispiel #5
0
    /// <summary>
    /// 关闭界面
    /// </summary>
    public void CloseWindow(EWindowID id)
    {
        BaseWindow window = getWindowByid(id);

        if (window != null)
        {
            Debug.Log("被动关闭");
            //if(window.CanPop)
            //{
            //    popWindows.Add(id);
            //}

            window.Close();
        }
    }
Beispiel #6
0
    public void CloseWindow(WindowID windowID)
    {
        BaseWindow window = mAllWindows[windowID];

        if (window == null)
        {
            return;
        }
        WindowType type = window.Type;

        window.Close();
        List <BaseWindow> list = null;

        mOpenWindows.TryGetValue(type, out list);
        if (list != null)
        {
            list.Remove(window);
        }
        DealWindowStack(window, false);
    }
Beispiel #7
0
    public void ShowWindow <T>(string componentName, object param = null, string packgeName = "wuxia") where T : BaseWindow
    {
        string uiName = typeof(T).Name;

        MyLog.Log("ShowWindow:" + uiName);
        if (mCurShownWindow != null)
        {
            mCurShownWindow.Close();
        }
        if (!mShownWindows.ContainsKey(uiName))
        {
            T window = System.Activator.CreateInstance <T>();
            window.Awake(packgeName, componentName);
            window.Show(param);
            mShownWindows.Add(uiName, window);
            mCurShownWindow = window;
        }
        else
        {
            mShownWindows[uiName].Show(param);
            mCurShownWindow = mShownWindows[uiName];
        }
    }
Beispiel #8
0
 public void CloseWindow(BaseWindow window)
 {
     window.Close();
     active_windows.Remove(window);
     window_pool.Enqueue(window);
 }
Beispiel #9
0
 /// <summary>
 /// Closes the modeless window if one exists
 /// </summary>
 public void CloseModelessWindow()
 {
     _modelessWindow?.Close();
     _modelessWindow = null;
 }
Beispiel #10
0
        public void formContextMenuItem_Click(object sender, System.EventArgs e)
        {
            
            if (sender is MenuItem)
            {
                MenuItem menuItem = (MenuItem)sender;
                if (menuItem.Text.Trim().Equals(FormDesignerConstants.DeleteBaseWindow))
                {
                    DialogResult result = MessageBox.Show("Do you want to delete the current formpattern", "Exit Window", MessageBoxButtons.OKCancel);
                    if (result == DialogResult.OK)
                    {
                        TreeNode selecetdTreeNode = this.treeView1.SelectedNode;
                        if (selecetdTreeNode != null)
                        {
                            if (FormDesigner.listFormBaseWindow.ContainsKey(selecetdTreeNode.Text))
                            {
                                //FormDesigner.listFormBaseWindow[baseWindow.Name].Close();
                                BaseWindow formBaseWindow = FormDesigner.listFormBaseWindow[selecetdTreeNode.Text];

                                //Added by HKU to tell that user deleting a defaultscreen
                                if (formBaseWindow.baseFrame.DefaultScreen)
                                {
                                    MessageBox.Show("You are deleting a defaultscreen formpattern. Make another formpattern as defaultscreen");
                                }
                                //Adding by HKU done
                                if (FormDesigner.listBaseWindow.Contains(formBaseWindow))
                                {
                                    FormDesignerUtilities.visibleTrueWindow.Clear();
                                }
                                FormDesigner.listFormBaseWindow.Remove(selecetdTreeNode.Text);

                                if (FormDesigner.listBaseWindow.Contains(formBaseWindow))
                                {
                                    FormDesigner.listBaseWindow.Remove(formBaseWindow);
                                }
                                formBaseWindow.Close();
                                designerForm.displayNameExplorer.formPatternMapList.Remove(formBaseWindow.Name);
                            }
                            XmlDocument document = designerForm.applicationDoc;
                            XmlNode formXmlNode = document.FirstChild.SelectSingleNode(FormDesignerConstants.FormPattern);
                            foreach (XmlNode xmlNode in formXmlNode.ChildNodes)
                            {
                                if (xmlNode.Attributes[XMLServicesConstants.XmlNodeNameAtt].Value.Trim().Equals(selecetdTreeNode.Text))
                                {
                                    formXmlNode.RemoveChild(xmlNode);
                                }
                            }
                            designerForm.saveToolStripMenuItem_Click(null, null);

                        }
                    }
                }
                else
                {
                    designerForm.initBaseWindow(FormDesignerConstants.FormDesigner, null, false);
                    designerForm.propertyEditorToolStripMenuItem_Click(null, null);
                    designerForm.formulaEditorToolStripMenuItem_Click(null, null);
                    designerForm.datapatternExplorerToolStripMenuItem_Click(null, null);
                    designerForm.toolBoxToolStripMenuItem_Click(null, null);
                    designerForm.toolBoxWindow.tabControl.SelectedIndex = 0;
                    designerForm.baseWindowDefaultToolClick(null, null);

                }
            }
        }