SetFocus() 공개 메소드

public SetFocus ( ) : void
리턴 void
예제 #1
0
 private void goToType(ITypeCache cache, Editor editor)
 {
     _ctx.Post((s) =>
         {
             if (_gotoType == null || !_gotoType.Visible)
             {
                 _gotoType = new TypeSearchForm(
                     cache,
                     (file, line, column) => { editor.GoTo(file, line, column); },
                     () => { new System.Threading.Thread(() => { System.Threading.Thread.Sleep(1000); editor.SetFocus(); }).Start(); });
                 _gotoType.Show(this);
             }
             setToForeground(_gotoType);
         }, null);
 }
예제 #2
0
 private void explore(ITypeCache cache, Editor editor)
 {
     _ctx.Post((s) =>
         {
             if (_exploreForm == null || !_exploreForm.Visible)
             {
                 _exploreForm = new FileExplorer(
                     cache,
                     _defaultLanguage,
                     (file, line, column) => { editor.GoTo(file, line, column); },
                     () => { editor.SetFocus(); });
                 _exploreForm.Show(this);
             }
             setToForeground(_exploreForm);
         }, null);
 }
예제 #3
0
 private void userSelect(MessageArgs message, Editor editor)
 {
     var state = new ConfigReader(_endpoint.Token).Get("oi.userselect.ui.fallback");
     if (state == "disabled")
         return;
     _ctx.Post((s) =>
         {
             try {
                 var args = new CommandStringParser().Parse(message.Message).ToArray();
                 var items = new List<string>();
                 var keys = new List<string>();
                 foreach (var item in args[3].Split(new[] {','})) {
                     var chunks = item.Split(new[] {"||"}, StringSplitOptions.None);
                     if (chunks.Length > 1) {
                         keys.Add(chunks[0]);
                         items.Add(chunks[1]);
                     } else {
                         keys.Add(item);
                         items.Add(item);
                     }
                 }
                 var command = "user-selected";
                 if (message.Message.StartsWith("user-select-at-caret "))
                     command = "user-selected-at-caret";
                 var form = new UserSelectForm(items, keys, (item) => {
                     if (item != null)
                         _endpoint.PublishEvent(command+" '" + args[2] + "' '"  + item + "'");
                     else
                         _endpoint.PublishEvent(command+" '" + args[2] + "' 'user-cancelled'");
                     editor.SetFocus();
                 });
                 form.Show(this);
                 setToForeground(form);
             } catch {
             }
         }, null);
 }
예제 #4
0
파일: TrayForm.cs 프로젝트: acken/OpenIDE
 private void goToType(ITypeCache cache, Editor editor)
 {
     Logger.Write("Preparing to open type search");
     _ctx.Post((s) =>
         {
             Logger.Write("Opening type search");
             try {
                 if (_gotoType == null || !_gotoType.Visible)
                 {
                     Logger.Write("Creating typesearch form");
                     _gotoType = new TypeSearchForm(
                         cache,
                         (file, line, column) => { editor.GoTo(file, line, column); },
                         () => { new System.Threading.Thread(() => { System.Threading.Thread.Sleep(1000); editor.SetFocus(); }).Start(); });
                     _gotoType.Show(this);
                 }
                 setToForeground(_gotoType);
             } catch (Exception ex) {
                 Logger.Write(ex);
             }
         }, null);
 }
예제 #5
0
 private void userInput(MessageArgs message, Editor editor)
 {
     Logger.Write("Getting state for userinput fallback");
     var state = new ConfigReader(_endpoint.Token).Get("oi.userinput.ui.fallback");
     Logger.Write("State is "+state);
     if (state == "disabled")
         return;
     _ctx.Post((s) =>
         {
             Logger.Write("Launching user input form");
             try {
                 var args = new CommandStringParser().Parse(message.Message).ToArray();
                 var defaultValue = "";
                 if (args.Length > 3)
                     defaultValue = args[3];
                 var form = new UserInputForm(defaultValue, (item) => {
                     if (item != null)
                         _endpoint.PublishEvent("user-inputted '" + args[2] + "' '"  + item + "'");
                     else
                         _endpoint.PublishEvent("user-inputted '" + args[2] + "' 'user-cancelled'");
                     editor.SetFocus();
                 });
                 form.Show(this);
                 setToForeground(form);
             } catch (Exception ex) {
                 Logger.Write(ex);
             }
         }, null);
 }