/// <summary> /// Creates the view model. /// </summary> /// <param name="settings">The settings.</param> /// <param name="parentViewModel">The parent view model.</param> /// <returns>IIntegrationServiceSettingsViewModel.</returns> /// <exception cref="System.ArgumentException">Invalid options type.</exception> public IIntegrationServiceSettingsViewModel CreateViewModel(IIntegrationServiceSettings settings, IIntegrationServiceViewModel parentViewModel) { if (settings is ServiceCreationSettingsEdit) { var viewModel = ServiceCreationSettingsViewModelFactory.CreateExport().Value; viewModel.Initialize((ServiceCreationSettingsEdit)settings, parentViewModel); return viewModel; } if (settings is ServiceCallSettingsEdit) { var viewModel = ServiceCallSettingsViewModelFactory.CreateExport().Value; viewModel.Initialize((ServiceCallSettingsEdit)settings, parentViewModel); return viewModel; } throw new ArgumentException("Invalid options type."); }
/// <summary> /// Refreshes the specified model. /// </summary> /// <param name="model">The model.</param> /// <exception cref="System.ArgumentNullException">model</exception> /// <exception cref="System.ArgumentException">Invalid model type.;model</exception> public void Refresh(IIntegrationServiceSettings model) { if (model == null) throw new ArgumentNullException("model"); if (!(model is ServiceCallSettingsEdit)) throw new ArgumentException("Invalid model type.", "model"); RefreshInternal((ServiceCallSettingsEdit)model); }
/// <summary> /// Refreshes the specified model. /// </summary> /// <param name="model">The model.</param> /// <exception cref="System.InvalidOperationException">Invalid model type.</exception> public void Refresh(IIntegrationServiceSettings model) { if (!(model is ServiceCreationSettingsEdit)) throw new InvalidOperationException("Invalid model type."); RefreshInternal((ServiceCreationSettingsEdit)model); }