public void then_name_contains_key_property_value() { var KeyValueElement = AppSettingsView.GetDescendentsOfType <KeyValueConfigurationElement>().First(); var KeyProperty = KeyValueElement.Property("Key"); Assert.IsTrue(KeyValueElement.Name.Contains((string)KeyProperty.Value)); }
public void then_can_create_new_app_setting() { var KeyValueCollection = AppSettingsView.GetDescendentsOfType <KeyValueConfigurationCollection, ElementCollectionViewModel>().First(); var element = KeyValueCollection.AddNewCollectionElement(typeof(KeyValueConfigurationElement)); Assert.IsNotNull(element); }
public void then_appsetting_key_property_has_display_name_attribute() { var KeyValueElement = AppSettingsView.GetDescendentsOfType <KeyValueConfigurationElement>().First(); var KeyProperty = KeyValueElement.Property("Key"); Assert.IsTrue(KeyProperty.Attributes.OfType <DisplayNameAttribute>().Any()); }
public void then_key_property_is_writeable() { var KeyValueElement = AppSettingsView.GetDescendentsOfType <KeyValueConfigurationElement>().First(); var KeyProperty = KeyValueElement.Property("Key"); KeyProperty.Value = "new value"; Assert.AreEqual("new value", KeyProperty.Value); }
private void ExecuteAddCommand() { var view = new AppSettingsView() { Owner = MainWindow.Instance, }; (view.DataContext as AppSettingsViewModel).Model = new ManagedWindowModel(); (view.DataContext as AppSettingsViewModel).RefreshManagedWindowsListCallback = () => this.RefreshList(); view.Show(); }
void AppSettingsStartup(bool smth) { var ctx = new ModalDialogContext(); AppSettingsView .Show(ctx) .Subscribe( result => { ctx.Dispose(); }, error => { ctx.Dispose(); dbg.Error(error); } ); }
protected override void Act() { var collection = (ElementCollectionViewModel)base.AppSettingsView.GetDescendentsOfType <KeyValueConfigurationCollection>().FirstOrDefault(); var newElement = collection.AddNewCollectionElement(typeof(KeyValueConfigurationElement)); newElement.Property("Key").Value = "new-setting"; newElement.Property("Value").Value = "value"; var newElement2 = collection.AddNewCollectionElement(typeof(KeyValueConfigurationElement)); newElement2.Property("Key").Value = "new-setting-2"; newElement2.Property("Value").Value = "value"; DesignDictionaryConfigurationSource saveSource = new DesignDictionaryConfigurationSource(); AppSettingsView.Save(saveSource); savedSection = (AppSettingsSection)saveSource.GetSection("appSettings"); }
public void ShowView(AppSettingsArgs args) { if (args == null) { throw new ArgumentNullException("AppSettingsArgs"); } var win = new AppSettingsView() { DataContext = new AppSettingsViewModel(args.WndTitle) { AccessToken = args.SrvSettings?.AccessToken, ServiceUrl = args.SrvSettings?.ServiceUrl, VersionDate = args.SrvSettings?.VersionDate } }; win.Closing += this.DialogClosing; win.Owner = Application.Current.MainWindow; win.ShowDialog(); }
public void then_appsetting_collection_has_display_name_attribute() { var KeyValueCollection = AppSettingsView.GetDescendentsOfType <KeyValueConfigurationCollection>().First(); Assert.IsTrue(KeyValueCollection.Attributes.OfType <DisplayNameAttribute>().Any()); }
protected override void Act() { AppSettingsView.Save(saveSource); }