Ejemplo n.º 1
0
        public virtual ICmdExecutor CreateForCommand(IInstallCmd command)
        {
            foreach (var pair in CommandToExecutorsMap)
            {
                if (pair.Key.IsInstanceOfType(command))
                {
                    var argument         = new ConstructorArgument("command", command);
                    var executorInstance = (ICmdExecutor)kernel.Get(pair.Value, argument);

                    return(executorInstance);
                }
            }

            throw new InvalidOperationException("Cannot create an executor for the provided command");
        }
Ejemplo n.º 2
0
        //protected void SaveContainerChanges(IContainerFile container, CancellationToken token)
        //{
        //    //Trzeba pomyśleć o innej ścieżce dla tego komunikatu, bo ta jest pełna i powoduje zbyt duże
        //    //zmiany długosci wyswietlanych komunikatów w interfejsie, poza tym jest pełna, a wyswietlane sa relatywne.
        //    CurrentMessage = String.Format(
        //        Properties.Resources.RebuildingParametrizedMsg,
        //        container.Path);

        //    ContainerWriterService.WriteFile(container, token);
        //}

        protected IEnumerable <String> GetPathsOfContentFiles(IInstallCmd cmd)
        {
            var contentFilesPaths = new List <String>();

            var nestedTargetCmd = cmd as IHasNestedTarget;

            if (nestedTargetCmd != null && nestedTargetCmd.UsesNestedTargetContent)
            {
                contentFilesPaths.Add(nestedTargetCmd.NestedTargetPath.LastPart);
            }

            var nestedSourceCmd = cmd as IHasNestedSource;

            if (nestedSourceCmd != null && nestedSourceCmd.UsesNestedSourceContent)
            {
                contentFilesPaths.Add(nestedSourceCmd.NestedSourcePath.LastPart);
            }

            return(contentFilesPaths);
        }