How to use OnPropertyChanged method of NBi.UI.Genbi.Presenter.TestCasesPresenter class

Best NBi code snippet using NBi.UI.Genbi.Presenter.TestCasesPresenter.OnPropertyChanged

TestCasesPresenter.cs

Source:TestCasesPresenter.cs Github

copy

Full Screen

...108 } 109110 #endregion111112 protected override void OnPropertyChanged(string propertyName)113 {114 base.OnPropertyChanged(propertyName);115 switch (propertyName)116 {117 case "TestCases":118 this.FilterDistinctCommand.Refresh();119 break;120 case "Variables":121 this.RenameVariableCommand.Refresh();122 this.RemoveVariableCommand.Refresh();123 this.MoveLeftVariableCommand.Refresh();124 this.MoveRightVariableCommand.Refresh();125 this.FilterCommand.Refresh();126 break;127 case "VariableSelectedIndex":128 this.RenameVariableCommand.Refresh();129 this.RemoveVariableCommand.Refresh();130 this.MoveLeftVariableCommand.Refresh();131 this.MoveRightVariableCommand.Refresh();132 break;133 case "ConnectionStringNames":134 ReloadConnectionStrings();135 this.RemoveConnectionStringCommand.Refresh();136 this.EditConnectionStringCommand.Refresh();137 break;138 case "ConnectionStringSelectedIndex":139 this.RemoveConnectionStringCommand.Refresh();140 this.EditConnectionStringCommand.Refresh();141 this.RunQueryCommand.Refresh();142 break;143 case "Query":144 this.RunQueryCommand.Refresh();145 break;146 default:147 break;148 }149 }150151 internal void LoadCsv(string fullPath)152 {153 var action = new LoadCaseFromFileAction(fullPath);154 action.Execute(testCaseCollectionManager.CurrentScope);155 Reload();156 OnPropertyChanged("Variables");157 }158159 internal void LoadQuery(string fullPath)160 {161 Query = System.IO.File.ReadAllText(fullPath);162 OnPropertyChanged("Query");163 }164165 internal void RunQuery()166 {167 var action = new LoadCaseFromQueryAction(Query, ConnectionStringSelectedValue);168 action.Execute(testCaseCollectionManager.CurrentScope);169 Reload();170 }171172 private void Reload()173 {174 var dtReader = new DataTableReader(testCaseCollectionManager.CurrentScope.Content);175176 //Reset the state of the DataTable177 //Remove the Sort Order or you'll be in troubles when loading the datatable178 TestCases.DefaultView.Sort = String.Empty;179 TestCases.Rows.Clear();180 TestCases.Columns.Clear();181 TestCases.RejectChanges();182183 //Load it184 TestCases.Load(dtReader, LoadOption.PreserveChanges);185 OnPropertyChanged("TestCases");186187 //Take care of variables188 Variables.Clear();189 foreach (var v in testCaseCollectionManager.CurrentScope.Variables)190 Variables.Add(v);191192 if (VariableSelectedIndex < 0 && Variables.Count > 0)193 VariableSelectedIndex = 0;194 }195196 private void ReloadConnectionStrings()197 {198 //Take care of variables199 ConnectionStringNames.Clear();200 foreach (var connStr in testCaseCollectionManager.ConnectionStringNames)201 ConnectionStringNames.Add(connStr);202203 if (ConnectionStringSelectedIndex < 0 && ConnectionStringNames.Count > 0)204 ConnectionStringSelectedIndex = 0;205 }206207 internal void Rename(int index, string newName)208 {209 var action = new RenameCaseAction(Variables.ElementAt(index), newName);210 action.Execute(testCaseCollectionManager.CurrentScope);211 Reload();212 OnPropertyChanged("Variables");213 }214215 internal void Remove(int index)216 {217 var action = new RemoveCaseAction(new[] { Variables.ElementAt(index) });218 action.Execute(testCaseCollectionManager.CurrentScope);219 Reload();220 OnPropertyChanged("Variables");221 }222223224 internal void Move(int selectedIndex, int newPosition)225 {226 var action = new MoveCaseAction(Variables[VariableSelectedIndex], newPosition);227 action.Execute(testCaseCollectionManager.CurrentScope);228 Reload();229 VariableSelectedIndex = newPosition;230 OnPropertyChanged("Variables");231 }232233 internal void Filter(int selectedIndex, OperatorType @operator, bool negation, string text)234 {235 var action = new FilterCaseAction(Variables[VariableSelectedIndex], @operator, new[] { text }, negation);236 action.Execute(testCaseCollectionManager.CurrentScope);237 Reload();238 OnPropertyChanged("TestCases");239 }240 internal void FilterDistinct()241 {242 var action = new FilterDistinctCaseAction();243 action.Execute(testCaseCollectionManager.CurrentScope);244 Reload();245 OnPropertyChanged("TestCases");246 }247248 internal bool IsRenamable()249 {250 return Variables.Count > 0;251 }252253 internal bool IsDeletable()254 {255 return Variables.Count > 1;256 }257258 internal bool IsValidVariableName(string variableName)259 {260 return !string.IsNullOrEmpty(variableName) && Variables.Contains(variableName);261 }262263 internal bool IsFirst()264 {265 return VariableSelectedIndex == 0;266 }267268 internal bool IsLast()269 {270 return VariableSelectedIndex == Variables.Count - 1;271 }272273 internal void AddConnectionString(string name, string value)274 {275 testCaseCollectionManager.AddConnectionStrings(name, value);276 OnPropertyChanged("ConnectionStringNames");277 }278279 internal void RemoveConnectionString()280 {281 testCaseCollectionManager.RemoveConnectionStrings(ConnectionStringSelectedName);282 OnPropertyChanged("ConnectionStringNames");283 }284285 internal void EditConnectionString(string newValue)286 {287 testCaseCollectionManager.EditConnectionStrings(ConnectionStringSelectedName, newValue);288 OnPropertyChanged("ConnectionStringNames");289 }290 }291} ...

Full Screen

Full Screen

TestCasesControl.cs

Source:TestCasesControl.cs Github

copy

Full Screen

...4142 connectionStringNames.DataBindings.Add("SelectedIndex", presenter, "ConnectionStringSelectedIndex", true, DataSourceUpdateMode.OnValidation);43 connectionStringNames.SelectedIndexChanged += (s, args) => connectionStringNames.DataBindings["SelectedIndex"].WriteValue();4445 sqlEditor.DataBindings.Add("Text", presenter, "Query", true, DataSourceUpdateMode.OnPropertyChanged);46 presenter.PropertyChanged += (sender, e) => { sqlEditor.Text = presenter.Query; };47 }48 }4950 public Button RemoveCommand51 {52 get53 {54 return remove;55 }56 }5758 public Button RenameCommand59 { ...

Full Screen

Full Screen

OnPropertyChanged

Using AI Code Generation

copy

Full Screen

1{2 public event PropertyChangedEventHandler PropertyChanged;3 public void OnPropertyChanged(string propertyName)4 {5 if (PropertyChanged != null)6 {7 PropertyChanged(this, new PropertyChangedEventArgs(propertyName));8 }9 }10}11{12 public event PropertyChangedEventHandler PropertyChanged;13 public void OnPropertyChanged(string propertyName)14 {15 if (PropertyChanged != null)16 {17 PropertyChanged(this, new PropertyChangedEventArgs(propertyName));18 }19 }20}21{22 public List<ViewModelObject> ViewModelObjects { get; set; }23 public ViewModel()24 {25 ViewModelObjects = new List<ViewModelObject>();26 for (int i = 0; i < 10; i++)27 {28 ViewModelObjects.Add(new ViewModelObject());29 }30 }31}32{33 public bool IsSelected { get; set; }34}35{36 public List<ViewModelObject> ViewModelObjects { get; set; }37 public ViewModel()38 {39 ViewModelObjects = new List<ViewModelObject>();40 for (int i = 0; i < 10; i++)41 {42 ViewModelObjects.Add(new ViewModelObject());43 }44 }45}

Full Screen

Full Screen

OnPropertyChanged

Using AI Code Generation

copy

Full Screen

1using NBi.UI.Genbi.Presenter;2using NBi.UI.Genbi.View.TestSuiteGenerator;3using System;4using System.Collections.Generic;5using System.Linq;6using System.Text;7using System.Threading.Tasks;8using System.Windows.Forms;9{10 {11 public TestCasesPresenter(ITestCasesView view)12 {13 view.TestCasesChanged += (s, e) => OnPropertyChanged("TestCases");14 }15 public event EventHandler TestCasesChanged;16 protected virtual void OnPropertyChanged(string propertyName)17 {18 if (TestCasesChanged != null)19 TestCasesChanged(this, new EventArgs());20 }21 }22}

Full Screen

Full Screen

OnPropertyChanged

Using AI Code Generation

copy

Full Screen

1using NBi.UI.Genbi.Presenter;2TestCasesPresenter testCasesPresenter = new TestCasesPresenter();3testCasesPresenter.OnPropertyChanged("TestCases");4using NBi.UI.Genbi.Presenter;5TestCasesPresenter testCasesPresenter = new TestCasesPresenter();6testCasesPresenter.OnTestCasesChanged();7using NBi.UI.Genbi.Presenter;8TestCasesPresenter testCasesPresenter = new TestCasesPresenter();9testCasesPresenter.OnTestCasesChanged();10using NBi.UI.Genbi.Presenter;11TestCasesPresenter testCasesPresenter = new TestCasesPresenter();12testCasesPresenter.OnPropertyChanged("TestCases");

Full Screen

Full Screen

OnPropertyChanged

Using AI Code Generation

copy

Full Screen

1using NBi.UI.Genbi.Presenter;2using NBi.UI.Genbi.View.TestSuiteGenerator;3using NBi.UI.Genbi.View.TestSuiteGenerator.Events;4{5 {6 public void MyMethod()7 {8 var presenter = new TestCasesPresenter();9 presenter.TestCasesView = new TestCasesView();10 presenter.TestCasesView.TestCasesPresenter = presenter;11 presenter.TestCasesView.TestCasesPresenter.TestCasesView = presenter.TestCasesView;12 presenter.TestCasesView.TestCasesPresenter.TestCasesView.TestCasesPresenter = presenter.TestCasesView.TestCasesPresenter;13 presenter.TestCasesView.TestCasesPresenter.TestCasesView.TestCasesPresenter.TestCasesView = presenter.TestCasesView.TestCasesPresenter.TestCasesView;14 presenter.TestCasesView.TestCasesPresenter.TestCasesView.TestCasesPresenter.TestCasesView.TestCasesPresenter = presenter.TestCasesView.TestCasesPresenter.TestCasesView.TestCasesPresenter;15 presenter.TestCasesView.TestCasesPresenter.TestCasesView.TestCasesPresenter.TestCasesView.TestCasesPresenter.TestCasesView = presenter.TestCasesView.TestCasesPresenter.TestCasesView.TestCasesPresenter.TestCasesView;16 presenter.TestCasesView.TestCasesPresenter.TestCasesView.TestCasesPresenter.TestCasesView.TestCasesPresenter.TestCasesView.TestCasesPresenter = presenter.TestCasesView.TestCasesPresenter.TestCasesView.TestCasesPresenter.TestCasesView.TestCasesPresenter;17 presenter.TestCasesView.TestCasesPresenter.TestCasesView.TestCasesPresenter.TestCasesView.TestCasesPresenter.TestCasesView.TestCasesPresenter.TestCasesView = presenter.TestCasesView.TestCasesPresenter.TestCasesView.TestCasesPresenter.TestCasesView.TestCasesPresenter.TestCasesView;18 presenter.TestCasesView.TestCasesPresenter.TestCasesView.TestCasesPresenter.TestCasesView.TestCasesPresenter.TestCasesView.TestCasesPresenter.TestCasesView.TestCasesPresenter = presenter.TestCasesView.TestCasesPresenter.TestCasesView.TestCasesPresenter.TestCasesView.TestCasesPresenter.TestCasesView.TestCasesPresenter;19 presenter.TestCasesView.TestCasesPresenter.TestCasesView.TestCasesPresenter.TestCasesView.TestCasesPresenter.TestCasesView.TestCasesPresenter.TestCasesView.TestCasesPresenter.TestCasesView = presenter.TestCasesView.TestCasesPresenter.TestCasesView.TestCasesPresenter.TestCasesView.TestCasesPresenter.TestCasesView.TestCasesPresenter.TestCasesView;

Full Screen

Full Screen

OnPropertyChanged

Using AI Code Generation

copy

Full Screen

1var presenter = new NBi.UI.Genbi.Presenter.TestCasesPresenter();2presenter.TestCases.Add(new NBi.UI.Genbi.TestCaseItem());3presenter.TestCases[0].Name = "test";4var presenter = new NBi.UI.Genbi.Presenter.TestCasesPresenter();5presenter.TestCases.Add(new NBi.UI.Genbi.TestCaseItem());6presenter.TestCases[0].Name = "test";7var presenter = new NBi.UI.Genbi.Presenter.TestCasesPresenter();8presenter.TestCases.Add(new NBi.UI.Genbi.TestCaseItem());9presenter.TestCases[0].Name = "test";10var presenter = new NBi.UI.Genbi.Presenter.TestCasesPresenter();11presenter.TestCases.Add(new NBi.UI.Genbi.TestCaseItem());12presenter.TestCases[0].Name = "test";13var presenter = new NBi.UI.Genbi.Presenter.TestCasesPresenter();14presenter.TestCases.Add(new NBi.UI.Genbi.TestCaseItem());15presenter.TestCases[0].Name = "test";16var presenter = new NBi.UI.Genbi.Presenter.TestCasesPresenter();17presenter.TestCases.Add(new NBi.UI.Genbi.TestCaseItem());18presenter.TestCases[0].Name = "test";19var presenter = new NBi.UI.Genbi.Presenter.TestCasesPresenter();20presenter.TestCases.Add(new NBi.UI.Genbi.TestCaseItem());21presenter.TestCases[0].Name = "test";22var presenter = new NBi.UI.Genbi.Presenter.TestCasesPresenter();23presenter.TestCases.Add(new NBi.UI.Genbi.TestCaseItem());24presenter.TestCases[0].Name = "test";25var presenter = new NBi.UI.Genbi.Presenter.TestCasesPresenter();

Full Screen

Full Screen

OnPropertyChanged

Using AI Code Generation

copy

Full Screen

1this.Dispatcher.BeginInvoke(DispatcherPriority.Normal, new Action(() =>2{3 this.testCasesPresenter.OnPropertyChanged("TestCases");4}));5this.Dispatcher.BeginInvoke(DispatcherPriority.Normal, new Action(() =>6{7 this.testCasesPresenter.OnPropertyChanged("TestCases");8}));9this.Dispatcher.BeginInvoke(DispatcherPriority.Normal, new Action(() =>10{11 this.testCasesPresenter.OnPropertyChanged("TestCases");12}));13this.Dispatcher.BeginInvoke(DispatcherPriority.Normal, new Action(() =>14{15 this.testCasesPresenter.OnPropertyChanged("TestCases");16}));17this.Dispatcher.BeginInvoke(DispatcherPriority.Normal, new Action(() =>18{19 this.testCasesPresenter.OnPropertyChanged("TestCases");20}));21this.Dispatcher.BeginInvoke(DispatcherPriority.Normal, new Action(() =>22{23 this.testCasesPresenter.OnPropertyChanged("TestCases");24}));

Full Screen

Full Screen

OnPropertyChanged

Using AI Code Generation

copy

Full Screen

1 private void LoadTestCases()2 {3 var testCases = new List<TestCase>();4 testCases.Add(new TestCase("My first test", "My first test", new List<TestCase>()));5 testCases.Add(new TestCase("My second test", "My second test", new List<TestCase>()));6 TestCases = testCases;7 }8 private void LoadTestCases()9 {10 var testCases = new List<TestCase>();11 testCases.Add(new TestCase("My first test", "My first test", new List<TestCase>()));12 testCases.Add(new TestCase("My second test", "My second test", new List<TestCase>()));13 TestCases = testCases;14 }15 private void LoadTestCases()16 {17 var testCases = new List<TestCase>();18 testCases.Add(new TestCase("My first test", "My first test", new List<TestCase>()));19 testCases.Add(new TestCase("My second test", "My second test", new List<TestCase>()));20 TestCases = testCases;21 }

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run NBi automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful