Ejemplo n.º 1
0
 private void PanelPaint_KeyDown(object sender,KeyEventArgs e)
 {
     if (selectedNote == null) return;
     if (e.KeyCode == Keys.Delete)
     {
         if (Methods.ShowStandardMsgBox(FormMessageType.Question, "حذف", "آیا مایل به حذف این نوشته هستید؟") == DialogResult.Yes)
         {
             PatientDoc.DocumentStickyNotes.RemoveAll(x => x == selectedNote);
             selectedNote = null;
             Invalidate();
         }
     }
 }
Ejemplo n.º 2
0
        protected override void OnMouseMove(System.Windows.Forms.MouseEventArgs e)
        {
            if (isPainting)
            {

                    _paintingElement.AddPoint(e.Location);
                    Invalidate();
            }
            else if (EditingType == ElementType.Text)
            {
                //determine mouse over a sticky note
                noteMouseOver = null;
                foreach (DocumentStickyNote note in PatientDoc.DocumentStickyNotes)
                {
                    if (e.X > note.X-35 && e.X < note.X+5  && e.Y > note.Y-35 && e.Y < note.Y+5 )
                    {
                        this.Cursor = Cursors.Hand;
                        noteMouseOver = note;

                    }
                }
                if (noteMouseOver==null) this.Cursor = CustomCursor;
                //////

                if (isMovingText)//moving stickyNote
                {
                    selectedNote.X = e.X;
                    selectedNote.Y = e.Y;
                    Invalidate();
                }
            }
        }
Ejemplo n.º 3
0
        protected override void OnMouseDown(System.Windows.Forms.MouseEventArgs e)
        {
            this.Focus();
            selectedNote = null;
            if (e.Button != System.Windows.Forms.MouseButtons.Left)
                return;
            switch (EditingType)
            {
                case ElementType.None:
                    break;
                case ElementType.Text:
                    if (noteMouseOver != null)
                    {
                        selectedNote = noteMouseOver;
                        isMovingText = true;
                        Invalidate();
                        return;
                    }

                    DocumentStickyNote d = new DocumentStickyNote() { X = e.X,Y=e.Y};

                    var editor = new TextElementEditor() { Location = e.Location };
                    editor.Set(d);
                    editor.ShowDialog();
                    if(!string.IsNullOrEmpty(d.Text))
                        _patient.DocumentStickyNotes.Add(d);
                    Invalidate();
                    break;
                case ElementType.Line:
                    _paintingElement.Color = PaintingColor;
                    isPainting = true;
                    Invalidate();
                    break;
                case ElementType.Eraser:
                    _paintingElement.Width = 10;
                    _paintingElement.Color = Color.Transparent;
                    isPainting = true;
                    Invalidate();
                    break;
                case ElementType.Circle:
                    break;
                default:
                    break;
            }
        }
Ejemplo n.º 4
0
 /// <summary>
 /// Deprecated Method for adding a new object to the DocumentStickyNotes EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToDocumentStickyNotes(DocumentStickyNote documentStickyNote)
 {
     base.AddObject("DocumentStickyNotes", documentStickyNote);
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Create a new DocumentStickyNote object.
 /// </summary>
 /// <param name="id">Initial value of the Id property.</param>
 /// <param name="x">Initial value of the X property.</param>
 /// <param name="y">Initial value of the Y property.</param>
 /// <param name="patientDocumentId">Initial value of the PatientDocumentId property.</param>
 /// <param name="color">Initial value of the Color property.</param>
 public static DocumentStickyNote CreateDocumentStickyNote(global::System.Int32 id, global::System.Double x, global::System.Double y, global::System.Int32 patientDocumentId, global::System.Int32 color)
 {
     DocumentStickyNote documentStickyNote = new DocumentStickyNote();
     documentStickyNote.Id = id;
     documentStickyNote.X = x;
     documentStickyNote.Y = y;
     documentStickyNote.PatientDocumentId = patientDocumentId;
     documentStickyNote.Color = color;
     return documentStickyNote;
 }
Ejemplo n.º 6
0
 public void Set(DocumentStickyNote element)
 {
     _element = element;
     textBox.Text = element.Text;
 }