/// <summary> /// Initializes a new instance of the <see cref="RoleBrowserViewModel"/> class. /// </summary> /// <param name="session">the associated session</param> /// <param name="siteDir">The unique <see cref="SiteDirectory"/></param> /// <param name="thingDialogNavigationService">The <see cref="IThingDialogNavigationService"/> that allows to navigate to <see cref="CDP4Common.CommonData.Thing"/> dialog view models</param> /// <param name="panelNavigationService">The <see cref="IPanelNavigationService"/> that allows to navigate to Panels</param> /// <param name="dialogNavigationService">The <see cref="IDialogNavigationService"/></param> /// <param name="pluginSettingsService"> /// The <see cref="IPluginSettingsService"/> used to read and write plugin setting files. /// </param> public RoleBrowserViewModel(ISession session, SiteDirectory siteDir, IThingDialogNavigationService thingDialogNavigationService, IPanelNavigationService panelNavigationService, IDialogNavigationService dialogNavigationService, IPluginSettingsService pluginSettingsService) : base(siteDir, session, thingDialogNavigationService, panelNavigationService, dialogNavigationService, pluginSettingsService) { this.Caption = string.Format("{0}, {1}", PanelCaption, this.Thing.Name); this.ToolTip = string.Format("{0}\n{1}\n{2}", this.Thing.Name, this.Thing.IDalUri, this.Session.ActivePerson.Name); }
/// <summary> /// Returns an instance of the <see cref="FiniteStateBrowserRibbonViewModel"/> class /// </summary> /// <param name="iteration">The <see cref="Iteration"/> containing the information</param> /// <param name="session">The <see cref="ISession"/></param> /// <param name="thingDialogNavigationService">The <see cref="IThingDialogNavigationService"/></param> /// <param name="panelNavigationService">The <see cref="IPanelNavigationService"/></param> /// <param name="pluginSettingsService"> /// The <see cref="IPluginSettingsService"/> used to read and write plugin setting files. /// </param> /// <returns>An instance of <see cref="OptionBrowserViewModel"/></returns> public static FiniteStateBrowserViewModel InstantiatePanelViewModel(Iteration iteration, ISession session, IThingDialogNavigationService thingDialogNavigationService, IPanelNavigationService panelNavigationService, IDialogNavigationService dialogNavigationService, IPluginSettingsService pluginSettingsService) { return(new FiniteStateBrowserViewModel(iteration, session, thingDialogNavigationService, panelNavigationService, dialogNavigationService, pluginSettingsService)); }
/// <summary> /// Initializes a new instance of the <see cref="OrdinalScaleDialogViewModel"/> class /// </summary> /// <param name="ordinalScale"> /// The <see cref="OrdinalScale"/> that is the subject of the current view-model. This is the object /// that will be either created, or edited. /// </param> /// <param name="transaction"> /// The <see cref="ThingTransaction"/> that contains the log of recorded changes. /// </param> /// <param name="session"> /// The <see cref="ISession"/> in which the current <see cref="Thing"/> is to be added or updated /// </param> /// <param name="isRoot"> /// Assert if this <see cref="DialogViewModelBase{T}"/> is the root of all <see cref="DialogViewModelBase{T}"/> /// </param> /// <param name="dialogKind"> /// The kind of operation this <see cref="DialogViewModelBase{T}"/> performs /// </param> /// <param name="thingDialogNavigationService"> /// The <see cref="IThingDialogNavigationService"/> that is used to navigate to a dialog of a specific <see cref="Thing"/>. /// </param> /// <param name="container"> /// The <see cref="Thing"/> that contains the created <see cref="Thing"/> in this Dialog /// </param> /// <param name="chainOfContainers"> /// The optional chain of containers that contains the <paramref name="container"/> argument /// </param> public OrdinalScaleDialogViewModel(OrdinalScale ordinalScale, IThingTransaction transaction, ISession session, bool isRoot, ThingDialogKind dialogKind, IThingDialogNavigationService thingDialogNavigationService, Thing container, IEnumerable <Thing> chainOfContainers) : base(ordinalScale, transaction, session, isRoot, dialogKind, thingDialogNavigationService, container, chainOfContainers) { if (container != null) { var containerThing = container as ReferenceDataLibrary; if (containerThing == null) { var errorMessage = string.Format( "The container parameter is of type {0}, it shall be of type ReferenceDataLibrary", container.GetType()); throw new ArgumentException(errorMessage); } } }
/// <summary> /// Initializes a new instance of the <see cref="ReferencerRuleDialogViewModel"/> class. /// </summary> /// <param name="referencerRule"> /// The <see cref="CDP4Common.SiteDirectoryData.ReferencerRule"/> that is the subject of the current view-model. This is the object /// that will be either created, or edited. /// </param> /// <param name="transaction"> /// The <see cref="ThingTransaction"/> that contains the log of recorded changes. /// </param> /// <param name="session"> /// The <see cref="ISession"/> in which the current <see cref="CDP4Common.CommonData.Thing"/> is to be added or updated /// </param> /// <param name="isRoot"> /// Assert if this <see cref="ReferencerRuleDialogViewModel"/> is the root of all <see cref="IThingDialogViewModel"/> /// </param> /// <param name="dialogKind"> /// The kind of operation this <see cref="ReferencerRuleDialogViewModel"/> performs /// </param> /// <param name="thingDialogNavigationService"> /// The <see cref="IThingDialogNavigationService"/> that is used to navigate to a dialog of a specific <see cref="Thing"/>. /// </param> /// <param name="container"> /// The Container <see cref="CDP4Common.CommonData.Thing"/> of the created <see cref="CDP4Common.SiteDirectoryData.ReferencerRule"/> /// </param> /// <param name="chainOfContainers"> /// The optional chain of containers that contains the <paramref name="container"/> argument /// </param> public ReferencerRuleDialogViewModel(ReferencerRule referencerRule, IThingTransaction transaction, ISession session, bool isRoot, ThingDialogKind dialogKind, IThingDialogNavigationService thingDialogNavigationService, Thing container = null, IEnumerable<Thing> chainOfContainers = null) : base(referencerRule, transaction, session, isRoot, dialogKind, thingDialogNavigationService, container, chainOfContainers) { }
/// <summary> /// Initializes a new instance of the <see cref="RequirementsSpecificationEditorViewModel"/> class /// </summary> /// <param name="thing">The <see cref="RequirementsSpecification"/> that is represented by the current view-model</param> /// <param name="session">The session</param> /// <param name="thingDialogNavigationService">the <see cref="IThingDialogNavigationService"/></param> /// <param name="panelNavigationService">the <see cref="IPanelNavigationService"/></param> /// <param name="dialogNavigationService">The <see cref="IDialogNavigationService"/></param> public RequirementsSpecificationEditorViewModel(RequirementsSpecification thing, ISession session, IThingDialogNavigationService thingDialogNavigationService, IPanelNavigationService panelNavigationService, IDialogNavigationService dialogNavigationService, IPluginSettingsService pluginSettingsService) : base(thing, session, thingDialogNavigationService, panelNavigationService, dialogNavigationService, pluginSettingsService) { this.Caption = string.Format("{0}: {1}", PanelCaption, this.Thing.ShortName); this.ToolTip = string.Format("{0}\n{1}\n{2}", this.Thing.Name, this.Thing.IDalUri, this.Session.ActivePerson.Name); var model = (EngineeringModel)this.Thing.TopContainer; this.modelSetup = model.EngineeringModelSetup; var iteration = (Iteration)thing.Container; this.iterationSetup = iteration.IterationSetup; this.ContainedRows = new ReactiveList <IRowViewModelBase <Thing> >(); this.AddRequirementsSpecificationRow(thing); this.UpdateRequirementGroupRows(); this.UpdateRequirementRows(); this.AddSubscriptions(); this.UpdateProperties(); }
/// <summary> /// Initializes a new instance of the <see cref="IdCorrespondenceDialogViewModel"/> class /// </summary> /// <param name="idCorrespondence"> /// The <see cref="IdCorrespondence"/> that is the subject of the current view-model. This is the object /// that will be either created, or edited. /// </param> /// <param name="transaction"> /// The <see cref="ThingTransaction"/> that contains the log of recorded changes. /// </param> /// <param name="session"> /// The <see cref="ISession"/> in which the current <see cref="Thing"/> is to be added or updated /// </param> /// <param name="isRoot"> /// Assert if this <see cref="DialogViewModelBase{T}"/> is the root of all <see cref="DialogViewModelBase{T}"/> /// </param> /// <param name="dialogKind"> /// The kind of operation this <see cref="DialogViewModelBase{T}"/> performs /// </param> /// <param name="thingDialogNavigationService"> /// The <see cref="IThingDialogNavigationService"/> that is used to navigate to a dialog of a specific <see cref="Thing"/>. /// </param> /// <param name="container"> /// The <see cref="Thing"/> that contains the created <see cref="Thing"/> in this Dialog /// </param> /// <param name="chainOfContainers"> /// The optional chain of containers that contains the <paramref name="container"/> argument /// </param> public IdCorrespondenceDialogViewModel(IdCorrespondence idCorrespondence, IThingTransaction transaction, ISession session, bool isRoot, ThingDialogKind dialogKind, IThingDialogNavigationService thingDialogNavigationService, Thing container, IEnumerable <Thing> chainOfContainers) : base(idCorrespondence, transaction, session, isRoot, dialogKind, thingDialogNavigationService, container, chainOfContainers) { if (container != null) { var containerThing = container as ExternalIdentifierMap; if (containerThing == null) { var errorMessage = string.Format( "The container parameter is of type {0}, it shall be of type ExternalIdentifierMap", container.GetType()); throw new ArgumentException(errorMessage); } } }
/// <summary> /// Initializes a new instance of the <see cref="RuleVerificationListBrowserViewModel"/> class. /// </summary> /// <param name="iteration"> /// The <see cref="Iteration"/> that is being represented by the view-model /// </param> /// <param name="participant"> /// The active <see cref="Participant"/>. /// </param> /// <param name="session"> /// The session. /// </param> /// <param name="thingDialogNavigationService"> /// The thing dialog navigation service. /// </param> /// <param name="panelNavigationService"> /// The panel navigation service. /// </param> /// <param name="dialogNavigationService"> /// The dialog navigation service. /// </param> public RuleVerificationListBrowserViewModel(Iteration iteration, Participant participant, ISession session, IThingDialogNavigationService thingDialogNavigationService, IPanelNavigationService panelNavigationService, IDialogNavigationService dialogNavigationService, IPluginSettingsService pluginSettingsService) : base(iteration, session, thingDialogNavigationService, panelNavigationService, dialogNavigationService, pluginSettingsService) { if (participant == null) { throw new ArgumentNullException("participant", "The participant must not be null"); } this.Caption = $"{PanelCaption}, iteration_{this.Thing.IterationSetup.IterationNumber}"; this.ToolTip = $"{((EngineeringModel) this.Thing.Container).EngineeringModelSetup.Name}\n{this.Thing.IDalUri}\n{this.Session.ActivePerson.Name}"; this.ActiveParticipant = participant; this.UpdateRuleVericationLists(); this.AddSubscriptions(); this.UpdateProperties(); }
/// <summary> /// Returns an instance of the <see cref="PublicationBrowserViewModel"/> class /// </summary> /// <param name="model">The <see cref="Iteration"/> containing the information</param> /// <param name="session">The <see cref="ISession"/></param> /// <param name="thingDialogNavigationService">The <see cref="IThingDialogNavigationService"/></param> /// <param name="panelNavigationService">The <see cref="IPanelNavigationService"/></param> /// <param name="pluginSettingsService"> /// The <see cref="IPluginSettingsService"/> used to read and write plugin setting files. /// </param> /// <returns>An instance of <see cref="PublicationBrowserViewModel"/></returns> public static PublicationBrowserViewModel InstantiatePanelViewModel(Iteration iteration, ISession session, IThingDialogNavigationService thingDialogNavigationService, IPanelNavigationService panelNavigationService, IDialogNavigationService dialogNavigationService, IPluginSettingsService pluginSettingsService) { var stopWatch = Stopwatch.StartNew(); var viewModel = new PublicationBrowserViewModel(iteration, session, thingDialogNavigationService, panelNavigationService, dialogNavigationService, pluginSettingsService); stopWatch.Stop(); Logger.Info("The Publication Browser opened in {0}", stopWatch.Elapsed.ToString("hh':'mm':'ss'.'fff")); return(viewModel); }
/// <summary> /// Initializes a new instance of the <see cref="DiscussionItemDialogViewModel{T}"/> class /// </summary> /// <param name="discussionItem"> /// The <see cref="DiscussionItem"/> that is the subject of the current view-model. This is the object /// that will be either created, or edited. /// </param> /// <param name="transaction"> /// The <see cref="ThingTransaction"/> that contains the log of recorded changes. /// </param> /// <param name="session"> /// The <see cref="ISession"/> in which the current <see cref="Thing"/> is to be added or updated /// </param> /// <param name="isRoot"> /// Assert if this <see cref="DialogViewModelBase{T}"/> is the root of all <see cref="DialogViewModelBase{T}"/> /// </param> /// <param name="dialogKind"> /// The kind of operation this <see cref="DialogViewModelBase{T}"/> performs /// </param> /// <param name="thingDialogNavigationService"> /// The <see cref="IThingDialogNavigationService"/> that is used to navigate to a dialog of a specific <see cref="Thing"/>. /// </param> /// <param name="container"> /// The <see cref="Thing"/> that contains the created <see cref="Thing"/> in this Dialog /// </param> /// <param name="chainOfContainers"> /// The optional chain of containers that contains the <paramref name="container"/> argument /// </param> protected DiscussionItemDialogViewModel(T discussionItem, IThingTransaction transaction, ISession session, bool isRoot, ThingDialogKind dialogKind, IThingDialogNavigationService thingDialogNavigationService, Thing container, IEnumerable <Thing> chainOfContainers) : base(discussionItem, transaction, session, isRoot, dialogKind, thingDialogNavigationService, container, chainOfContainers) { }
/// <summary> /// Initializes a new instance of the <see cref="TermDialogViewModel"/> class. /// </summary> /// <param name="term"> /// The <see cref="Term"/> that is the subject of the current view-model. This is the object /// that will be either created, or edited. /// </param> /// <param name="transaction"> /// The <see cref="ThingTransaction"/> that contains the log of recorded changes. /// </param> /// <param name="session"> /// The <see cref="ISession"/> in which the current <see cref="Thing"/> is to be added or updated /// </param> /// <param name="isRoot"> /// Assert if this <see cref="CategoryDialogViewModel"/> is the root of all <see cref="IThingDialogViewModel"/> /// </param> /// <param name="dialogKind"> /// The kind of operation this <see cref="CategoryDialogViewModel"/> performs /// </param> /// <param name="thingDialogNavigationService"> /// The <see cref="IThingDialogNavigationService"/> /// </param> /// <param name="container"> /// The Container <see cref="Thing"/> of the created <see cref="Thing"/> /// </param> /// <param name="chainOfContainers"> /// The optional chain of containers that contains the <paramref name="container"/> argument /// </param> public TermDialogViewModel(Term term, IThingTransaction transaction, ISession session, bool isRoot, ThingDialogKind dialogKind, IThingDialogNavigationService thingDialogNavigationService, Thing container, IEnumerable <Thing> chainOfContainers = null) : base(term, transaction, session, isRoot, dialogKind, thingDialogNavigationService, container, chainOfContainers) { }
/// <summary> /// Initializes a new instance of the <see cref="RequirementDialogViewModel"/> class. /// </summary> /// <param name="requirement"> /// The <see cref="Requirement"/> that is the subject of the current view-model. This is the object /// that will be either created, or edited. /// </param> /// <param name="transaction"> /// The <see cref="ThingTransaction"/> that contains the log of recorded changes. /// </param> /// <param name="session"> /// The <see cref="ISession"/> in which the current <see cref="Thing"/> is to be added or updated /// </param> /// <param name="isRoot"> /// Assert if this <see cref="DialogViewModelBase{T}"/> is the root of all <see cref="IThingDialogViewModel"/> /// </param> /// <param name="dialogKind"> /// The kind of operation this <see cref="DialogViewModelBase{T}"/> performs /// </param> /// <param name="thingDialogNavigationService">The <see cref="IThingDialogNavigationService"/></param> /// <param name="container">The <see cref="RequirementsSpecificationDialogViewModel.container"/> for this <see cref="RequirementsSpecificationDialogViewModel.Thing"/></param> /// <param name="chainOfContainers"> /// The optional chain of containers that contains the <paramref name="container"/> argument /// </param> public RequirementDialogViewModel(Requirement requirement, IThingTransaction transaction, ISession session, bool isRoot, ThingDialogKind dialogKind, IThingDialogNavigationService thingDialogNavigationService, Thing container = null, IEnumerable <Thing> chainOfContainers = null) : base(requirement, transaction, session, isRoot, dialogKind, thingDialogNavigationService, container, chainOfContainers) { this.SelectedOwner = this.Session.ActivePerson.DefaultDomain ?? this.PossibleOwner.First(); this.WhenAnyValue(vm => vm.RequirementText).Subscribe(_ => this.UpdateOkCanExecute()); }
public BasicRdlModule(IFluentRibbonManager ribbonManager, IPanelNavigationService panelNavigationService, IThingDialogNavigationService thingDialogNavigationService, IDialogNavigationService dialogNavigationService, IPluginSettingsService pluginSettingsService, IFavoritesService favoritesService) { this.RibbonManager = ribbonManager; this.PanelNavigationService = panelNavigationService; this.ThingDialogNavigationService = thingDialogNavigationService; this.DialogNavigationService = dialogNavigationService; this.PluginSettingsService = pluginSettingsService; this.FavoritesService = favoritesService; }
/// <summary> /// Initializes a new instance of the <see cref="DialogViewModelBase{T}"/> class /// </summary> /// <param name="thingClone">The clone of the <see cref="Thing"/> that this dialog belongs to.</param> /// <param name="parentTransaction"> /// The parent <see cref="ThingTransaction"/> that contains the log of recorded changes at the previous level. /// </param> /// <param name="session"> /// The <see cref="ISession"/> in which the current <see cref="Thing"/> is to be added or updated /// </param> /// <param name="isRoot"> /// Assert if this <see cref="DialogViewModelBase{T}"/> is the root of all <see cref="IThingDialogViewModel"/> /// </param> /// <param name="dialogKind"> /// The kind of operation this <see cref="DialogViewModelBase{T}"/> performs /// </param> /// <param name="thingDialogNavigationService">The <see cref="IThingDialogNavigationService"/></param> /// <param name="container">The <see cref="Thing"/> that contains the created one in this <see cref="DialogViewModelBase{T}"/></param> /// <param name="chainOfContainers"> /// The optional chain of containers that contains the <paramref name="container"/> argument /// </param> /// <remarks> /// <paramref name="thingClone"/> shall always be a clone when opening a dialog to create or edit a thing. /// </remarks> protected DialogViewModelBase(T thingClone, IThingTransaction parentTransaction, ISession session, bool isRoot, ThingDialogKind dialogKind, IThingDialogNavigationService thingDialogNavigationService, Thing container, IEnumerable <Thing> chainOfContainers) : base(thingClone, session) { // add the animation uri path this.AnimationUri = $"{Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location)}{CdpLogoAnimationPath}"; this.LoadingMessage = "Processing..."; this.InitializeSpellingChecker(); this.thingDialogNavigationService = thingDialogNavigationService; this.PossibleContainer = new ReactiveList <Thing>(); this.Container = container; this.parentTransaction = parentTransaction; this.isRoot = isRoot; this.dialogKind = dialogKind; this.serializer = new Cdp4JsonSerializer(this.Session.Dal.MetaDataProvider, this.Session.DalVersion); this.ChainOfContainer = (chainOfContainers != null) ? chainOfContainers.ToList() : new List <Thing>(); this.ChainOfContainer.Add(this.Container); this.WhenAnyValue(vm => vm.Container) .Where(x => x != null) .Subscribe(_ => this.UpdateChainOfContainer()); this.Initialize(); this.InitializeCommands(); this.UpdateProperties(); this.WhenAnyValue(x => x.WriteException).Select(x => x != null).ToProperty(this, x => x.HasException, out this.hasException); switch (this.dialogKind) { case ThingDialogKind.Create: this.transaction = new ThingTransaction(this.Thing, parentTransaction, container); break; case ThingDialogKind.Update: this.transaction = new ThingTransaction(this.Thing, parentTransaction, container); break; case ThingDialogKind.Inspect: break; default: throw new InvalidEnumArgumentException("The provided dialogKind is Invalid"); } }
/// <summary> /// Initializes a new instance of the <see cref="ParticipantRoleDialogViewModel"/> class. /// </summary> /// <param name="participantRole"> /// The participant Role. /// </param> /// <param name="transaction"> /// The <see cref="ThingTransaction"/> that contains the log of recorded changes. /// </param> /// <param name="session"> /// The <see cref="ISession"/> in which the current <see cref="Thing"/> is to be added or updated /// </param> /// <param name="isRoot"> /// Assert if this <see cref="ParticipantRoleDialogViewModel"/> is the root of all dialogs /// </param> /// <param name="dialogKind"> /// The kind of operation this <see cref="ParticipantRoleDialogViewModel"/> performs /// </param> /// <param name="thingDialogNavigationService"> /// The <see cref="IThingDialogNavigationService"/> that allows to navigate to <see cref="Thing"/> dialog view models /// </param> /// <param name="container"> /// The container <see cref="Thing"/> for the created <see cref="Thing"/> /// </param> /// <param name="chainOfContainers"> /// The optional chain of containers that contains the <paramref name="container"/> argument /// </param> public ParticipantRoleDialogViewModel(ParticipantRole participantRole, IThingTransaction transaction, ISession session, bool isRoot, ThingDialogKind dialogKind, IThingDialogNavigationService thingDialogNavigationService, Thing container, IEnumerable <Thing> chainOfContainers = null) : base(participantRole, transaction, session, isRoot, dialogKind, thingDialogNavigationService, container, chainOfContainers) { }
/// <summary> /// Initializes a new instance of the <see cref="LinearConversionUnitDialogViewModel"/> class. /// </summary> /// <param name="linearConversionUnit"> /// The <see cref="LinearConversionUnit"/> that is the subject of the current view-model. This is the object /// that will be either created, or edited. /// </param> /// <param name="transaction"> /// The <see cref="ThingTransaction"/> that contains the log of recorded changes. /// </param> /// <param name="session"> /// The <see cref="ISession"/> in which the current <see cref="Thing"/> is to be added or updated /// </param> /// <param name="isRoot"> /// Assert if this <see cref="LinearConversionUnitDialogViewModel"/> is the root of all <see cref="IThingDialogViewModel"/> /// </param> /// <param name="dialogKind"> /// The kind of operation this <see cref="LinearConversionUnitDialogViewModel"/> performs /// </param> /// <param name="thingDialogNavigationService"> /// The <see cref="IThingDialogNavigationService"/> that is used to navigate to a dialog of a specific <see cref="Thing"/>. /// </param> /// <param name="container"> /// The <see cref="Thing"/> that contains the created <see cref="Thing"/> in this Dialog /// </param> /// <param name="chainOfContainers"> /// The optional chain of containers that contains the <paramref name="container"/> argument /// </param> public LinearConversionUnitDialogViewModel(LinearConversionUnit linearConversionUnit, IThingTransaction transaction, ISession session, bool isRoot, ThingDialogKind dialogKind, IThingDialogNavigationService thingDialogNavigationService, Thing container = null, IEnumerable <Thing> chainOfContainers = null) : base(linearConversionUnit, transaction, session, isRoot, dialogKind, thingDialogNavigationService, container, chainOfContainers) { this.WhenAnyValue(vm => vm.Container).Subscribe(_ => this.PopulatePossibleReferenceUnit()); this.WhenAnyValue(vm => vm.Container).Subscribe(_ => this.UpdateOkCanExecute()); }
/// <summary> /// Initializes a new instance of the <see cref="BooleanExpressionDialogViewModel{T}"/> class /// </summary> /// <param name="booleanExpression"> /// The <see cref="BooleanExpression"/> that is the subject of the current view-model. This is the object /// that will be either created, or edited. /// </param> /// <param name="transaction"> /// The <see cref="ThingTransaction"/> that contains the log of recorded changes. /// </param> /// <param name="session"> /// The <see cref="ISession"/> in which the current <see cref="Thing"/> is to be added or updated /// </param> /// <param name="isRoot"> /// Assert if this <see cref="DialogViewModelBase{T}"/> is the root of all <see cref="DialogViewModelBase{T}"/> /// </param> /// <param name="dialogKind"> /// The kind of operation this <see cref="DialogViewModelBase{T}"/> performs /// </param> /// <param name="thingDialogNavigationService"> /// The <see cref="IThingDialogNavigationService"/> that is used to navigate to a dialog of a specific <see cref="Thing"/>. /// </param> /// <param name="container"> /// The <see cref="Thing"/> that contains the created <see cref="Thing"/> in this Dialog /// </param> /// <param name="chainOfContainers"> /// The optional chain of containers that contains the <paramref name="container"/> argument /// </param> protected BooleanExpressionDialogViewModel(T booleanExpression, IThingTransaction transaction, ISession session, bool isRoot, ThingDialogKind dialogKind, IThingDialogNavigationService thingDialogNavigationService, Thing container, IEnumerable <Thing> chainOfContainers) : base(booleanExpression, transaction, session, isRoot, dialogKind, thingDialogNavigationService, container, chainOfContainers) { if (container != null) { var containerThing = container as ParametricConstraint; if (containerThing == null) { var errorMessage = string.Format( "The container parameter is of type {0}, it shall be of type ParametricConstraint", container.GetType()); throw new ArgumentException(errorMessage); } } }
/// <summary> /// Initializes a new instance of the <see cref="ElementBaseDialogViewModel{T}"/> class /// </summary> /// <param name="elementBase"> /// The <see cref="ElementBase"/> that is the subject of the current view-model. This is the object /// that will be either created, or edited. /// </param> /// <param name="transaction"> /// The <see cref="ThingTransaction"/> that contains the log of recorded changes. /// </param> /// <param name="session"> /// The <see cref="ISession"/> in which the current <see cref="Thing"/> is to be added or updated /// </param> /// <param name="isRoot"> /// Assert if this <see cref="DialogViewModelBase{T}"/> is the root of all <see cref="DialogViewModelBase{T}"/> /// </param> /// <param name="dialogKind"> /// The kind of operation this <see cref="DialogViewModelBase{T}"/> performs /// </param> /// <param name="thingDialogNavigationService"> /// The <see cref="IThingDialogNavigationService"/> that is used to navigate to a dialog of a specific <see cref="Thing"/>. /// </param> /// <param name="container"> /// The <see cref="Thing"/> that contains the created <see cref="Thing"/> in this Dialog /// </param> /// <param name="chainOfContainers"> /// The optional chain of containers that contains the <paramref name="container"/> argument /// </param> protected ElementBaseDialogViewModel(T elementBase, IThingTransaction transaction, ISession session, bool isRoot, ThingDialogKind dialogKind, IThingDialogNavigationService thingDialogNavigationService, Thing container, IEnumerable <Thing> chainOfContainers) : base(elementBase, transaction, session, isRoot, dialogKind, thingDialogNavigationService, container, chainOfContainers) { }
/// <summary> /// Initializes a new instance of the <see cref="LogarithmicScaleDialogViewModel"/> class. /// </summary> /// <param name="logarithmicScale"> /// The Simple quantity Kind. /// </param> /// <param name="transaction"> /// The <see cref="ThingTransaction"/> that contains the log of recorded changes. /// </param> /// <param name="session"> /// The <see cref="ISession"/> in which the current <see cref="Thing"/> is to be added or updated /// </param> /// <param name="isRoot"> /// Assert if this <see cref="LogarithmicScaleDialogViewModel"/> is the root of all <see cref="IThingDialogViewModel"/> /// </param> /// <param name="dialogKind"> /// The kind of operation this <see cref="LogarithmicScaleDialogViewModel"/> performs /// </param> /// <param name="thingDialogNavigationService"> /// The <see cref="IThingDialogNavigationService"/> that is used to navigate to a dialog of a specific <see cref="Thing"/>. /// </param> /// <param name="container"> /// The <see cref="Thing"/> that contains the created <see cref="Thing"/> in this Dialog /// </param> /// <param name="chainOfContainers"> /// The optional chain of containers that contains the <paramref name="container"/> argument /// </param> /// <exception cref="ArgumentException"> /// The container must be of type <see cref="ReferenceDataLibrary"/>. /// </exception> public LogarithmicScaleDialogViewModel(LogarithmicScale logarithmicScale, IThingTransaction transaction, ISession session, bool isRoot, ThingDialogKind dialogKind, IThingDialogNavigationService thingDialogNavigationService, Thing container = null, IEnumerable <Thing> chainOfContainers = null) : base(logarithmicScale, transaction, session, isRoot, dialogKind, thingDialogNavigationService, container, chainOfContainers) { this.WhenAnyValue(vm => vm.Container).Subscribe(_ => { this.PopulatePossibleUnit(); this.PopulatePossibleReferenceQuantityKind(); }); this.WhenAnyValue(vm => vm.SelectedUnit).Subscribe(_ => this.UpdateOkCanExecute()); }
/// <summary> /// Initializes a new instance of the <see cref="NaturalLanguageBrowserViewModel"/> class /// </summary> /// <param name="session">The <see cref="ISession"/> containing the given <see cref="SiteDirectory"/></param> /// <param name="siteDir">The <see cref="SiteDirectory"/> containing the data of this browser</param> /// <param name="thingDialogNavigationService"> /// The <see cref="IThingDialogNavigationService"/> that allows to navigate to <see cref="Thing"/> dialog view models /// </param> /// <param name="panelNavigationService">The <see cref="IPanelNavigationService"/> /// The <see cref="IPanelNavigationService"/> that allows to navigate to Panels /// </param> /// <param name="dialogNavigationService">The <see cref="IDialogNavigationService"/></param> /// <param name="pluginSettingsService"> /// The <see cref="IPluginSettingsService"/> used to read and write plugin setting files. /// </param> public NaturalLanguageBrowserViewModel(ISession session, SiteDirectory siteDir, IThingDialogNavigationService thingDialogNavigationService, IPanelNavigationService panelNavigationService, IDialogNavigationService dialogNavigationService, IPluginSettingsService pluginSettingsService) : base(siteDir, session, thingDialogNavigationService, panelNavigationService, dialogNavigationService, pluginSettingsService) { this.Caption = PanelCaption + ", " + this.Thing.Name; this.ToolTip = string.Format("{0}\n{1}\n{2}", this.Thing.Name, this.Thing.IDalUri, this.Session.ActivePerson.Name); this.NaturalLanguageRowViewModels = new DisposableReactiveList <NaturalLanguageRowViewModel>(); this.ComputeNaturalLanguageRows(); }
/// <summary> /// Initializes a new instance of the <see cref="GlossaryDialogViewModel"/> class. /// </summary> /// <param name="glossary"> /// The <see cref="Glossary"/> that is the subject of the current view-model. This is the object /// that will be either created, or edited. /// </param> /// <param name="transaction"> /// The <see cref="ThingTransaction"/> that contains the log of recorded changes. /// </param> /// <param name="session"> /// The <see cref="ISession"/> in which the current <see cref="Thing"/> is to be added or updated /// </param> /// <param name="isRoot"> /// Assert if this <see cref="CategoryDialogViewModel"/> is the root of all <see cref="IThingDialogViewModel"/> /// </param> /// <param name="dialogKind"> /// The kind of operation this <see cref="CategoryDialogViewModel"/> performs /// </param> /// <param name="thingDialogNavigationService"> /// The <see cref="IThingDialogNavigationService"/> /// </param> /// <param name="container"> /// The Container <see cref="Thing"/> of the created <see cref="Thing"/> /// </param> /// <param name="chainOfContainers"> /// The optional chain of containers that contains the <paramref name="container"/> argument /// </param> public GlossaryDialogViewModel(Glossary glossary, IThingTransaction transaction, ISession session, bool isRoot, ThingDialogKind dialogKind, IThingDialogNavigationService thingDialogNavigationService, Thing container = null, IEnumerable <Thing> chainOfContainers = null) : base(glossary, transaction, session, isRoot, dialogKind, thingDialogNavigationService, container, chainOfContainers) { this.WhenAnyValue(x => x.Container).Subscribe(_ => this.PopulateCategory()); }
/// <summary> /// returns a new instance of the <see cref="DomainOfExpertiseBrowserViewModel"/> class /// </summary> /// <param name="session">The <see cref="ISession"/></param> /// <param name="thingDialogNavigationService">The <see cref="IThingDialogNavigationService"/></param> /// <param name="panelNavigationService">The <see cref="IPanelNavigationService"/></param> /// <param name="dialogNavigationService">The <see cref="IDialogNavigationService"/></param> /// <returns>An instance of the <see cref="DomainOfExpertiseBrowserViewModel"/> class</returns> public static IPanelViewModel InstantiatePanelViewModel(ISession session, IThingDialogNavigationService thingDialogNavigationService, IPanelNavigationService panelNavigationService, IDialogNavigationService dialogNavigationService, IPluginSettingsService pluginSettingsService) { return(new DomainOfExpertiseBrowserViewModel(session, session.RetrieveSiteDirectory(), thingDialogNavigationService, panelNavigationService, dialogNavigationService, pluginSettingsService)); }
/// <summary> /// Initializes a new instance of the <see cref="DerivedUnitDialogViewModel"/> class. /// </summary> /// <param name="derivedUnit"> /// The <see cref="DerivedUnit"/> that is the subject of the current view-model. This is the object /// that will be either created, or edited. /// </param> /// <param name="transaction"> /// The <see cref="ThingTransaction"/> that contains the log of recorded changes. /// </param> /// <param name="session"> /// The <see cref="ISession"/> in which the current <see cref="Thing"/> is to be added or updated /// </param> /// <param name="isRoot"> /// Assert if this <see cref="DerivedUnitDialogViewModel"/> is the root of all <see cref="IThingDialogViewModel"/> /// </param> /// <param name="dialogKind"> /// The kind of operation this <see cref="DerivedUnitDialogViewModel"/> performs /// </param> /// <param name="thingDialogNavigationService"> /// The <see cref="IThingDialogNavigationService"/> that is used to navigate to a dialog of a specific <see cref="Thing"/>. /// </param> /// <param name="container"> /// The <see cref="Thing"/> that contains the created <see cref="Thing"/> in this Dialog /// </param> /// <param name="chainOfContainers"> /// The optional chain of containers that contains the <paramref name="container"/> argument /// </param> public DerivedUnitDialogViewModel(DerivedUnit derivedUnit, IThingTransaction transaction, ISession session, bool isRoot, ThingDialogKind dialogKind, IThingDialogNavigationService thingDialogNavigationService, Thing container = null, IEnumerable <Thing> chainOfContainers = null) : base(derivedUnit, transaction, session, isRoot, dialogKind, thingDialogNavigationService, container, chainOfContainers) { var canCreateCondition = this.WhenAnyValue(vm => vm.Container).Select(x => x != null); this.CreateUnitFactorCommand = ReactiveCommand.Create(canCreateCondition); this.CreateUnitFactorCommand.Subscribe(_ => this.ExecuteCreateCommand <UnitFactor>(this.PopulateUnitFactor)); this.WhenAnyValue(vm => vm.Container).Subscribe(_ => this.UpdateOkCanExecute()); }
/// <summary> /// Initializes a new instance of the <see cref="ReferenceSourceDialogViewModel"/> class. /// </summary> /// <param name="referenceSource"> /// The <see cref="ReferenceSource"/> that is the subject of the current view-model. This is the object /// that will be either created, or edited. /// </param> /// <param name="transaction"> /// The <see cref="ThingTransaction"/> that contains the log of recorded changes. /// </param> /// <param name="session"> /// The <see cref="ISession"/> in which the current <see cref="Thing"/> is to be added or updated /// </param> /// <param name="isRoot"> /// Assert if this <see cref="ReferenceSourceDialogViewModel"/> is the root of all <see cref="IThingDialogViewModel"/> /// </param> /// <param name="dialogKind"> /// The kind of operation this <see cref="ReferenceSourceDialogViewModel"/> performs /// </param> /// <param name="thingDialogNavigationService"> /// The <see cref="IThingDialogNavigationService"/> /// </param> /// <param name="container"> /// The Container <see cref="Thing"/> of the created <see cref="Thing"/> /// </param> /// <param name="chainOfContainers"> /// The optional chain of containers that contains the <paramref name="container"/> argument /// </param> public ReferenceSourceDialogViewModel(ReferenceSource referenceSource, IThingTransaction transaction, ISession session, bool isRoot, ThingDialogKind dialogKind, IThingDialogNavigationService thingDialogNavigationService, Thing container = null, IEnumerable <Thing> chainOfContainers = null) : base(referenceSource, transaction, session, isRoot, dialogKind, thingDialogNavigationService, container, chainOfContainers) { this.WhenAnyValue(vm => vm.Container).Subscribe(_ => this.PopulatePossiblePublishedIn()); }
/// <summary> /// Initializes a new instance of the <see cref="DomainFileStoreBrowserViewModel"/> class. /// </summary> /// <param name="iteration"> /// The iteration. /// </param> /// <param name="session"> /// The session /// </param> /// <param name="thingDialogNavigationService"> /// the <see cref="IThingDialogNavigationService"/> /// </param> /// <param name="panelNavigationService"> /// the <see cref="IPanelNavigationService"/> /// </param> /// <param name="dialogNavigationService"> /// The <see cref="IDialogNavigationService"/> /// </param> public DomainFileStoreBrowserViewModel(Iteration iteration, ISession session, IThingDialogNavigationService thingDialogNavigationService, IPanelNavigationService panelNavigationService, IDialogNavigationService dialogNavigationService, IPluginSettingsService pluginSettingsService) : base(iteration, session, thingDialogNavigationService, panelNavigationService, dialogNavigationService, pluginSettingsService) { this.Caption = $"{PanelCaption}, iteration_{this.Thing.IterationSetup.IterationNumber}"; this.ToolTip = $"{((EngineeringModel)this.Thing.Container).EngineeringModelSetup.Name}\n{this.Thing.IDalUri}\n{this.Session.ActivePerson.Name}"; this.ContainedRows = new DisposableReactiveList <IRowViewModelBase <Thing> >(); this.AddSubscriptions(); this.UpdateProperties(); }
/// <summary> /// Initializes a new instance of the <see cref="ElementDefinitionDialogViewModel"/> class /// </summary> /// <param name="elementDefinition"> /// The <see cref="ElementDefinition"/> that is the subject of the current view-model. This is the object /// that will be either created, or edited. /// </param> /// <param name="transaction"> /// The <see cref="ThingTransaction"/> that contains the log of recorded changes. /// </param> /// <param name="session"> /// The <see cref="ISession"/> in which the current <see cref="Thing"/> is to be added or updated /// </param> /// <param name="isRoot"> /// Assert if this <see cref="DialogViewModelBase{T}"/> is the root of all <see cref="DialogViewModelBase{T}"/> /// </param> /// <param name="dialogKind"> /// The kind of operation this <see cref="DialogViewModelBase{T}"/> performs /// </param> /// <param name="thingDialogNavigationService"> /// The <see cref="IThingDialogNavigationService"/> that is used to navigate to a dialog of a specific <see cref="Thing"/>. /// </param> /// <param name="container"> /// The <see cref="Thing"/> that contains the created <see cref="Thing"/> in this Dialog /// </param> /// <param name="chainOfContainers"> /// The optional chain of containers that contains the <paramref name="container"/> argument /// </param> public ElementDefinitionDialogViewModel(ElementDefinition elementDefinition, IThingTransaction transaction, ISession session, bool isRoot, ThingDialogKind dialogKind, IThingDialogNavigationService thingDialogNavigationService, Thing container, IEnumerable <Thing> chainOfContainers) : base(elementDefinition, transaction, session, isRoot, dialogKind, thingDialogNavigationService, container, chainOfContainers) { if (container != null) { var containerThing = container as Iteration; if (containerThing == null) { var errorMessage = string.Format( "The container parameter is of type {0}, it shall be of type Iteration", container.GetType()); throw new ArgumentException(errorMessage); } } }
/// <summary> /// Initializes a new instance of the <see cref="SimpleParameterValueDialogViewModel"/> class /// </summary> /// <param name="simpleParameterValue"> /// The <see cref="SimpleParameterValue"/> that is the subject of the current view-model. This is the object /// that will be either created, or edited. /// </param> /// <param name="transaction"> /// The <see cref="ThingTransaction"/> that contains the log of recorded changes. /// </param> /// <param name="session"> /// The <see cref="ISession"/> in which the current <see cref="Thing"/> is to be added or updated /// </param> /// <param name="isRoot"> /// Assert if this <see cref="IThingDialogViewModel"/> is the root of all <see cref="IThingDialogViewModel"/> /// </param> /// <param name="dialogKind"> /// The kind of operation this <see cref="IThingDialogViewModel"/> performs /// </param> /// <param name="thingDialogNavigationService"> /// The <see cref="IThingDialogNavigationService"/> that is used to navigate to a dialog of a specific <see cref="Thing"/>. /// </param> /// <param name="container"> /// The <see cref="Thing"/> that contains the created <see cref="Thing"/> in this Dialog /// </param> /// <param name="chainOfContainers"> /// The optional chain of containers that contains the <paramref name="container"/> argument /// </param> public SimpleParameterValueDialogViewModel(SimpleParameterValue simpleParameterValue, IThingTransaction transaction, ISession session, bool isRoot, ThingDialogKind dialogKind, IThingDialogNavigationService thingDialogNavigationService, Thing container = null, IEnumerable <Thing> chainOfContainers = null) : base(simpleParameterValue, transaction, session, isRoot, dialogKind, thingDialogNavigationService, container, chainOfContainers) { this.WhenAnyValue(vm => vm.SelectedScale).Subscribe(_ => this.UpdateOkCanExecute()); this.WhenAnyValue(vm => vm.SelectedParameterType).Subscribe(_ => this.PopulateValues()); this.Values.CountChanged.Subscribe(_ => this.UpdateOkCanExecute()); }
public CultureConversionRelationalExpressionDialogViewModel(RelationalExpression relationalExpression, IThingTransaction transaction, ISession session, bool isRoot, ThingDialogKind dialogKind, IThingDialogNavigationService thingDialogNavigationService, Thing container = null, IEnumerable <Thing> chainOfContainers = null) : base(relationalExpression, transaction, session, isRoot, dialogKind, thingDialogNavigationService, container, chainOfContainers) { }
/// <summary> /// Initializes a new instance of the <see cref="StakeHolderValueMapSettingsDialogViewModel"/> class /// </summary> /// <param name="stakeHolderValueMapSettings"> /// The <see cref="StakeHolderValueMapSettings"/> that is the subject of the current view-model. This is the object /// that will be either created, or edited. /// </param> /// <param name="transaction"> /// The <see cref="ThingTransaction"/> that contains the log of recorded changes. /// </param> /// <param name="session"> /// The <see cref="ISession"/> in which the current <see cref="Thing"/> is to be added or updated /// </param> /// <param name="isRoot"> /// Assert if this <see cref="DialogViewModelBase{T}"/> is the root of all <see cref="DialogViewModelBase{T}"/> /// </param> /// <param name="dialogKind"> /// The kind of operation this <see cref="DialogViewModelBase{T}"/> performs /// </param> /// <param name="thingDialogNavigationService"> /// The <see cref="IThingDialogNavigationService"/> that is used to navigate to a dialog of a specific <see cref="Thing"/>. /// </param> /// <param name="container"> /// The <see cref="Thing"/> that contains the created <see cref="Thing"/> in this Dialog /// </param> /// <param name="chainOfContainers"> /// The optional chain of containers that contains the <paramref name="container"/> argument /// </param> public StakeHolderValueMapSettingsDialogViewModel(StakeHolderValueMapSettings stakeHolderValueMapSettings, IThingTransaction transaction, ISession session, bool isRoot, ThingDialogKind dialogKind, IThingDialogNavigationService thingDialogNavigationService, Thing container, IEnumerable <Thing> chainOfContainers) : base(stakeHolderValueMapSettings, transaction, session, isRoot, dialogKind, thingDialogNavigationService, container, chainOfContainers) { if (container != null) { var containerThing = container as StakeHolderValueMap; if (containerThing == null) { var errorMessage = string.Format( "The container parameter is of type {0}, it shall be of type StakeHolderValueMap", container.GetType()); throw new ArgumentException(errorMessage); } } }
/// <summary> /// Initializes a new instance of the <see cref="DiagramCanvasDialogViewModel"/> class. /// </summary> /// <param name="diagram"> /// The <see cref="DiagramCanvas"/> that is the subject of the current view-model. This is the object /// that will be either created, or edited. /// </param> /// <param name="transaction"> /// The <see cref="ThingTransaction"/> that contains the log of recorded changes. /// </param> /// <param name="session"> /// The <see cref="ISession"/> in which the current <see cref="Thing"/> is to be added or updated /// </param> /// <param name="isRoot"> /// Assert if this <see cref="DiagramCanvasDialogViewModel"/> is the root of all <see cref="IThingDialogViewModel"/> /// </param> /// <param name="dialogKind"> /// The kind of operation this <see cref="DiagramCanvasDialogViewModel"/> performs /// </param> /// <param name="thingDialogNavigationService"> /// The <see cref="IThingDialogNavigationService"/> /// </param> /// <param name="container"> /// The Container <see cref="Thing"/> of the created <see cref="Thing"/> /// </param> /// <param name="chainOfContainers"> /// The optional chain of containers that contains the <paramref name="container"/> argument /// </param> public DiagramCanvasDialogViewModel(DiagramCanvas diagram, IThingTransaction transaction, ISession session, bool isRoot, ThingDialogKind dialogKind, IThingDialogNavigationService thingDialogNavigationService, Thing container = null, IEnumerable <Thing> chainOfContainers = null) : base(diagram, transaction, session, isRoot, dialogKind, thingDialogNavigationService, container, chainOfContainers) { }
/// <summary> /// Initializes a new instance of the <see cref="ParameterDialogViewModel"/> class /// </summary> /// <param name="parameter"> /// The parameter. /// </param> /// <param name="transaction"> /// The <see cref="ThingTransaction"/> that contains the log of recorded changes. /// </param> /// <param name="session"> /// The <see cref="ISession"/> in which the current <see cref="Thing"/> is to be added or updated /// </param> /// <param name="isRoot"> /// Assert if this <see cref="DialogViewModelBase{T}"/> is the root of all <see cref="DialogViewModelBase{T}"/> /// </param> /// <param name="dialogKind"> /// The kind of operation this <see cref="DialogViewModelBase{T}"/> performs /// </param> /// <param name="thingDialogNavigationService"> /// The <see cref="IThingDialogNavigationService"/> that is used to navigate to a dialog of a specific <see cref="Thing"/>. /// </param> /// <param name="container"> /// The Container <see cref="Thing"/> of the created <see cref="MultiRelationshipRule"/> /// </param> /// <param name="chainOfContainers"> /// The optional chain of containers that contains the <paramref name="container"/> argument /// </param> public ParameterDialogViewModel(Parameter parameter, IThingTransaction transaction, ISession session, bool isRoot, ThingDialogKind dialogKind, IThingDialogNavigationService thingDialogNavigationService, Thing container = null, IEnumerable <Thing> chainOfContainers = null) : base(parameter, transaction, session, isRoot, dialogKind, thingDialogNavigationService, container, chainOfContainers) { this.WhenAnyValue(vm => vm.SelectedOwner).Subscribe(_ => this.UpdateOkCanExecute()); this.WhenAnyValue(vm => vm.SelectedScale).Subscribe(_ => this.UpdateOkCanExecute()); this.WhenAnyValue(vm => vm.IsOptionDependent).Subscribe(_ => this.IsValueSetEditable = this.IsOptionDependent == this.Thing.IsOptionDependent && this.SelectedStateDependence == this.Thing.StateDependence); this.WhenAnyValue(vm => vm.SelectedStateDependence).Subscribe(_ => this.IsValueSetEditable = this.IsOptionDependent == this.Thing.IsOptionDependent && this.SelectedStateDependence == this.Thing.StateDependence); this.WhenAnyValue(vm => vm.SelectedScale).Where(x => x != null).Subscribe(_ => this.CheckValueValidation()); this.WhenAnyValue(vm => vm.SelectedGroupSelection).Subscribe(x => this.SelectedGroup = x != null ? x.Thing : null); this.IsNameVisible = this.Thing.ParameterType is CompoundParameterType || this.Thing.IsOptionDependent || this.Thing.StateDependence != null; }