コード例 #1
0
        internal bool TryCreate(string updateAsmPath, out ICheckForUpdatesService updateService)
        {
            Assembly updateAsm = Assembly.LoadFrom(updateAsmPath);

            var serviceFactoryType = updateAsm.GetTypes().SingleOrDefault(x => typeof(ICheckForUpdateServiceFactory).IsAssignableFrom(x));

            if (serviceFactoryType == null)
            {
                updateService = null;
                return(false);
            }

            var serviceFactory = (ICheckForUpdateServiceFactory)Activator.CreateInstance(serviceFactoryType);

            updateService = serviceFactory.Create(TheProduct.Name, TheProduct.Version, Product.Resources.ProductIcon);
            return(true);
        }
コード例 #2
0
        internal bool TryCreate(string updateAsmPath, out ICheckForUpdatesService updateService)
        {
            Assembly updateAsm = Assembly.LoadFrom(updateAsmPath);

            var serviceFactoryType = updateAsm.GetTypes().SingleOrDefault(x => typeof (ICheckForUpdateServiceFactory).IsAssignableFrom(x));

            if (serviceFactoryType == null)
            {
                updateService = null;
                return false;
            }

            var serviceFactory = (ICheckForUpdateServiceFactory) Activator.CreateInstance(serviceFactoryType);

            updateService = serviceFactory.Create(TheProduct.Name, TheProduct.Version, Product.Resources.ProductIcon);
            return true;
        }
コード例 #3
0
        public void OnLoad(ISsmsExtendedFunctionalityProvider provider)
        {
            AssemblyLoadHandler.Initialize();
            LogConfigurator.InitializeForHost();

            var ssmsProvider = (ISsmsFunctionalityProvider6) provider;
            var ssmsQueryWindowManager = ssmsProvider.GetQueryWindowManager();
            m_CheckForUpdatesService = GetBestCheckForUpdateService();

            ObjectFactory.Bind<ISsmsFunctionalityProvider6>().ToConstant(ssmsProvider);
            ObjectFactory.Bind<ISsmsQueryWindowManager>().ToConstant(ssmsQueryWindowManager);
            ObjectFactory.Bind<Dispatcher>().ToConstant(Dispatcher.CurrentDispatcher).InSingletonScope();

            AddObjectExplorerMenuItems(ssmsProvider);
            AddQueryWindowContextItems(ssmsQueryWindowManager);
            AddToolbarItems(ssmsProvider);
            AddToolsMenuItems(ssmsProvider);

            m_CheckForUpdatesService.OnStartup();

            s_Logger.Debug("Loaded");
        }
コード例 #4
0
        public void OnLoad(ISsmsExtendedFunctionalityProvider provider)
        {
            AssemblyLoadHandler.Initialize();
            LogConfigurator.InitializeForHost();

            var ssmsProvider           = (ISsmsFunctionalityProvider6)provider;
            var ssmsQueryWindowManager = ssmsProvider.GetQueryWindowManager();

            m_CheckForUpdatesService = GetBestCheckForUpdateService();

            ObjectFactory.Bind <ISsmsFunctionalityProvider6>().ToConstant(ssmsProvider);
            ObjectFactory.Bind <ISsmsQueryWindowManager>().ToConstant(ssmsQueryWindowManager);
            ObjectFactory.Bind <Dispatcher>().ToConstant(Dispatcher.CurrentDispatcher).InSingletonScope();

            AddObjectExplorerMenuItems(ssmsProvider);
            AddQueryWindowContextItems(ssmsQueryWindowManager);
            AddToolbarItems(ssmsProvider);
            AddToolsMenuItems(ssmsProvider);

            m_CheckForUpdatesService.OnStartup();

            s_Logger.Debug("Loaded");
        }