public void Receive(Pablo.Network.ReceiveCommandArgs args) { var commands = new List <RipCommand>(); args.Message.ReadCommands(handler.RipDocument, commands); handler.Document.IsModified = true; args.Invoke(delegate { var updates = new List <Rectangle>(); if (handler.SelectedTool != null) { handler.SelectedTool.RemoveDrawing(updates); } foreach (var cmd in commands) { var optional = cmd as RipOptionalCommand; if (optional != null && !optional.ShouldApply(handler.BGI)) { continue; } handler.RipDocument.Commands.Add(cmd); cmd.Apply(updates); } handler.RedoBuffer.Clear(); if (handler.SelectedTool != null) { handler.SelectedTool.ApplyDrawing(updates); } handler.BGI.UpdateRegion(updates); }); }
public override void Receive(Pablo.Network.ReceiveCommandArgs args) { base.Receive(args); var pos = args.Message.ReadPoint(); DoDelete(pos); }
public override void Receive(Pablo.Network.ReceiveCommandArgs args) { base.Receive(args); Location = args.Message.ReadPoint(); var characterDocument = args.Document as CharacterDocument; Canvas = args.Message.ReadCanvas(characterDocument.Pages[0].Palette); }
public void Receive(ReceiveCommandArgs args) { Key = new Guid(args.Message.ReadString()); Alias = args.Message.ReadString(); HostName = args.Message.ReadString(); //IPAddress = args.Message.ReadIPAddress(); Level = (UserLevel)args.Message.ReadVariableInt32(); }
public override void Receive(Pablo.Network.ReceiveCommandArgs args) { base.Receive(args); var cursor = args.Message.ReadPoint(); var pos = args.Message.ReadPoint(); InsertLine(pos, cursor); }
public void Receive(Pablo.Network.ReceiveCommandArgs args) { Palette = args.Message.ReadPalette(); args.Invoke(delegate { Handler.CurrentPage.Palette = Palette; Handler.Document.IsModified = true; }); }
public virtual void Receive(Pablo.Network.ReceiveCommandArgs args) { var id = args.Message.ReadInt32(); if (id != UndoID) { throw new InvalidOperationException("invalid undo type"); } }
public void Receive(Pablo.Network.ReceiveCommandArgs args) { var useIce = args.Message.ReadBoolean(); args.Invoke(delegate { Do(useIce); }); }
public override void Receive(Pablo.Network.ReceiveCommandArgs args) { base.Receive(args); var rect = args.Message.ReadRectangle(); var element = args.Message.ReadCanvasElement(); args.Invoke(delegate { Do(rect, null, element); }); }
public override void Receive(Pablo.Network.ReceiveCommandArgs args) { base.Receive(args); var rect = args.Message.ReadRectangle(); var applyColour = args.Message.ReadBoolean(); var applyCharacter = args.Message.ReadBoolean(); var filled = args.Message.ReadBoolean(); var element = args.Message.ReadCanvasElement(); args.Invoke(delegate { Do(null, rect, element, applyColour, applyCharacter, filled); }); }
public override void Receive(Pablo.Network.ReceiveCommandArgs args) { base.Receive(args); var start = args.Message.ReadPoint(); var end = args.Message.ReadPoint(); var applyColour = args.Message.ReadBoolean(); var applyCharacter = args.Message.ReadBoolean(); var element = args.Message.ReadCanvasElement(); args.Invoke(delegate { Do(null, start, end, element, applyColour, applyCharacter); }); }
public override void Receive(Pablo.Network.ReceiveCommandArgs args) { base.Receive(args); CharacterHandler handler = this.Handler as CharacterHandler; Canvas canvas = handler.CurrentPage.Canvas; int y = args.Message.ReadVariableInt32(); var rect = new Rectangle(0, y, canvas.Width, canvas.Height - y); if (!args.IsMe) { args.Invoke(delegate { handler.Undo.Save(new UndoDeleteLine(handler, y) { CursorLocation = handler.CursorPosition }); canvas.DeleteRow(y); if (y < handler.CursorPosition.Y) { var pos = handler.CursorPosition; pos.Y--; handler.CursorPosition = pos; var scrollpos = handler.Viewer.ScrollPosition; if (scrollpos.Y > handler.CurrentPage.Font.Height) { scrollpos.Y -= handler.CurrentPage.Font.Height; handler.Viewer.ScrollPosition = scrollpos; } } if (handler.SelectedTool != null) { handler.SelectedTool.DeleteLine(y); } handler.InvalidateCharacterRegion(rect, true); }); } else { args.Invoke(delegate { handler.Undo.Save(new UndoDeleteLine(handler, y) { CursorLocation = handler.CursorPosition }); canvas.DeleteRow(y); handler.InvalidateCharacterRegion(rect, true); }); } }
public override void Receive(Pablo.Network.ReceiveCommandArgs args) { base.Receive(args); var gradient = args.Message.ReadArray <Character>(); var location = args.Message.ReadPoint(); var attr = args.Message.ReadAttribute(); var inverse = args.Message.ReadBoolean(); var applyColour = args.Message.ReadBoolean(); var size = args.Message.ReadVariableInt32(); args.Invoke(delegate { Do(location, null, attr, gradient, size, inverse, applyColour); }); }
public override void Receive(Pablo.Network.ReceiveCommandArgs args) { base.Receive(args); var handler = this.Handler as CharacterHandler; var attribs = new FillAttributes { Rectangle = args.Message.ReadRectangle(), Mode = args.Message.ReadEnum <Controls.FillMode>(), Attribute = args.Message.ReadAttribute(), Character = args.Message.ReadInt32() }; args.Invoke(delegate { Do(null, attribs); handler.InvalidateCharacterRegion(attribs.Rectangle, true); }); }
public override void Receive(Pablo.Network.ReceiveCommandArgs args) { base.Receive(args); var handler = Handler as CharacterHandler; var canvas = handler.CurrentPage.Canvas; var x = args.Message.ReadVariableInt32(); args.Invoke(delegate { handler.Undo.Save(new UndoInsertColumn(handler, x) { CursorLocation = handler.CursorPosition }); canvas.InsertColumn(x); handler.InvalidateCharacterRegion(new Rectangle(x, 0, canvas.Width - x, canvas.Height), true); }); }
public void Receive(Pablo.Network.ReceiveCommandArgs args) { var color = args.Message.ReadColor(); var index = args.Message.ReadVariableInt32(); args.Invoke(delegate { var pal = Handler.CurrentPage.Palette; if (index < pal.Count) { Handler.Undo.Save(new UndoColour { Color = pal [index], Index = index }); pal [index] = color; Handler.Document.IsModified = true; } }); }
public override void Receive(Pablo.Network.ReceiveCommandArgs args) { base.Receive(args); var pos = args.Message.ReadPoint(); var insmod = args.Message.ReadBoolean(); var fore = args.Message.ReadVariableInt32(); var back = args.Message.ReadVariableInt32(); var character = args.Message.ReadVariableInt32(); var ce = new CanvasElement(character, new Attribute(fore, back)); var nextPos = pos; if (nextPos.X < Handler.CurrentPage.Canvas.Width - 1) { nextPos.X++; } args.Invoke(delegate { Do(Handler as CharacterHandler, pos, ce, insmod, true, true, args.IsMe ? (Point?)pos : null, args.IsMe ? (Point?)nextPos : null); }); }
public override void Receive(Pablo.Network.ReceiveCommandArgs args) { base.Receive(args); /*var hasLocation = args.Message.ReadBoolean (); * CursorLocation = hasLocation ? (Point?)args.Message.ReadPoint() : null; * * var hasnextLocation = args.Message.ReadBoolean (); * NextLocation = hasnextLocation ? (Point?)args.Message.ReadPoint () : null;*/ Items.Clear(); var count = args.Message.ReadInt32(); for (int i = 0; i < count; i++) { var type = (UndoType)Enum.ToObject(typeof(UndoType), args.Message.PeekInt32()); var item = UndoManager.CreateUndoItem(type); if (item != null) { item.Receive(args); Items.Add(item); } } }
public override void Receive(Pablo.Network.ReceiveCommandArgs args) { base.Receive(args); Position = args.Message.ReadPoint(); NextPosition = args.Message.ReadBoolean() ? (Point?)args.Message.ReadPoint() : null; }
public void Receive(Pablo.Network.ReceiveCommandArgs args) { character = args.Message.ReadInt16(); }
public override void Receive(Pablo.Network.ReceiveCommandArgs args) { base.Receive(args); Color = args.Message.ReadColor(); Index = args.Message.ReadVariableInt32(); }