Exemplo n.º 1
0
        public void Execute()
        {
            //Статус выполнения чтения данных
            _status = LoadStatus.ReadingData;
            try
            {
                if (_dataFileName == string.Empty)
                {
                    Console.WriteLine("Имя файла не указано");
                    throw new Exception("Имя файла не указано");
                }
                if (!(File.Exists(@"C:\Users\Ram\Desktop\КАИ\Конструирование ПО\" + _dataFileName)))
                {
                    Console.WriteLine("Файла не существует");
                    throw new Exception("Файла " + _dataFileName + " не существует!");
                }
                //Создание нового списка
                _carsList = new List <Car>();

                //Чтение данных
                StreamReader sr = null;

                using (sr = new StreamReader(@"C:\Users\Ram\Desktop\КАИ\Конструирование ПО\" + _dataFileName))
                {
                    while (!sr.EndOfStream)
                    {
                        //Прочитать очередную строку
                        string str = sr.ReadLine();
                        //Console.WriteLine(str);
                        string[] arr = str.Split('|');
                        //Создать новый объект
                        Car car = new Car()
                        {
                            Mark  = arr[0],
                            Model = arr[1],
                            Price = arr[2]
                        };
                        _carsList.Add(car);
                    }
                }
                //Статус чтения данных успешно
                _status = LoadStatus.Succes;
            }
            catch (Exception ex)
            {
                _status = LoadStatus.ReadingError;
                Console.WriteLine("ExecuteError");
                LogUtility.ErrorLog(ex);
            }
        }
Exemplo n.º 2
0
        private IEnumerator TransitionStateRoutine <TV>(TV gameStatePrefab, Action <TV> initializeState = null, Action onStateLoaded = null) where TV : GameState
        {
            PartyParrotManager.Instance.LoadingManager.ShowLoadingScreen(true);

            IEnumerator exitRunner = ExitCurrentStateRoutine();

            while (exitRunner.MoveNext())
            {
                yield return(null);
            }

            // TODO: this should enable the state from the set rather than allocating
            TV gameState = Instantiate(gameStatePrefab, transform);

            initializeState?.Invoke(gameState);

            PartyParrotManager.Instance.LoadingManager.UpdateLoadingScreen(0.0f, "Loading scene...");
            yield return(null);

            IEnumerator <float> runner = gameState.LoadSceneRoutine();

            while (runner.MoveNext())
            {
                PartyParrotManager.Instance.LoadingManager.UpdateLoadingScreen(runner.Current * 0.5f, "Loading scene...");
                yield return(null);
            }

            PartyParrotManager.Instance.LoadingManager.UpdateLoadingScreen(0.5f, "Scene loaded!");
            yield return(null);

            _currentGameState = gameState;
            IEnumerator <LoadStatus> enterRunner = _currentGameState.OnEnterRoutine();

            while (enterRunner.MoveNext())
            {
                LoadStatus status = enterRunner.Current;
                if (null != status)
                {
                    PartyParrotManager.Instance.LoadingManager.UpdateLoadingScreen(0.5f + status.LoadPercent * 0.5f, status.Status);
                }
                yield return(null);
            }

            PartyParrotManager.Instance.LoadingManager.UpdateLoadingScreen(1.0f, "Done!");
            yield return(null);

            PartyParrotManager.Instance.LoadingManager.ShowLoadingScreen(false);

            onStateLoaded?.Invoke();
        }
Exemplo n.º 3
0
        private IEnumerator ExitCurrentStateRoutine()
        {
            while (null != _currentSubGameState || _subStateStack.Count > 0)
            {
                PopSubState();
            }

            if (null == _currentGameState)
            {
                yield break;
            }

            _currentGameState.OnExit();

            GameState gameState = _currentGameState;

            _currentGameState = null;

            PartyParrotManager.Instance.LoadingManager.UpdateLoadingScreen(0.0f, "Unloading current scene...");
            yield return(null);

            IEnumerator <float> runner = gameState.UnloadSceneRoutine();

            while (runner.MoveNext())
            {
                PartyParrotManager.Instance.LoadingManager.UpdateLoadingScreen(runner.Current * 0.5f, "Unloading current scene...");
                yield return(null);
            }

            PartyParrotManager.Instance.LoadingManager.UpdateLoadingScreen(0.5f, "Unloading current scene...");
            yield return(null);

            IEnumerator <LoadStatus> exitRunner = gameState.OnExitRoutine();

            while (exitRunner.MoveNext())
            {
                LoadStatus status = exitRunner.Current;
                if (null != status)
                {
                    PartyParrotManager.Instance.LoadingManager.UpdateLoadingScreen(0.5f + status.LoadPercent * 0.5f, status.Status);
                }
                yield return(null);
            }

            PartyParrotManager.Instance.LoadingManager.UpdateLoadingScreen(1.0f, "Current scene unloaded!");
            yield return(null);

            // TODO: disable the state, don't destroy it
            Destroy(gameState.gameObject);
        }
Exemplo n.º 4
0
    public bool CancelLoading()
    {
        if (loadStatus == LoadStatus.Loading)
        {
            StopCoroutine(_coroutine);
            loadStatus = LoadStatus.Cancelled;

            return(true);
        }
        else
        {
            return(false);
        }
    }
        public void Execute()
        {
            try
            {
                _status = LoadStatus.None;
                if (_filePath == "")
                {
                    _status = LoadStatus.FileNameIsEmpty;
                    throw new Exception("Неправильные входные параметры");
                }

                if (!File.Exists(_filePath))
                {
                    _status = LoadStatus.FileNotExists;
                    throw new Exception("Файл не существует");
                }

                StreamReader sr = null;
                using (sr = new StreamReader(_filePath))
                {
                    while (!sr.EndOfStream)
                    {
                        string str = sr.ReadLine();
                        try
                        {
                            string[]      arr           = str.Split('|');
                            SemiConductor semiconductor = new SemiConductor
                            {
                                Substance_name      = arr[0],
                                ForbiddenZone_width = float.Parse(arr[1]) /*(float)0.15*/,
                                Electron_move       = int.Parse(arr[2]),
                                Hole_move           = int.Parse(arr[3])
                            };
                            _semiconductorList.Add(semiconductor);
                        }
                        catch (Exception ex)
                        {
                            _status = LoadStatus.GeneralError;
                            LogUtility.ErrorLog(ex);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                LogUtility.ErrorLog(ex);
            }
            _status = LoadStatus.Success;
        }
Exemplo n.º 6
0
        /// <summary>
        /// Constructor
        /// </summary>
        public SplashScreen()
        {
            InitializeComponent();
            CurrentState     = State.DirectoryCheck;
            CurrentStatus    = CheckStatus.Checking;
            CurrentAppStatus = LoadStatus.Loading;

            errorList = new List <string>();

            AccessUtils.AppDirectoryPath = Configuration.AppDir;
            AccessUtils.DatabasePath     = Configuration.DbPath;
            AccessUtils.AI = new AccessInfo {
                FileName = Configuration.DbPath
            };
        }
 public void OnCompletion(Exception optionalException)
 {
     if (optionalException != null)
     {
         LoadStatus = Controls.LoadStatus.Failed;
     }
     // else: could consider setting loaded, too...
     else if (IsLoadComplete == false)
     {
         //LoadStatus = Controls.LoadStatus.Loaded;
         // GIC probably!
         System.Diagnostics.Debug.WriteLine("Warning: this object should have perhaps manually set its bit... unless it's a delaying object.");
         // hmm should it have been set?
     }
 }
Exemplo n.º 8
0
        public void Load()
        {
            if (IsGhost)
            {
                status = LoadStatus.LOADING;

                var customer = load();

                base.Name            = customer.Name;
                base.ShippingAddress = customer.ShippingAddress;
                base.City            = customer.City;
                base.PostalCode      = customer.PostalCode;
                base.Country         = customer.Country;
            }
        }
Exemplo n.º 9
0
        private void loadDta()
        {
            if (s == LoadStatus.GHOST)
            {
                s = LoadStatus.LOADING;
                var customer = load();
                base.Name            = customer.Name;
                base.ShippingAddress = customer.ShippingAddress;
                base.City            = customer.City;
                base.PostalCode      = customer.PostalCode;
                base.Country         = customer.Country;

                s = LoadStatus.LOADED;
            }
        }
Exemplo n.º 10
0
        public void Execute()
        {
            _status = LoadStatus.None;
            if (_dataFileName == null)
            {
                _status = LoadStatus.FileNameIsEmpty;
                throw new Exception("Имя файла не задано");
            }

            if (!File.Exists(Path.GetFullPath(_dataFileName)))
            {
                _status = LoadStatus.FileNotExists;
                throw new Exception("Файл не существует ");
            }

            StreamReader reader = null;

            _substances = new List <Substance>();
            using (reader = new StreamReader(_dataFileName)) {
                while (!reader.EndOfStream)
                {
                    try
                    {
                        string   str   = reader.ReadLine();
                        string[] array = str.Split('|');
                        Console.WriteLine(array[2]);
                        _substances.Add(new Substance()
                        {
                            name            = array[0],
                            type            = Convert.ToChar(array[1]),
                            lowTemperature  = (float)Convert.ToDouble(array[2]),
                            highTemperature = (float)Convert.ToDouble(array[3])
                        });
                    } catch (Exception ex) {
                        LogUtility.ErrorLog(ex.Message);
                        _status = LoadStatus.GeneralError;
                        var alert = new NSAlert();
                        alert.InformativeText = ex.Message;
                        alert.MessageText     = "Произошла ошибка";
                        alert.RunModal();
                    }
                }
                if (_status != LoadStatus.GeneralError)
                {
                    _status = LoadStatus.Success;
                }
            }
        }
Exemplo n.º 11
0
 /// <summary>
 /// A timer used to check the current status of the applicaiton load.
 /// </summary>
 /// <param name="sender">The timer</param>
 /// <param name="e">the tick event</param>
 private void timer1_Tick(object sender, EventArgs e)
 {
     if (runningThread == false && CurrentAppStatus != LoadStatus.Complete)
     {
         runningThread = true;
         if (CurrentState == State.DirectoryCheck)
         {
             new Thread(() => {
                 CheckApplicationFolderStructure();
             }).Start();
         }
         else if (CurrentState == State.FileCheck)
         {
             new Thread(() => {
                 CheckApplicationFiles();
             }).Start();
         }
         else if (CurrentState == State.DatabaseCheck)
         {
             new Thread(() => {
                 CheckDatabase();
             }).Start();
         }
     }
     else
     {
         if (CurrentStatus == CheckStatus.Complete)
         {
             if (CurrentState == State.DatabaseCheck)
             {
                 CurrentAppStatus = LoadStatus.Complete;
                 Thread thrd = new Thread(() => { loadMainThread(); });
                 thrd.SetApartmentState(ApartmentState.STA);
                 Hide();
                 timer1.Stop();
                 thrd.Start();
                 thrd.Join();        // Wait here on this thread until the application is closed.
                 Application.Exit(); // Close the splash screen (main thread)
             }
             else
             {
                 runningThread = false;
                 CurrentStatus = CheckStatus.Checking;
                 CurrentState++;
             }
         }
     }
 }
Exemplo n.º 12
0
 public void LoadDatabase(string _RealmPath, DateTime?_HistoryEarliestDateTime = null)
 {
     lock (m_LockObj)
     {
         if (m_LoadStatus == LoadStatus.EverythingLoaded)
         {
             m_LoadStatus = LoadStatus.CurrentlyLoading;
         }
         else
         {
             return;
         }
     }
     m_LoaderThread = new System.Threading.Thread(() => Thread_LoadDatabase(_RealmPath, _HistoryEarliestDateTime));
     m_LoaderThread.Start();
 }
Exemplo n.º 13
0
    private IEnumerator BeginInitialize()
    {
        if (mStatus == LoadStatus.Done)
        {
            yield break;
        }
        else if (mStatus == LoadStatus.Loading)
        {
            yield return(new WaitUntil(() => mStatus >= LoadStatus.Done));
        }
        else
        {
            mStatus = LoadStatus.Loading;
            //初始化资源列表
            yield return(AssetPath.Initialize());

            if (AssetPath.status == LoadStatus.Done)
            {
                if (AssetPath.mode == AssetMode.AssetBundle)
                {
                    if (string.IsNullOrEmpty(AssetPath.list.manifest))
                    {
                        mStatus = LoadStatus.Error;
                        Debug.LogError("AssetPath.list.manifest is null !!!");
                    }
                    else
                    {
                        BundleAsset bundle = GetOrCreateBundle <BundleAsset>(AssetPath.list.manifest);

                        AssetLoadTask <AssetBundleManifest> task = new AssetLoadTask <AssetBundleManifest>(AssetPath.list.manifest, FinishInitialize);

                        task.assetName = "AssetBundleManifest";

                        yield return(bundle.LoadAssetAsync(task));
                    }
                }
                else
                {
                    FinishInitialize(null);
                }
            }
            else
            {
                mStatus = LoadStatus.Error;
            }
        }
    }
        public void Execute()
        {
            try
            {
                {
                    Accessory accessory = new Accessory()
                    {
                        name     = "RT-11-24",
                        type     = "R",
                        value    = "100000",
                        quantity = "12"
                    };

                    accessoryList.Add(accessory);
                }

                {
                    Accessory accessory = new Accessory()
                    {
                        name     = "RT-11-24",
                        type     = "R",
                        value    = "50000",
                        quantity = "10"
                    };

                    accessoryList.Add(accessory);
                }

                {
                    Accessory accessory = new Accessory()
                    {
                        name     = "CGU-12K",
                        type     = "C",
                        value    = "17.5",
                        quantity = "3"
                    };

                    accessoryList.Add(accessory);
                }
            }
            catch (Exception ex)
            {
                LogUtility.ErrorLog(ex);
            }

            _status = LoadStatus.Success;
        }
        public void Execute()
        {
            _status = LoadStatus.Reading;

            if (_dataFileName == "")
            {
                _status = LoadStatus.FileNameIsEmpty;
                onStatusChangedDelegate?.Invoke(_status);
                throw new Exception("Имя файла отсутствует");
            }
            if (!File.Exists(_dataFileName))
            {
                _status = LoadStatus.FileNotExists;
                onStatusChangedDelegate?.Invoke(_status);
                throw new FileNotFoundException();
            }


            StreamReader sr = null;

            using (sr = new StreamReader(_dataFileName))
            {
                while (!sr.EndOfStream)
                {
                    try
                    {
                        string        str = sr.ReadLine();
                        string[]      arr = str.Split('|');
                        SearchProject newSearchProject = new SearchProject()
                        {
                            year        = arr[0],
                            director    = arr[1],
                            diamAntenna = Convert.ToInt32(arr[2]),
                            frequency   = Convert.ToInt32(arr[3])
                        };
                        _searchProjectList.Add(newSearchProject);
                    }
                    catch (Exception ex)
                    {
                        LogUtility.ErrorLog(ex);
                        _status = LoadStatus.GeneralError;
                    }
                }
            }
            _status = LoadStatus.Success;
            onStatusChangedDelegate?.Invoke(_status);
        }
Exemplo n.º 16
0
    public virtual bool Unload(bool force = false)
    {
        if (force == false)
        {
            Debug.Log("卸载Bundle:" + bundleName);
        }
        AssetLoader.RemoveBundle(this);

        if (bundle != null)
        {
            bundle.Unload(true);
            bundle = null;
        }
        status = LoadStatus.None;

        return(true);
    }
Exemplo n.º 17
0
 private void OnDestroy()
 {
     mBundleNameList.Clear();
     mBundleNameList.AddRange(mAssetBundleDic.Keys);
     for (int i = 0; i < mBundleNameList.Count; ++i)
     {
         var bundleName = mBundleNameList[i];
         if (mAssetBundleDic.TryGetValue(bundleName, out Bundle bundle))
         {
             bundle.Unload(true);
         }
     }
     mBundleNameList.Clear();
     mAssetBundleDic.Clear();
     mAssetManifest = null;
     mStatus        = LoadStatus.None;
 }
Exemplo n.º 18
0
        /// <inheritdoc/>
        public string ToDelimitedString()
        {
            CultureInfo culture = CultureInfo.CurrentCulture;

            return(string.Format(
                       culture,
                       StringHelper.StringFormatSequence(0, 8, Configuration.FieldSeparator),
                       Id,
                       LotNumber?.ToDelimitedString(),
                       DeviceNumber?.ToDelimitedString(),
                       DeviceName,
                       DeviceDataState?.ToDelimitedString(),
                       LoadStatus?.ToDelimitedString(),
                       ControlCode.HasValue ? ControlCode.Value.ToString(Consts.NumericFormat, culture) : null,
                       OperatorName
                       ).TrimEnd(Configuration.FieldSeparator.ToCharArray()));
        }
Exemplo n.º 19
0
        public LoadStatus Load(string filename)
        {
            if (!File.Exists(filename))
            {
                return(LoadStatus.FileDoesNotExists);
            }

            string[] lines = File.ReadAllLines(filename);
            if (lines.Length == 0)
            {
                scanmsg.Report("file is empty [" + filename + "]");
                return(LoadStatus.FileIsEmpty);
            }

            //bool blank = File.ReadAllText( filename ).Last() == '\n';

            uint number = 0;
            bool multi  = false;

            //string last = "";

            foreach (string fline in lines)
            {
                number++;
                string line = fline.Replace("\t", " ");

                LoadStatus status = LoadStatus.OK;
                string     report = "";
                if (!LoadLine(line, ref multi, ref status, ref report))
                {
                    scanmsg.Report(line);
                    scanmsg.Report(report + " [" + filename + ":" + number + "]");
                }

                //last = line;
            }

            //if( !blank )
            //{
            //    scanmsg.Report( last );
            //    scanmsg.Report( new string( '-', last.Length ) + "^ blank line required [" + filename + ":" + number + "]" );
            //}

            return(LoadStatus.OK);
        }
Exemplo n.º 20
0
    /// 値の設定
    // @param x X座標
    // @param y Y座標
    // @param v 設定する値
    public void Set(int x, int y, LoadStatus v)
    {
        if (IsOutOfRange(x, y))
        {
            // 領域外を指定した
            return;
        }

        if (CommonFunction.IsNull(_values[y * Width + x]) == false)
        {
            _values[y * Width + x].Clear();
            _values[y * Width + x].State = v;
        }
        else
        {
            _values[y * Width + x] = new DungeonUnitInfo(v);
        }
    }
Exemplo n.º 21
0
        public void Execute()
        {
            var filename = GlobalAppSettings.DataFileName;

            if (filename == null)
            {
                Status = LoadStatus.FileNameIsEmpty;
                throw new ArgumentException("Не указан путь к файлу для загрузки");
            }

            if (!File.Exists(filename))
            {
                Status = LoadStatus.FileNotExists;
                throw new ArgumentException("Указанный файл не существует");
            }

            try
            {
                var lines = File.ReadAllLines(filename);
                Systems.Clear();

                foreach (var line in lines)
                {
                    var arr  = line.Split('|');
                    var item = new InformationSystem
                    {
                        OperationSystem = arr[0],
                        Database        = arr[1],
                        RamAmount       = int.Parse(arr[2]),
                        MemoryAmount    = int.Parse(arr[3]),
                        Cost            = int.Parse(arr[4])
                    };

                    Systems.Add(item);
                }
                Status = LoadStatus.Success;
            }
            catch (Exception e)
            {
                Status = LoadStatus.GeneralError;
                Logger.Log(e);
                throw;
            }
        }
        private IEnumerator LoadVCSInfoAsync()
        {
            string path = LocalPathProtocolHeader + InfoFilePath;

            using (WWW www = new WWW(path)) {
                _loadStatus = LoadStatus.Loading;

                yield return(www);

                if (!string.IsNullOrEmpty(www.error))
                {
                    Debug.LogWarningFormat("{0}->LoadVCSInfoAsync: load vcs info FAILED! [{1}]", GetType().Name, www.error);
                    yield break;
                }

                _vcsInfo    = JsonUtility.FromJson <CocoVCSInfo> (www.text);
                _loadStatus = _vcsInfo != null && !string.IsNullOrEmpty(_vcsInfo.CommitId) ? LoadStatus.Loaded : LoadStatus.LoadFailed;
            }
        }
        public void Execute(OnLoadFileDelegate UpdateProgressBar)
        {
            try
            {
                if (filePath == "")
                {
                    loadStatus = LoadStatus.FileNameIsEmpty;
                    throw new Exception("Путь к файлу не указан");
                }
                int    sector = int.Parse(Math.Ceiling((double)(100 / File.ReadAllLines(filePath).Length)).ToString());
                var    file   = File.Open(filePath, FileMode.Open, FileAccess.Read);
                string text;
                using (var sr = new StreamReader(file))
                {
                    int currentProgress = 0;
                    while ((text = sr.ReadLine()) != "")
                    {
                        var enterpriceParts = text.Split('|');
                        enterpriseList.Add(new Enterprise()
                        {
                            Name = enterpriceParts[0], PropertyType = enterpriceParts[1], LandArea = int.Parse(enterpriceParts[2]), EmployeeQty = int.Parse(enterpriceParts[3])
                        });

                        currentProgress += sector;
                        UpdateProgressBar(currentProgress);

                        Thread.Sleep(1000);
                    }
                }
                loadStatus = LoadStatus.Success;
            }
            catch (FileNotFoundException e)
            {
                enterpriseList = null;
                loadStatus     = LoadStatus.FileNotExists;
                LogUtility.ErrorLog(e);
            }
            catch (Exception e)
            {
                loadStatus = LoadStatus.GeneralError;
                LogUtility.ErrorLog(e);
            }
        }
Exemplo n.º 24
0
    public override bool Load(Priority priority, out bool process)
    {
        process = this.process;
        if (loadStatus == LoadStatus.UNLOAD)
        {
            process = this.process;

            Action <UnityEngine.Object> onLoadCallBack = (abObject) =>
            {
                this.loadStatus = LoadStatus.LOADEND;
                this.process    = true;
                onLoadFinishCallBack.Invoke(abObject);
            };

            switch (GameSetting.Instance.runType)
            {
            case RunType.PATCHER_SA_PS:
                AssetBundleLoader.LoadAsset(name, assetType, onLoadCallBack);
                break;

            case RunType.NOPATCHER_SA:
                AssetBundleLoader.LoadAsset(name, assetType, onLoadCallBack);
                break;

            case RunType.NOPATCHER_RES:
                ResourcesLoader.LoadAsset(name, assetType, onLoadCallBack);
                break;
            }

            loadStatus = LoadStatus.LOADING;
        }
        else if (loadStatus == LoadStatus.LOADING)
        {
            process = this.process;
        }
        else if (loadStatus == LoadStatus.LOADEND)
        {
            process = this.process;
        }

        return(true);
    }
Exemplo n.º 25
0
    public virtual IEnumerator LoadAsync()
    {
#if UNITY_EDITOR
        if (AssetPath.mode == AssetMode.Editor)
        {
            yield break;
        }
#endif
        if (status == LoadStatus.Done)
        {
            yield break;
        }
        else if (status == LoadStatus.Loading)
        {
            yield return(new WaitUntil(() => status >= LoadStatus.Done));
        }
        else
        {
            string path = AssetPath.GetFullPath(bundleName);
            AssetBundleCreateRequest request = AssetBundle.LoadFromFileAsync(path);

            status = LoadStatus.Loading;

            yield return(request);

            status = LoadStatus.Done;

            if (bundle == null)
            {
                if (request.isDone && request.assetBundle)
                {
                    bundle = request.assetBundle;
                }
                else
                {
                    status = LoadStatus.Error;
                    Debug.Log("Can't Load AssetBundle:" + bundleName + "  from :" + path + "!!");
                }
            }
        }
    }
Exemplo n.º 26
0
    public static IEnumerator Initialize()
    {
        if (status == LoadStatus.Done)
        {
            yield break;
        }
        else if (status == LoadStatus.Loading)
        {
            yield return(new WaitUntil(() => status >= LoadStatus.Done));
        }
        else
        {
            string assetFile = GetAssetFile();

#if UNITY_EDITOR_OSX || UNITY_STANDALONE_OSX
            //这两个平台用UnityWebRequest加载要加file://
            assetFile = string.Format("file://{0}", assetFile);
#endif
            Debug.Log("AssetMode:" + mode.ToString() + " assetFile:" + assetFile);

            using (UnityWebRequest request = UnityWebRequest.Get(assetFile))
            {
                status = LoadStatus.Loading;

                UnityWebRequestAsyncOperation operation = request.SendWebRequest();
                yield return(operation);

                if (string.IsNullOrEmpty(request.downloadHandler.text) == false)
                {
                    list.FromXml(request.downloadHandler.text);

                    status = LoadStatus.Done;
                }
                else
                {
                    status = LoadStatus.Error;
                    Debug.LogError(request.error);
                }
            }
        }
    }
Exemplo n.º 27
0
        private void OnLoadingDone(LoadStatus loadStatus)
        {
            for (var i = _loadCalls.Count - 1; i > 0; i--)
            {
                var loadCall = _loadCalls[i];
                if (loadCall.Dependencies.Contains(loadStatus))
                {
                    loadCall.Dependencies.Remove(loadStatus);
                }

                if (loadCall.LoadStatus == loadStatus)
                {
                    _loadCalls.RemoveAt(i);
                }
            }

            foreach (var loadCall in _loadCalls.Where(loadCall => loadCall.Dependencies.Contains(loadStatus)))
            {
                loadCall.Dependencies.Remove(loadStatus);
            }
        }
        private void ShowFailureMessage(LoadStatus status, Uri uri)
        {
            switch (status)
            {
            case LoadStatus.PasswordNeeded:
                ActionRequired?.Invoke(new InvalidPasswordMessageArgs());
                break;

            case LoadStatus.InvalidData:
                ActionRequired?.Invoke(new InvalidDataMessageArgs(uri.ToString()));
                break;

            case LoadStatus.NotSupported:
                ActionRequired?.Invoke(new NotSupportedMessageArgs(uri.ToString()));
                break;

            case LoadStatus.UnexpectedError:
                ActionRequired?.Invoke(new UnexpectedErrorMessageArgs(uri.ToString()));
                break;
            }
        }
Exemplo n.º 29
0
    public static void Initialize()
    {
        if (mInstance != null)
        {
            return;
        }
        if (mStatus == LoadStatus.Loading)
        {
            return;
        }
        mStatus = LoadStatus.Loading;

        AssetLoader.LoadAsset <GameObject>("assetprefab.prefab", (asset) => {
            if (asset != null)
            {
                mAsset    = asset;
                mInstance = mAsset.assetObject.GetComponent <AssetPrefab>();
                DontDestroyOnLoad(mAsset.assetObject);
            }
            mStatus = LoadStatus.Done;
        });
    }
Exemplo n.º 30
0
 private void _InitializeStaticDb()
 {
     lock (this._syncRoot)
     {
         if (!this._applicationInstance.UseConnectedDatabase)
         {
             string dbFolder = this._applicationInstance.Server.MapPath("~/App_Data");
             this.NounIndex       = new WordNetDataReader.IndexFile(dbFolder, Common.PartOfSpeech.Noun);
             this.NounStatus      = new LoadStatus(this.NounIndex);
             this.NounData        = new WordNetDataReader.DataFile(dbFolder, Common.PartOfSpeech.Noun);
             this.VerbIndex       = new WordNetDataReader.IndexFile(dbFolder, Common.PartOfSpeech.Verb);
             this.VerbStatus      = new LoadStatus(this.VerbIndex);
             this.VerbData        = new WordNetDataReader.DataFile(dbFolder, Common.PartOfSpeech.Verb);
             this.AdjectiveIndex  = new WordNetDataReader.IndexFile(dbFolder, Common.PartOfSpeech.Adjective);
             this.AdjectiveStatus = new LoadStatus(this.AdjectiveIndex);
             this.AdjectiveData   = new WordNetDataReader.DataFile(dbFolder, Common.PartOfSpeech.Adjective);
             this.AdverbIndex     = new WordNetDataReader.IndexFile(dbFolder, Common.PartOfSpeech.Adverb);
             this.AdverbStatus    = new LoadStatus(this.AdverbIndex);
             this.AdverbData      = new WordNetDataReader.DataFile(dbFolder, Common.PartOfSpeech.Adverb);
         }
     }
 }
Exemplo n.º 31
0
 public void MarkLoading()
 {
     _status = LoadStatus.Loading;
 }
Exemplo n.º 32
0
 public void MarkLoaded()
 {
     _status = LoadStatus.Loaded;
 }