public ServerMonitorView(IViewContext viewContext, ServerMonitorViewModel serverMonitorViewModel) : base(viewContext, serverMonitorViewModel, DashboardModule.ModuleName) { InitializeComponent(); DataContext = serverMonitorViewModel; }
public CustomerRemediationView(IViewContext viewContext, CustomerRemediationViewModel customerRemediationViewModel) : base(viewContext, customerRemediationViewModel, Module.ModuleName) { InitializeComponent(); DataContext = customerRemediationViewModel; }
public void Handle(IViewContext context, UserDetailsUpdated domainEvent) { var user = FindInternalUserProfile(domainEvent); user.FirstName = domainEvent.FirstName; user.LastName = domainEvent.LastName; }
public void Handle(IViewContext context, NumberEvent domainEvent) { var aggregateRootId = domainEvent.GetAggregateRootId(); var instance = context.Load <AggregateRootWithLogic>(aggregateRootId); Counter = instance.Counter; }
public ConfigureAuthorisationView(IViewContext viewContext, ConfigurationAuthorisationViewModel configurationAuthorisationViewModel) : base (viewContext, configurationAuthorisationViewModel, Module.ModuleName) { InitializeComponent(); DataContext = configurationAuthorisationViewModel; }
public void Handle(IViewContext context, MemberRegisteredToAssociation domainEvent) { AssociationMembers.Add(new AssociationMember { Id = domainEvent.MemberId }); }
protected override void OnDataBindingComplete(DataGridViewBindingCompleteEventArgs e) { var bindingListSource = DataSource as BindingListSource; var newViewContext = bindingListSource == null ? null : bindingListSource.ViewContext; if (!ReferenceEquals(_viewContext, newViewContext)) { if (_viewContext != null) { DataError -= _viewContext.OnDataError; } _viewContext = newViewContext; if (_viewContext != null) { DataError += _viewContext.OnDataError; } } if (!ReferenceEquals(_bindingListSource, bindingListSource)) { if (_bindingListSource != null) { _bindingListSource.AllRowsChanged -= BindingListSourceOnAllRowsChanged; _bindingListSource.ColumnFormats.FormatsChanged -= OnFormatsChanged; } _bindingListSource = bindingListSource; if (_bindingListSource != null) { _bindingListSource.AllRowsChanged += BindingListSourceOnAllRowsChanged; _bindingListSource.ColumnFormats.FormatsChanged += OnFormatsChanged; } } UpdateColumns(); base.OnDataBindingComplete(e); }
protected override void Initialize(IViewContext context) { ClientId = Guid.NewGuid().ToString(); _removeReportAction = SdlTradosStudio.Application.GetAction <RemoveReportAction>(); _addReportAction = SdlTradosStudio.Application.GetAction <AddReportAction>(); _editReportAction = SdlTradosStudio.Application.GetAction <EditReportAction>(); _openSettingsAction = SdlTradosStudio.Application.GetAction <OpenSettingsAction>(); //_pageSetupAction = SdlTradosStudio.Application.GetAction<PageSetupAction>(); //_printPreviewReportAction = SdlTradosStudio.Application.GetAction<PrintPreviewReportAction>(); _printReportAction = SdlTradosStudio.Application.GetAction <PrintReportAction>(); _refreshAction = SdlTradosStudio.Application.GetAction <RefreshAction>(); _saveAsReportAction = SdlTradosStudio.Application.GetAction <SaveAsReportAction>(); _pathInfo = new PathInfo(); ReportsController = ReportsController.Instance; ReportsController.ReportsChanging += Controller_ReportsChanging; ReportsController.ReportsChanged += Controller_ReportsChanged; ReportsController.ReportsAdded += Controller_ReportsAdded; ReportsController.ReportsRemoved += Controller_ReportsRemoved; ReportsController.ReportsUpdated += Controller_ReportsUpdated; ReportsController.ReportTemplatesChanged += Controller_ReportTemplatesChanged; ActivationChanged += ReportsViewerController_ActivationChanged; }
public TradeServerManagerView(IViewContext viewContext, TradeServerManagerViewModel serverManagerViewModel) : base(viewContext, serverManagerViewModel, ConfigurationModule.ModuleName) { InitializeComponent(); DataContext = serverManagerViewModel; }
public void DispatchToView(IViewContext context, DomainEvent domainEvent, TViewInstance view) { var lastGlobalSequenceNumber = domainEvent.GetGlobalSequenceNumber(); if (lastGlobalSequenceNumber <= view.LastGlobalSequenceNumber) { return; } var domainEventType = domainEvent.GetType(); var dispatcherMethod = _dispatcherMethods .GetOrAdd(domainEventType, type => _dispatchToViewGenericMethod.MakeGenericMethod(domainEventType)); try { _logger.Debug("Dispatching event {0} to {1} with ID {2}", lastGlobalSequenceNumber, view, view.Id); context.CurrentEvent = domainEvent; dispatcherMethod.Invoke(this, new object[] { context, domainEvent, view }); view.LastGlobalSequenceNumber = lastGlobalSequenceNumber; } catch (Exception exception) { throw new ApplicationException(string.Format("Could not dispatch {0} to {1}", domainEvent, view), exception); } }
public ExampleDocumentView(IViewContext viewContext, ExampleDocumentViewModel exampleDocumentViewModel) : base(viewContext, exampleDocumentViewModel, Module.ModuleName) { InitializeComponent(); DataContext = exampleDocumentViewModel; }
public NewDocumentView(IViewContext viewContext, NewDocumentViewModel newDocumentViewModel) : base(viewContext, newDocumentViewModel, Module.ModuleName) { InitializeComponent(); DataContext = newDocumentViewModel; }
public ManageViewsForm(IViewContext viewContext) { InitializeComponent(); ViewContext = viewContext; Icon = ViewContext.ApplicationIcon; RefreshUi(true); }
public void Dispatch(IViewContext viewContext, IEnumerable <DomainEvent> batch, IViewManagerProfiler viewManagerProfiler) { foreach (var e in batch) { _position = e.GetGlobalSequenceNumber(); } }
public ViewEditor(IViewContext viewContext, ViewInfo viewInfo) { InitializeComponent(); ViewContext = viewContext; ViewInfo = OriginalViewInfo = viewInfo; _undoIndex = 0; _undoStack = new List<KeyValuePair<ViewInfo, IList<PropertyPath>>>(); SetViewInfo(ViewInfo, new PropertyPath[0]); tbxViewName.Text = ViewSpec.Name; Icon = ViewContext.ApplicationIcon; _chooseColumnsTab = new ChooseColumnsTab {Dock = DockStyle.Fill}; tabPageColumns.Controls.Add(_chooseColumnsTab); _filterTab = new FilterTab { Dock = DockStyle.Fill }; tabPageFilter.Controls.Add(_filterTab); _sourceTab = new SourceTab{Dock = DockStyle.Fill}; tabPageSource.Controls.Add(_sourceTab); _editorWidgets.AddRange(new ViewEditorWidget[] { _chooseColumnsTab, _filterTab, _sourceTab }); foreach (var tab in _editorWidgets) { tab.SetViewEditor(this); } toolButtonShowAdvanced.Checked = ShowHiddenFields; if (!ShowHiddenFields) { tabControl1.TabPages.Remove(tabPageSource); } }
public void Handle(IViewContext context, UserCreated domainEvent) { UserProfiles.Add(new UserProfile { Id = domainEvent.GetAggregateRootId() }); }
public UserAccountsView(IViewContext viewContext, UserAccountsViewModel userAccountsViewModel) : base(viewContext, userAccountsViewModel, Module.ModuleName) { InitializeComponent(); DataContext = userAccountsViewModel; }
public StrategyManagerView(IViewContext viewContext, StrategyManagerViewModel strategyManagerViewModel) : base(viewContext, strategyManagerViewModel, Module.ModuleName) { InitializeComponent(); DataContext = strategyManagerViewModel; }
public void Handle(IViewContext context, CountingRootIncremented domainEvent) { Console.WriteLine("Loading aggregate root"); var root = context.Load <CountingRoot>(domainEvent.GetAggregateRootId()); Console.WriteLine($"Got the number {root.Number} from it"); Number = root.Number; }
protected override IEnumerable <string> GetViewIds(IViewContext context, DomainEvent e) { yield return("some"); yield return("known"); yield return("ids"); }
public ManageViewsForm(IViewContext viewContext) { InitializeComponent(); ViewContext = viewContext; Icon = ViewContext.ApplicationIcon; chooseViewsControl1.ViewContext = viewContext; UpdateButtons(); }
public TableInformationCollectionView(IViewContext viewContext) : base(viewContext, TableInformationCollectionPresenterFactory.Factory) { InitializeComponent(); DataGridViewDetail = null; BindingSourceDetail = null; Title = "MaterialType"; }
public void Handle(IViewContext context, RootEvent domainEvent) { var aggregateRootId = domainEvent.GetAggregateRootId(); EventCounts[aggregateRootId] = EventCounts.ContainsKey(aggregateRootId) ? EventCounts[aggregateRootId] + 1 : 1; }
public MainFormViewModel(ApplicationContext applicationContext, IViewContext viewContext) { this.applicationContext = applicationContext; this.viewContext = viewContext; BitcoinNode = new BitcoinNodeViewModel(applicationContext, viewContext); PaperWallet = new PaperWalletViewModel(viewContext); }
public void Handle(IViewContext context, AddressAddedToAssociation domainEvent) { var address = new AssociationAddress(); address.MapFromEvent(domainEvent); _addresses.Add(address); }
public static T Get <T>(this IViewContext context) where T : class { if (context == null) { throw new ArgumentNullException("context"); } return(Get <T>(context, typeof(T).FullName)); }
internal Task <T> CreateAndStartAsyncInternal <T>(object arg = null, IControllerFactory factory = null, CancellationToken token = default, IViewContext viewContext = null) where T : ControllerBase { return(CreateAndStartAsyncInternal <T>(typeof(T), arg, factory, token, viewContext)); }
/// <summary> /// Evaluates whether the field should be shown or hidden. If this method returns null, the next filter attribute will be evaluated. /// </summary> public VisibilityMode?CanShow(IViewContext viewContext) { if (ViewNames.Contains(viewContext.ViewName, StringComparer.CurrentCultureIgnoreCase)) { return(Mode); } return(null); }
public AppointmentOrderFactorCollectionView(IViewContext viewContext) : base(viewContext, AppointmentOrderFactorCollectionPresenterFactory.Factory) { InitializeComponent(); DataGridViewDetail = null; BindingSourceDetail = null; Title = "MaterialType"; }
/// <summary> /// Evaluates whether the field should be shown or hidden. If this method returns null, the next filter attribute will be evaluated. /// </summary> public VisibilityMode?CanShow(IViewContext viewContext) { if (viewContext.CurrentUser != null && RoleNames.Any(viewContext.CurrentUser.IsInRole)) { return(Mode); } return(null); }
public void Dispatch(IViewContext viewContext, IEnumerable <DomainEvent> batch, IViewManagerProfiler viewManagerProfiler) { foreach (var e in batch) { _position = e.GetGlobalSequenceNumber(); Console.WriteLine("TestViewManager: position = {0}", _position); } }
public void Handle(IViewContext context, CodeAssignedToAddress domainEvent) { var associationId = domainEvent.GetAggregateRootId(); var address = GetAssociationAddressList(associationId).FirstOrDefault(a => a.Id == domainEvent.AddressId); address.Codes.Add(domainEvent.Code); }
/// <summary> /// Evaluates whether the field should be shown or hidden. If this method returns null, the next filter attribute will be evaluated. /// </summary> public VisibilityMode?CanShow(IViewContext viewContext) { if (viewContext.CurrentUser?.Identity?.IsAuthenticated == true) { return(Mode); } return(null); }
protected override IEnumerable<string> GetViewIds(IViewContext context, DomainEvent e) { if (e is JustAnEvent) { yield return "yay"; } else { throw new ApplicationException("oh noes!!!!"); } }
/// <summary> /// Initializes a new instance of the <see cref="DocumentViewBase"/> class. /// </summary> /// <param name="viewContext">The view context.</param> /// <param name="authorisationViewModel">The view model.</param> /// <param name="moduleName">The mudule name.</param> protected DocumentViewBase(IViewContext viewContext, DocumentViewModel authorisationViewModel, string moduleName) : base(viewContext) { ModuleName = moduleName; authorisationViewModel.ViewModelContext.UiDispatcher = Dispatcher; authorisationViewModel.Activate += ViewModelActivate; authorisationViewModel.ShowMessageWindow += ShowMessageBox; authorisationViewModel.ShowModalWindow += ShowModalWindow; authorisationViewModel.NavigateTarget += NavigateTarget; authorisationViewModel.GetViewModels += GetViewModels; authorisationViewModel.Publish += Publish; }
public ViewColumn(IViewContext viewContext, ColumnPropertyDescriptor columnPropertyDescriptor, DataGridViewCell cellTemplate) : base(cellTemplate) { ViewContext = viewContext; ColumnPropertyDescriptor = columnPropertyDescriptor; SortMode = DataGridViewColumnSortMode.Automatic; if (columnPropertyDescriptor != null) { HeaderText = columnPropertyDescriptor.DisplayName; DataPropertyName = columnPropertyDescriptor.Name; Name = columnPropertyDescriptor.Name; } }
protected override IEnumerable<string> GetViewIds(IViewContext context, DomainEvent e) { if (!(e is NodeAttachedToParentNode)) throw new ArgumentException(String.Format("Can't handle {0}", e)); var node = context.Load<Node>(e.GetAggregateRootId()); while (node.ParentNodeId != null) { node = context.Load<Node>(node.ParentNodeId); } return new[] { node.Id }; }
public SubscriptionViewModel(IViewContext clientViewContext, Guid subscriptionId, SubscriptionKind kind, string paramUri) { _viewContext = new EntileViewContext(clientViewContext); _subscriptionId = subscriptionId; _viewContext.SetValue("SubscriptionId", _subscriptionId); RegisterLinkAction("Unsubscribe", l => { var action = new UnsubscribeCommand(_viewContext, l.Uri); UnsubscribeCommand = action; }); _kind = kind; _paramUri = paramUri; }
protected override IEnumerable<string> GetViewIds(IViewContext context, DomainEvent e) { var handlerMethod = _handlerMethodsByDomainEventType.GetOrAdd(e.GetType(), GetHandlerMethodFor); if (handlerMethod == null) return new string[0]; try { var ids = ((IEnumerable<string>)handlerMethod.Invoke(this, new object[] { context, e })).ToList(); return ids; } catch (Exception exception) { throw new ApplicationException(string.Format("Could not get IDs for domain event {0}!", e), exception); } }
protected override void OnDataBindingComplete(DataGridViewBindingCompleteEventArgs e) { var bindingListSource = DataSource as BindingListSource; var newViewContext = bindingListSource == null ? null : bindingListSource.ViewContext; if (!ReferenceEquals(_viewContext, newViewContext)) { if (_viewContext != null) { DataError -= _viewContext.OnDataError; } _viewContext = newViewContext; if (_viewContext != null) { DataError += _viewContext.OnDataError; } } UpdateColumns(); base.OnDataBindingComplete(e); }
public void SetViewContext(IViewContext viewContext, ViewInfo viewInfo) { ViewContext = viewContext; if (null == viewInfo) { BindingListView.ViewInfo = null; } else { IEnumerable rowSource = null; if (null != ViewInfo) { if (ViewInfo.RowSourceName == viewInfo.RowSourceName) { rowSource = RowSource; } } rowSource = rowSource ?? viewContext.GetRowSource(viewInfo); BindingListView.SetViewAndRows(viewInfo, rowSource); } OnListChanged(new ListChangedEventArgs(ListChangedType.Reset, -1)); }
public BitcoinNodeViewModel(ApplicationContext applicationContext, IViewContext viewContext) { this.applicationContext = applicationContext; this.viewContext = viewContext; UpdateValues(); }
/// <summary> /// Initializes a new instance of the <see cref="ViewBase"/> class. /// </summary> /// <param name="viewContext">The view context.</param> protected ViewBase(IViewContext viewContext) { ViewContext = viewContext; Logger = ViewContext.Logger; }
protected override IEnumerable<string> GetViewIds(IViewContext context, DomainEvent e) { return ViewInstanceIds; }
public void OnBeforeView(IView view, IViewContext viewContext) { var startDateTime = DateTime.UtcNow; var actionDescriptor = ConvertActionDescriptor(viewContext.ActionDescriptor); var message = new BeforeActionViewInvokedMessage { ActionId = actionDescriptor.Id, ActionName = actionDescriptor.Name, ActionControllerName = actionDescriptor.ControllerName, ViewPath = view.Path, //ViewData = new ViewResult { // TODO: because we switch threads, we need to make sure we get // ViewData = result.ViewData, // what we need off the thread before publishing // TempData = result.TempData //}, ViewStartTime = startDateTime }; _broker.BeginLogicalOperation(message, startDateTime); _broker.SendMessage(message); }
public void OnAfterView(IView view, IViewContext viewContext) { var timing = _broker.EndLogicalOperation<BeforeActionViewInvokedMessage>(); if (timing != null) { var actionDescriptor = ConvertActionDescriptor(viewContext.ActionDescriptor); var message = new AfterActionViewInvokedMessage { ActionId = actionDescriptor.Id, ActionName = actionDescriptor.Name, ActionControllerName = actionDescriptor.ControllerName, ViewEndTime = timing.End, ViewDuration = timing.Elapsed, ViewOffset = timing.Offset }; _broker.SendMessage(message); } else { _logger.LogCritical("OnAfterView: Couldn't publish `AfterActionViewInvokedMessage` as `BeforeActionViewInvokedMessage` wasn't found in stack"); } }
/// <summary> /// Initializes a new instance of the <see cref="ModalViewBase"/> class. /// </summary> /// <param name="viewContext"></param> protected ModalViewBase(IViewContext viewContext) : base(viewContext) { }
protected override IEnumerable<string> GetViewIds(IViewContext context, DomainEvent e) { return e.Meta.Keys.ToArray(); }
protected override IEnumerable<string> GetViewIds(IViewContext context, DomainEvent e) { return new[] {e.Meta[DomainEvent.MetadataKeys.AggregateRootId]}; }
public ClientQuery(IViewContext viewContext, string uri) : base(viewContext, uri) { }
public RegisterClientCommand(IViewContext viewContext, string uri) : base(viewContext, uri) { }
public ViewColumn(IViewContext viewContext, ColumnPropertyDescriptor columnPropertyDescriptor) : this(viewContext, columnPropertyDescriptor, new ViewCell()) { }
public UnsubscribeCommand(IViewContext viewContext, string uri) : base(viewContext, uri) { }
public ExampleModalView(IViewContext viewContext) : base(viewContext) { InitializeComponent(); }
protected override void Initialize(IViewContext context) { ActivationChanged += JobsView_ActivationChanged; }