示例#1
0
 internal void OnDirectoryDeleted(PathEventArgs e)
 {
     if (DirectoryDeleted != null)
     {
         DirectoryDeleted(this, e);
     }
 }
        private void RequestNavigation(String Path)
        {
            PathEventArgs       ea   = null;
            var                 path = String.Empty;
            BreadcrumbBarFSItem item = null;

            if (Path.Trim().StartsWith("%"))
            {
                path = Environment.ExpandEnvironmentVariables(Path);
                item = new BreadcrumbBarFSItem(Path, path);
            }
            else
            {
                path = Path;
                item = new BreadcrumbBarFSItem(ShellObject.FromParsingName(Path.StartsWith(":") ? "shell:" + Path : Path));
            }

            ea = new PathEventArgs(ShellObject.FromParsingName(path));

            OnNavigateRequested(ea);
            if (writetohistory == true)
            {
                if (hl.Select(s => s.RealPath).Contains(Path) == false)
                {
                    hl.Add(item);
                }
            }
        }
示例#3
0
        private IEnumerable <string> VisitDirectory(string root)
        {
            foreach (var file in VisitFiles(root))
            {
                yield return(file);
            }

            foreach (var subDirectory in Directory.EnumerateDirectories(root))
            {
                var directoryEventArgs = new PathEventArgs {
                    Path = subDirectory
                };

                OnDirectoryFound(directoryEventArgs);

                if (_filter(subDirectory))
                {
                    var filteredDirectoryEventArgs = new PathEventArgs {
                        Path = subDirectory
                    };

                    OnFilteredDirectoryFound(directoryEventArgs);

                    yield return(subDirectory);
                }

                foreach (var item in VisitDirectory(subDirectory))
                {
                    yield return(item);
                }
            }
        }
示例#4
0
 internal void OnFileDeleted(PathEventArgs e)
 {
     if (FileDeleted != null)
     {
         FileDeleted(this, e);
     }
 }
        private void HandlePathStart(PathEventArgs args)
        {
            if (!ShowPath && !ShowCommandName)
            {
                return;
            }

            Debug.WriteLine("WhenPathStart");

            _screenBounds = Screen.ScreenBoundsFromPoint(args.Location).Value; //Screen.FromPoint(args.Location);

            _prevPoint  = args.Location;                                       //ToUpLeftCoord(args.Location);
            _pointCount = 1;

            //_tempMainPen = args.Button == GestureTriggerButton.Right ? _mainPen : _middleBtnPen;
            if ((args.Button & GestureTriggerButton.Right) != 0)
            {
                _tempMainPen = _mainPen;
            }
            else if ((args.Button & GestureTriggerButton.X) != 0)
            {
                _tempMainPen = _xBtnPen;
            }
            else
            {
                _tempMainPen = _middleBtnPen;
            }

            _isCurrentRecognized   = false;
            _recognizeStateChanged = false;

            BeginView();
        }
示例#6
0
        private void ListView_SelectedChange(object sender, PathEventArgs e)
        {
            Repository selected = fileSystem.FindDirectory(e.Path);

            if (selected != null)
            {
                listView.ClearList();
                bool previousExpandCondition = selected.IsExpand;
                selected.IsExpand = true;
                fileSystem.Expand(selected);

                foreach (var item in selected.Entries)
                {
                    if (item is Repository repository)
                    {
                        if (!repository.HasAccessRight)
                        {
                            listView.AddInaccessibleFolder(repository.Name);
                        }
                        else
                        {
                            listView.AddFolder(repository.Name);
                        }
                    }
                    else
                    {
                        listView.AddFile(item.Name, item.Path, Converter.BytesToString(((File)item).Size));
                    }
                }

                selected.IsExpand = previousExpandCondition;
            }
        }
示例#7
0
 private void OnPath(PathEventArgs e)
 {
     if (Path != null)
     {
         Path(this, e);
     }
 }
示例#8
0
        //public event EventHandler MouseDoubleClick;

        // Invoke the Changed event; called whenever list changes:
        protected virtual void OnNavigateRequested(PathEventArgs e)
        {
            if (NavigateRequested != null)
            {
                NavigateRequested(this, e);
            }
        }
示例#9
0
 private void player_PlayerStopped(object sender, PathEventArgs e)
 {
    //if (lblPlaying.InvokeRequired)
    //   Invoke((Action)(() => lblPlaying.Text = null));
    //else
    lblPlaying.Text = null;
 }
示例#10
0
        //public event EventHandler MouseDoubleClick;

        // Invoke the Changed event; called whenever list changes:
        protected virtual void OnUpdaterDownloadComplete(PathEventArgs e)
        {
            if (UpdaterDownloadComplete != null)
            {
                UpdaterDownloadComplete(this, e);
            }
        }
示例#11
0
        //public event EventHandler MouseDoubleClick;

        // Invoke the Changed event; called whenever list changes:
        protected virtual void OnContextMenuRequested(PathEventArgs e)
        {
            if (ContextMenuRequested != null)
            {
                ContextMenuRequested(this, e);
            }
        }
        void g_Click(object sender, RoutedEventArgs e)
        {
            HistoryCombo.Text = (string)(sender as MenuItem).Header;
            PathEventArgs args = new PathEventArgs(ShellObject.FromParsingName(HistoryCombo.Text.Trim().StartsWith("%") ? Environment.ExpandEnvironmentVariables(HistoryCombo.Text) : HistoryCombo.Text));

            OnNavigateRequested(args);
            ExitEditMode();
        }
示例#13
0
        protected virtual void OnRemoveRecentFileClick(PathEventArgs e)
        {
            if (e is null)
            {
                throw new ArgumentNullException(nameof(e));
            }

            RemoveRecentFileClick?.Invoke(this, e);
            RecentFiles.Remove(e.Path);
        }
示例#14
0
        protected virtual void OnOpenRecentAsClick(PathEventArgs e)
        {
            if (e is null)
            {
                throw new ArgumentNullException(nameof(e));
            }

            OpenRecentAsClick?.Invoke(this, e);
            OpenFileHelper?.OpenFileAs(e.Path);
        }
示例#15
0
 void duh_ContextMenuRequested(object sender, PathEventArgs e)
 {
     ShellItem[] dirs = new ShellItem[1];
     dirs[0] = e.ShellItem;
     Point relativePoint = this.TransformToAncestor(Application.Current.MainWindow)
                           .Transform(new Point(0, 0));
     Point            realCoordinates = Application.Current.MainWindow.PointToScreen(relativePoint);
     ShellContextMenu cm = new ShellContextMenu(dirs);
     //cm.ShowContextMenu(new System.Drawing.Point((int)GetCursorPosition().X, (int)realCoordinates.Y + (int)this.Height));
 }
示例#16
0
        private void bBrowse_Click(object sender, EventArgs e)
        {
            FolderBrowserDialog fbd = new FolderBrowserDialog();

            if (fbd.ShowDialog(this) == DialogResult.OK)
            {
                tbPath.Text = fbd.SelectedPath;
                PathEventArgs args = new PathEventArgs();
                args.Path = tbPath.Text;
                OnPath(args);
            }
        }
        private void HandlePathTimeout(PathEventArgs args)
        {
            if (!ShowPath && !ShowCommandName)
            {
                return;
            }

            Debug.WriteLine("PathTimeout");

            //if (ShowPath) ResetPathDirtyRect();
            EndView();
        }
        private void HandlePathGrow(PathEventArgs args)
        {
            if (!ShowPath && !ShowCommandName)
            {
                return;
            }
            if (_pointCount > _pathMaxPointCount)
            {
                return;
            }

            _pointCount++;

            if (_pointCount == _pathMaxPointCount)
            {
                ShowLabel(Color.White, "您是有多无聊啊 :)", Color.FromArgb(128, 255, 0, 0));

                DrawAndUpdate();
                _labelChanged          = false;
                _recognizeStateChanged = false;

                return;
            }

            if (ShowPath)
            {
                var curPos = args.Location;//ToUpLeftCoord(args.Location);

                //需要将点换算为基于窗口的坐标
                var pA = new Point(_prevPoint.X - _screenBounds.X, _prevPoint.Y - _screenBounds.Y);
                var pB = new Point(curPos.X - _screenBounds.X, curPos.Y - _screenBounds.Y);

                if (pA != pB)
                {
                    _gPath.AddLine(pA, pB);

                    _gPathDirty.Reset();
                    _gPathDirty.AddLine(pA, pB);
                    _gPathDirty.Widen(_dirtyMarkerPen);
                }


                //_pathDirtyRect = GetDirtyRect(_prevPoint, curPos);
                //_pathDirtyRegion.Union(_pathDirtyRect);
            }

            DrawAndUpdate();

            _recognizeStateChanged = false;

            _prevPoint = args.Location;//ToUpLeftCoord(args.Location);
        }
示例#19
0
        private void TreeView_Expand(object sender, PathEventArgs e)
        {
            Repository repository = fileSystem.FindDirectory(e.Path);

            repository.IsExpand = true;
            fileSystem.Expand(repository);
            if (!treeView.Loaded(e.Path, fakeFolder))
            {
                treeView.Clear(e.Path);
            }
            ExpandTreeView(repository);

            if (fileSystem.Selected != null)
            {
                treeView.Selected = fileSystem.Selected.Path;
            }
        }
示例#20
0
    public void OnPointerClick(PointerEventData eventData)
    {
        Debug.Log($"Активна тропа № {ThisPathNumber}");
        var e = new PathEventArgs {
            PathNumber = ThisPathNumber
        };

        IsActive(this, e);

        pathes = GameObject.FindGameObjectsWithTag("Path");
        foreach (var path in pathes)
        {
            path.GetComponent <MeshRenderer>().material.color = Color.white;
        }

        gameObject.GetComponent <MeshRenderer>().material.color = Color.green;
    }
示例#21
0
        private void WhenPathStart(PathEventArgs args)
        {
            if (!ShowPath && !ShowCommandName)
            {
                return;
            }

            Debug.WriteLine("WhenPathStart");

            var activeScreen = Screen.FromPoint(args.Location);

            _screenBounds = activeScreen.Bounds;

            _prevPoint  = args.Location;//ToUpLeftCoord(args.Location);
            _pointCount = 1;

            _tempMainPen = args.Button == GestureButtons.RightButton ? _mainPen : _middleBtnPen;

            BeginView();
        }
示例#22
0
        private void WhenPathGrow(PathEventArgs args)
        {
            if (!ShowPath && !ShowCommandName)
            {
                return;
            }

            if (_pointCount > _pathMaxPointCount)
            {
                return;
            }

            _pointCount++;

            if (_pointCount == _pathMaxPointCount)
            {
                ShowLabel(Color.White, "您是有多无聊啊 :)", Color.FromArgb(128, 255, 0, 0));

                DrawAndUpdate();
                _labelChanged = false;
                return;
            }

            if (ShowPath)
            {
                var curPos = args.Location;//ToUpLeftCoord(args.Location);


                //需要将点换算为基于窗口的坐标
                _gPath.AddLine(new Point(_prevPoint.X - _screenBounds.X, _prevPoint.Y - _screenBounds.Y), new Point(curPos.X - _screenBounds.X, curPos.Y - _screenBounds.Y));

                //_gPath.PathPoints.

                _pathDirtyRect = GetDirtyRect(_prevPoint, curPos);
                _pathDirtyRegion.Union(_pathDirtyRect);
            }

            DrawAndUpdate();

            _prevPoint = args.Location;//ToUpLeftCoord(args.Location);
        }
        private void HandlePathStart(PathEventArgs args)
        {
            if (!ShowPath && !ShowCommandName)
            {
                return;
            }

            Debug.WriteLine("WhenPathStart");

            _screenBounds = Screen.ScreenBoundsFromPoint(args.Location); //Screen.FromPoint(args.Location);

            _prevPoint  = args.Location;                                 //ToUpLeftCoord(args.Location);
            _pointCount = 1;

            _tempMainPen = args.Button == GestureButtons.RightButton ? _mainPen : _middleBtnPen;

            _isCurrentRecognized   = false;
            _recognizeStateChanged = false;

            BeginView();
        }
示例#24
0
        private IEnumerable <string> VisitFiles(string root)
        {
            foreach (var file in Directory.EnumerateFiles(root))
            {
                var fileEventArgs = new PathEventArgs {
                    Path = file
                };

                OnFileFound(fileEventArgs);

                if (_filter(file))
                {
                    var filteredFileEventArgs = new PathEventArgs {
                        Path = file
                    };
                    OnFilteredFileFound(filteredFileEventArgs);

                    yield return(file);
                }
            }
        }
示例#25
0
 private void ArchiverView_Unzipping(object sender, PathEventArgs e)
 {
     archiverModel.Unzip(e.Path, archiverView.GetFolderPath());
 }
示例#26
0
 private void ArchiverView_RemoveFolder(object sender, PathEventArgs e)
 {
     archiverModel.RemoveFolder(e.Path);
 }
示例#27
0
 private void ArchiverView_OpenFile(object sender, PathEventArgs e)
 {
     archiverModel.Start(e.Path);
 }
示例#28
0
 private void ArchiverView_UnzipHere(object sender, PathEventArgs e)
 {
     archiverModel.Unzip(e.FileName, e.Path);
 }
        //public event EventHandler MouseDoubleClick;

        // Invoke the Changed event; called whenever list changes:
        protected virtual void OnNavigateRequested(PathEventArgs e)
        {
            if (NavigateRequested != null)
                NavigateRequested(this, e);
        }
示例#30
0
 private void _fileBrowser_FileActivate(object sender, PathEventArgs e)
 {
     DoOpenFile(e.Path);
 }
示例#31
0
 private void player_PlayerStarted(object sender, PathEventArgs e)
 {
    lblPlaying.Text = e.Path;
 }
示例#32
0
        //public event EventHandler MouseDoubleClick;

        // Invoke the Changed event; called whenever list changes:
        protected virtual void OnUpdaterDownloadComplete(PathEventArgs e)
        {
            if (UpdaterDownloadComplete != null)
                UpdaterDownloadComplete(this, e);
        }
 void duh_NavigateRequested(object sender, PathEventArgs e)
 {
     OnNavigateRequested(e);
     LastPath = e.ShellObject.ParsingName;
 }
示例#34
0
 private void ArchiverView_LoadConent(object sender, PathEventArgs e)
 {
     archiverView.ShowContent(archiverModel.GetContent(e.Path));
 }
        private void HistoryCombo_KeyUp(object sender, KeyEventArgs e)
        {
            e.Handled = true;
            if (e.Key == Key.Enter)
            {
                try
                {
                    PathEventArgs ea = new PathEventArgs(ShellObject.FromParsingName(HistoryCombo.Text));
                    OnNavigateRequested(ea);
                    if (writetohistory == true)
                    {
                        if (hl.Contains(HistoryCombo.Text) == false)
                        {
                            hl.Add(HistoryCombo.Text);
                        }
                    }
                }
                catch (Exception)
                {
                    
                    // For now just handle the exception. later will be fixed to navigate correct path.
                }
            }
            if (e.Key == Key.Escape)
            {

                ExitEditMode();
            }
        }
 private void breadcrumbBarControl1_NavigateRequested(object sender, PathEventArgs e)
 {
     Explorer.Navigate(e.ShellObject != null ? e.ShellObject : ShellObject.FromParsingName(e.Path));
 }
 private void CreateNewDirectory(object sender, PathEventArgs args)
 {
     _fileSystemManager.CreateNewDirectory(args.Path);
     View.ValidateAll();
 }