Exemplo n.º 1
0
        public static void InitializeWorkbench()
        {
            LayoutConfiguration.LoadLayoutConfiguration();
            StatusBarService.Initialize();
            DomHostCallback.Register();             // must be called after StatusBarService.Initialize()
            ParserService.InitializeParserService();
            Project.CustomToolsService.Initialize();

            workbench = new DefaultWorkbench();
#endif
            MessageService.MainForm = workbench;

            PropertyService.PropertyChanged += new PropertyChangedEventHandler(TrackPropertyChanges);
            ResourceService.LanguageChanged += delegate { workbench.RedrawAllComponents(); };

            caller = new STAThreadCaller(workbench);

            workbench.InitializeWorkspace();

            workbench.SetMemento(PropertyService.Get(workbenchMemento, new Properties()));

            workbench.WorkbenchLayout = new SdiWorkbenchLayout();

            OnWorkbenchCreated();
        }
Exemplo n.º 2
0
        public static void InitializeWorkbench(System.Type workbenchtype)
        {
            LayoutConfiguration.LoadLayoutConfiguration();
            StatusBarService.Initialize();
            DomHostCallback.Register();             // must be called after StatusBarService.Initialize()
            ParserService.InitializeParserService();
            Project.CustomToolsService.Initialize();

            workbench = (ICSharpCode.SharpDevelop.Gui.DefaultWorkbench)Activator.CreateInstance(workbenchtype);
Exemplo n.º 3
0
        public static void InitializeWorkbench(IWorkbench workbench, IWorkbenchLayout layout)
        {
            WorkbenchSingleton.workbench = workbench;

            LanguageService.ValidateLanguage();

            DisplayBindingService.InitializeService();
            LayoutConfiguration.LoadLayoutConfiguration();
            FileService.InitializeService();
            DomHostCallback.Register();             // must be called after StatusBarService.Initialize()
            ParserService.InitializeParserService();
            TaskService.Initialize();
            Bookmarks.BookmarkManager.Initialize();
            Project.CustomToolsService.Initialize();
            Project.BuildModifiedProjectsOnlyService.Initialize();

            var messageService = Core.Services.ServiceManager.Instance.MessageService as IDialogMessageService;

            if (messageService != null)
            {
                messageService.DialogOwner = workbench.MainWin32Window;
                Debug.Assert(messageService.DialogOwner != null);
                messageService.DialogSynchronizeInvoke = workbench.SynchronizingObject;
            }

            workbench.Initialize();
            workbench.SetMemento(PropertyService.Get(workbenchMemento, new Properties()));
            workbench.WorkbenchLayout = layout;

            ApplicationStateInfoService.RegisterStateGetter(activeContentState, delegate { return(WorkbenchSingleton.Workbench.ActiveContent); });

            OnWorkbenchCreated();

            // initialize workbench-dependent services:
            Project.ProjectService.InitializeService();
            NavigationService.InitializeService();

            workbench.ActiveContentChanged += delegate {
                Debug.WriteLine("ActiveContentChanged to " + workbench.ActiveContent);
                LoggingService.Debug("ActiveContentChanged to " + workbench.ActiveContent);
            };
            workbench.ActiveViewContentChanged += delegate {
                Debug.WriteLine("ActiveViewContentChanged to " + workbench.ActiveViewContent);
                LoggingService.Debug("ActiveViewContentChanged to " + workbench.ActiveViewContent);
            };
            workbench.ActiveWorkbenchWindowChanged += delegate {
                Debug.WriteLine("ActiveWorkbenchWindowChanged to " + workbench.ActiveWorkbenchWindow);
                LoggingService.Debug("ActiveWorkbenchWindowChanged to " + workbench.ActiveWorkbenchWindow);
            };
        }
Exemplo n.º 4
0
        public static void InitializeWorkbench(IWorkbench workbench, IWorkbenchLayout layout)
        {
            WorkbenchSingleton.workbench = workbench;

            //DisplayBindingService.InitializeService();
            LayoutConfiguration.LoadLayoutConfiguration();
            //FileService.InitializeService();
            StatusBarService.Initialize();
            //DomHostCallback.Register(); // must be called after StatusBarService.Initialize()
            ParserService.InitializeParserService();
            //Bookmarks.BookmarkManager.Initialize();
            //Project.CustomToolsService.Initialize();
            //Project.BuildModifiedProjectsOnlyService.Initialize();

            workbench.Initialize();
            workbench.SetMemento(PropertyService.Get(workbenchMemento, new Core.Properties()));

            caller = new STAThreadCaller(workbench.MainForm);
            WinFormsMessageService.DialogOwner             = workbench.MainForm;
            WinFormsMessageService.DialogSynchronizeInvoke = workbench.MainForm;

            //RemoveXButton(WorkbenchSingleton.MainForm.Handle.ToInt32());
            PropertyService.PropertyChanged += new PropertyChangedEventHandler(TrackPropertyChanges);
            ResourceService.LanguageChanged += delegate { workbench.RedrawAllComponents(); };

            ApplicationStateInfoService.RegisterStateGetter(activeContentState, delegate { return(WorkbenchSingleton.Workbench.ActiveContent); });

            // attach workbench layout -> load pads
            workbench.WorkbenchLayout = layout;

            OnWorkbenchCreated();

            // initialize workbench-dependent services:
//            Project.ProjectService.InitializeService();
            NavigationService.InitializeService();

            workbench.ActiveContentChanged += delegate
            {
                LoggingService.Debug("ActiveContentChanged to " + workbench.ActiveContent);
            };
            workbench.ActiveViewContentChanged += delegate
            {
                LoggingService.Debug("ActiveViewContentChanged to " + workbench.ActiveViewContent);
            };
            workbench.ActiveWorkbenchWindowChanged += delegate
            {
                LoggingService.Debug("ActiveWorkbenchWindowChanged to " + workbench.ActiveWorkbenchWindow);
            };
        }
Exemplo n.º 5
0
        public static void InitializeWorkbench(Window window)//, IWorkbenchLayout layout)
        {
            WorkbenchSingleton.workbench = new Workbench(window);

            PropertyService.InitializeService(@"C:\Users\admin\AppData\Roaming\ICSharpCode/SharpDevelop4",
                                              @"F:\Install\Develop\Visual Studio\SharpDevelop\SharpDevelop_4.2.1.8805_Source\bin\..\data",
                                              "CodeEditor");
            PropertyService.Load();
            ResourceService.InitializeService(Path.Combine(PropertyService.DataDirectory, "resources"));
            ResourceService.RegisterNeutralImages(new ResourceManager("Savchin.Resources.BitmapResources", typeof(ITextEditor).Assembly));
            ResourceService.RegisterNeutralStrings(new ResourceManager("Savchin.Resources.StringResources", typeof(ITextEditor).Assembly));
            //ProjectBindingService.SetBindings(new ProjectBindingDescriptor[]
            //                                      {
            //                                          new ProjectBindingDescriptor(new Codon(null,"ProjectBinding",new Properties
            //                                                                                                           {

            //                                                                                                           },
            //                                              )),
            //                                      });
            var path  = Path.GetDirectoryName(typeof(WorkbenchSingleton).Assembly.Location);
            var files = new List <string>(Directory.GetFiles(path, "*.addin", SearchOption.AllDirectories));

            AddInTree.Load(files, new List <string>());
            //TODO: Uncomment
            //LanguageService.ValidateLanguage();

            //DisplayBindingService.InitializeService();
            //LayoutConfiguration.LoadLayoutConfiguration();
            //FileService.InitializeService();
            //DomHostCallback.Register(); // must be called after StatusBarService.Initialize()
            ParserService.InitializeParserService();
            //TaskService.Initialize();
            //Bookmarks.BookmarkManager.Initialize();
            //CustomToolsService.Initialize();
            //BuildModifiedProjectsOnlyService.Initialize();

            //var messageService = Core.Services.ServiceManager.Instance.MessageService as IDialogMessageService;
            //if (messageService != null)
            //{
            //    messageService.DialogOwner = workbench.MainWin32Window;
            //    Debug.Assert(messageService.DialogOwner != null);
            //    messageService.DialogSynchronizeInvoke = workbench.SynchronizingObject;
            //}

            //workbench.Initialize();
            workbench.SetMemento(PropertyService.Get(workbenchMemento, new Properties()));
            //TODO: Uncomment
            // workbench.WorkbenchLayout = layout;

            ApplicationStateInfoService.RegisterStateGetter(activeContentState, delegate { return(WorkbenchSingleton.Workbench.ActiveContent); });

            OnWorkbenchCreated();

            //TODO: Uncomment
            //// initialize workbench-dependent services:
            //Project.ProjectService.InitializeService();
            //NavigationService.InitializeService();

            //workbench.ActiveContentChanged += delegate
            //{
            //    Debug.WriteLine("ActiveContentChanged to " + workbench.ActiveContent);
            //    LoggingService.Debug("ActiveContentChanged to " + workbench.ActiveContent);
            //};
            workbench.ActiveViewContentChanged += delegate
            {
                Debug.WriteLine("ActiveViewContentChanged to " + workbench.ActiveViewContent);
                LoggingService.Debug("ActiveViewContentChanged to " + workbench.ActiveViewContent);
            };
            //TODO: Uncomment
            //workbench.ActiveWorkbenchWindowChanged += delegate
            //{
            //    Debug.WriteLine("ActiveWorkbenchWindowChanged to " + workbench.ActiveWorkbenchWindow);
            //    LoggingService.Debug("ActiveWorkbenchWindowChanged to " + workbench.ActiveWorkbenchWindow);
            //};


            FakeProject.Create(path, "PresentationFramework", "WindowsBase");
        }