示例#1
0
        public TaskStore()
        {
            workspaceReg = Runtime.ServiceProvider.WhenServiceInitialized <RootWorkspace> (s => {
                workspace = s;
                workspace.FileRenamedInProject   += ProjectFileRenamed;
                workspace.FileRemovedFromProject += ProjectFileRemoved;
            });

            textEditorServiceReg = Runtime.ServiceProvider.WhenServiceInitialized <TextEditorService> (s => {
                textEditorService = s;
                textEditorService.LineCountChangesCommitted += TextEditorService_LineCountChangesCommitted;
                textEditorService.LineCountChangesReset     += TextEditorService_LineCountChangesReset;
                textEditorService.LineCountChanged          += TextEditorService_LineCountChanged;
            });
        }
示例#2
0
 static IdeServices()
 {
     Runtime.ServiceProvider.WhenServiceInitialized <TextEditorService> (s => textEditorService = s);
     Runtime.ServiceProvider.WhenServiceInitialized <NavigationHistoryService> (s => navigationHistoryManager = s);
     Runtime.ServiceProvider.WhenServiceInitialized <DisplayBindingService> (s => displayBindingService       = s);
     Runtime.ServiceProvider.WhenServiceInitialized <FontService> (s => fontService                             = s);
     Runtime.ServiceProvider.WhenServiceInitialized <TypeSystemService> (s => typeSystemService                 = s);
     Runtime.ServiceProvider.WhenServiceInitialized <DesktopService> (s => desktopService                       = s);
     Runtime.ServiceProvider.WhenServiceInitialized <DocumentManager> (s => documentManager                     = s);
     Runtime.ServiceProvider.WhenServiceInitialized <RootWorkspace> (s => workspace                             = s);
     Runtime.ServiceProvider.WhenServiceInitialized <ProgressMonitorManager> (s => progressMonitorManager       = s);
     Runtime.ServiceProvider.WhenServiceInitialized <TaskService> (s => taskService                             = s);
     Runtime.ServiceProvider.WhenServiceInitialized <ProjectOperations> (s => projectOperations                 = s);
     Runtime.ServiceProvider.WhenServiceInitialized <HelpOperations> (s => helpOperations                       = s);
     Runtime.ServiceProvider.WhenServiceInitialized <DocumentControllerService> (s => documentControllerService = s);
     Runtime.ServiceProvider.WhenServiceInitialized <DocumentModelRegistry> (s => documentModelRegistry         = s);
 }
 public void ShowMiniButton()
 {
     if (dialog != null)
     {
         dialog.Destroy();
         dialog = null;
     }
     if (button != null)
     {
         button.Dispose();
         button = null;
     }
     if (miniButton == null)
     {
         miniButton = new ExceptionCaughtMiniButton(this, File, Line);
         TextEditorService.RegisterExtension(miniButton);
     }
 }
示例#4
0
 public void ShowButton()
 {
     if (dialog != null)
     {
         dialog.Destroy();
     }
     if (button == null)
     {
         button      = new ExceptionCaughtButton(ex, this);
         button.File = file;
         button.Line = line;
         TextEditorService.RegisterExtension(button);
     }
     if (miniButton != null)
     {
         miniButton.Dispose();
         miniButton = null;
     }
 }
示例#5
0
 public void ShowButton()
 {
     if (dialog != null)
     {
         dialog.Destroyed -= Dialog_Destroyed;
         dialog.Destroy();
         dialog = null;
     }
     if (button == null)
     {
         button = new ExceptionCaughtButton(ex, this, File, Line);
         TextEditorService.RegisterExtension(button);
         button.ScrollToView();
     }
     if (miniButton != null)
     {
         miniButton.Dispose();
         miniButton = null;
     }
 }
示例#6
0
        public void TestServiceHeavily()
        {
            var lines = new string[(int)1e3];

            for (int i = 0; i < lines.Length; i++)
            {
                lines[i] = random.GenerateRandomWord((int)1e4, 3);
            }

            var stopEvent = new AutoResetEvent(false);

            new Thread(() =>
            {
                var service = new TextEditorService(createServer, () => stopEvent.WaitOne(), s => { }, lines);
                service.Run();
            }).Start();
            Thread.Sleep(500);

            using (var client = new HttpClient())
            {
                client.BaseAddress = new Uri("http://localhost/");

                var tasks = new List <Task>();
                for (int i = 0; i < 200; i++)
                {
                    var content = new FormUrlEncodedContent(new[]
                    {
                        new KeyValuePair <string, string>("word", "d"),
                        new KeyValuePair <string, string>("replace", "")
                    });
                    tasks.Add(client.PostAsync("/", content));
                }

                Task.WaitAll(tasks.ToArray());
            }

            stopEvent.Set();
            Thread.Sleep(500);
        }