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");
        }
Пример #2
0
        public SaveCommand(TheData theData)
        {
            if (theData == null) throw new ArgumentNullException("theData");

            this.theData = theData;
            this.theData.Changed += HandleTheDataChanged;
        }
Пример #3
0
        public TheDataViewModel(TheData theData)
        {
            this.theData = theData;
            theData.Changed += HandleTheDataChanged;

            IsChanged = theData.IsModified;
        }
Пример #4
0
 void Awake()
 {
     _instance = this;
     ItemData.Load(items_folder);
     ConstructionData.Load(constructions_folder);
     PlantData.Load(plants_folder);
     CraftData.Load();
 }
Пример #5
0
        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);
        }
Пример #7
0
        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]);
        }
Пример #8
0
        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();
    }
Пример #10
0
        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;
        }
Пример #11
0
 public static GameData Get()
 {
     return(TheData.Get().data);
 }
Пример #12
0
 public ChangeButtonModel(TheData theData)
 {
     if (theData == null) throw new ArgumentNullException("theData");
     this.theData = theData;
 }
Пример #13
0
        public ChangeCommand(TheData theData)
        {
            if (theData == null) throw new ArgumentNullException("theData");

            this.theData = theData;
        }