예제 #1
0
    override protected void DoCreate()
    {
        list               = new SwitchList <string>();
        tabBar             = new TabBar <string>(list, TabBar <string> .DefaultStringOf);
        tabBar.Text        = "Info";
        tabBar.CloseClick += OnCloseClick;
        Controls.Add(tabBar);

        KeyMap frameKeyMap = new KeyMap();

        frameKeyMap.AddItem(new KeyItem(Keys.Escape, null, new KeyAction("&View\\Close info", DoClose, null, false)));
        frameKeyMap.AddItem(new KeyItem(Keys.Enter, null, new KeyAction("&View\\Close info", DoClose, null, false)));

        textBox = new MulticaretTextBox();
        textBox.KeyMap.AddAfter(KeyMap);
        textBox.KeyMap.AddAfter(frameKeyMap, 1);
        textBox.KeyMap.AddAfter(DoNothingKeyMap, -1);
        textBox.FocusedChange        += OnTextBoxFocusedChange;
        textBox.Controller.isReadonly = true;
        textBox.ViShortcut           += OnViShortcut;
        SetTextBoxParameters();
        Controls.Add(textBox);

        tabBar.MouseDown += OnTabBarMouseDown;
        InitResizing(tabBar, null);
        Height = MinSize.Height;
    }
예제 #2
0
                /// <summary>
                /// Returns list of switch objects where each switch was
                /// used by the command line tool.
                /// </summary>
                /// <returns></returns>
                public SwitchList GetUsedSwitches()
                {
                    SwitchList list = new SwitchList();

                    list.AddRange(this.FindAll(s => s.IsUsed == true));
                    return(list);
                }
예제 #3
0
    override protected void DoCreate()
    {
        SwitchList <NamedAction> list        = new SwitchList <NamedAction>();
        KeyMapBuilder            frameKeyMap = new KeyMapBuilder(new KeyMap(), list);

        frameKeyMap.Add(Keys.Escape, null, new KeyAction("F&ind\\Cancel find", DoCancel, null, false));
        frameKeyMap.AddInList(Keys.Enter, null, new KeyAction("F&ind\\Find next", DoFindNext, null, false));
        if (data.history != null)
        {
            KeyAction prevAction = new KeyAction("F&ind\\Previous pattern", DoPrevPattern, null, false);
            KeyAction nextAction = new KeyAction("F&ind\\Next pattern", DoNextPattern, null, false);
            frameKeyMap.Add(Keys.Up, null, prevAction);
            frameKeyMap.Add(Keys.Down, null, nextAction);
            frameKeyMap.Add(Keys.Control | Keys.P, null, prevAction);
            frameKeyMap.Add(Keys.Control | Keys.N, null, nextAction);
        }
        frameKeyMap.Add(Keys.None, null, new KeyAction("F&ind\\-", null, null, false));
        if (allowNormalMode)
        {
            frameKeyMap.Add(Keys.Control | Keys.F, null,
                            new KeyAction("&View\\Vi normal mode", DoNormalMode, null, false));
        }

        KeyMapBuilder beforeKeyMap = new KeyMapBuilder(new KeyMap(), list);

        if (doSelectAllFound != null)
        {
            beforeKeyMap.AddInList(Keys.Control | Keys.D, null,
                                   new KeyAction("F&ind\\Select next found", DoSelectNextFound, null, false));
            beforeKeyMap.AddInList(Keys.Control | Keys.Shift | Keys.D, null,
                                   new KeyAction("F&ind\\Select all found", DoSelectAllFound, null, false));
            beforeKeyMap.Add(Keys.Control | Keys.K, null,
                             new KeyAction("F&ind\\Unselect prev text", DoUnselectPrevText, null, false));
        }

        textBox = new MulticaretTextBox(true);
        textBox.KeyMap.AddBefore(beforeKeyMap.map);
        textBox.KeyMap.AddAfter(KeyMap);
        textBox.KeyMap.AddAfter(frameKeyMap.map, 1);
        textBox.KeyMap.AddAfter(DoNothingKeyMap, -1);
        textBox.FocusedChange += OnTextBoxFocusedChange;
        Controls.Add(textBox);

        tabBar            = new TabBar <NamedAction>(list, TabBar <NamedAction> .DefaultStringOf, NamedAction.HintOf);
        tabBar.Text       = Name;
        tabBar.ButtonMode = true;
        tabBar.RightHint  = findParams != null?findParams.GetIndicationHint() : null;

        tabBar.TabClick   += OnTabClick;
        tabBar.CloseClick += OnCloseClick;
        tabBar.MouseDown  += OnTabBarMouseDown;
        Controls.Add(tabBar);

        InitResizing(tabBar, null);
        Height = MinSize.Height;
        UpdateFindParams();
    }
예제 #4
0
    override protected void DoCreate()
    {
        SwitchList <NamedAction> list = new SwitchList <NamedAction>();

        KeyMap frameKeyMap = new KeyMap();

        frameKeyMap.AddItem(new KeyItem(Keys.Escape, null,
                                        new KeyAction("F&ind\\Cancel find", DoCancel, null, false)));
        frameKeyMap.AddItem(new KeyItem(Keys.Enter, null,
                                        new KeyAction("F&ind\\Find next", DoFindNext, null, false)));
        if (data.history != null)
        {
            KeyAction prevAction = new KeyAction("F&ind\\Previous pattern", DoPrevPattern, null, false);
            KeyAction nextAction = new KeyAction("F&ind\\Next pattern", DoNextPattern, null, false);
            frameKeyMap.AddItem(new KeyItem(Keys.Up, null, prevAction));
            frameKeyMap.AddItem(new KeyItem(Keys.Down, null, nextAction));
            frameKeyMap.AddItem(new KeyItem(Keys.Control | Keys.P, null, prevAction));
            frameKeyMap.AddItem(new KeyItem(Keys.Control | Keys.N, null, nextAction));
        }
        frameKeyMap.AddItem(new KeyItem(Keys.None, null, new KeyAction("F&ind\\-", null, null, false)));
        frameKeyMap.AddItem(new KeyItem(Keys.Control | Keys.F, null,
                                        new KeyAction("&View\\Vi normal mode", DoNormalMode, null, false)));

        frameKeyMap.AddItem(new KeyItem(Keys.Control | Keys.Shift | Keys.R, null,
                                        new KeyAction("F&ind\\Switch regex", DoSwitchRegex, null, false)
                                        .SetGetText(GetFindRegex)));
        frameKeyMap.AddItem(new KeyItem(Keys.Control | Keys.Shift | Keys.I, null,
                                        new KeyAction("F&ind\\Switch ignore case", DoSwitchIgnoreCase, null, false)
                                        .SetGetText(GetFindIgnoreCase)));

        KeyMap beforeKeyMap = new KeyMap();

        textBox = new MulticaretTextBox(true);
        textBox.KeyMap.AddBefore(beforeKeyMap);
        textBox.KeyMap.AddAfter(KeyMap);
        textBox.KeyMap.AddAfter(frameKeyMap, 1);
        textBox.KeyMap.AddAfter(DoNothingKeyMap, -1);
        textBox.FocusedChange += OnTextBoxFocusedChange;
        textBox.TextChange    += OnTextChange;
        Controls.Add(textBox);

        tabBar            = new TabBar <NamedAction>(list, TabBar <NamedAction> .DefaultStringOf, NamedAction.HintOf);
        tabBar.Text       = (isBackward ? "?" : "/") + Name;
        tabBar.ButtonMode = true;
        tabBar.RightHint  = findParams != null?findParams.GetIndicationHint() : null;

        tabBar.TabClick   += OnTabClick;
        tabBar.CloseClick += OnCloseClick;
        tabBar.MouseDown  += OnTabBarMouseDown;
        Controls.Add(tabBar);

        InitResizing(tabBar, null);
        Height = MinSize.Height;
        UpdateFindParams();
    }
 private void MessageReceived(Tuple <int, string> message /*string message*/)
 {
     if (message.Item1 == MessageSentEvent.RepositoryUpdated)
     {
         SwitchList.Clear();
         foreach (NetworkDevice item in _dataRepositoryService.GetDevices())
         {
             if (item.Serial == null)//исключаем коммутаторы уже имеющие серийник (они уже были сконфигурированны)
             {
                 SwitchList.Add(item);
             }
         }
     }
 }
예제 #6
0
    override protected void DoCreate()
    {
        SwitchList <NamedAction> list = new SwitchList <NamedAction>();

        KeyMap frameKeyMap = new KeyMap();

        frameKeyMap.AddItem(new KeyItem(Keys.Escape, null,
                                        new KeyAction("&View\\Cancel command", DoCancel, null, false)));
        frameKeyMap.AddItem(new KeyItem(Keys.Enter, null,
                                        new KeyAction("&View\\Run command", DoRunCommand, null, false)));
        {
            KeyAction prevAction = new KeyAction("&View\\Previous command", DoPrevCommand, null, false);
            KeyAction nextAction = new KeyAction("&View\\Next command", DoNextCommand, null, false);
            frameKeyMap.AddItem(new KeyItem(Keys.Up, null, prevAction));
            frameKeyMap.AddItem(new KeyItem(Keys.Down, null, nextAction));
            frameKeyMap.AddItem(new KeyItem(Keys.Control | Keys.P, null, prevAction));
            frameKeyMap.AddItem(new KeyItem(Keys.Control | Keys.N, null, nextAction));
        }
        {
            KeyAction action = new KeyAction("&View\\Autocomplete", DoAutocomplete, null, false);
            frameKeyMap.AddItem(new KeyItem(Keys.Control | Keys.Space, null, action));
            frameKeyMap.AddItem(new KeyItem(Keys.Tab, null, action));
        }
        frameKeyMap.AddItem(new KeyItem(Keys.Control | Keys.F, null,
                                        new KeyAction("&View\\Vi normal mode", DoNormalMode, null, false)));

        textBox = new MulticaretTextBox(true);
        textBox.KeyMap.AddAfter(KeyMap);
        textBox.KeyMap.AddAfter(frameKeyMap, 1);
        textBox.KeyMap.AddAfter(DoNothingKeyMap, -1);
        textBox.FocusedChange += OnTextBoxFocusedChange;
        textBox.TextChange    += OnTextChange;
        Controls.Add(textBox);

        tabBar             = new TabBar <NamedAction>(list, TabBar <NamedAction> .DefaultStringOf, NamedAction.HintOf);
        tabBar.Text        = Name;
        tabBar.ButtonMode  = true;
        tabBar.TabClick   += OnTabClick;
        tabBar.CloseClick += OnCloseClick;
        tabBar.MouseDown  += OnTabBarMouseDown;
        Controls.Add(tabBar);

        InitResizing(tabBar, null);
        Height = MinSize.Height;
    }
예제 #7
0
 private void MessageReceived(Message message)//(Tuple<int, string> message)
 {
     if (message.ActionCode == MessageSentEvent.RepositoryUpdated)
     {
         SwitchList.Clear();
         List <Cabinet> cabinets = (List <Cabinet>)_dataRepositoryService.GetCabinetsWithDevices <EthernetSwitch>();
         foreach (Cabinet cabinet in cabinets)
         {
             foreach (EthernetSwitch item in cabinet.GetDevicesList <EthernetSwitch>()) // масло масляное, в шкафах cabinets не может быть приборов отличных от EthernetSwitch
             {
                 SwitchList.Add(item);
             }
         }
     }
     if (message.ActionCode == MessageSentEvent.NeedOfUserAction)
     {
         MessageForUser = message.MessageString;// Обновим информацию для пользователя
     }
     if (message.ActionCode == MessageSentEvent.StringToConsole)
     {
         ObserveConsole += message.MessageString + "\r\n";// Ответы коммутатора в консоль
     }
 }
예제 #8
0
 public void SetUp()
 {
     list = new SwitchList <string>();
     log  = "";
 }
예제 #9
0
            /// <summary>
            /// Parses command line arguments (raw arguments) into Switch objects, their arguments, and
            /// stand-alone arguments.
            /// </summary>
            /// <seealso cref="Switch.UsedSwitches"/>
            /// <seealso cref="Switch.Args"/>
            /// <seealso cref="Switch.StartStandAloneArgs"/>
            /// <seealso cref="Switch.EndStandAloneArgs"/>
            /// <seealso cref="Switch.AllStandAloneArgs"/>
            /// <param name="commandLineArguments">Assign it argument "args" from main(string[] args)</param>
            public static void AssimilateArgs(string[] commandLineArgs)
            {
                //*** Variables ***
                //*****************

                /* IDE ISSUE:
                 * For Visual Studio 2019: version 16.1.0 and before
                 * , the IDE falsely identifies unused variables in this method.
                 * Only delete a variable after manual confirmation.
                 */
                Switch curSwitch                    = null;
                Switch lastSwitch                   = null;
                int    indexOfLastSwitch            = 0;
                string lastRawArgIdentifiedAsSwitch = "";
                string curSwitchStr                 = null;
                bool   isFirstSwitchEncountered     = false;
                bool   isCurSwitchTheLast           = false;
                bool   rawArgIsSwitchArg            = false;
                bool   rawArgIsSwitch               = false;
                bool   minMet = false;
                bool   maxMet = false;

                //*** Get Last Raw Argument Identified As Switch ***
                //**************************************************
                if (commandLineArgs.Length > 0)
                {
                    for (int i = commandLineArgs.Length - 1; i >= 0; i--)
                    {
                        if (commandLineArgs[i].IsPrefixedNameOfSwitch())
                        {
                            lastRawArgIdentifiedAsSwitch = commandLineArgs[i];
                            indexOfLastSwitch            = i;
                            break;
                        }
                    }
                }

                //*** Get Last Identified Switch As Switch Object ***
                //***************************************************
                lastSwitch = AllSwitches.GetSwitch(lastRawArgIdentifiedAsSwitch);

                //*** Remember That Last Switch That Is Used ***
                //**********************************************
                //after loop, last switch is known unless no switches were used
                if (!(lastSwitch is null))
                {
                    lastSwitch.IsUsed = true;
                }

                //*** Identify All Raw Arguments AS Switch Objects OR Arguments ***
                //*****************************************************************
                foreach (var arg in commandLineArgs)
                {
                    //*** * Loop Variables ***
                    rawArgIsSwitch    = arg.IsPrefixedNameOfSwitch();
                    rawArgIsSwitchArg = !rawArgIsSwitch;

                    //*** * Identify As Switch? ***
                    //if raw argument is identified as Switch, then
                    if (rawArgIsSwitch)
                    {
                        curSwitch    = AllSwitches.GetSwitch(arg);
                        curSwitchStr = arg;

                        //fail command line tool if Switch object has already been used in command line
                        if (curSwitch.IsUsed && curSwitch != lastSwitch)
                        {
                            Console.Error.WriteLine("Switch '" + curSwitchStr + "' has already been used in command line: command line tool ended");
                        #if DEBUG
                            throw new Exception("Switch object was already used in command line");
                        #endif
                        #if RELEASE
                            Environment.Exit(0);
                        #endif
                        }

                        curSwitch.IsUsed         = true;
                        isFirstSwitchEncountered = true;
                        isCurSwitchTheLast       = curSwitch == lastSwitch;
                    }

                    //*** * Case: Raw Arg Identified As Starting Stand-Alone Argument ***
                    //until first switch is encountered, add arg to StartStandAloneArgs
                    if (!isFirstSwitchEncountered)
                    {
                        StartStandAloneArgs.Add(arg);
                        StartStandAloneSmartArgs.Add(new SmartArg(arg));
                        continue;
                    }

                    //*** * Case: Raw Arg Identified As Switch Argument ***
                    minMet = curSwitch.Args.Count >= curSwitch.MinArgs;
                    maxMet = curSwitch.Args.Count >= curSwitch.MaxArgs;

                    //obviously min args must be met, it's a requirement
                    if (!minMet)
                    {
                        if (rawArgIsSwitchArg || !(isCurSwitchTheLast && /* not last raw arg to be identified */ indexOfLastSwitch <= commandLineArgs.Length - 1))
                        {
                            curSwitch.Args.Add(arg);
                            curSwitch.SmartArgs.Add(new SmartArg(arg));
                        }
                        else /* ERROR */
                        {
                            Console.Error.WriteLine("Min args not met for switch '" + curSwitchStr + "': command line tool ended");
                        #if DEBUG
                            throw new Exception("Min args not met for switch");
                        #endif
                        #if RELEASE
                            Environment.Exit(0);
                        #endif
                        }
                    }
                    //but if min args is met, we need logic where max args hasn't been met
                    if (minMet && !maxMet)
                    {
                        if (rawArgIsSwitchArg)
                        {
                            curSwitch.Args.Add(arg);
                            curSwitch.SmartArgs.Add(new SmartArg(arg));
                        }
                    }

                    //*** * Case: Raw Arg Identified As Ending Stand-Alone Argument ***
                    //if max args be met, but current switch is the last switch, then add to EndStandAlone
                    if (minMet && maxMet && isCurSwitchTheLast && rawArgIsSwitchArg)
                    {
                        EndStandAloneArgs.Add(arg);
                        EndStandAloneSmartArgs.Add(new SmartArg(arg));
                    }
                }

                //*** Create Lists AllStandAloneArgs & UsedSwitches ***
                //*****************************************************
                Switch.AllStandAloneArgs.AddRange(StartStandAloneArgs);
                Switch.AllStandAloneArgs.AddRange(EndStandAloneArgs);
                Switch.AllStandAloneSmartArgs.AddRange(StartStandAloneSmartArgs);
                Switch.AllStandAloneSmartArgs.AddRange(EndStandAloneSmartArgs);
                Switch.UsedSwitches = Switch.AllSwitches.GetUsedSwitches();
            }
예제 #10
0
    override protected void DoCreate()
    {
        list               = new SwitchList <string>();
        tabBar             = new TabBar <string>(list, TabBar <string> .DefaultStringOf);
        tabBar.Text        = name;
        tabBar.CloseClick += OnCloseClick;
        Controls.Add(tabBar);

        KeyMap textKeyMap     = new KeyMap();
        KeyMap variantsKeyMap = new KeyMap();
        KeyMap beforeKeyMap   = new KeyMap();

        {
            KeyAction action = new KeyAction("F&ind\\" + submenu + "\\Close", DoClose, null, false);
            textKeyMap.AddItem(new KeyItem(Keys.Escape, null, action));
            variantsKeyMap.AddItem(new KeyItem(Keys.Escape, null, action));
        }
        {
            KeyAction actionUp   = new KeyAction("F&ind\\" + submenu + "\\Select up", DoUp, null, false);
            KeyAction actionDown = new KeyAction("F&ind\\" + submenu + "\\Select down", DoDown, null, false);
            textKeyMap.AddItem(new KeyItem(Keys.Up, null, actionUp));
            textKeyMap.AddItem(new KeyItem(Keys.Down, null, actionDown));
            textKeyMap.AddItem(new KeyItem(Keys.Control | Keys.K, null, actionUp));
            textKeyMap.AddItem(new KeyItem(Keys.Control | Keys.J, null, actionDown));
            textKeyMap.AddItem(new KeyItem(Keys.Control | Keys.F, null,
                                           new KeyAction("&View\\Vi normal mode", DoNormalMode, null, false)));
            if (findInFilesData != null)
            {
                textKeyMap.AddItem(new KeyItem(Keys.Control | Keys.E, null,
                                               new KeyAction("F&ind\\Temp filter", DoSwitchToTempFilter, null, false)));
            }
        }
        {
            beforeKeyMap.AddItem(new KeyItem(Keys.Control | Keys.Home, null,
                                             new KeyAction("F&ind\\" + submenu + "\\Select document start", DoDocumentStart, null, false)));
            beforeKeyMap.AddItem(new KeyItem(Keys.Control | Keys.End, null,
                                             new KeyAction("F&ind\\" + submenu + "\\Select document end", DoDocumentEnd, null, false)));
            beforeKeyMap.AddItem(new KeyItem(Keys.PageUp, null,
                                             new KeyAction("F&ind\\" + submenu + "\\Select page up", DoPageUp, null, false)));
            beforeKeyMap.AddItem(new KeyItem(Keys.PageDown, null,
                                             new KeyAction("F&ind\\" + submenu + "\\Select page down", DoPageDown, null, false)));
        }
        {
            KeyAction action = new KeyAction("F&ind\\" + submenu + "\\Next field", DoNextField, null, false);
            textKeyMap.AddItem(new KeyItem(Keys.Tab, null, action));
            variantsKeyMap.AddItem(new KeyItem(Keys.Tab, null, action));
        }
        {
            KeyAction action = new KeyAction("F&ind\\" + submenu + "\\Open", DoExecute, null, false);
            textKeyMap.AddItem(new KeyItem(Keys.Enter, null, action));
            textKeyMap.AddItem(new KeyItem(Keys.None, null, action).SetDoubleClick(true));
            variantsKeyMap.AddItem(new KeyItem(Keys.Enter, null, action));
            variantsKeyMap.AddItem(new KeyItem(Keys.None, null, action).SetDoubleClick(true));
        }

        variantsTextBox = new MulticaretTextBox();
        variantsTextBox.KeyMap.AddAfter(KeyMap);
        variantsTextBox.KeyMap.AddAfter(variantsKeyMap, 1);
        variantsTextBox.KeyMap.AddAfter(DoNothingKeyMap, -1);
        variantsTextBox.FocusedChange        += OnTextBoxFocusedChange;
        variantsTextBox.Controller.isReadonly = true;
        variantsTextBox.AfterClick           += OnVariantsTextBoxClick;
        variantsTextBox.AfterKeyPress        += OnVariantsTextBoxClick;
        Controls.Add(variantsTextBox);

        textBox = new MulticaretTextBox(true);
        textBox.KeyMap.AddBefore(beforeKeyMap);
        textBox.KeyMap.AddAfter(KeyMap);
        textBox.KeyMap.AddAfter(textKeyMap, 1);
        textBox.KeyMap.AddAfter(DoNothingKeyMap, -1);
        textBox.FocusedChange += OnTextBoxFocusedChange;
        textBox.TextChange    += OnTextBoxTextChange;
        Controls.Add(textBox);

        SetTextBoxParameters();

        tabBar.RightHint = tempSettings.FindParams != null?
                           tempSettings.FindParams.GetIgnoreCaseIndicationHint() : "";

        tabBar.MouseDown += OnTabBarMouseDown;

        if (findInFilesData != null)
        {
            KeyMap filterKeyMap = new KeyMap();
            {
                KeyAction action = new KeyAction("F&ind\\Switch to input field", DoSwitchToInputField, null, false);
                filterKeyMap.AddItem(new KeyItem(Keys.Control | Keys.E, null, action));
                filterKeyMap.AddItem(new KeyItem(Keys.Enter, null, action));
            }
            filterKeyMap.AddItem(new KeyItem(Keys.Control | Keys.F, null,
                                             new KeyAction("&View\\Vi normal mode", DoNormalMode, null, false)));
            if (findInFilesData.filterHistory != null)
            {
                KeyAction prevAction = new KeyAction("F&ind\\Previous filter", DoFilterPrevPattern, null, false);
                KeyAction nextAction = new KeyAction("F&ind\\Next filter", DoFilterNextPattern, null, false);
                filterKeyMap.AddItem(new KeyItem(Keys.Up, null, prevAction));
                filterKeyMap.AddItem(new KeyItem(Keys.Down, null, nextAction));
                filterKeyMap.AddItem(new KeyItem(Keys.Control | Keys.P, null, prevAction));
                filterKeyMap.AddItem(new KeyItem(Keys.Control | Keys.N, null, nextAction));
            }
            filterTextBox            = new MulticaretTextBox(true);
            filterTextBox.FontFamily = FontFamily.GenericMonospace;
            filterTextBox.SetFontSize(10.25f, 0);
            filterTextBox.ShowLineNumbers      = false;
            filterTextBox.HighlightCurrentLine = false;
            filterTextBox.KeyMap.AddAfter(KeyMap);
            filterTextBox.KeyMap.AddAfter(filterKeyMap, 1);
            filterTextBox.KeyMap.AddAfter(DoNothingKeyMap, -1);
            filterTextBox.FocusedChange += OnTextBoxFocusedChange;
            filterTextBox.Visible        = false;
            filterTextBox.Text           = findInFilesData.currentFilter.value;
            filterTextBox.TextChange    += OnFilterTextChange;
            tabBar.Controls.Add(filterTextBox);
        }

        InitResizing(tabBar, null);
        Height = MinSize.Height;

        Name = GetSubname();
        if (findInFilesData != null)
        {
            lastFilter = GetFilterText();
        }
        if (!Prebuild())
        {
            preventOpen = true;
            return;
        }
        UpdateVariantsText();
        UpdateFindParams();
    }
예제 #11
0
    override protected void DoCreate()
    {
        SwitchList <NamedAction> list = new SwitchList <NamedAction>();

        KeyMapBuilder frameKeyMap = new KeyMapBuilder(new KeyMap(), list);

        frameKeyMap.Add(Keys.Escape, null, new KeyAction("F&ind\\Cancel find", DoCancel, null, false));
        frameKeyMap.Add(Keys.Tab, null, new KeyAction("F&ind\\Next field", DoNextField, null, false));
        frameKeyMap.Add(Keys.Control | Keys.Tab, null, new KeyAction("F&ind\\Prev field", DoPrevField, null, false));
        frameKeyMap.AddInList(Keys.Enter, null, new KeyAction("F&ind\\Find next", DoFind, null, false));
        frameKeyMap.AddInList(Keys.Control | Keys.Shift | Keys.H, null, new KeyAction("F&ind\\Replace", DoReplace, null, false));
        frameKeyMap.AddInList(Keys.Control | Keys.Alt | Keys.Enter, null, new KeyAction("F&ind\\Replace all", DoReplaceAll, null, false));
        {
            KeyAction prevAction = new KeyAction("F&ind\\Previous pattern", DoPrevPattern, null, false);
            KeyAction nextAction = new KeyAction("F&ind\\Next pattern", DoNextPattern, null, false);
            frameKeyMap.Add(Keys.Up, null, prevAction);
            frameKeyMap.Add(Keys.Down, null, nextAction);
            frameKeyMap.Add(Keys.Control | Keys.P, null, prevAction);
            frameKeyMap.Add(Keys.Control | Keys.N, null, nextAction);
        }
        frameKeyMap.Add(Keys.Control | Keys.F, null,
                        new KeyAction("&View\\Vi normal mode", DoNormalMode, null, false));

        KeyMapBuilder beforeKeyMap = new KeyMapBuilder(new KeyMap(), list);

        beforeKeyMap.AddInList(Keys.Control | Keys.Shift | Keys.D, null,
                               new KeyAction("F&ind\\Select all found", DoSelectAllFound, null, false));
        beforeKeyMap.AddInList(Keys.Control | Keys.D, null,
                               new KeyAction("F&ind\\Select next found", DoSelectNextFound, null, false));
        beforeKeyMap.Add(Keys.Control | Keys.K, null,
                         new KeyAction("F&ind\\Unselect prev text", DoUnselectPrevText, null, false));

        tabBar             = new TabBar <NamedAction>(list, TabBar <NamedAction> .DefaultStringOf, NamedAction.HintOf);
        tabBar.Text        = Name;
        tabBar.ButtonMode  = true;
        tabBar.RightHint   = findParams.GetIndicationWithEscapeHint();
        tabBar.TabClick   += OnTabClick;
        tabBar.CloseClick += OnCloseClick;
        Controls.Add(tabBar);

        textBox = new MulticaretTextBox(true);
        textBox.ShowLineNumbers      = false;
        textBox.HighlightCurrentLine = false;
        textBox.KeyMap.AddAfter(KeyMap);
        textBox.KeyMap.AddBefore(beforeKeyMap.map);
        textBox.KeyMap.AddAfter(frameKeyMap.map, 1);
        textBox.KeyMap.AddAfter(DoNothingKeyMap, -1);
        textBox.FocusedChange += OnTextBoxFocusedChange;
        Controls.Add(textBox);

        replaceTextBox = new MulticaretTextBox(true);
        replaceTextBox.ShowLineNumbers      = false;
        replaceTextBox.HighlightCurrentLine = false;
        replaceTextBox.KeyMap.AddAfter(KeyMap);
        replaceTextBox.KeyMap.AddBefore(beforeKeyMap.map);
        replaceTextBox.KeyMap.AddAfter(frameKeyMap.map, 1);
        replaceTextBox.KeyMap.AddAfter(DoNothingKeyMap, -1);
        replaceTextBox.FocusedChange += OnTextBoxFocusedChange;
        Controls.Add(replaceTextBox);

        textLabel      = new MonospaceLabel();
        textLabel.Text = "Text";
        Controls.Add(textLabel);

        replaceTextLabel      = new MonospaceLabel();
        replaceTextLabel.Text = "Replace";
        Controls.Add(replaceTextLabel);

        tabBar.MouseDown += OnTabBarMouseDown;
        InitResizing(tabBar, null);
        Height = MinSize.Height;
        UpdateFindParams();
    }