private void OutputService_LineWritten(object sender, WriteLineEventArgs e) { var clientUpdate = new ClientUpdate(); clientUpdate.OutputLines = new[] { e.Line }; PushUpdate(clientUpdate); }
private void SelectedEntities_CollectionChanged(object sender, EventArgs e) { var selectedEntities = Workspace.SelectedEntities.ToList(); var clientUpdate = new ClientUpdate(); // prepare selected drawing clientUpdate.SelectedEntitiesDrawing = new ClientDrawing(null); var fallBackColor = Workspace.SettingsService.GetValue <CadColor>(DisplaySettingsNames.BackgroundColor).GetAutoContrastingColor(); foreach (var entity in selectedEntities) { foreach (var primitive in entity.GetPrimitives()) { AddPrimitiveToDrawing(clientUpdate.SelectedEntitiesDrawing, primitive, fallBackColor); } } // update property pane ClientPropertyPane propertyPane; if (selectedEntities.Count == 0) { // nothing selected; send emtpy set to clear ui propertyPane = new ClientPropertyPane(); } else { // only get properties common to all entities propertyPane = new ClientPropertyPane(Workspace.GetPropertyPaneValues()); } clientUpdate.PropertyPane = propertyPane; PushUpdate(clientUpdate); }
private void SettingsService_SettingChanged(object sender, SettingChangedEventArgs e) { var clientUpdate = new ClientUpdate(); clientUpdate.Settings = GetSettings(); PushUpdate(clientUpdate); }
private void InputService_PromptChanged(object sender, PromptChangedEventArgs e) { var clientUpdate = new ClientUpdate(); clientUpdate.Prompt = e.Prompt; PushUpdate(clientUpdate); }
private void _workspace_WorkspaceChanged(object sender, WorkspaceChangeEventArgs e) { var doUpdate = false; var clientUpdate = new ClientUpdate(); if (e.IsDirtyChange) { doUpdate = true; clientUpdate.IsDirty = true; } if (e.IsActiveViewPortChange) { doUpdate = true; clientUpdate.Transform = GetDisplayTransform(); } if (e.IsDrawingChange) { doUpdate = true; clientUpdate.Drawing = GetDrawing(); } if (doUpdate) { PushUpdate(clientUpdate); } }
private void _dim_SelectionRectangleUpdated(object sender, SelectionState?e) { var clientUpdate = new ClientUpdate(); clientUpdate.SelectionState = e; PushUpdate(clientUpdate); }
private void _dim_HotPointsUpdated(object sender, IEnumerable <Point> e) { var clientUpdate = new ClientUpdate(); clientUpdate.HotPoints = e.Select(p => new ClientPoint(p)).ToArray(); PushUpdate(clientUpdate); }
private void _dim_CursorStateUpdated(object sender, CursorState e) { var clientUpdate = new ClientUpdate(); clientUpdate.CursorState = e; PushUpdate(clientUpdate); }
private void _dim_CurrentSnapPointUpdated(object sender, TransformedSnapPoint?e) { if (e.HasValue) { var clientUpdate = new ClientUpdate(); clientUpdate.TransformedSnapPoint = e; PushUpdate(clientUpdate); } }
public void Resize(double width, double height) { _dim.Resize(width, height); var clientUpdate = new ClientUpdate() { Transform = GetDisplayTransform(), }; PushUpdate(clientUpdate); }
private void _dim_RubberBandPrimitivesChanged(object sender, IEnumerable <IPrimitive> primitives) { var clientUpdate = new ClientUpdate(); clientUpdate.RubberBandDrawing = new ClientDrawing(null); var fallBackColor = Workspace.SettingsService.GetValue <CadColor>(DisplaySettingsNames.BackgroundColor).GetAutoContrastingColor(); foreach (var primitive in primitives) { AddPrimitiveToDrawing(clientUpdate.RubberBandDrawing, primitive, fallBackColor); } PushUpdate(clientUpdate); }
public void Ready(double width, double height) { _dim.Resize(width, height); var clientUpdate = new ClientUpdate() { Drawing = GetDrawing(), Settings = GetSettings(), Transform = GetDisplayTransform(), }; PushUpdate(clientUpdate); if (!_readyEventFired) { _readyEventFired = true; IsReady?.Invoke(this, new EventArgs()); } }
private void PushUpdate(ClientUpdate clientUpdate) { var _ = _jsonRpc.NotifyAsync("ClientUpdate", clientUpdate); }