Exemplo n.º 1
0
            public override void Move(EditorDiagram editor, Point point)
            {
                Point end = Symbol.ScreenPoint(Symbol.GridPoint(point));

                this.markerLine.X2 = end.X;
                this.markerLine.Y2 = end.Y;
            }
Exemplo n.º 2
0
        public void CreateSymbol(EditorDiagram editor, GridPoint point)
        {
            CircuitProject project = editor.CircuitProject;
            DialogText     dialog  = new DialogText(null);
            bool?          result  = editor.Mainframe.ShowDialog(dialog);

            if (result.HasValue && result.Value && TextNote.IsValidText(dialog.Document))
            {
                project.InTransaction(() => project.TextNoteSet.Create(editor.Project.LogicalCircuit, point, dialog.Document));
            }
        }
Exemplo n.º 3
0
 public override void Commit(EditorDiagram editor, Point point, bool withWires)
 {
     if (editor.SelectionCount > 1)
     {
         base.Commit(editor, point, withWires);
     }
     else
     {
         this.parent.CommitResize(editor, withWires);
     }
 }
Exemplo n.º 4
0
 public override void Move(EditorDiagram editor, Point point)
 {
     if (editor.SelectionCount > 1)
     {
         base.Move(editor, point);
     }
     else
     {
         ResizeMarker <TParent> .move[this.x + this.y * 3](this.parent, point);
     }
 }
Exemplo n.º 5
0
 public override void Move(EditorDiagram editor, Point point)
 {
     if (editor.SelectionCount > 1)
     {
         base.Move(editor, point);
     }
     else
     {
         this.setPoint(point);
         this.Refresh();
     }
 }
Exemplo n.º 6
0
            public override void Commit(EditorDiagram editor, Point point, bool withWires)
            {
                this.Move(editor, point);
                Wire wire = editor.CreateWire(this.Point1, this.Point2);

                if (wire == null)
                {
                    wire = editor.FindWireNear(point);
                    if (wire != null)
                    {
                        editor.Select(wire);
                    }
                }
            }
Exemplo n.º 7
0
 public override void Commit(EditorDiagram editor, Point point, bool withWires)
 {
     if (editor.SelectionCount > 1)
     {
         base.Commit(editor, point, withWires);
     }
     else
     {
         editor.CommitMove(point, withWires, this);
         if (this.Parent.Wire.IsDeleted())
         {
             editor.Unselect(this.Parent.Wire);
         }
         else
         {
             this.Parent.Refresh();
         }
     }
 }
Exemplo n.º 8
0
 public WireValidator(EditorDiagram diagram)
 {
     this.diagram = diagram;
     if (WireValidator.thread == null)
     {
         Thread attempt = new Thread(new ThreadStart(WireValidator.Run))
         {
             Name         = nameof(WireValidator),
             IsBackground = true,
             Priority     = ThreadPriority.BelowNormal
         };
         if (null == Interlocked.CompareExchange(ref WireValidator.thread, attempt, null))
         {
             WireValidator.updateRequest = new AutoResetEvent(false);
             WireValidator.thread.Start();
         }
     }
     WireValidator.wireValidator = this;
 }
Exemplo n.º 9
0
 public void CommitResize(EditorDiagram editor, bool withWires)
 {
     editor.CommitMove(this);
 }
Exemplo n.º 10
0
 public virtual void Commit(EditorDiagram editor, Point point, bool withWires)
 {
     editor.CommitMove(point, withWires);
 }
Exemplo n.º 11
0
 public virtual void Move(EditorDiagram editor, Point point)
 {
     editor.MoveSelection(point);
 }
Exemplo n.º 12
0
        public void CreateSymbol(EditorDiagram editor, GridPoint point)
        {
            CircuitProject project = editor.CircuitProject;

            project.InTransaction(() => project.CircuitSymbolSet.Create(this.GetCircuitToDrop(project), editor.Project.LogicalCircuit, point.X, point.Y));
        }
Exemplo n.º 13
0
 public override void Commit(EditorDiagram editor, Point point, bool withWires)
 {
     editor.Select(new Rect(this.point0, point));
 }
Exemplo n.º 14
0
 public override void Move(EditorDiagram editor, Point point)
 {
     this.PositionGlyph(point);
 }