Exemple #1
0
        public FindFileDock() {
            if (_instance == null) {
                _instance = this;
            }

            InitializeComponent();

            this.TabText = Resources.FindResults;
        }
Exemple #2
0
        public FindFileDock()
        {
            if (_instance == null)
            {
                _instance = this;
            }

            InitializeComponent();

            this.TabText = Resources.FindResults;
        }
Exemple #3
0
        internal static void Inspect(string findWhat, int findFileCount, List<ObjectPair> findObjects) {
            if (_instance == null) {
                _instance = new FindFileDock();
                _instance.Show(MainWindow.Instance.DockPanel, WeifenLuo.WinFormsUI.Docking.DockState.DockBottom);

            } else {
                _instance.Show();
            }

            _instance.SetResults(findWhat, findFileCount, findObjects);
        }
Exemple #4
0
        public FindFileDock() {
            if (_instance != null)
            {
                _instance.Close();
                _instance = null;
            }

            _instance = this;

            InitializeComponent();

            this.TabText = Resources.FindResults;
        }
Exemple #5
0
        internal static void Inspect(string findWhat, int findFileCount, List <ObjectPair> findObjects)
        {
            if (_instance != null)
            {
                _instance.Close();
                _instance = null;
            }

            _instance = new FindFileDock();
            _instance.Show(MainWindow.Instance.DockPanel, WeifenLuo.WinFormsUI.Docking.DockState.DockBottom);

            _instance.SetResults(findWhat, findFileCount, findObjects);
        }
Exemple #6
0
        public FindFileDock()
        {
            if (_instance != null)
            {
                _instance.Close();
                _instance = null;
            }

            _instance = this;

            InitializeComponent();

            this.TabText = Resources.FindResults;
        }
Exemple #7
0
        protected override void OnClosed(EventArgs e)
        {
            _instance = null;

            base.OnClosed(e);
        }
Exemple #8
0
        protected override void OnClosed(EventArgs e) {
            _instance = null;

            base.OnClosed(e);
        }
Exemple #9
0
        private void FindObject(string findWhat, FindRange findRange, bool matchCase,
                                bool matchWholeWord, bool onlyByNodeType, bool onlyByNodeId, FindType findType)
        {
            if (string.IsNullOrEmpty(findWhat))
            {
                return;
            }

            saveFindSettings();

            try {
                List <Nodes.Node> rootNodes   = GetRootNodes(findRange);
                List <ObjectPair> findObjects = new List <ObjectPair>();

                if (!onlyByNodeType)
                {
                    // by Id
                    int id = int.MinValue;

                    if (int.TryParse(findWhat, out id))
                    {
                        foreach (Nodes.Node root in rootNodes)
                        {
                            DefaultObject obj = Plugin.GetObjectById(root, id);

                            if (obj != null)
                            {
                                findObjects.Add(new ObjectPair(root, obj));
                            }
                        }
                    }
                }

                if (!onlyByNodeId)
                {
                    // by Type
                    foreach (Nodes.Node root in rootNodes)
                    {
                        root.GetObjectsByType(root, findWhat, matchCase, matchWholeWord, ref findObjects);
                    }
                }

                if (!onlyByNodeId && !onlyByNodeType)
                {
                    foreach (Nodes.Node root in rootNodes)
                    {
                        root.GetObjectsByPropertyMethod(root, findWhat, matchCase, matchWholeWord, ref findObjects);
                    }
                }

                if (findObjects.Count > 0)
                {
                    if (Plugin.CompareTwoObjectLists(_findObjects, findObjects))
                    {
                        if (findType == FindType.Next)
                        {
                            _objectIndex++;

                            if (_objectIndex >= findObjects.Count)
                            {
                                _objectIndex = 0;
                            }
                        }
                        else if (findType == FindType.Previous)
                        {
                            _objectIndex--;

                            if (_objectIndex < 0)
                            {
                                _objectIndex = findObjects.Count - 1;
                            }
                        }
                    }
                    else
                    {
                        _objectIndex = 0;
                        _findObjects = findObjects;
                    }

                    if (findType == FindType.All)
                    {
                        FindFileDock.Inspect(findWhat, rootNodes.Count, findObjects);
                    }
                    else
                    {
                        ShowObject(findObjects[_objectIndex]);
                    }

                    return;
                }
            } catch (Exception) {
            }

            MessageBox.Show(Resources.FindWarningInfo, Resources.FindWarning, MessageBoxButtons.OK);
        }