public void SearchFilter(string column, SearchBar entry) { IEnumerable <Inventory> list = new List <Inventory>(); switch (column) { case "Short Description": list = TheData.Where(x => x.ShortDescription.ToUpper().Contains(entry.Text.ToUpper())); break; case "UPC Code": list = TheData.Where(x => x.UPCA.ToUpper().Contains(entry.Text.ToUpper())); break; case "Custom Code": list = TheData.Where(x => x.CustomCode.ToUpper().Contains(entry.Text.ToUpper())); break; default: break; } if (!list.Any()) { entry.TextColor = Color.Red; return; } else { entry.TextColor = Color.Green; } InventoryList = new ObservableCollection <Inventory>(list); OnPropertyChanged("InventoryList"); }
public SaveCommand(TheData theData) { if (theData == null) throw new ArgumentNullException("theData"); this.theData = theData; this.theData.Changed += HandleTheDataChanged; }
public TheDataViewModel(TheData theData) { this.theData = theData; theData.Changed += HandleTheDataChanged; IsChanged = theData.IsModified; }
void Awake() { _instance = this; ItemData.Load(items_folder); ConstructionData.Load(constructions_folder); PlantData.Load(plants_folder); CraftData.Load(); }
public SaveButtonModel(TheData theData) { if (theData == null) throw new ArgumentNullException("theData"); this.theData = theData; theData.Changed += HandleTheDataChanged; Enabled = theData.IsModified; }
public void TestCase() { var theData = new TheData() { ABool = true, AChar = 'A', ADouble = 2, AnInt = 33 }; var aFileName = BinaryReaderWriterExample.WriteData(theData); var thisData = BinaryReaderWriterExample.Readata(aFileName); Assert.AreEqual(theData, thisData); }
public void TestCase() { var theData = new TheData() { ABool = true, AChar = 'A', ADouble = 2, AnInt = 33 }; var aFilePath = StreamReaderWriterExample.WriteData(theData); var aOutStrings = StreamReaderWriterExample.ReadData(aFilePath); Assert.AreEqual(theData.ABool.ToString(), aOutStrings [0]); Assert.AreEqual(theData.AChar.ToString(), aOutStrings [1]); Assert.AreEqual(theData.ADouble.ToString(), aOutStrings [2]); Assert.AreEqual(theData.AnInt.ToString(), aOutStrings [3]); }
public void Initialize() { UserInterface userInterface = new UserInterface(); MyApplication myApplication = new MyApplication(userInterface); TheData theData = new TheData(userInterface, myApplication); MainWindow mainForm = new MainWindow { ViewModel = new MainViewModel(myApplication, theData) }; userInterface.MainWindow = mainForm; userInterface.Run(); }
void Awake() { if (Instance == null) { Instance = this; } else { Debug.LogWarning($"Removed duplicate singleton script on {gameObject.name}"); Destroy(this); } // ItemData.Load(itemsFolder); // CraftData.Load(); }
public MainViewModel(MyApplication myApplication, TheData theData) { if (myApplication == null) throw new ArgumentNullException("myApplication"); if (theData == null) throw new ArgumentNullException("theData"); this.myApplication = myApplication; TheDataModel = new TheDataViewModel(theData); ExitButtonModel = new ExitButtonModel(myApplication); SaveButtonModel = new SaveButtonModel(theData); ChangeButtonModel = new ChangeButtonModel(theData); myApplication.BeforeExiting += HandleMyApplicationBeforeExiting; myApplication.ExitCanceled += HandleMyApplicationExitCanceled; }
public static GameData Get() { return(TheData.Get().data); }
public ChangeButtonModel(TheData theData) { if (theData == null) throw new ArgumentNullException("theData"); this.theData = theData; }
public ChangeCommand(TheData theData) { if (theData == null) throw new ArgumentNullException("theData"); this.theData = theData; }