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); } }
private TileItem CreateTileItem(TIS.Model.Internal.Document.DocNode node) { try { TileItem ti = new TileItem(); ti.BackgroundImageAlignment = TileItemContentAlignment.MiddleCenter; ti.BackgroundImageScaleMode = TileItemImageScaleMode.ZoomInside; if (node.Document == null) { ti.IsLarge = true; } if (node.ImageIndex >= 0 && node.ImageIndex < iclExtraLarge.Images.Count) { ti.BackgroundImage = iclExtraLarge.Images[node.ImageIndex]; } else if (node.Document != null) { RegistryKey oHKCR = null; RegistryKey oProgID = null; RegistryKey oOpenCmd = null; string StrProgID = null; string StrExe = null; try { oHKCR = Registry.ClassesRoot; oProgID = oHKCR.OpenSubKey(node.Document.Name.Substring(node.Document.Name.LastIndexOf('.'))); StrProgID = oProgID.GetValue(null).ToString(); oProgID.Close(); oOpenCmd = oHKCR.OpenSubKey(StrProgID + @"\shell\open\command"); StrExe = oOpenCmd.GetValue(null).ToString(); oOpenCmd.Close(); int TempPos = StrExe.IndexOf(" %1"); if (TempPos > 0) { StrExe = StrExe.Substring(0, TempPos); } TempPos = StrExe.IndexOf("\""); if (TempPos >= 0) { StrExe = StrExe.Substring(TempPos + 1, StrExe.IndexOf("\"", TempPos + 1) - 1); } ti.BackgroundImage = Icon.ExtractAssociatedIcon(StrExe).ToBitmap(); } catch (Exception e) { } } ti.Text = node.Name; ti.Tag = node; return(ti); } catch (Exception exception1) { Exception innerException = exception1; throw new Exception(MethodBase.GetCurrentMethod().Name, innerException); } }
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); } }
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); } }
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); } }