/// <summary>
 /// Initializes a new instance of the <see cref="AddSatelliteProviderCommand"/> class.
 /// </summary>
 /// <remarks>
 /// This class is intended to be initialized by the <see cref="SectionViewModel.CreateElementCollectionAddCommands"/>.
 /// </remarks>
 /// <param name="commandAttribute">The <see cref="AddSateliteProviderCommandAttribute"/> that specifes metadata for this <see cref="AddSatelliteProviderCommand"/> to be initialized with.</param>
 /// <param name="collection"></param>
 /// <param name="commandService"></param>
 /// <param name="configurationElementType"></param>
 /// <param name="lookup"></param>
 /// <param name="uiService"></param>
 public AddSatelliteProviderCommand(AddSateliteProviderCommandAttribute commandAttribute, MenuCommandService commandService, ConfigurationElementType configurationElementType, ElementCollectionViewModel collection, ElementLookup lookup, IUIServiceWpf uiService)
     : base(commandAttribute, configurationElementType, collection, uiService)
 {
     this.commandService = commandService;
     this.commandAttribute = commandAttribute;
     this.lookup = lookup;
 }
示例#2
0
        /// <summary>
        /// Initializes a new instance of <see cref="ApplicationViewModel"/>.
        /// </summary>
        /// <param name="uiService">The <see cref="IUIServiceWpf"/> that should be used to interact with the user.</param>
        /// <param name="sourceModel">The <see cref="ConfigurationSourceModel"/> that should be used to interact with the configuration schema.</param>
        /// <param name="lookup">The <see cref="ElementLookup"/> that should be used to look up <see cref="ElementViewModel"/> instances.</param>
        /// <param name="builder">The <see cref="IUnityContainer"/> instance that should be used to create view model instances with.</param>
        /// <param name="menuCommandService">The <see cref="MenuCommandService"/> that should be used to look up top-level <see cref="CommandModel"/> instances.</param>
        /// <param name="validationModel">The <see cref="ValidationModel"/> that should be used to add validation errors and warnings to.</param>
        public ApplicationViewModel(IUIServiceWpf uiService, ConfigurationSourceModel sourceModel, ElementLookup lookup,
                                    IUnityContainer builder, MenuCommandService menuCommandService,
                                    ValidationModel validationModel)
        {
            ValidationModel = validationModel;
            this.uiService = uiService;
            this.sourceModel = sourceModel;
            
            this.lookup = lookup;
            this.builder = builder;
            this.menuCommandService = menuCommandService;

            NewConfigurationCommand = new DelegateCommand(x => New());
            SaveConfigurationCommand = new DelegateCommand(x => Save());
            SaveAsConfigurationCommand = new DelegateCommand(x => SaveAs());
            OpenConfigurationCommand = new DelegateCommand(x => OpenConfigurationSource());
            ExitCommand = new DelegateCommand(x => Close());

            OpenEnvironmentCommand = new OpenEnvironmentConfigurationDeltaCommand(uiService, this);
            NewEnvironmentCommand = new DelegateCommand(x => NewEnvironment());
        }
        /// <summary>
        /// Initializes a new instance of <see cref="ApplicationViewModel"/>.
        /// </summary>
        /// <param name="uiService">The <see cref="IUIServiceWpf"/> that should be used to interact with the user.</param>
        /// <param name="sourceModel">The <see cref="ConfigurationSourceModel"/> that should be used to interact with the configuration schema.</param>
        /// <param name="lookup">The <see cref="ElementLookup"/> that should be used to look up <see cref="ElementViewModel"/> instances.</param>
        /// <param name="builder">The <see cref="IUnityContainer"/> instance that should be used to create view model instances with.</param>
        /// <param name="menuCommandService">The <see cref="MenuCommandService"/> that should be used to look up top-level <see cref="CommandModel"/> instances.</param>
        /// <param name="validationModel">The <see cref="ValidationModel"/> that should be used to add validation errors and warnings to.</param>
        /// <param name="profile">The <see cref="Profile"/> that should be used to filter UI elements based on the platform.</param>
        public ApplicationViewModel(IUIServiceWpf uiService, ConfigurationSourceModel sourceModel, ElementLookup lookup,
                                    IUnityContainer builder, MenuCommandService menuCommandService,
                                    ValidationModel validationModel, Profile profile)
        {
            ValidationModel = validationModel;
            this.uiService = uiService;
            this.sourceModel = sourceModel;

            this.lookup = lookup;
            this.builder = builder;
            this.menuCommandService = menuCommandService;
            this.profile = profile;

            NewConfigurationCommand = new DelegateCommand(x => New());
            SaveConfigurationCommand = new DelegateCommand(x => Save());
            SaveAsConfigurationCommand = new DelegateCommand(x => SaveAs());
            OpenConfigurationCommand = new DelegateCommand(x => OpenConfigurationSource());
            ExitCommand = new DelegateCommand(x => Close());

            var environmentCommandsEnabled = this.profile == null ? true : profile.EnvironmentCommandsEnabled;
            OpenEnvironmentCommand = new OpenEnvironmentConfigurationDeltaCommand(uiService, this, environmentCommandsEnabled);
            NewEnvironmentCommand = new DelegateCommand(x => NewEnvironment(), _ => environmentCommandsEnabled);
        }
        protected override void Arrange()
        {
            base.Arrange();

            commandService = Container.Resolve<MenuCommandService>();
        }