示例#1
0
 public void LoadNextScene()
 {
     int currLevelIndex = previousLevelIndex = Application.loadedLevel;
     loadState = LoadState.loading;
     currLevelIndex++;
     Application.LoadLevel(currLevelIndex);
 }
示例#2
0
文件: OBJ.cs 项目: chenyufjfz/Paoku
	void Awake ()
	{                
        /*
#if UNITY_STANDALONE_WIN || UNITY_EDITOR_WIN
        objPath = "file://" + Application.streamingAssetsPath + "/model2.obj";
#else
#if UNITY_ANDROID
        FileInfo fi = new FileInfo("/sdcard/model.obj");
        if (fi.Exists)
            objPath = "file://" +"/sdcard/model.obj";
        else
            objPath = Application.streamingAssetsPath + "/model2.obj";            
#endif
#endif
         */
#if STANDALONE_DEBUG
        IPAddress ip = IPAddress.Parse("127.0.0.1");
        serverSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
        serverSocket.Bind(new IPEndPoint(ip, myPort));
        serverSocket.Listen(5);
        clientSocket = new List<Socket>();
#endif
        load_state = LoadState.IDLE;
        move_para = new MovePara();
        show_envelop = false;
        show_joint = false;
        show_body = true;

        gameObject.AddComponent<Animation>();
        animation.AddClip(move_para.create_move(Movement.RUN), "run");
        animation.AddClip(move_para.create_move(Movement.JUMP), "jump");
        animation.AddClip(move_para.create_move(Movement.SLIDE), "slide");
	}
示例#3
0
 public void LoadMainMenu()
 {
     previousLevelIndex = Application.loadedLevel;
     loadState = LoadState.loading;
     DestroyPersistantObjects();
     Application.LoadLevel(0);
 }
示例#4
0
 public static object LoadMem(LoadState S, Type t, int n)
 {
     ArrayList array = new ArrayList();
     for (int i=0; i<n; i++)
         array.Add(LoadMem(S, t));
     return array.ToArray(t);
 }
示例#5
0
		/// <summary>
		/// Create RenderWareFile from byte data<para/>
		/// Создание RenderWareFile из массива байт
		/// </summary>
		/// <param name="data">File content<para/>Содержимое файла</param>
		/// <param name="readNow">Read file immediately instead of threaded reading<para/>Прочитать файл сейчас же, не полагаясь на потоковый загрузчик</param>
		public RenderWareFile(byte[] data, bool readNow = false) {
			QueuedStream = new MemoryStream(data, false);
			State = LoadState.None;
			if (readNow) {
				ReadData();
			}
		}
示例#6
0
		public static void Init ()
		{
			curLoadState = LoadState.Loading;
			LoadTextureFolders ();
			LoadXMLPaths ();
			curLoadState = LoadState.Finished;
		}
示例#7
0
		/// <summary>
		/// Create RenderWareFile from file<para/>
		/// Создание RenderWareFile из файла
		/// </summary>
		/// <param name="name">File name<para/>Имя файла</param>
		/// <param name="readNow">Read file immediately instead of threaded reading<para/>Прочитать файл сейчас же, не полагаясь на потоковый загрузчик</param>
		public RenderWareFile(string name, bool readNow = false) {
			if (!File.Exists(name)) {
				throw new FileNotFoundException("[RenderWareFile] File not found: "+Path.GetFileName(name), name);
			}
			QueuedStream = new FileStream(name, FileMode.Open, FileAccess.Read);
			State = LoadState.None;
			if (readNow) {
				ReadData();
			}
		}
示例#8
0
        internal void EnsureLoaded() {
#if FALSE
            // If we're fully loaded, just return.
            if (_loadState == LoadState.Loaded) {
                return;
            }

            // If we're loading or not loaded, we need to take this lock.
            if (!_typeDb.BeginModuleLoad(this, 10000)) {
                Debug.Fail("Timeout loading {0}", _modName);
                //throw new InvalidOperationException("Cannot load module at this time");
                return;
            }

            try {
                // Ensure we haven't started/finished loading while waiting
                if (_loadState != LoadState.NotLoaded) {
                    return;
                }

                // Mark as loading now (before it completes), if we have circular
                // references we'll fix them up after loading
                // completes.
                _loadState = LoadState.Loading;

                using (var stream = new FileStream(_dbFile, FileMode.Open, FileAccess.Read, FileShare.Read)) {
                    Dictionary<string, object> contents = null;
                    try {
                        contents = (Dictionary<string, object>)Unpickle.Load(stream);
                    } catch (ArgumentException) {
                        _typeDb.OnDatabaseCorrupt();
                    } catch (InvalidOperationException) {
                        // Bug 511 - http://pytools.codeplex.com/workitem/511
                        // Ignore a corrupt database file.
                        _typeDb.OnDatabaseCorrupt();
                    }

                    if (contents != null) {
                        LoadModule(contents);
                    }
                }
            } catch (FileNotFoundException) {
                // if the file got deleted before we've loaded it don't crash...
            } catch (IOException) {
                // or if someone has locked the file for some reason, also don't crash...
            } finally {
                // Regardless of how we finish, mark us as loaded so we don't
                // try again.
                _loadState = LoadState.Loaded;
                _typeDb.EndModuleLoad(this);
            }
#endif
        }
示例#9
0
        private void ChosenCode(Toon [] Character, Toon ChosenOne, Toon OpponentToon, Extras extra)
        {
            TransferAttributes(Character, ChosenOne, OnToon);
            int OpponentNum = rand.Next(0, extra.NumOfToons);
            if (OpponentNum != OnToon)
            {
                TransferAttributes(Character, OpponentToon, OpponentNum);
                extra.State = Extras.GameState.FIGHT;
                State = LoadState.Initialize;

            }
        }
示例#10
0
 //#endif
 public static object LoadMem(LoadState S, Type t)
 {
     int size = Marshal.SizeOf(t);
     CharPtr str = new char[size];
     LoadBlock(S, str, size);
     byte[] bytes = new byte[str.chars.Length];
     for (int i = 0; i < str.chars.Length; i++)
         bytes[i] = (byte)str.chars[i];
     GCHandle pinnedPacket = GCHandle.Alloc(bytes, GCHandleType.Pinned);
     object b = Marshal.PtrToStructure(pinnedPacket.AddrOfPinnedObject(), t);
     pinnedPacket.Free();
     return b;
 }
示例#11
0
 public static object LoadMem(LoadState S, Type t, int n)
 {
     #if SILVERLIGHT
     List<object> array = new List<object>();
     for (int i = 0; i < n; i++)
         array.Add(LoadMem(S, t));
     return array.ToArray();
     #else
     ArrayList array = new ArrayList();
     for (int i=0; i<n; i++)
         array.Add(LoadMem(S, t));
     return array.ToArray(t);
     #endif
 }
示例#12
0
 public static void Cancel()
 {
     if (activeSaveSlot != -1)
     {
         if (state == LoadState.Normal)
         {
             state = LoadState.ConfirmClear;
         }
         else
         {
             state = LoadState.Normal;
         }
     }
 }
        public MainToolbarViewModel(SongLoader songLoader, CurrentSongService currentSongService, PrintService printService, ExportImageService saveService)
        {
            LoadState = new LoadState();
            this.printService = printService;
            this.saveService = saveService;
            this.currentSongService = currentSongService;

            SelectedGuitarPath = currentSongService.GuitarPath.Name;

            OpenFileCommand = new RelayCommand(songLoader.OpenFile);
            LoadDiskTracksCommand = new RelayCommand(songLoader.LoadDiskTracks);
            LoadDLCTracksCommand = new RelayCommand(songLoader.LoadDLCTracks);
            PrintCommand = new RelayCommand<TabControl>(PrintTab);
            SaveCommand = new RelayCommand<TabControl>(SaveTabImage);

            Messenger.Default.Register<SongChange>(this, (SongChange c) => { if (c == SongChange.Score) RaisePropertyChanged("IsATrackLoaded"); });
        }
示例#14
0
        internal async Task LoadDetail(string url)
        {
            base.SetProgressIndicator("LoadDetail", true, "Loading detail...");
            if (this.isLoadDetailAndChaper == LoadState.None)
            {
                this.isLoadDetailAndChaper = LoadState.Loading;
                var jsonDetail = await Config.GetDetail(url);
                if (jsonDetail.error_code == 0)
                {
                    bool isFavorite = App.dbHelper.Select<MangaCore.Sqlite.Models.SqlMangaFavorite>(t => t.Url == url) != null;
                    bool isRead = App.dbHelper.Select<MangaCore.Sqlite.Models.SqlHistoryRead>(t => t.UrlManga == url) != null;
                    ItemDetail.NameManga = jsonDetail.data._detailNameManga;
                    ItemDetail.UrlCover = jsonDetail.data._detailUrlCover;
                    ItemDetail.Description = jsonDetail.data._detailDescription;
                    //ItemDetail.Description = @"";
                    ItemDetail.Rating = jsonDetail.data._rating;
                    ItemDetail.IsFavorite = isFavorite;
                    ItemDetail.IsRead = isRead;
                    ItemDetail.UrlManga = url;


                    var listHistoryChaperRead = App.dbHelper.Select<MangaCore.Sqlite.Models.SqlHistoryRead>().Where(t => t.UrlManga == url);
                    var listHistoryDownload = App.dbHelper.Select<MangaCore.Sqlite.Models.SqlDownload>();
                    var listChaperBookmask = App.dbHelper.Select<MangaCore.Sqlite.Models.SqlChaperBookmask>().Where(t => t.Sever == App.NewSever);

                    foreach (var itemChaper in jsonDetail.data.listChap)
                    {
                        bool isRead2 = listHistoryChaperRead.FirstOrDefault(t => t.UrlChaper == itemChaper._urlChap) != null;
                        bool isDownload = listHistoryDownload.FirstOrDefault(t => t.Url == itemChaper._urlChap) != null;
                        bool isFavorite2 = listChaperBookmask.FirstOrDefault(t => t.Url == itemChaper._urlChap) != null;


                        this.Chapers.Add(new Chaper(itemChaper._chap, itemChaper._urlChap, DateTime.Now.ToString(MangaCore.Comon.FormatDateTime), isRead2, false, isDownload, isFavorite2, "", false));
                    }
                }
                else
                {
                    Utils.ShowMessage("Error: " + jsonDetail.msg, "Error", 0);
                }

            }
            base.SetProgressIndicator("LoadDetail", false, "Loading...");
        }
示例#15
0
        private void SetPersonnelPageCount_cmbPersonnel_ManagersWorkFlow(LoadState Ls, int pageSize, string SearchTerm)
        {
            string[] retMessage     = new string[4];
            int      PersonnelCount = 0;

            try
            {
                switch (Ls)
                {
                case LoadState.Normal:
                    PersonnelCount = this.PersonnelBusiness.GetPersonCount();
                    break;

                case LoadState.Search:
                    PersonnelCount = this.PersonnelBusiness.GetPersonInQuickSearchCount(SearchTerm);
                    break;

                case LoadState.AdvancedSearch:
                    PersonnelCount = this.PersonnelBusiness.GetPersonInAdvanceSearchCount(this.APSProv.CreateAdvancedPersonnelSearchProxy(SearchTerm));
                    break;
                }
                this.hfPersonnelPageCount_ManagersWorkFlow.Value = Utility.GetPageCount(PersonnelCount, pageSize).ToString();
            }
            catch (UIValidationExceptions ex)
            {
                retMessage = this.exceptionHandler.HandleException(this.Page, ExceptionTypes.UIValidationExceptions, ex, retMessage);
                this.ErrorHiddenField_Personnel_ManagersWorkFlow.Value = this.exceptionHandler.CreateErrorMessage(retMessage);
            }
            catch (UIBaseException ex)
            {
                retMessage = this.exceptionHandler.HandleException(this.Page, ExceptionTypes.UIBaseException, ex, retMessage);
                this.ErrorHiddenField_Personnel_ManagersWorkFlow.Value = this.exceptionHandler.CreateErrorMessage(retMessage);
            }
            catch (Exception ex)
            {
                retMessage = this.exceptionHandler.HandleException(this.Page, ExceptionTypes.Exception, ex, retMessage);
                this.ErrorHiddenField_Personnel_ManagersWorkFlow.Value = this.exceptionHandler.CreateErrorMessage(retMessage);
            }
        }
示例#16
0
        private static Proto LoadFunction(LoadState S, TString p)
        {
            Proto f = luaF_newproto(S.L);

            setptvalue2s(S.L, S.L.top, f); incr_top(S.L);
            f.source = LoadString(S); if (f.source == null)
            {
                f.source = p;
            }
            f.linedefined     = LoadInt(S);
            f.lastlinedefined = LoadInt(S);
            f.nups            = LoadByte(S);
            f.numparams       = LoadByte(S);
            f.is_vararg       = LoadByte(S);
            f.maxstacksize    = LoadByte(S);
            LoadCode(S, f);
            LoadConstants(S, f);
            LoadDebug(S, f);
            IF(luaG_checkcode(f) == 0 ? 1 : 0, "bad code");
            StkId.dec(ref S.L.top);
            return(f);
        }
示例#17
0
        public virtual void Load()
        {
#if UNITY_EDITOR
            m_asset = UnityEditor.AssetDatabase.LoadAssetAtPath <Object>(m_assetPath);
#else
            string resPath = string.Empty;
            if (FileManager.GetResourcePath(m_assetPath, ref resPath))
            {
                try
                {
                    m_asset = Resources.Load(resPath);
                    m_state = LoadState.Complete;
                }
                catch (Exception e)
                {
                    Debug.Log(e.ToString());
                    m_state = LoadState.Error;
                }
            }
#endif
            InvokeComplete();
        }
    void FixedUpdate()
    {
        switch (loadState)
        {
        case LoadState.Loading:
            _TrySceneActivation();
            if (asyncLoadOp == null || asyncLoadOp.isDone)
            {
                if (asyncLoadOp != null)
                {
                    chunkActivating = null;
                    activationQueue.RemoveFirst();
                    asyncLoadOp = null;
                }
                loadState = LoadState.Loaded;
                // Run update again to try to parent the chunk right away.
                FixedUpdate();
            }
            break;

        case LoadState.Loaded:
            // Unity takes a frame to create the objects, so fix them up here.
            _SetupChunk();
            break;

        case LoadState.Active:
            // Do nothing.
            break;

        case LoadState.Unloading:
            _TrySceneActivation();
            _FindChunkRoot();
            if (chunkRoot)
            {
                _DestoryChunk(true, false);
            }
            break;
        }
    }
示例#19
0
    // Update is called once per frame
    void Update()
    {
        if (Input.GetButton("Load1"))
        {
            ChangeWeapons(0);
        }
        else if (Input.GetButton("Load2"))
        {
            ChangeWeapons(1);
        }

        if (falcon.button_states[1])
        {
            ChangeWeapons(1);
        }


        switch (loadState)
        {
        case LoadState.Loading:
            if (timer <= 0)
            {
                loadState = LoadState.Loaded;
            }
            break;

        case LoadState.Unloading:
            if (timer <= 0)
            {
                loadState = LoadState.NotLoaded;
            }
            break;
        }

        if (timer > 0)
        {
            timer -= Time.deltaTime;
        }
    }
示例#20
0
        internal override void OnMessage(string method, JsonElement?serverParams)
        {
            switch (method)
            {
            case "navigated":
                var e = serverParams?.ToObject <FrameNavigatedEventArgs>(Connection.GetDefaultJsonSerializerOptions());

                if (serverParams.Value.TryGetProperty("newDocument", out var documentElement))
                {
                    e.NewDocument = documentElement.ToObject <NavigateDocument>(Connection.GetDefaultJsonSerializerOptions());
                }

                Navigated?.Invoke(this, e);
                break;

            case "loadstate":
                LoadState?.Invoke(
                    this,
                    serverParams?.ToObject <FrameChannelLoadStateEventArgs>(Connection.GetDefaultJsonSerializerOptions()));
                break;
            }
        }
示例#21
0
        /*
        ** load precompiled chunk
        */
        public static Proto luaU_undump(lua_State L, ZIO Z, Mbuffer buff, CharPtr name)
        {
            LoadState S = new LoadState();

            if (name[0] == '@' || name[0] == '=')
            {
                S.name = name + 1;
            }
            else if (name[0] == LUA_SIGNATURE[0])
            {
                S.name = "binary string";
            }
            else
            {
                S.name = name;
            }
            S.L = L;
            S.Z = Z;
            S.b = buff;
            LoadHeader(S);
            return(LoadFunction(S, luaS_newliteral(L, "=?")));
        }
示例#22
0
        /// <summary>
        /// Loads the <see cref="ProjectInfo"/> from the specified project file and all referenced projects.
        /// The first <see cref="ProjectInfo"/> in the result corresponds to the specified project file.
        /// </summary>
        public async Task <ImmutableArray <ProjectInfo> > LoadProjectInfoAsync(
            string projectFilePath,
            ImmutableDictionary <string, ProjectId> projectPathToProjectIdMap = null,
            CancellationToken cancellationToken = default)
        {
            if (projectFilePath == null)
            {
                throw new ArgumentNullException(nameof(projectFilePath));
            }

            this.TryGetAbsoluteProjectPath(projectFilePath, Directory.GetCurrentDirectory(), ReportMode.Throw, out var fullPath);
            this.TryGetLoaderFromProjectPath(projectFilePath, ReportMode.Throw, out var loader);

            var loadedProjects = new LoadState(projectPathToProjectIdMap);

            var id = await this.LoadProjectAsync(fullPath, loader, this.LoadMetadataForReferencedProjects, loadedProjects, cancellationToken).ConfigureAwait(false);

            var result = loadedProjects.Projects.Reverse().ToImmutableArray();

            Debug.Assert(result[0].Id == id);
            return(result);
        }
示例#23
0
        private void SetManagersPageCount_Managers(LoadState Ls, decimal AccessGroupID, ManagerSearchFields SearchField, string SearchTerm)
        {
            string[] retMessage = new string[4];
            try
            {
                int ManagersCount = 0;
                switch (Ls)
                {
                case LoadState.Normal:
                    ManagersCount = this.ManagerBusiness.GetRecordCount();
                    break;

                case LoadState.Filter:
                    ManagersCount = this.ManagerBusiness.GetRecordCountByAccessGroupFilter(AccessGroupID);
                    break;

                case LoadState.Search:
                    ManagersCount = this.ManagerBusiness.GetRecordCountBySearch(SearchTerm, SearchField);
                    break;
                }
                this.hfManagersPageCount_Managers.Value = Utility.GetPageCount(ManagersCount, this.GridManagers_Managers.PageSize).ToString();
            }
            catch (UIValidationExceptions ex)
            {
                retMessage = this.exceptionHandler.HandleException(this.Page, ExceptionTypes.UIValidationExceptions, ex, retMessage);
                this.ErrorHiddenField_Managers_Managers.Value = this.exceptionHandler.CreateErrorMessage(retMessage);
            }
            catch (UIBaseException ex)
            {
                retMessage = this.exceptionHandler.HandleException(this.Page, ExceptionTypes.UIBaseException, ex, retMessage);
                this.ErrorHiddenField_Managers_Managers.Value = this.exceptionHandler.CreateErrorMessage(retMessage);
            }
            catch (Exception ex)
            {
                retMessage = this.exceptionHandler.HandleException(this.Page, ExceptionTypes.Exception, ex, retMessage);
                this.ErrorHiddenField_Managers_Managers.Value = this.exceptionHandler.CreateErrorMessage(retMessage);
            }
        }
示例#24
0
        private void Fill_cmbPersonnel_Substitute(LoadState Ls, int pageSize, int pageIndex, string SearchTerm)
        {
            string[] retMessage = new string[4];
            try
            {
                IList <Person> PersonnelList = null;
                switch (Ls)
                {
                case LoadState.Normal:
                    PersonnelList = this.PersonnelBusiness.GetAllPerson(pageIndex, pageSize);
                    break;

                case LoadState.Search:
                    PersonnelList = this.PersonnelBusiness.QuickSearchByPage(pageIndex, pageSize, SearchTerm);
                    break;

                case LoadState.AdvancedSearch:
                    PersonnelList = this.PersonnelBusiness.GetPersonInAdvanceSearch(this.APSProv.CreateAdvancedPersonnelSearchProxy(SearchTerm), pageIndex, pageSize);
                    break;
                }
                this.Fill_LookUpCmb_Substitute(this.cmbPersonnel_Substitute, PersonnelList);
            }
            catch (UIValidationExceptions ex)
            {
                retMessage = this.exceptionHandler.HandleException(this.Page, ExceptionTypes.UIValidationExceptions, ex, retMessage);
                this.ErrorHiddenField_Personnel_Substitute.Value = this.exceptionHandler.CreateErrorMessage(retMessage);
            }
            catch (UIBaseException ex)
            {
                retMessage = this.exceptionHandler.HandleException(this.Page, ExceptionTypes.UIBaseException, ex, retMessage);
                this.ErrorHiddenField_Personnel_Substitute.Value = this.exceptionHandler.CreateErrorMessage(retMessage);
            }
            catch (Exception ex)
            {
                retMessage = this.exceptionHandler.HandleException(this.Page, ExceptionTypes.Exception, ex, retMessage);
                this.ErrorHiddenField_Personnel_Substitute.Value = this.exceptionHandler.CreateErrorMessage(retMessage);
            }
        }
        public void InitializeScenes(LightSystemSettings systemSettings)
        {
            foreach (SerializationScene scene in systemSettings.scenes)
            {
                var id = SettingsManager.ConvertStringNumberToInt(scene.id);

                Scene lightScene = new Scene(id, scene.name);

                if (scene.wholeHome)
                {
                    lightScene.WholeHome = true;
                }

                foreach (SerializationLoadState loadState in scene.loadStates)
                {
                    var level = SettingsManager.ConvertUnsignedStringNumber(loadState.level);

                    List <int> loadIds = null;

                    if (loadState.loadList == "all")
                    {
                        loadIds = _loadManager.GetLoads().Select(x => x.LoadID).ToList <int>();
                    }
                    else
                    {
                        loadIds = new List <int>(loadState.loadList.Split(',').Select(s => int.Parse(s)));
                    }

                    foreach (int loadID in loadIds)
                    {
                        LoadState state = new LoadState((ushort)level, LoadManager.GetLoad(loadID));
                        lightScene.AddLoadState(state);
                    }
                }

                _sceneManager.AddScene(lightScene);
            }
        }
示例#26
0
 protected void ExtensionSet(string attribute, object value)
 {
     if (attribute != null)
     {
         this.ValidateExtensionObject(value);
         if (value as object[] == null)
         {
             object[] objArray = new object[1];
             objArray[0] = value;
             this.extensionCache.properties[attribute] = new ExtensionCacheValue(objArray);
         }
         else
         {
             this.extensionCache.properties[attribute] = new ExtensionCacheValue((object[])value);
         }
         this.extensionCacheChanged = LoadState.Changed;
         return;
     }
     else
     {
         throw new ArgumentException(StringResources.NullArguments);
     }
 }
示例#27
0
        public void LoadAsync <T>(Func <LoadState, T> func, Action <T> gui)
        {
            LoadState state = new LoadState()
            {
                Progress = 0, Text = ""
            };

            lock (states)
                states.Add(state);

            var ui = TaskScheduler.FromCurrentSynchronizationContext();
            var t  = Task.Factory.StartNew <T>(() =>
            {
                var val = func(state);
                return(val);
            }, System.Threading.CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).ContinueWith(tsk =>
            {
                lock (states)
                    states.Remove(state);

                gui(tsk.Result);
            }, System.Threading.CancellationToken.None, TaskContinuationOptions.None, ui);
        }
示例#28
0
        /// <summary>
        /// 开始加载
        /// </summary>
        public virtual void Start()
        {
            if (_state != LoadState.STOPED)
            {
                Stop();
            }

            _state = LoadState.STARTED;
            _stats.Start();

            if (_task == null)
            {
                _task = App.objectPoolManager.GetObject <CoroutineTask>();
            }

            _task.routine = InvokeLoading();
            _task.Start();

            if (_startCallback != null)
            {
                _startCallback.Invoke(this);
            }
        }
示例#29
0
        public void OnNavigatedTo(NavigationEventArgs e)
        {
            var frameState = SuspensionManager.SessionStateForFrame(this.Frame);

            _pageKey = "Page-" + Frame.BackStackDepth;

            if (e.NavigationMode == NavigationMode.New)
            {
                var nextPageKey   = this._pageKey;
                int nextPageIndex = this.Frame.BackStackDepth;
                while (frameState.Remove(nextPageKey))
                {
                    nextPageIndex++;
                    nextPageKey = "Page-" + nextPageIndex;
                }

                LoadState?.Invoke(this, new LoadStateEventArgs(e.Parameter, null));
            }
            else
            {
                LoadState?.Invoke(this, new LoadStateEventArgs(e.Parameter, (Dictionary <String, Object>)frameState[this._pageKey]));
            }
        }
示例#30
0
 internal void AdvancedFilterSet(string attribute, object value, Type objectType, MatchType mt)
 {
     if (attribute != null)
     {
         this.ValidateExtensionObject(value);
         if (value as object[] == null)
         {
             object[] objArray = new object[1];
             objArray[0] = value;
             this.extensionCache.properties[attribute] = new ExtensionCacheValue(objArray, objectType, mt);
         }
         else
         {
             this.extensionCache.properties[attribute] = new ExtensionCacheValue((object[])value, objectType, mt);
         }
         this.extensionCacheChanged = LoadState.Changed;
         return;
     }
     else
     {
         throw new ArgumentException(StringResources.NullArguments);
     }
 }
        private LoadState UpgradeSystems(SaveData saveData, out bool upgraded)
        {
            LoadState state = LoadState.OK;

            upgraded = false;
            try
            {
                ClearSystems();
                foreach (KeyValuePair <string, SaveSystem> pair in m_saveSystems)
                {
                    pair.Value.data = saveData;
                    if (pair.Value.Upgrade())
                    {
                        upgraded = true;
                    }
                }
            }
            catch (CorruptedSaveException)
            {
                state = LoadState.Corrupted;
            }
            return(state);
        }
示例#32
0
        internal Frame(IChannelOwner parent, string guid, FrameInitializer initializer) : base(parent, guid)
        {
            _channel    = new FrameChannel(guid, parent.Connection, this);
            Url         = initializer.Url;
            Name        = initializer.Name;
            ParentFrame = initializer.ParentFrame;
            _loadStates = initializer.LoadStates;

            _channel.LoadState += (_, e) =>
            {
                lock (_loadStates)
                {
                    if (e.Add.HasValue)
                    {
                        _loadStates.Add(e.Add.Value);
                        LoadState?.Invoke(this, e.Add.Value);
                    }

                    if (e.Remove.HasValue)
                    {
                        _loadStates.Remove(e.Remove.Value);
                    }
                }
            };

            _channel.Navigated += (_, e) =>
            {
                Url  = e.Url;
                Name = e.Name;
                Navigated?.Invoke(this, e);

                if (string.IsNullOrEmpty(e.Error))
                {
                    ((Page)Page)?.OnFrameNavigated(this);
                }
            };
        }
示例#33
0
        private int InternalLoadSync(Action <bool, AssetBundle> loadedAction)
        {
            if (loadedAction == null)
            {
                loadedAction = s_DefaultLoadedCallback;
            }

            var index = ResourceManager.GetNewResourceIndex();

            m_ResouceIndexSet.Add(index);
            if (m_LoadState == LoadState.Init || m_LoadState == LoadState.WaitLoad)
            {
                var depends = s_ManifestAsset.GetAllDependencies(m_BundleName);
                foreach (var depend in depends)
                {
                    var resIndex = SingleBundleLoader.LoadSync(depend, null);
                    m_DependBundleIndexList.Add(resIndex);
                }

                m_BundleIndex = SingleBundleLoader.LoadSync(m_BundleName, null);
                var bundleLoader = SingleBundleLoader.GetLoader(m_BundleIndex);
                m_Bundle = bundleLoader.GetAssetBundle();

                m_LoadState = LoadState.Complete;
                loadedAction(m_Bundle != null, m_Bundle);
            }
            else if (m_LoadState == LoadState.Loading)
            {
                Debug.LogWarning("错误加载 fullbundleloader");
            }
            else
            {
                loadedAction(m_Bundle != null, m_Bundle);
            }

            return(index);
        }
示例#34
0
文件: Logger.cs 项目: nschnarr/awssdk
        /// <summary>
        /// This should be a one time call to use reflection to find all the types and methods
        /// needed for the logging API.
        /// </summary>
        private static void loadStatics()
        {
            lock (Logger.LOCK)
            {
                if (loadState != LoadState.Uninitialized)
                {
                    return;
                }

                loadState = LoadState.Loading;
                try
                {
                    // The LogManager and its methods
                    logMangerType = Type.GetType("log4net.LogManager, log4net");
                    if (logMangerType == null)
                    {
                        loadState = LoadState.Failed;
                        return;
                    }
                    getLoggerWithTypeMethod = logMangerType.GetMethod("GetLogger", new Type[] { typeof(Type) });

                    // The ILog and its methdods
                    logType                  = Type.GetType("log4net.ILog, log4net");
                    debugFormatMethod        = logType.GetMethod("DebugFormat", new Type[] { typeof(string), typeof(object[]) });
                    debugWithExceptionMethod = logType.GetMethod("Debug", new Type[] { typeof(string), typeof(Exception) });
                    errorWithExceptionMethod = logType.GetMethod("Error", new Type[] { typeof(string), typeof(Exception) });
                    infoFormatMethod         = logType.GetMethod("InfoFormat", new Type[] { typeof(string), typeof(object[]) });

                    loadState = LoadState.Success;
                }
                catch
                {
                    // Mark as failed so no attempted will be made on the logging methods.
                    loadState = LoadState.Failed;
                }
            }
        }
 public void Unload(bool completly)
 {
     if (completly)
     {
         loadState = LoadState.unloaded;
         backgroundRenderer.gameObject.SetActive(false);
         for (int i = 0; i < floorBlock.GetLength(0); ++i)
         {
             floorBlock[i].Disable();
         }
         for (int i = 0; i < wallBlock.GetLength(0); ++i)
         {
             wallBlock[i].Disable();
         }
         for (int i = 0; i < platformBlock.GetLength(0); ++i)
         {
             platformBlock[i].Disable();
         }
     }
     else
     {
         loadState = LoadState.partialyLoaded;
     }
 }
        private void CustomizeTlbMasterMonthlyOperation_MonthlyOperationGanttChartSchema()
        {
            if (HttpContext.Current.Request.QueryString.AllKeys.Contains("LoadState"))
            {
                LoadState LS = (LoadState)Enum.Parse(typeof(LoadState), this.StringBuilder.CreateString(HttpContext.Current.Request.QueryString["LoadState"]));
                switch (LS)
                {
                case LoadState.Manager:
                case LoadState.Operator:
                    this.TlbMonthlyOperation.Items[0].Visible = false;
                    this.TlbMonthlyOperation.Items[2].Visible = true;
                    this.TlbMonthlyOperation.Items[3].Visible = false;
                    break;

                case LoadState.Personnel:
                    break;
                }
                //string MonthlyOperationSchema = ((MonthlyOperationSchema)MonthlyOperationSchemaHelper.InitializeSchema(this.Page)).ToString();
                //if (MonthlyOperationSchema == "GanttChart")
                //    this.TlbMonthlyOperation.Items[5].Visible = true;
                //else
                //    this.TlbMonthlyOperation.Items[5].Visible = false;
            }
        }
示例#37
0
        public static async void Load()
        {
            foreach (var category in TagsRecord.Keys)
            {
                TagsRecord[category].Clear();
            }
            ImageTagger.TagManipulation.Internal.MyTagsRecord.Load(ref TagsRecord);
            foreach (var category in TagsRecord.Keys)
            {
                OnProcessedNewCategory(null, new AddedCategoryEventArgs(category));
                foreach (var tag in TagsRecord[category])
                {
                    OnProcessedNewTag(null, new AddedTagEventArgs(category, tag));
                }
            }
            OnPreviewTagsLoaded(null, new EventArgs());
            loadState = LoadState.Loading;
            var source = PersistanceUtil.RetreiveSetting(Setting.SourceDirectory);

            await LoadTagsFromFileAsynch(source);

            loadState = LoadState.Loaded;
            OnTagsLoaded(null, new EventArgs());
        }
示例#38
0
        /// <summary>
        /// 销毁
        /// </summary>
        public virtual void Dispose()
        {
            Stop();

            onDispose();

            if (_task != null)
            {
                App.objectPoolManager.ReleaseObject(_task);
                _task = null;
            }

            _loadParams = null;
            _stats      = null;
            _state      = LoadState.STOPED;
            _data       = null;
            _asset      = null;

            _startCallback    = null;
            _stopCallback     = null;
            _completeCallback = null;
            _errorCallback    = null;
            _progressCallback = null;
        }
示例#39
0
        internal Frame(IChannelOwner parent, string guid, FrameInitializer initializer) : base(parent, guid)
        {
            _channel     = new FrameChannel(guid, parent.Connection, this);
            _initializer = initializer;
            Url          = _initializer.Url;
            Name         = _initializer.Name;
            ParentFrame  = _initializer.ParentFrame;

            _channel.LoadState += (sender, e) =>
            {
                if (e.Add.HasValue)
                {
                    _loadStates.Add(e.Add.Value);
                    LoadState?.Invoke(this, new LoadStateEventArgs {
                        LifecycleEvent = e.Add.Value
                    });
                }

                if (e.Remove.HasValue)
                {
                    _loadStates.Remove(e.Remove.Value);
                }
            };

            _channel.Navigated += (sender, e) =>
            {
                Url  = e.Url;
                Name = e.Name;
                Navigated?.Invoke(this, e);

                if (string.IsNullOrEmpty(e.Error))
                {
                    ((Page)Page)?.OnFrameNavigated(this);
                }
            };
        }
示例#40
0
        public void SetStatus(LoadState state)
        {
            State = state;
            switch (state)
            {
            case LoadState.Unknown:
                pictureBox1.Image = _unknown;
                lblStatus.Text    = "State Unknown";
                break;

            case LoadState.NotStarted:
                lblStatus.Text    = "No Loads Underway";
                pictureBox1.Image = _noLoadUnderway;
                break;

            case LoadState.StartedOrCrashed:
                lblStatus.Text    = "Load Underway/Crashed";
                pictureBox1.Image = _executingOrCrashed;
                break;

            default:
                throw new ArgumentOutOfRangeException("state");
            }
        }
示例#41
0
        protected override IEnumerator LoadFuncEnumerator()
        {
            if (m_LoadState != LoadState.WaitLoad)
            {
                yield break;
            }

            m_LoadState   = LoadState.Loading;
            m_BundleIndex = FullBundleLoader.LoadAsync(m_BundleName, null);
            var bundleLoader = FullBundleLoader.GetLoader(m_BundleIndex);

            while (!bundleLoader.IsComplate)
            {
                yield return(null);
            }

            var bundle  = bundleLoader.GetAssetBundle();
            var request = bundle.LoadAssetAsync <Object>(m_AssetName);

            while (!request.isDone)
            {
                yield return(null);
            }

            m_AssetObject = request.asset;
            m_LoadState   = LoadState.Complete;

            foreach (var action in m_LoadedCallbackDict)
            {
                var callback = action.Value;
                callback(m_AssetObject != null, m_AssetObject);
            }

            m_LoadedCallbackDict.Clear();
            TryUnLoadByAssetKey(m_AssetKeyName);
        }
示例#42
0
 private static int LoadInt(LoadState S)
 {
     int x = (int)LoadVar(S, typeof(int));
      IF (x<0, "bad integer");
      return x;
 }
示例#43
0
 private static void LoadHeader(LoadState S)
 {
     CharPtr h = new char[LUAC_HEADERSIZE];
      CharPtr s = new char[LUAC_HEADERSIZE];
      luaU_header(h);
      LoadBlock(S, s, LUAC_HEADERSIZE);
      IF (memcmp(h, s, LUAC_HEADERSIZE)!=0, "bad header");
 }
示例#44
0
 private static Proto LoadFunction(LoadState S, TString p)
 {
     Proto f;
      if (++S.L.nCcalls > LUAI_MAXCCALLS) error(S,"code too deep");
      f=luaF_newproto(S.L);
      setptvalue2s(S.L,S.L.top,f); incr_top(S.L);
      f.source=LoadString(S); if (f.source==null) f.source=p;
      f.linedefined=LoadInt(S);
      f.lastlinedefined=LoadInt(S);
      f.nups=LoadByte(S);
      f.numparams=LoadByte(S);
      f.is_vararg=LoadByte(S);
      f.maxstacksize=LoadByte(S);
      LoadCode(S,f);
      LoadConstants(S,f);
      LoadDebug(S,f);
      IF (luaG_checkcode(f)==0 ? 1 : 0, "bad code");
      StkId.dec(ref S.L.top);
      S.L.nCcalls--;
      return f;
 }
示例#45
0
 private static void LoadDebug(LoadState S, Proto f)
 {
     int i,n;
      n=LoadInt(S);
      f.lineinfo=luaM_newvector<int>(S.L,n);
      f.sizelineinfo=n;
      f.lineinfo = (int[])LoadVector(S, typeof(int), n);
      n=LoadInt(S);
      f.locvars=luaM_newvector<LocVar>(S.L,n);
      f.sizelocvars=n;
      for (i=0; i<n; i++) f.locvars[i].varname=null;
      for (i=0; i<n; i++)
      {
       f.locvars[i].varname=LoadString(S);
       f.locvars[i].startpc=LoadInt(S);
       f.locvars[i].endpc=LoadInt(S);
      }
      n=LoadInt(S);
      f.upvalues=luaM_newvector<TString>(S.L, n);
      f.sizeupvalues=n;
      for (i=0; i<n; i++) f.upvalues[i]=null;
      for (i=0; i<n; i++) f.upvalues[i]=LoadString(S);
 }
示例#46
0
 private static void LoadConstants(LoadState S, Proto f)
 {
     int i,n;
      n=LoadInt(S);
      f.k = luaM_newvector<TValue>(S.L, n);
      f.sizek=n;
      for (i=0; i<n; i++) setnilvalue(f.k[i]);
      for (i=0; i<n; i++)
      {
       TValue o=f.k[i];
       int t=LoadChar(S);
       switch (t)
       {
        case LUA_TNIL:
        			setnilvalue(o);
     break;
        case LUA_TBOOLEAN:
        			setbvalue(o, LoadChar(S));
     break;
        case LUA_TNUMBER:
     setnvalue(o, LoadNumber(S));
     break;
        case LUA_TSTRING:
     setsvalue2n(S.L, o, LoadString(S));
     break;
        default:
     error(S,"bad constant");
     break;
       }
      }
      n=LoadInt(S);
      f.p=luaM_newvector<Proto>(S.L,n);
      f.sizep=n;
      for (i=0; i<n; i++) f.p[i]=null;
      for (i=0; i<n; i++) f.p[i]=LoadFunction(S,f.source);
 }
示例#47
0
 /// <summary>
 /// 界面加载
 /// </summary>
 /// <param name="loadedCallback"></param>
 public void Load(Action <ViewBase> loadedCallback = null)
 {
     m_loadedCallback = loadedCallback;
     m_loadState      = LoadState.LOADING;
     LoadModule.LoadUI(assetPath, OnLoadCompleted);
 }
示例#48
0
 public static lu_byte LoadByte(LoadState S)
 {
     return (lu_byte)LoadChar(S);
 }
示例#49
0
 private static void LoadBlock(LoadState S, CharPtr b, int size)
 {
     uint r=luaZ_read(S.Z, b, (uint)size);
      IF (r!=0, "unexpected end");
 }
        private void LoadWortk(bool bManual = false)
        {
            try
            {
                if (!ParamSetMgr.GetInstance().GetBoolParam("右剥料回原点成功"))
                {
                    return;
                }
                if (!IOMgr.GetInstace().ReadIoInBit("右装料平台有无感应器") &&
                    !ParamSetMgr.GetInstance().GetBoolParam("右搜寻蜂鸣器成功") &&
                    loadState != LoadState.exceing &&
                    sys.g_AppMode == AppMode.AirRun &&
                    GlobalVariable.g_StationState == StationState.StationStateRun)
                {
                    Info(string.Format("右装料平台有无感应器{0},右搜寻蜂鸣器成功{1},右拨料平台状态{2},右剥料吸嘴状态{3} 右剥料归位{4}",
                                       IOMgr.GetInstace().ReadIoInBit("右装料平台有无感应器"),
                                       ParamSetMgr.GetInstance().GetBoolParam("右搜寻蜂鸣器成功"),
                                       PlaneMgr.GetInstance().PlaneArr[(int)PlaneType.rightStripPlane].planeState,
                                       NozzleMgr.GetInstance().nozzleArr[(int)NozzleType.RightStripNozzle].nozzleState,
                                       ParamSetMgr.GetInstance().GetBoolParam("右剥料归位")));
retry_find:
                    loadState = LoadState.exceing;
                    WaranResult waranResult = FindBuzzer();
                    if (waranResult == WaranResult.Retry)
                    {
                        goto retry_find;
                    }
                    loadState = LoadState.None;
                }


                if (ParamSetMgr.GetInstance().GetBoolParam("右搜寻蜂鸣器成功") &&
                    ParamSetMgr.GetInstance().GetBoolParam("右装料平台上升到位") &&
                    NozzleMgr.GetInstance().nozzleArr[(int)NozzleType.RightStripNozzle].nozzleState == NozzleState.None &&
                    loadState != LoadState.exceing &&
                    GlobalVariable.g_StationState == StationState.StationStateRun)
                {
                    Info(string.Format("右装料平台有无感应器{0},右搜寻蜂鸣器成功{1},右拨料平台状态{2},右剥料吸嘴状态{3} 右剥料归位{4}",
                                       IOMgr.GetInstace().ReadIoInBit("右装料平台有无感应器"),
                                       ParamSetMgr.GetInstance().GetBoolParam("右搜寻蜂鸣器成功"),
                                       PlaneMgr.GetInstance().PlaneArr[(int)PlaneType.rightStripPlane].planeState,
                                       NozzleMgr.GetInstance().nozzleArr[(int)NozzleType.RightStripNozzle].nozzleState,
                                       ParamSetMgr.GetInstance().GetBoolParam("右剥料归位")));
                    loadState = LoadState.exceing;
                    Pick();
                    loadState = LoadState.None;
                }

                if (ParamSetMgr.GetInstance().GetBoolParam("右搜寻蜂鸣器成功") &&
                    !ParamSetMgr.GetInstance().GetBoolParam("右装料平台上升到位") &&
                    GlobalVariable.g_StationState == StationState.StationStateRun)
                {
                    Info("装料步进运动");
                    int    pos     = MotionMgr.GetInstace().GetAxisPos(AxisZ);
                    double steplen = ParamSetMgr.GetInstance().GetDoubleParam("装料步长");
                    pos = pos + (int)(steplen * nResolutionZ);
                    MoveSigleAxisPosWaitInpos(AxisZ, pos, MotionMgr.GetInstace().GetAxisMovePrm(AxisZ).VelH, 20, bManual, this);
                    ParamSetMgr.GetInstance().SetBoolParam("右装料平台上升到位", true);
                }
            }
            catch (Exception e)
            {
                loadState = LoadState.None;
                Warn("异常发生" + e.Message);
                return;
            }
        }
示例#51
0
 public static object LoadVector(LoadState S, Type t, int n)
 {
     return LoadMem(S, t, n);
 }
示例#52
0
 public AssetRequest()
 {
     asset     = null;
     loadState = LoadState.Init;
 }
示例#53
0
 private static lua_Number LoadNumber(LoadState S)
 {
     return (lua_Number)LoadVar(S, typeof(lua_Number));
 }
示例#54
0
 private static int LoadChar(LoadState S)
 {
     return (char)LoadVar(S, typeof(char));
 }
示例#55
0
 private static TString LoadString(LoadState S)
 {
     uint size = (uint)LoadVar(S, typeof(uint));
      if (size==0)
       return null;
      else
      {
       CharPtr s=luaZ_openspace(S.L,S.b,size);
       LoadBlock(S, s, (int)size);
       return luaS_newlstr(S.L,s,size-1);		/* remove trailing '\0' */
      }
 }
示例#56
0
 private static void LoadCode(LoadState S, Proto f)
 {
     int n=LoadInt(S);
      f.code = luaM_newvector<Instruction>(S.L, n);
      f.sizecode=n;
      f.code = (Instruction[])LoadVector(S, typeof(Instruction), n);
 }
示例#57
0
 /*
 ** load precompiled chunk
 */
 public static Proto luaU_undump(lua_State L, ZIO Z, Mbuffer buff, CharPtr name)
 {
     LoadState S = new LoadState();
      if (name[0] == '@' || name[0] == '=')
       S.name = name+1;
      else if (name[0]==LUA_SIGNATURE[0])
       S.name="binary string";
      else
       S.name=name;
      S.L=L;
      S.Z=Z;
      S.b=buff;
      LoadHeader(S);
      return LoadFunction(S,luaS_newliteral(L,"=?"));
 }
示例#58
0
        /// <summary>
        /// Request access to xna texture.
        /// </summary>
        /// <returns>true if data from texture can be readed.</returns>
        protected bool RequestAccess()
        {
            switch (this.LoadState)
            {
                case LoadState.Loaded:
                    if (IsValid)
                    {
                        return true;
                    }
                    else
                    {
                        using (MyTextureManager.TexturesLock.AcquireExclusiveUsing())
                        {
                            Unload();
                            return Load();
                        }
                    }

                case LoadState.Unloaded:
                case LoadState.LoadYourself:
                    using (MyTextureManager.TexturesLock.AcquireExclusiveUsing())
                    {
                        return Load();
                    }

                case LoadState.LoadYourselfBackground:
                    {
                        bool immediate = MyTextureManager.OverrideLoadingMode.HasValue && MyTextureManager.OverrideLoadingMode.Value == LoadingMode.Immediate;

                        if (immediate)
                        {
                            using (MyTextureManager.TexturesLock.AcquireExclusiveUsing())
                            {
                                return Load();
                            }
                        }
                        else
                        {
                            MyTextureManager.LoadTextureInBackground(this);
                            loadState = LoadState.Pending;
                            return false;
                        }
                    }

                case LoadState.Pending:
                case LoadState.Error:
                    return false;

                default:
                    throw new MyMwcExceptionApplicationShouldNotGetHere();
            }

        }
示例#59
0
 public static object LoadVar(LoadState S, Type t)
 {
     return LoadMem(S, t);
 }
示例#60
0
 static void error(LoadState S, CharPtr why)
 {
     luaO_pushfstring(S.L,"%s: %s in precompiled chunk",S.name,why);
      luaD_throw(S.L,LUA_ERRSYNTAX);
 }