コード例 #1
0
ファイル: AddInTree.cs プロジェクト: vu111293/pat-design
        static AddInTree()
        {
            doozers.Add("Class", new ClassDoozer());
            doozers.Add("FileFilter", new FileFilterDoozer());
            doozers.Add("String", new StringDoozer());
            doozers.Add("Icon", new IconDoozer());
            doozers.Add("MenuItem", new MenuItemDoozer());
            doozers.Add("ToolbarItem", new ToolbarItemDoozer());
            doozers.Add("Include", new IncludeDoozer());

            conditionEvaluators.Add("Compare", new CompareConditionEvaluator());
            conditionEvaluators.Add("Ownerstate", new OwnerStateConditionEvaluator());

            ApplicationStateInfoService.RegisterStateGetter("Installed 3rd party AddIns", GetInstalledThirdPartyAddInsListAsString);
        }
コード例 #2
0
        /// <summary>
        /// Starts the core services.
        /// This initializes the PropertyService and ResourceService.
        /// </summary>
        public void StartCoreServices(IPropertyService propertyService)
        {
            var container = ServiceSingleton.GetRequiredService <IServiceContainer>();
            var applicationStateInfoService = new ApplicationStateInfoService();

            addInTree = new AddInTreeImpl(applicationStateInfoService);

            container.AddService(typeof(IPropertyService), propertyService);
            container.AddService(typeof(IResourceService), new ResourceServiceImpl(
                                     Path.Combine(propertyService.DataDirectory, "resources"), propertyService));
            container.AddService(typeof(IAddInTree), addInTree);
            container.AddService(typeof(ApplicationStateInfoService), applicationStateInfoService);
            StringParser.RegisterStringTagProvider(new AppNameProvider {
                appName = applicationName
            });
        }
コード例 #3
0
ファイル: CoreStartup.cs プロジェクト: Paccc/SharpDevelop
		/// <summary>
		/// Starts the core services.
		/// This initializes the PropertyService and ResourceService.
		/// </summary>
		public void StartCoreServices(IPropertyService propertyService)
		{
			var container = ServiceSingleton.GetRequiredService<IServiceContainer>();
			var applicationStateInfoService = new ApplicationStateInfoService();
			addInTree = new AddInTreeImpl(applicationStateInfoService);
			
			container.AddService(typeof(IPropertyService), propertyService);
			container.AddService(typeof(IResourceService), new ResourceServiceImpl(
				Path.Combine(propertyService.DataDirectory, "resources"), propertyService));
			container.AddService(typeof(IAddInTree), addInTree);
			container.AddService(typeof(ApplicationStateInfoService), applicationStateInfoService);
			StringParser.RegisterStringTagProvider(new AppNameProvider { appName = applicationName });
		}
コード例 #4
0
        /// <summary>
        /// Starts the core services.
        /// This initializes the PropertyService and ResourceService.
        /// </summary>
        /// <returns>A list containing service types and the corresponding instances.</returns>
        public Tuple<IEnumerable<KeyValuePair<Type, Type>>, IEnumerable<KeyValuePair<Type, object>>> StartCoreServices()
        {
            if(config_directory == null)
                config_directory = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),
                                               application_name);

            var property_service = new PropertyServiceImpl(
                DirectoryName.Create(config_directory),
                DirectoryName.Create(data_directory ?? Path.Combine(FileUtility.ApplicationRootPath, "data")),
                properties_name);
            var application_state_info_service = new ApplicationStateInfoService();
            addInTree = new AddInTreeImpl(application_state_info_service);

            var services = new List<KeyValuePair<Type, Type>>();
            var instances = new List<KeyValuePair<Type, object>>();
            instances.Add(new KeyValuePair<Type,object>(typeof(IPropertyService), property_service));
            //instances.Add(new KeyValuePair<Type,object>(typeof(IResourceService), new ResourceServiceImpl(
            //    Path.Combine(property_service.DataDirectory, "resources"), property_service)));
            instances.Add(new KeyValuePair<Type,object>(typeof(IAddInTree), addInTree));

            services.Add(new KeyValuePair<Type,Type>(typeof(ApplicationStateInfoService), typeof(ApplicationStateInfoService)));
            StringParser.RegisterStringTagProvider(new AppNameProvider{AppName = application_name});

            return Tuple.Create((IEnumerable<KeyValuePair<Type, Type>>)services, (IEnumerable<KeyValuePair<Type, object>>)instances);
        }