Exemplo n.º 1
0
 void scriptListForm_Reloaded()
 {
     foreach (FlowDrawDockForm drawForm in FlowDrawForms.Where(d => !File.Exists(d.FilePath)))
     {
         drawForm.Close();
     }
 }
Exemplo n.º 2
0
        private FlowDrawDockForm AddFlowDrawForm(string filePath)
        {
            FlowDrawDockForm drawForm = null;

            if (!File.Exists(filePath))
            {
                return(null);
            }
            if ((drawForm = FlowDrawForms.FirstOrDefault(f => f.FilePath.ToLower() == filePath.ToLower())) != null)
            {
                drawForm.Activate();
                return(drawForm);
            }

            drawForm = new FlowDrawDockForm();
            drawForm.VisibleChanged += windowVisibleChanged;
            drawForm.Modified       += drawForm_Modified;
            drawForm.FlowDrawPanel.SearchRequired   += FlowDrawPanel_SearchRequired;
            drawForm.FlowDrawPanel.FlowPropertyPanel = propertyForm.FlowPropertyPanel;
            drawForm.FlowDrawPanel.FlowTreeView      = treeViewForm.FlowTreeView;
            drawForm.SetLang();
            drawForm.FilePath = filePath;
            drawForm.Show(dockPanel1, WeifenLuo.WinFormsUI.Docking.DockState.Document);
            return(drawForm);
        }
Exemplo n.º 3
0
        void FlowSearchPanel_SelectionChanged(FlowScriptControl.Classes.SearchResultItem obj)
        {
            var foundForm = FlowDrawForms.FirstOrDefault(f => f.FlowDrawPanel.Guid == obj.SearchResult.Guid);

            if (foundForm == null)
            {
                return;
            }
            if (CurrentFlowDrawForm != foundForm)
            {
                foundForm.Activate();
            }

            if (obj.Source == null)
            {
                foundForm.FlowDrawPanel.SelectAndFocus(obj.Comment);
            }
            else
            {
                foundForm.FlowDrawPanel.SelectAndFocus(obj.Source);
            }
        }
Exemplo n.º 4
0
 private FlowDrawDockForm GetFlowDrawDockForm(string fileName)
 {
     return(FlowDrawForms.FirstOrDefault(f => f.FilePath.ToLower().IndexOf(fileName.ToLower()) >= 0));
 }