private void CreateCommandsOnNode(ConfigurationNode node, PropertyInfo[] properties)
        {
            IStorageService storageService = ServiceHelper.GetCurrentStorageService(ServiceProvider);

            foreach (PropertyInfo property in properties)
            {
                StorageCreationAttribute[] storageCreationAttributes = (StorageCreationAttribute[])property.GetCustomAttributes(typeof(StorageCreationAttribute), true);
                foreach (StorageCreationAttribute storageCreationAttribute in storageCreationAttributes)
                {
                    StorageCreationCommand cmd = storageCreationAttribute.CreateCommand(node, property, ServiceProvider);
                    if (!storageService.Contains(cmd.Name))
                    {
                        storageService.Add(cmd);
                    }
                }
            }
        }
예제 #2
0
 /// <devdoc>
 /// Adds a StorageCreationCommand to the table.
 /// </devdoc>
 public void Add(StorageCreationCommand storageCreationCommand)
 {
     storageCommands.Add(storageCreationCommand.Name.ToLower(CultureInfo.InvariantCulture), storageCreationCommand);
 }
 /// <summary>
 /// <para>Adds the specified configuration data for the specified configuration section name.</para>
 /// </summary>
 /// <param name="name"><para>The name of a <see cref="StorageCreationCommand"/>.</para></param>
 /// <param name="storageCreationCommand"><para>A <see cref="StorageCreationCommand"/> object.</para></param>
 public void Add(string name, StorageCreationCommand storageCreationCommand)
 {
     base.Dictionary.Add(name, storageCreationCommand);
 }
 private void ExecuteStorageCommand(StorageCreationCommand cmd)
 {
     cmd.Execute();
 }
 /// <summary>
 /// <para>Adds the specified configuration data for the specified configuration section name.</para>
 /// </summary>
 /// <param name="name"><para>The name of a <see cref="StorageCreationCommand"/>.</para></param>
 /// <param name="storageCreationCommand"><para>A <see cref="StorageCreationCommand"/> object.</para></param>
 public void Add(string name, StorageCreationCommand storageCreationCommand)
 {
     base.Dictionary.Add(name, storageCreationCommand);
 }
예제 #6
0
 /// <summary>
 /// Adds a <see cref="StorageCreationCommand"/> to the table.
 /// </summary>
 /// <param name="storageCreationCommand">
 /// The <see cref="StorageCreationCommand"/> to add.
 /// </param>
 public void Add(StorageCreationCommand storageCreationCommand)
 {
     storageCommands.Add(storageCreationCommand.Name.ToLower(CultureInfo.InvariantCulture),  storageCreationCommand);
 }
 private void ExecuteStorageCommand(StorageCreationCommand cmd)
 {
     cmd.Execute();
 }