/// <summary>
        /// Creates the commands and adds them to the <see cref="IStorageService"/>.
        /// </summary>
        /// <param name="node">The node to execute the command upon.</param>
        protected override void ExecuteCore(ConfigurationNode node)
        {
            // clear out the service first since we are going to refill it
            IStorageService storageService = ServiceHelper.GetCurrentStorageService(ServiceProvider);

            storageService.Clear();
            CreateCommands(node);
        }
        private string GetFileToSave()
        {
            string file = File;

            if (!System.IO.Path.IsPathRooted(file))
            {
                file = System.IO.Path.Combine(System.IO.Path.GetDirectoryName(ServiceHelper.GetCurrentStorageService(Site).ConfigurationFile), file);
            }
            return(file);
        }
        private bool CreateConfigurationFile()
        {
            // set the configuration file here for the service
            IStorageService service = ServiceHelper.GetCurrentStorageService(ServiceProvider);

            service.ConfigurationFile = ServiceHelper.GetCurrentRootNode(ServiceProvider).ConfigurationFile;
            ConfigurationFileStorageCreationCommand cmd = new ConfigurationFileStorageCreationCommand(service.ConfigurationFile, ServiceProvider);

            cmd.Execute();
            if (cmd.CreationCancled)
            {
                return(false);
            }
            return(true);
        }
        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);
                    }
                }
            }
        }