Example #1
0
        public static bool ParseModFile(string modFileData)
        {
            if (SystemsContainer.Get <ModSystem>().ModControl == ModControlMode.Disabled)
            {
                return(true);
            }

            SystemsContainer.Get <ModSystem>().LastModFileData = modFileData; //Save mod file so we can recheck it.

            StringBuilder = new StringBuilder();
            ParseRequired.Clear();
            ParseOptional.Clear();
            WhiteList.Clear();
            BlackList.Clear();
            PartsList.Clear();

            SaveCurrentModConfigurationFile();

            ReadModConfigurationFile(modFileData);

            CheckFiles();

            if (!ModCheckOk)
            {
                SystemsContainer.Get <ModSystem>().FailText = StringBuilder.ToString();
                WindowsContainer.Get <ModWindow>().Display  = true;
                return(false);
            }

            SystemsContainer.Get <ModSystem>().AllowedParts = PartsList;
            LunaLog.Log("[LMP]: Mod check passed!");
            return(true);
        }
Example #2
0
        public static bool ParseModFile(string modFileData)
        {
            if (ModSystem.Singleton.ModControl == ModControlMode.DISABLED)
            {
                return(true);
            }

            ModSystem.Singleton.LastModFileData = modFileData; //Save mod file so we can recheck it.

            StringBuilder = new StringBuilder();
            ParseRequired.Clear();
            ParseOptional.Clear();
            WhiteList.Clear();
            BlackList.Clear();
            PartsList.Clear();

            SaveCurrentModConfigurationFile();

            ReadModConfigurationFile(modFileData);

            CheckFiles();

            if (!ModCheckOk)
            {
                ModSystem.Singleton.FailText = StringBuilder.ToString();
                ModWindow.Singleton.Display  = true;
                return(false);
            }

            ModSystem.Singleton.AllowedParts = PartsList;
            Debug.Log("[LMP]: Mod check passed!");
            return(true);
        }
Example #3
0
        public DataEditViewModel(IPartsListRipository partsListRipository,
                                 IBomRepository bomRepository)
        {
            _partsListRipository = partsListRipository;
            _bomRepository       = bomRepository;

            PartsList.Clear();
            foreach (var partslist in _partsListRipository.GetPartsList(1))
            {
                PartsList.Add(new PartsListEtity(partslist.Id, partslist.SqkId, partslist.PartsNumber,
                                                 partslist.PartsName, partslist.PartsQuantity));
            }

            BomList.Clear();
            foreach (var bomlist in _bomRepository.GetBoms("test"))
            {
                BomList.Add(new BomEntity(bomlist.Id, bomlist.AircraftNumber, bomlist.AssyNo,
                                          bomlist.PartsNo, bomlist.NeedQuantity, bomlist.ReceivedQuantity, bomlist.Memo));
                OriginalQuantityText += bomlist.ReceivedQuantity;
            }

            UpdateButton = new DelegateCommand(UpdateButtonExecute);

            DivideQuantityText    = 10;
            RemainingQuantityText = DivideQuantityText;
        }
Example #4
0
 private void PartsListUpDate()
 {
     PartsList.Clear();
     foreach (var partslist in _partsListRipository.GetPartsList(Convert.ToInt32(SqkIdText)))
     {
         PartsList.Add(new PartsListEtity(partslist.Id, partslist.SqkId, partslist.PartsNumber,
                                          partslist.PartsName, partslist.PartsQuantity));
     }
 }
Example #5
0
 private void Reset()
 {
     PartsList.Clear();
     SelectedPartsList = null;
     SelectedSqk       = null;
     SqkIdText         = string.Empty;
     PartsNumberText   = string.Empty;
     PartsQuantityText = string.Empty;
 }
Example #6
0
 public void Clear()
 {
     PartsList.Clear();
 }