コード例 #1
0
            public void Load(Stream fs, Canvas canvas, Palette palette, WaitEventHandler onWait = null)
            {
                ansiLineWrap = null;
                var br = new BinaryReader(fs);

                this.canvas  = canvas;
                this.palette = palette;
                rClip        = new Rectangle(0, 0, canvas.Width, canvas.Height);
                attribute    = rgbAttribute = new Attribute(7, 0);
                ptCur        = rClip.Location;
                try
                {
                    var  args    = new WaitEventArgs();
                    byte curByte = br.ReadByte();
                    while (true)
                    {
                        if (onWait != null)
                        {
                            onWait(this, args);
                        }
                        if (args.Exit)
                        {
                            break;
                        }
                        if (curByte == 27)
                        {
                            curByte = br.ReadByte();
                            if (curByte == 91)
                            {
                                // Escape sequence found!  scan for parameter
                                ReadEscapeSequence(ref br);
                            }
                            else
                            {
                                ReadCurByte(27);
                                continue;
                            }
                        }
                        else
                        {
                            ReadCurByte(curByte);
                        }
                        curByte = br.ReadByte();
                    }
                }
                catch (EndOfStreamException)
                {
                    // end of stream, so we're finished
                }
                catch (CanvasOverflowException)
                {
                    // everything's still okay, just went over the limits of the canvas
                }
                // Console.WriteLine("Finished Loading!");
                br.Close();
            }
コード例 #2
0
        /*
         * public override void Receive (Lidgren.Network.NetIncomingMessage message)
         * {
         *      base.Receive (message);
         *      forceAnimation = message.ReadBoolean ();
         * }
         *
         * public override bool Send (Lidgren.Network.NetOutgoingMessage message)
         * {
         *      base.Send (message);
         *      message.Write(!EditMode && Info.AnimationEnabled && AnimateView);
         *      return true;
         * }*/

        #region IDisposable Members

        public abstract void SetWaitHandler(WaitEventHandler waitHandler);
コード例 #3
0
 public override void SetWaitHandler(WaitEventHandler waitHandler)
 {
     Wait += waitHandler;
 }