コード例 #1
0
 private void tileDocument_MouseDoubleClick(object sender, MouseEventArgs e)
 {
     try
     {
         if (e.Button == System.Windows.Forms.MouseButtons.Right)
         {
             DocumentNodeOrLink dnol = new DocumentNodeOrLink(iclExtraLarge);
             dnol.ShowDialog(this);
             if (dnol.DialogResult == DialogResult.OK)
             {
                 TIS.Model.Internal.Document.DocNode newNode = new TIS.Model.Internal.Document.DocNode(Uow);
                 newNode.ParentDocNode = _selectedNode;
                 newNode.Name          = dnol.NodeName;
                 //newNode.DocTreeDisplay = _docTree;
                 newNode.ImageIndex = dnol.Index;
                 if (dnol.isLink)
                 {
                     Model.Internal.Document.Document document = new Model.Internal.Document.Document(Uow);
                     document.Name           = dnol.Url;
                     document.DocTypeDisplay = Enumeration.Document.DocumentType.Link;
                     document.DocNode        = newNode;
                     newNode.Document        = document;
                 }
                 Uow.CommitChanges();
                 SelectNode(_selectedNode);
             }
         }
     }
     catch (Exception exception1)
     {
         System.Exception thisException = exception1;
         Management.ShowException(thisException);
     }
 }
コード例 #2
0
 private void tileDocument_ItemClick(object sender, TileItemEventArgs e)
 {
     try
     {
         Model.Internal.Document.DocNode node = (TIS.Model.Internal.Document.DocNode)(e.Item.Tag);
         if (node.Document == null)
         {
             SelectNode(node);
             //int groupIndex = int.Parse(e.Item.Group.Tag.ToString());
             //List<TileGroup> deleteGroups = new List<TileGroup>();
             //foreach (TileGroup tg in tileDocument.Groups)
             //{
             //    if (int.Parse(tg.Tag.ToString()) > groupIndex)
             //    {
             //        deleteGroups.Add(tg);
             //    }
             //}
             //foreach (TileGroup tg in deleteGroups)
             //{
             //    tileDocument.Groups.Remove(tg);
             //}
             //TileGroup newGroup = new TileGroup();
             //newGroup.Tag = groupIndex + 1;
             //if (_selectedNode != null)
             //{
             //    foreach (TIS.Model.Internal.Document.DocNode n in _selectedNode.childDocNode)
             //    {
             //        newGroup.Items.Add(CreateTileItem(n));
             //    }
             //    tileDocument.Groups.Clear();
             //    tileDocument.Groups.Add(newGroup);
             //}
         }
         else
         {
             Model.Internal.Document.Document currentDocument = node.Document;
             if (currentDocument != null)
             {
                 if (currentDocument.DocTypeDisplay == Enumeration.Document.DocumentType.Document)
                 {
                     currentDocument.OpenFile();
                 }
                 else
                 {
                     System.Diagnostics.Process.Start(currentDocument.Name);
                 }
             }
         }
     }
     catch (Exception exception1)
     {
         System.Exception thisException = exception1;
         Management.ShowException(thisException);
     }
 }
コード例 #3
0
 private void tileDocument_DragDrop(object sender, DragEventArgs e)
 {
     try
     {
         string[] FileList = (string[])e.Data.GetData(DataFormats.FileDrop, false);
         Model.Internal.Document.Document document = new Model.Internal.Document.Document(Uow);
         foreach (string file in FileList)
         {
             if (!System.IO.Directory.Exists(file))
             {
                 document.ReadFile(file);
                 document.Name           = file.Substring(file.LastIndexOf('\\') + 1);
                 document.DocTypeDisplay = Enumeration.Document.DocumentType.Document;
                 TIS.Model.Internal.Document.DocNode newNode = new TIS.Model.Internal.Document.DocNode(Uow);
                 newNode.Document      = document;
                 newNode.ParentDocNode = _selectedNode;
                 newNode.Name          = document.Name;
                 //newNode.DocTreeDisplay = _docTree;
                 newNode.ImageIndex = -1;
                 DocumentFile df = new DocumentFile(iclExtraLarge, document.Name);
                 df.ShowDialog(this);
                 if (df.DialogResult == DialogResult.OK)
                 {
                     newNode.ImageIndex = df.Index >= iclExtraLarge.Images.Count ? -1 : df.Index;
                     newNode.Name       = df.DocName;
                     Uow.CommitChanges();
                 }
                 //this.Uow = new UnitOfWork();
             }
         }
         SelectNode(_selectedNode);
     }
     catch (Exception exception1)
     {
         System.Exception thisException = exception1;
         Management.ShowException(thisException);
     }
 }
コード例 #4
0
ファイル: Document.cs プロジェクト: GianiWVL/VUYLSTEKE
 private void tileDocument_MouseDoubleClick(object sender, MouseEventArgs e)
 {
     try
     {
         if (e.Button == System.Windows.Forms.MouseButtons.Right)
         {
             DocumentNodeOrLink dnol = new DocumentNodeOrLink(iclExtraLarge);
             dnol.ShowDialog(this);
             if (dnol.DialogResult == DialogResult.OK)
             {
                 TIS.Model.Internal.Document.DocNode newNode = new TIS.Model.Internal.Document.DocNode(Uow);
                 newNode.ParentDocNode = _selectedNode;
                 newNode.Name = dnol.NodeName;
                 //newNode.DocTreeDisplay = _docTree;
                 newNode.ImageIndex = dnol.Index;
                 if (dnol.isLink)
                 {
                     Model.Internal.Document.Document document = new Model.Internal.Document.Document(Uow);
                     document.Name = dnol.Url;
                     document.DocTypeDisplay = Enumeration.Document.DocumentType.Link;
                     document.DocNode = newNode;
                     newNode.Document = document;
                 }
                 Uow.CommitChanges();
                 SelectNode(_selectedNode);
             }
         }
     }
     catch (Exception exception1)
     {
         System.Exception thisException = exception1;
         Management.ShowException(thisException);
     }
 }
コード例 #5
0
ファイル: Document.cs プロジェクト: GianiWVL/VUYLSTEKE
 private void tileDocument_DragDrop(object sender, DragEventArgs e)
 {
     try
     {
         string[] FileList = (string[])e.Data.GetData(DataFormats.FileDrop, false);
         Model.Internal.Document.Document document = new Model.Internal.Document.Document(Uow);
         foreach (string file in FileList)
         {
             if (!System.IO.Directory.Exists(file))
             {
                 document.ReadFile(file);
                 document.Name = file.Substring(file.LastIndexOf('\\') + 1);
                 document.DocTypeDisplay = Enumeration.Document.DocumentType.Document;
                 TIS.Model.Internal.Document.DocNode newNode = new TIS.Model.Internal.Document.DocNode(Uow);
                 newNode.Document = document;
                 newNode.ParentDocNode = _selectedNode;
                 newNode.Name = document.Name;
                 //newNode.DocTreeDisplay = _docTree;
                 newNode.ImageIndex = -1;
                 DocumentFile df = new DocumentFile(iclExtraLarge, document.Name);
                 df.ShowDialog(this);
                 if (df.DialogResult == DialogResult.OK)
                 {
                     newNode.ImageIndex = df.Index >= iclExtraLarge.Images.Count ? -1 : df.Index;
                     newNode.Name = df.DocName;
                     Uow.CommitChanges();
                 }
                 //this.Uow = new UnitOfWork();
             }
         }
         SelectNode(_selectedNode);
     }
     catch (Exception exception1)
     {
         System.Exception thisException = exception1;
         Management.ShowException(thisException);
     }
 }