상속: System.Configuration.ConfigurationSection
        public virtual void OnBindToElement(AppSettingsSection appSettings, CommanderSection commanderSettings, NamedConfigurationElement element)
        {
            var handler = BindToElement;
            if (handler != null)
            {
				handler(this, new BindToElementEventArgs(appSettings, commanderSettings, element));
            }
        }
        public virtual void OnBindToElementCollection(AppSettingsSection appSettings, CommanderSection commanderSettings, CurrentConfigurationElementCollection elementCollection)
        {
            var handler = BindToElementCollection;
            if (handler != null)
            {
				handler(this, new BindToElementCollectionEventArgs(appSettings, commanderSettings, elementCollection));
            }
        }
		public CommanderManager(ExportProvider container, AppSettingsSection appSettings, CommanderSection commanderSettings, IEnhancedFileSystemWatcherFactory enhancedFileSystemWatcherFactory)
		{
			NLogAppender.Initialize();

            _container = container;
			_appSettings = appSettings;
            _commanderSettings = commanderSettings;
			_folderWatcherService = new FolderWatcherService(enhancedFileSystemWatcherFactory);
			IsRunning = false;
        }
		/// <summary>
		/// Get the project that the file match element belongs too.
		/// </summary>
		/// <param name="commanderSettings"></param>
		/// <param name="fileMatchElement"></param>
		/// <returns></returns>
		private ProjectElement GetProjectElement(CommanderSection commanderSettings, FileMatchElement fileMatchElement)
		{
			var project = commanderSettings.Projects.Cast<ProjectElement>()
				.Where(x => x.Folders.Cast<FolderElement>()
								.Where(y => y.FileMatches.Cast<FileMatchElement>()
												.Where(z => z == fileMatchElement)
												.Any())
								.Any())
				.First();

			return project;
		}
예제 #5
0
		/// <summary>
		/// Get the project element for a plugin.
		/// </summary>
		/// <param name="commanderSettings"></param>
		/// <param name="namedConfigurationElement"></param>
		/// <returns>The project element for the plugin.</returns>
		private ProjectElement GetCurrentProjectElement(CommanderSection commanderSettings, NamedConfigurationElement namedConfigurationElement)
		{
			if (namedConfigurationElement is FolderElement)
			{
				var projectElementForFolderElement = commanderSettings.Projects
					.Where(x => x.Folders
						.Where(y => y.Name == namedConfigurationElement.Name)
						.Any()
					)
					.First();

				return projectElementForFolderElement;
			}

			var projectElementForPlugin = commanderSettings.Projects
				.Where(x => x.CommandPlugins
					.SelectMany(y => y.Cast<NamedConfigurationElement>())					
					.Where(z => z.Name == namedConfigurationElement.Name)
					.Any()
				)
				.First();

			return projectElementForPlugin;
		}
예제 #6
0
		public DefaultPaths(AppSettingsSection appSettings, CommanderSection commanderSettings)
		{
			_appSettings = appSettings;
			_commanderSettings = commanderSettings;
		}
		public BindToElementEventArgs(AppSettingsSection appSettings, CommanderSection commanderSettings, NamedConfigurationElement element)
        {
			AppSettings = appSettings;
			CommanderSettings = commanderSettings;
            Element = element;
        }
        public BindToElementCollectionEventArgs(AppSettingsSection appSettings, CommanderSection commanderSettings, CurrentConfigurationElementCollection elementCollection)
        {
			AppSettings = appSettings;
			CommanderSettings = commanderSettings;
            ElementCollection = elementCollection;
        }