public Form1() { InitializeComponent(); var startPath = Environment.GetFolderPath(Environment.SpecialFolder.Desktop); var startNode = new NodeNavigationInfo(startPath); SetActivePath(startNode); }
private void OnItemClick(WinExplorerItemViewInfo itemInfo) { if (itemInfo == null || itemInfo.Row.RowKey is FileEntry) { return; } var entry = (FileSystemEntry)itemInfo.Row.RowKey; var activeNode = new NodeNavigationInfo(entry.Path, itemInfo.Bounds); RunZoomInAnimation(activeNode, () => { SetActivePath(activeNode); }); }
void RunZoomInAnimation(NodeNavigationInfo activeNode, Action action) { var zoomTransition = this.transitionManager1.GetTransition <ZoomTransition>(this.gridControl1); this.transitionManager1.StartTransition(this.gridControl1); zoomTransition.ActiveSettings = new ZoomTransitionSettings() { SourceBounds = activeNode.SourceBounds, TargetBounds = GridClientBounds }; action(); this.transitionManager1.EndTransition(); }
private void OnBreadCrumbValueChanged(object sender, EventArgs e) { var breadCrumb = (BreadCrumbEdit)sender; var path = breadCrumb.EditValue as string; if (this.transitionManager1.IsTransition || path == null) { return; } var activeNode = new NodeNavigationInfo(path, new Rectangle(GridClientBounds.Width / 2, GridClientBounds.Height / 2, 1, 1)); RunZoomInAnimation(activeNode, () => { SetActivePath(activeNode); }); }
private void SetActivePath(NodeNavigationInfo node) { int currentIndex = PathHistory.IndexOf(CurrentNode); CurrentNode = node; if (currentIndex > -1) { int pathCount = PathHistory.Count; while (pathCount > currentIndex + 1) { PathHistory.RemoveAt(pathCount - 1); pathCount--; } } PathHistory.Add(CurrentNode); }