コード例 #1
0
 public PasteTaggedValuesCommand(IReadableAtom <TaggedValuesClipboard> clipboard, ModelEntityRepository repo)
 {
     Clipboard = clipboard;
     Repo      = repo;
 }
コード例 #2
0
ファイル: EAAddIn.cs プロジェクト: yjstyle/ADMentor
 public abstract Tuple <Option <IEntityWrapper>, IEnumerable <ValidationRule> > Bootstrap(IReadableAtom <EA.Repository> repository);
コード例 #3
0
        public override Tuple <Option <IEntityWrapper>, IEnumerable <ValidationRule> > Bootstrap(IReadableAtom <EA.Repository> repository)
        {
            var entityWrapper    = new AdEntityWrapper();
            var entityRepository = new AdRepository(repository, entityWrapper);

            var exportCmd = new ExportToADRepoCommand(entityRepository);

            Register(new Menu("AD Repo Connector",
                              new MenuItem("Export to AD Repo", exportCmd.ToMenuHandler())));

            return(Tuple.Create(
                       Options.Some(entityWrapper as IEntityWrapper),
                       Enumerable.Empty <ValidationRule>()));
        }
コード例 #4
0
ファイル: XmlExporter.cs プロジェクト: yjstyle/ADMentor
 public Factory(ModelEntityRepository repo, IReadableAtom <EA.Repository> eaRepo)
 {
     Repo   = repo;
     EaRepo = eaRepo;
 }
コード例 #5
0
 public ContextItemHandler(Atom <Option <ModelEntity> > ci, IReadableAtom <EA.Repository> repo, IReadableAtom <IEntityWrapper> wrapper)
 {
     repository    = repo;
     entityWrapper = wrapper;
     contextItem   = ci;
 }
コード例 #6
0
ファイル: AdRepository.cs プロジェクト: yjstyle/ADMentor
 public AdRepository(IReadableAtom <EA.Repository> repo, IEntityWrapper wrapper) : base(repo, wrapper)
 {
 }
コード例 #7
0
ファイル: MenuHandler.cs プロジェクト: yjstyle/ADMentor
 public MenuHandler(IReadableAtom <Option <ModelEntity> > contextItem)
 {
     ContextItem = contextItem;
 }
コード例 #8
0
 public PasteTaggedValuesIntoChildrenCommand(IReadableAtom <TaggedValuesClipboard> clipboard, ModelEntityRepository repo)
 {
     Clipboard = clipboard;
     Repo      = repo;
     Form      = new SelectDescendantsForm();
 }
コード例 #9
0
 public ModelEntityRepository(IReadableAtom <EA.Repository> repo, IEntityWrapper wrapper)
 {
     Repo    = repo;
     Wrapper = wrapper;
 }
コード例 #10
0
ファイル: ValidationHandler.cs プロジェクト: yjstyle/ADMentor
 public ValidationHandler(IReadableAtom <EA.Repository> repository, IEnumerable <ValidationRule> rules)
 {
     Repository = repository;
     Rules      = rules;
 }
コード例 #11
0
        public override Tuple <Option <IEntityWrapper>, IEnumerable <ValidationRule> > Bootstrap(IReadableAtom <EA.Repository> eaRepository)
        {
            var entityWrapper    = new AdEntityWrapper();
            var entityRepository = new AdRepository(eaRepository, entityWrapper);
            var migrator         = new Migrator(technology);

            var tvClipboard = new Atom <TaggedValuesClipboard>(new TaggedValuesClipboard());

            var updateMetadataCommand            = new UpdateMetadataOfNewElementsCommand(entityRepository);
            var updateStateOnAlternativesChanged = new UpdateProblemOccurrenceStateOnAlternativesChanged(entityRepository);
            var updateStateOnAlternativesAdded   = new UpdateProblemOccurrenceStateOnAlternativesAdded(entityRepository);
            var updateStateOnRemoveAlternative   = new UpdateProblemOccurrenceStateOnAlternativeRemoved(entityRepository);
            var populateDependenciesCommand      = new PopulateDependenciesCommand(
                entityRepository, new DependencySelectorForm(entityRepository));
            var instantiateProblemSpace = new InstantiateProblemSpaceCommand(entityRepository, new InstantiateSolutionForm());
            var exportProblemSpace      = new ExportProblemSpaceCommand(
                entityRepository, new TailorPackageExportForm(), new XmlExporter.Factory(entityRepository, eaRepository), new SelectExportPathDialog());

            Register(new Menu(AddInName,
                              new MenuItem("Copy Tagged Values",
                                           new CopyTaggedValuesCommand(tvClipboard).ToMenuHandler()),
                              new MenuItem("Paste Tagged Values",
                                           new PasteTaggedValuesCommand(tvClipboard, entityRepository).ToMenuHandler()),
                              new MenuItem("Paste Tagged Values into Descendant Elements",
                                           new PasteTaggedValuesIntoChildrenCommand(tvClipboard, entityRepository).ToMenuHandler()),
                              new Separator(),
                              new MenuItem("Choose Selected and Neglect not chosen Alternatives",
                                           new ChooseOptionOccurrenceCommand <Unit>(entityRepository, updateStateOnAlternativesChanged).ToMenuHandler()),
                              new MenuItem("Neglect all Alternatives",
                                           new NeglectAllOptionsCommand(entityRepository).ToMenuHandler()),
                              new Separator(),
                              new MenuItem("Tailor Problem Space",
                                           exportProblemSpace.ToMenuHandler()),
                              new MenuItem("Create Solution Space from Problem Space",
                                           instantiateProblemSpace.ToMenuHandler()),
                              new MenuItem("Locate Option/Problem",
                                           new GoToClassifierCommand(entityRepository).ToMenuHandler()),
                              new MenuItem("Establish Dependencies from Problem Space",
                                           populateDependenciesCommand.ToMenuHandler()),
                              new MenuItem("Migrate Element(s) to Current Model Version",
                                           new MigrateModelEntitiesCommand(migrator).ToMenuHandler()),
                              new Separator(),
                              new MenuItem("Package Metrics",
                                           new AnalysePackageCommand(entityRepository, new DisplayMetricsForm()).ToMenuHandler())));

            OnEntityCreated.Add(updateMetadataCommand.ToEntityCreatedHandler());
            OnEntityCreated.Add(updateStateOnAlternativesAdded.ToEntityCreatedHandler());

            OnEntityModified.Add(updateStateOnAlternativesChanged.ToEntityModifiedHandler());

            OnDeleteEntity.Add(updateStateOnRemoveAlternative.AsOnDeleteEntityHandler());

            var rules = new[] {
                ValidationRule.FromCommand(AddInName, new ValidateProblemOptionCompositionCommand(entityRepository)),
                ValidationRule.FromCommand(AddInName, new ValidateProblemOccurrenceStateCommand(entityRepository)),
                ValidationRule.FromCommand(AddInName, new ValidateConflictingOptionsCommand(entityRepository)),
                ValidationRule.FromCommand(AddInName, new MultipleProblemsAddressedByAnOptionCommand(entityRepository)),
                ValidationRule.FromCommand(AddInName, migrator.GetValidator()),
                new ElementNotUsedDiagramRule(AddInName, entityRepository)
            };

            return(Tuple.Create(
                       Options.Some(entityWrapper as IEntityWrapper),
                       rules.AsEnumerable()));
        }