Exemplo n.º 1
0
        public override bool Send(Pablo.Network.SendCommandArgs args)
        {
            var handler = this.Handler as CharacterHandler;

            base.Send(args);

            var attribs = GetAttribs();

            if (attribs == null)
            {
                return(false);
            }

            args.Message.Write(attribs.Rectangle);
            args.Message.WriteEnum <Controls.FillMode> (attribs.Mode);
            args.Message.Write(attribs.Attribute);
            args.Message.Write((int)attribs.Character);

            if (tool != null)
            {
                tool.ClearSelected = false;
                tool.DrawMode      = DrawMode.Normal;
                //tool.SelectedRegion = Rectangle.Empty;
                handler.CursorPosition = attribs.Rectangle.TopLeft;
            }
            return(true);
        }
Exemplo n.º 2
0
 public override bool Send(Pablo.Network.SendCommandArgs args)
 {
     base.Send(args);
     args.Message.Write(Color);
     args.Message.WriteVariableInt32(Index);
     return(true);
 }
Exemplo n.º 3
0
        public override bool Send(Pablo.Network.SendCommandArgs args)
        {
            base.Send(args);
            var handler = Handler as CharacterHandler;

            args.Message.Write(handler.CursorPosition);
            return(true);
        }
Exemplo n.º 4
0
 public bool Send(SendCommandArgs args)
 {
     args.Message.Write(Key.ToString());
     args.Message.Write(Alias);
     args.Message.Write(HostName);
     //args.Message.Write (IPAddress);
     args.Message.WriteVariableInt32((int)Level);
     return(true);
 }
Exemplo n.º 5
0
        public override bool Send(Pablo.Network.SendCommandArgs args)
        {
            base.Send(args);
            args.Message.Write(Location);
            var characterDocument = args.Network.Delegate.Document as CharacterDocument;

            args.Message.Write(Canvas, characterDocument.Pages[0].Palette);
            return(true);
        }
Exemplo n.º 6
0
        public override bool Send(Pablo.Network.SendCommandArgs args)
        {
            base.Send(args);
            CharacterHandler handler = this.Handler as CharacterHandler;

            args.Message.WriteVariableInt32(handler.CursorPosition.Y);

            return(true);
        }
Exemplo n.º 7
0
 public override bool Send(Pablo.Network.SendCommandArgs args)
 {
     base.Send(args);
     args.Message.Write(Rectangle);
     args.Message.Write(ApplyColour);
     args.Message.Write(ApplyCharacter);
     args.Message.Write(Filled);
     args.Message.Write(Element);
     return(true);
 }
Exemplo n.º 8
0
 public override bool Send(Pablo.Network.SendCommandArgs args)
 {
     base.Send(args);
     args.Message.Write(Position);
     args.Message.Write(NextPosition != null);
     if (NextPosition != null)
     {
         args.Message.Write(NextPosition.Value);
     }
     return(true);
 }
Exemplo n.º 9
0
        public override bool Send(Pablo.Network.SendCommandArgs args)
        {
            base.Send(args);
            var rect = tool.SelectedRegion.Value;

            args.Message.Write(rect);
            args.Message.Write(Handler.DrawElement);
            tool.DrawMode               = DrawMode.Normal;
            tool.SelectedRegion         = null;
            tool.Handler.CursorPosition = rect.TopLeft;
            return(true);
        }
Exemplo n.º 10
0
        public override bool Send(Pablo.Network.SendCommandArgs args)
        {
            base.Send(args);
            var attr     = Handler.DrawAttribute;
            var gradient = DrawBrush.GetCharacters(Handler.CurrentPage.Font.Encoding);

            args.Message.Write(gradient);
            args.Message.Write(Location);
            args.Message.Write(attr);
            args.Message.Write(Inverse);
            args.Message.Write(ApplyColour);
            args.Message.WriteVariableInt32(this.Size);
            return(true);
        }
Exemplo n.º 11
0
 public void SendCommand(ICommand command)
 {
     //Console.WriteLine ("User:{0}, needed:{1}", CurrentUser.Level, command.Level);
     if (CurrentUser.Level >= command.Level)
     {
         var message = client.CreateMessage();
         message.WriteVariableInt32(command.CommandID);
         var args = new SendCommandArgs(message, this);
         if (command.Send(args))
         {
             client.SendMessage(message, NetDeliveryMethod.ReliableOrdered, 1);
         }
     }
 }
Exemplo n.º 12
0
        public override bool Send(Pablo.Network.SendCommandArgs args)
        {
            base.Send(args);
            var handler = Handler as CharacterHandler;
            var attr    = handler.DrawAttribute;

            //var canvas = handler.CurrentPage.Canvas;
            //canvas [handler.CursorPosition] = new CanvasElement (this.Character, attr);
            args.Message.Write(Location ?? handler.CursorPosition);
            args.Message.Write(Location == null ? handler.InsertMode : false);
            args.Message.WriteVariableInt32(attr.Foreground);
            args.Message.WriteVariableInt32(attr.Background);
            args.Message.WriteVariableInt32(this.Character);
            MoveCursor();
            return(true);
        }
Exemplo n.º 13
0
        public override bool Send(Pablo.Network.SendCommandArgs args)
        {
            base.Send(args);

            /*
             * args.Message.Write (CursorLocation != null);
             * if (CursorLocation != null) args.Message.Write (CursorLocation.Value);
             *
             * args.Message.Write (NextLocation != null);
             * if (NextLocation != null) args.Message.Write (NextLocation.Value);
             */

            args.Message.Write(Items.Count);
            for (int i = 0; i < Items.Count; i++)
            {
                Items [i].Send(args);
            }
            return(true);
        }
Exemplo n.º 14
0
        public override bool Send(Pablo.Network.SendCommandArgs args)
        {
            base.Send(args);
            CharacterHandler handler = this.Handler as CharacterHandler;
            Canvas           canvas  = handler.CurrentPage.Canvas;
            var cursor = handler.CursorPosition;

            if (cursor.Y < canvas.Height - 1)
            {
                var pos = cursor;
                pos.Y++;
                pos.X = 0;
                handler.CursorPosition = pos;
                handler.EnsureVisible(pos);

                if (handler.InsertMode)
                {
                    args.Message.Write(cursor);
                    args.Message.Write(pos);
                    return(true);
                }
            }
            return(false);
        }
Exemplo n.º 15
0
 public bool Send(Pablo.Network.SendCommandArgs args)
 {
     args.Message.Write(character);
     return(true);
 }
Exemplo n.º 16
0
 public bool Send(Pablo.Network.SendCommandArgs args)
 {
     args.Message.Write(this.Checked);
     return(true);
 }
Exemplo n.º 17
0
 public virtual bool Send(Pablo.Network.SendCommandArgs args)
 {
     args.Message.Write(UndoID);
     return(true);
 }