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)); }
public IFeatureBranch CreateFeatureBranch(Folders.FeatureFolder folder, IMainBranch owner) { return(new FeatureBranch(folder, owner, _serviceLocator)); }
public FeatureBranch(Folders.FeatureFolder folder, IMainBranch owner, IServiceLocator serviceLocator) { _featureFolder = folder; this.Owner = owner; _serviceLocator = serviceLocator; }