Ejemplo n.º 1
0
        public void CreateFeatureBranch(string name, IEnumerable <ILogicalComponent> components, Action <ProgressCallbackData> progressCallback)
        {
            if (string.IsNullOrEmpty(name))
            {
                throw new ArgumentNullException(nameof(name), "You must provide a name for the feature branch");
            }

            if (components == null)
            {
                throw new ArgumentNullException(nameof(components), "A feature branch must have at least one component");
            }

            if (!components.Any())
            {
                throw new ArgumentException(nameof(components), "A feature branch must have at least one component");
            }

            Folders.FeatureFolder featureFolder = Location.Features.Feature(name).Create();

            new BranchBuilder(featureFolder, components, GetMainFolder(), progressCallback).Build();

            var featureBranch = ServiceLocator.GetInstance <ILogicalBranchComponentFactory>().CreateFeatureBranch(featureFolder, this);

            PubSubMediator.Publish(new Interfaces.Events.NewFeatureBranchEventData(featureBranch, this));
        }
Ejemplo n.º 2
0
 public IFeatureBranch CreateFeatureBranch(Folders.FeatureFolder folder, IMainBranch owner)
 {
     return(new FeatureBranch(folder, owner, _serviceLocator));
 }
Ejemplo n.º 3
0
 public FeatureBranch(Folders.FeatureFolder folder, IMainBranch owner, IServiceLocator serviceLocator)
 {
     _featureFolder  = folder;
     this.Owner      = owner;
     _serviceLocator = serviceLocator;
 }