private void Refresh_Overview() { try { Model.Internal.Document.DocNode node = _selectedNode; List <Model.Internal.Document.DocNode> nodes = new List <Model.Internal.Document.DocNode>(); while (node != null) { nodes.Insert(0, node); node = node.ParentDocNode; } // maybe : create top lvl item; TileGroup newGroup = new TileGroup(); newGroup.Items.Add(_overviewTileItem); foreach (Model.Internal.Document.DocNode n in nodes) { newGroup.Items.Add(CreateTileItem(n)); } tileControlOverview.Groups.Clear(); tileControlOverview.Groups.Add(newGroup); } catch (Exception exception1) { Exception innerException = exception1; throw new Exception(MethodBase.GetCurrentMethod().Name, innerException); } }
private void SelectNode(Model.Internal.Document.DocNode node) { try { _selectedNode = node; if (_selectedNode == null) { Find(); } else { tileDocument.Groups.Clear(); TileGroup newGroup = new TileGroup(); foreach (Model.Internal.Document.DocNode n in node.childDocNode) { newGroup.Items.Add(CreateTileItem(n)); } tileDocument.Groups.Add(newGroup); Refresh_Overview(); } } catch (Exception exception1) { Exception innerException = exception1; throw new Exception(MethodBase.GetCurrentMethod().Name, innerException); } }
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); } }
private void tileControlOverview_ItemClick(object sender, TileItemEventArgs e) { try { if (e.Item == _overviewTileItem) { SelectNode(null); } else { Model.Internal.Document.DocNode node = (Model.Internal.Document.DocNode)e.Item.Tag; SelectNode(node); } } catch (Exception exception1) { System.Exception thisException = exception1; Management.ShowException(thisException); } }
private void tileDocument_RightItemClick(object sender, TileItemEventArgs e) { try { Model.Internal.Document.DocNode node = (TIS.Model.Internal.Document.DocNode)(e.Item.Tag); if (node.Document == null) { DocumentFile df = new DocumentFile(iclExtraLarge, node.Name, node.ImageIndex, "Map"); df.ShowDialog(this); if (df.DialogResult == DialogResult.OK) { if (df.isDeleted) { if (node.childDocNode.Count == 0) { Uow.Delete(node); } else { DevExpress.XtraEditors.XtraMessageBox.Show("Onmogelijk om te verwijderen terwijl de map niet leeg is", "Verwijderen mislukt", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } } else { node.ImageIndex = df.Index >= iclExtraLarge.Images.Count ? -1 : df.Index; node.Name = df.DocName; } Uow.CommitChanges(); SelectNode(_selectedNode); } //this.Uow = new UnitOfWork(); } else { if (node.Document.DocTypeDisplay == Enumeration.Document.DocumentType.Link) { DocumentLink dl = new DocumentLink(iclExtraLarge, node.Name, node.ImageIndex, node.Document.Name); dl.ShowDialog(); if (dl.DialogResult == DialogResult.OK) { if (dl.isDeleted) { Uow.Delete(node.Document); Uow.Delete(node); } else { node.Name = dl.NodeName; node.ImageIndex = dl.Index >= iclExtraLarge.Images.Count ? -1 : dl.Index; node.Document.Name = dl.Url; } Uow.CommitChanges(); SelectNode(_selectedNode); } } else //if (node.Document.DocTypeDisplay == Enumeration.Document.DocumentType.Document) { DocumentFile df = new DocumentFile(iclExtraLarge, node.Name, node.ImageIndex, node.Document.DocTypeDisplay == Enumeration.Document.DocumentType.Document ? "Document" : node.Document.DocTypeDisplay == Enumeration.Document.DocumentType.Application ? "Programma" : ""); df.ShowDialog(this); if (df.DialogResult == DialogResult.OK) { if (df.isDeleted) { if (node.childDocNode.Count == 0) { Uow.Delete(node); } else { DevExpress.XtraEditors.XtraMessageBox.Show("Onmogelijk om te verwijderen terwijl de map niet leeg is", "Verwijderen mislukt", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } } else { node.ImageIndex = df.Index >= iclExtraLarge.Images.Count ? -1 : df.Index; node.Name = df.DocName; } Uow.CommitChanges(); SelectNode(_selectedNode); } //this.Uow = new UnitOfWork(); } } } catch (Exception exception1) { System.Exception thisException = exception1; Management.ShowException(thisException); } }
private void SelectNode(Model.Internal.Document.DocNode node) { try { _selectedNode = node; if (_selectedNode == null) { Find(); } else { tileDocument.Groups.Clear(); TileGroup newGroup = new TileGroup(); foreach (Model.Internal.Document.DocNode n in node.childDocNode) { newGroup.Items.Add(CreateTileItem(n)); } tileDocument.Groups.Add(newGroup); Refresh_Overview(); } } catch (Exception exception1) { Exception innerException = exception1; throw new Exception(MethodBase.GetCurrentMethod().Name, innerException); } }