/// <summary> /// Called when the color changed. /// </summary> void _editorColorChanged(object sender, CadKit.Color.ColorChangedEventArgs args) { try { CadKit.Interfaces.IClearColor color = CadKit.Documents.Manager.Instance.ActiveView as CadKit.Interfaces.IClearColor; if (null != color) { color.ClearColor = args.Color; System.Windows.Forms.Control control = color as System.Windows.Forms.Control; if (null != control) { control.Invalidate(true); } } } catch (System.Exception e) { System.Console.WriteLine("Error 3571950654: {0}", e.Message); } }
/// <summary> /// Called when the active view changes. /// </summary> private void _onActiveViewChanged(CadKit.Interfaces.IDocumentView oldView, CadKit.Interfaces.IDocumentView newView) { try { CadKit.Interfaces.IClearColor color = newView as CadKit.Interfaces.IClearColor; if (null != color) { try { _editor.Color = (System.Drawing.Color)color.ClearColor; } catch (System.InvalidCastException) { } } } catch (System.Exception e) { System.Console.WriteLine("Error 6361619200: {0}", e.Message); } }