Пример #1
0
 public RuleFactory(
     IServiceLocator containerGetter,
     IEventAggregator eventAggregator,
     IRuleExecutorFactory ruleExecutorFactory,
     IRulePreviewView rulePReviewView)
 {
     this.containerGetter     = containerGetter;
     this.eventAggregator     = eventAggregator;
     this.ruleExecutorFactory = ruleExecutorFactory;
     this.rulePReviewView     = rulePReviewView;
 }
        public GeneratorRulePresenter(IRulePreviewView rulePreviewView, IEventAggregator eventAggregator)
        {
            Name = "Fake Data Generator";

            _subscriptions.AddRange(new[]
            {
                eventAggregator.GetEvent <NodePreviewRequestedEvent>()
                .Where(n => n.Id == this.View?.Id)
                .Subscribe(n =>
                {
                    rulePreviewView.SetText("TODODO");
                })
            });
        }
Пример #3
0
        public FakeDataPluginControl(
            IEventAggregator eventAggregator,
            IRuleFactory ruleFactory,
            IRuleEditView ruleEditView,
            IRulePreviewView rulePreviewView,
            IRulesTreeView rulesTreeView,
            IServiceLocator containerGetter)
        {
            InitializeComponent();

            containerGetter.RegisterOrganizationServiceFactory(() => Service);

            var rulesTreeViewControl = rulesTreeView.ToControl();

            this.tableLayoutPanel1.Controls.Add(rulesTreeViewControl, 0, 0);
            rulesTreeViewControl.Dock = DockStyle.Fill;

            var ruleEditControl = ruleEditView.ToControl();

            this.tableLayoutPanel1.Controls.Add(ruleEditControl);
            ruleEditControl.Dock = DockStyle.Fill;

            var rulePreviewControl = rulePreviewView.ToControl();

            this.scMain.Panel2.Controls.Add(rulePreviewControl);
            rulePreviewControl.Dock = DockStyle.Fill;

            this.eventAggregator = eventAggregator;

            // TODO: ten rule factory jeszcze stąd wywalić jakos
            this.ruleFactory     = ruleFactory;
            this.ruleEditView    = ruleEditView;
            this.rulesTreeView   = rulesTreeView;
            this.containerGetter = containerGetter;
            var rootRule = this.ruleFactory.Create();

            rulesTreeView.AddRoot(rootRule.View);
        }