Ejemplo n.º 1
0
        private void _Init()
        {
            if (_SplashColor.a > 0)
            {
                this.ready         = false;
                this.splashTexture = new Texture2D(1, 1, TextureFormat.ARGB32, false);
                this.splashTexture.SetPixel(0, 0, _SplashColor);
                this.splashTexture.Apply();
            }

            AnyLogger._GetInstance()._Init();
        }
Ejemplo n.º 2
0
        internal void _Exit()
        {
            for (var i = this.runners.Count - 1; i >= 0; --i)
            {
                this.runners[i].Shutdown();
            }

            this.runners           = null;
            this.host              = null;
            ServiceCenter.instance = null;

            AnyLogger._GetInstance()._Dispose();
            Console.Stop();
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 是否完成。
        /// </summary>
        /// <returns>true表示完成;false表示未完成。</returns>
        protected override bool IsDone()
        {
            if (!File.Exists(this.filePath))
            {
                this.completed = true;
            }
            else if (null == this.stream)
            {
                try {
                    this.stream = new FileStream(this.filePath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
                    this.bytes  = new byte[this.stream.Length];
                    this.stream.BeginRead(this.bytes, 0, this.bytes.Length, new AsyncCallback(_OnReadComplete), null);
                } catch (Exception e) {
                    AnyLogger.X(e);
                    this.stream = null;
                }
            }

            return(this.completed);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 是否完成。
        /// </summary>
        /// <returns>true表示完成;false表示未完成。</returns>
        protected override bool IsDone()
        {
            if (null == this.stream)
            {
                try {
                    var info = new FileInfo(this.filePath);
                    if (!Directory.Exists(info.DirectoryName))
                    {
                        Directory.CreateDirectory(info.DirectoryName);
                    }

                    this.stream = new FileStream(this.filePath, FileMode.OpenOrCreate, FileAccess.Write, FileShare.ReadWrite);
                    this.stream.Seek(0, (SeekOrigin)this.mode);
                    this.stream.BeginWrite(this.bytes, 0, this.bytes.Length, new AsyncCallback(_OnWriteComplete), null);
                } catch (Exception e) {
                    AnyLogger.X(e);
                    this.stream = null;
                }
            }

            return(this.completed);
        }