コード例 #1
0
ファイル: FindFileDock.cs プロジェクト: pjkui/behaviac
        public FindFileDock() {
            if (_instance == null) {
                _instance = this;
            }

            InitializeComponent();

            this.TabText = Resources.FindResults;
        }
コード例 #2
0
ファイル: FindFileDock.cs プロジェクト: chkob/behaviac-old
        public FindFileDock()
        {
            if (_instance == null)
            {
                _instance = this;
            }

            InitializeComponent();

            this.TabText = Resources.FindResults;
        }
コード例 #3
0
ファイル: FindFileDock.cs プロジェクト: pjkui/behaviac
        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);
        }
コード例 #4
0
ファイル: FindFileDock.cs プロジェクト: 675492062/behaviac
        public FindFileDock() {
            if (_instance != null)
            {
                _instance.Close();
                _instance = null;
            }

            _instance = this;

            InitializeComponent();

            this.TabText = Resources.FindResults;
        }
コード例 #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);
        }
コード例 #6
0
        public FindFileDock()
        {
            if (_instance != null)
            {
                _instance.Close();
                _instance = null;
            }

            _instance = this;

            InitializeComponent();

            this.TabText = Resources.FindResults;
        }
コード例 #7
0
ファイル: FindFileDock.cs プロジェクト: chkob/behaviac-old
        protected override void OnClosed(EventArgs e)
        {
            _instance = null;

            base.OnClosed(e);
        }
コード例 #8
0
ファイル: FindFileDock.cs プロジェクト: 675492062/behaviac
        protected override void OnClosed(EventArgs e) {
            _instance = null;

            base.OnClosed(e);
        }
コード例 #9
0
ファイル: FindDock.cs プロジェクト: chkob/behaviac-old
        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);
        }