示例#1
0
        public override HResult Initialize()
        {
            try
            {
                var hr = base.Initialize();

                if (!ErrorUtil.Success(hr))
                {
                    return(hr);
                }

                var serviceContainer = (IServiceContainer)GetService(typeof(IServiceContainer));

                serviceContainer.AddService(
                    typeof(INiLanguageServiceRegistry),
                    new NiLanguageServiceRegistry(this),
                    true
                    );
                serviceContainer.AddService(
                    typeof(INiSettings),
                    new NiSettings(this),
                    true
                    );
                serviceContainer.AddService(
                    typeof(INiProjectExplorer),
                    new NiProjectExplorer(this),
                    true
                    );
                serviceContainer.AddService(
                    typeof(INiFinder),
                    new NiFinder(this)
                    );
                serviceContainer.AddService(
                    typeof(INiNotificationManager),
                    new NiNotificationManager(this),
                    true
                    );
                serviceContainer.AddService(
                    typeof(INiHelp),
                    new NiHelp(this),
                    true
                    );

                _projectManager      = (INiProjectManager)GetService(typeof(INiProjectManager));
                _windowPaneSelection = (INiWindowPaneSelection)GetService(typeof(INiWindowPaneSelection));
                _env    = (INiEnv)GetService(typeof(INiEnv));
                _finder = (INiFinder)GetService(typeof(INiFinder));

                BuildCommands();

                return(HResult.OK);
            }
            catch (Exception ex)
            {
                return(ErrorUtil.GetHResult(ex));
            }
        }
示例#2
0
        public override HResult Initialize()
        {
            try
            {
                var hr = base.Initialize();

                if (!ErrorUtil.Success(hr))
                    return hr;

                var serviceContainer = (IServiceContainer)GetService(typeof(IServiceContainer));

                serviceContainer.AddService(
                    typeof(INiLanguageServiceRegistry),
                    new NiLanguageServiceRegistry(this),
                    true
                );
                serviceContainer.AddService(
                    typeof(INiSettings),
                    new NiSettings(this),
                    true
                );
                serviceContainer.AddService(
                    typeof(INiProjectExplorer),
                    new NiProjectExplorer(this),
                    true
                );
                serviceContainer.AddService(
                    typeof(INiFinder),
                    new NiFinder(this)
                );
                serviceContainer.AddService(
                    typeof(INiNotificationManager),
                    new NiNotificationManager(this),
                    true
                );
                serviceContainer.AddService(
                    typeof(INiHelp),
                    new NiHelp(this),
                    true
                );

                _projectManager = (INiProjectManager)GetService(typeof(INiProjectManager));
                _windowPaneSelection = (INiWindowPaneSelection)GetService(typeof(INiWindowPaneSelection));
                _env = (INiEnv)GetService(typeof(INiEnv));
                _finder = (INiFinder)GetService(typeof(INiFinder));

                BuildCommands();

                return HResult.OK;
            }
            catch (Exception ex)
            {
                return ErrorUtil.GetHResult(ex);
            }
        }