private void Window_Loaded(object sender, RoutedEventArgs e) { collectionMonitor = ((App)Application.Current)._recosCollection.collectionMonitor; collectionMonitor.Subscribe(this); LoadRECoComboBox(); this.IsButtonClose = false; NewPerson = new Person(); switch (this.AddType) { case "Agent": { NewAgent = new Agent(); ExistingRECo = new RealEstateCompany(); LoadAgentPanel(); LoadRECoComboBox(); DisableBuyerPanel(); DisableOwnerPanel(); break; } case "Owner": { NewOwner = new Owner(); LoadOwnerPanel(); DisableAgentPanel(); DisableBuyerPanel(); break; } case "Buyer": { NewBuyer = new Buyer(); LoadBuyerPanel(); DisableAgentPanel(); DisableOwnerPanel(); break; } default: { DisplayStatusMessage("No type included. Click Close to exit without saving."); AddOwnerButton.IsEnabled = false; AddBuyerButton.IsEnabled = false; AddAgentButton.IsEnabled = false; UpdatePersonInfoButton.IsEnabled = false; CloseButton.IsEnabled = true; this.IsButtonClose = true; break; } } }
private void Window_Loaded(object sender, RoutedEventArgs e) { personCollectionMonitor = ((App)Application.Current)._peopleCollection.collectionMonitor; personCollectionMonitor.Subscribe(this); recoCollectionMonitor = ((App)Application.Current)._recosCollection.collectionMonitor; recoCollectionMonitor.Subscribe(this); ReceivedPerson = ((App)Application.Current)._peopleCollection.Get(ReceivedPersonID); if (ReceivedPerson == null) { DisplayStatusMessage("No person found. Exit this Window and try again."); return; } var ReceivedRECo = new RealEstateCompany(); var SelectedRECo = new RealEstateCompany(); LoadPersonInformation(); logger = new Logger(); string updateType = CalledByUpdateMenuType; switch (updateType) { case "AGENT": { LoadAgentPanel(); break; } case "BUYER": { LoadBuyerPanel(); break; } case "OWNER": { LoadOwnerPanel(); break; } default: { break; } } IsButtonClose = false; }
private void Window_Loaded(object sender, RoutedEventArgs e) { if (UpdateInsteadOfAdd) { statusBarText.Text = $"Update this home's address or Owner"; this.homeAddressTextbox.Text = NewHome.Address.Trim(); this.homeCityTextbox.Text = NewHome.City.Trim(); this.homeStateTextbox.Text = NewHome.State.Trim(); this.homeZipTextbox.Text = NewHome.Zip.Trim(); } else { statusBarText.Text = $"Add a new { this.AddType } to the database."; } collectionMonitor = ((App)Application.Current)._peopleCollection.collectionMonitor; collectionMonitor.Subscribe(this); RefreshOwnersComboBox(); }
public void SplitIntoBinsCollection() { int[] coll = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 }; const int nBinCount = 5; CollectionMonitor <int> seq = new CollectionMonitor <int>(coll); int nCurrentIndex = 0; foreach (IEnumerable <int> batch in EnumerableUtility.SplitIntoBins <int>(seq, nBinCount)) { foreach (int nValue in batch) { Assert.AreEqual(coll[nCurrentIndex], nValue); nCurrentIndex++; } Assert.AreEqual(nCurrentIndex, seq.RequestCount); } Assert.AreEqual(coll.Length, nCurrentIndex); Assert.AreEqual(nCurrentIndex, seq.RequestCount); }
public HomesCollection(List <Home> homes) { _homesList = homes; collectionMonitor = new CollectionMonitor(); }
/// <summary> /// Constructor. /// </summary> public HomesCollection() { //_homesList = new List<Home>(); _homesList = new List <Home>(EntityLists.GetTreeListOfHomes()); collectionMonitor = new CollectionMonitor(); }
/// <summary> /// Validate that minimal inputs are received when this Window Opens, otherwise turn off all editing options and only allow user to Close it. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Window_Loaded(object sender, RoutedEventArgs e) { collectionMonitor = ((App)Application.Current)._peopleCollection.collectionMonitor; collectionMonitor.Subscribe(this); AddNewAgentButton.Visibility = Visibility.Hidden; AddNewAgentButton.IsEnabled = false; AddNewBuyerButton.Visibility = Visibility.Hidden; AddNewBuyerButton.IsEnabled = false; LoadBuyersCombobox(); LoadAgentsCombobox(true); if (UpdateHome != null && UpdateHome.HomeID > -1) { UpdateHomeSale.HomeID = UpdateHome.HomeID; } logger = new Logger(); int count = 0; if (UpdateHome != null) { count++; } if (UpdateType.Count() > 3) { count++; } if (UpdatePerson != null) { count++; } if (UpdateHome != null) { count++; } if (UpdateReco != null) { count++; } if (UpdateHomeSale != null) { count++; } if (UpdateAgent != null) { count++; } if (UpdateBuyer != null) { count++; } if (UpdateOwner != null) { count++; } if (count > 2) // UpdateHome and UpdateType are absolutely required { LoadPanelsAndFields(); } else { ShowCloseButtonOnly(); } }
public void Setup() { _source = ClinqTestFactory.CreateTwoPersonSource(); _target = new CollectionMonitor <Person>(_source); }
public void Setup() { _source = ClinqTestFactory.CreateTwoPersonSource(); _target = new CollectionMonitor<Person>(_source); }
/// <summary> /// Constructor will initialize this Collection with a List of type RealEstateCompany instances. /// </summary> /// <param name="reCompanies"></param> public RealEstateCosCollection(List <RealEstateCompany> reCompanies) { _recoList = reCompanies; collectionMonitor = new CollectionMonitor(); }
public PeopleCollection(List <T> peopleList) { _peopleList = peopleList; collectionMonitor = new CollectionMonitor(); }