private void OnControlsDataChanged(Object sender, EventArgs e)
 {
     if (m_currentNote != null)
     {
         if (sender is DevExpress.XtraEditors.DateEdit)
         {
             DevExpress.XtraEditors.DateEdit control = sender as DevExpress.XtraEditors.DateEdit;
             if (control.Name == m_TaskStartDateControl.Name)
             {
                 m_currentNote.StartDate = m_TaskStartDateControl.DateTime;
             }
             else
             {
                 m_currentNote.FinishDate = m_TaskFinishDateControl.DateTime;
             }
         }
         else if (sender is DevExpress.XtraEditors.TextEdit && ((DevExpress.XtraEditors.TextEdit)sender).Name == m_TaskNameControl.Name)
         {
             m_currentNote.NodeName = m_TaskNameControl.Text;
         }
         else if (sender is DevExpress.XtraEditors.CheckEdit)
         {
             m_currentNote.IsDone = m_TaskIsDoneControl.Checked;
         }
         else if (sender is DevExpress.XtraEditors.MemoEdit)
         {
             m_currentNote.TaskText = m_TaskTextControl.Text;
         }
         CaseKeeper.OnCaseUpdate();
     }
 }
Example #2
0
        private void TreeListDragDrop(object sender, System.Windows.Forms.DragEventArgs e)
        {
            try
            {
                e.Effect = System.Windows.Forms.DragDropEffects.None;
                TreeListNode dragNode, targetNode;
                INode        IdragNode, ItargetNode;
                TreeList     treeList = sender as TreeList;

                Point p = treeList.PointToClient(new Point(e.X, e.Y));

                dragNode   = e.Data.GetData(typeof(TreeListNode)) as TreeListNode;
                targetNode = treeList.CalcHitInfo(p).Node;

                IdragNode   = (e.Data.GetData(typeof(TreeListNode)) as TreeListNode).GetValue(GUIConstants.TreeListOriginalNoteColumnName) as INode;
                ItargetNode = (treeList.CalcHitInfo(p).Node).GetValue(GUIConstants.TreeListOriginalNoteColumnName) as INode;

                if (IdragNode != null && ItargetNode != null && ItargetNode.IsContainer)
                {
                    IdragNode.Parent.Nodes.Remove(IdragNode);
                    ItargetNode.Nodes.Add(IdragNode);
                    IdragNode.Parent = ItargetNode;
                    treeList.SetNodeIndex(dragNode, treeList.GetNodeIndex(targetNode));
                    //e.Effect = System.Windows.Forms.DragDropEffects.Link;
                    CaseKeeper.OnCaseUpdate();
                }
            }
            catch (System.Exception ex)
            {
                Log.Logger.WriteErrorMessage(string.Format("DragandDrop exception in TreeListCaseAdapter, exception:\n\t{0}", ex.ToString()));
            }
        }
Example #3
0
 public void AddNewNodeClicked <T>(INode m_currentNode) where T : INode, new()
 {
     try
     {
         T itemToAdd = new T();
         if (m_currentNode == null && CaseKeeper.CurrentCase != null)
         {
             itemToAdd.Parent = CaseKeeper.CurrentCase;
             CaseKeeper.CurrentCase.Nodes.Add(itemToAdd);
         }
         else if (m_currentNode is BaseContainerNode || m_currentNode is Case)
         {
             itemToAdd.Parent = m_currentNode;
             m_currentNode.Nodes.Add(itemToAdd);
         }
         else
         {
             itemToAdd.Parent = m_currentNode.Parent;
             m_currentNode.Parent.Nodes.Add(itemToAdd);
         }
         CaseKeeper.OnCaseUpdate();
     }
     catch (System.Exception ex)
     {
         Log.Logger.WriteErrorMessage(string.Format("Error during proccesing TableGridPopupMenu click, exception:\n\t{0}", ex.ToString()));
     }
 }
Example #4
0
 public void DeleteNode(INode m_currentNode)
 {
     try
     {
         m_currentNode.Parent.Nodes.Remove(m_currentNode);
         CaseKeeper.OnCaseUpdate();
     }
     catch (System.Exception ex)
     {
         Log.Logger.WriteErrorMessage(string.Format("Error during proccesing TableGridPopupMenu click, exception:\n\t{0}", ex.ToString()));
     }
 }
 private void GridViewCellValueChanged(object sender, CellValueChangedEventArgs e)
 {
     CaseKeeper.OnCaseUpdate();
 }