Inheritance: System.Windows.Forms.TreeNode
Ejemplo n.º 1
0
 private void SetExpandedImageIndex(DirectoryTreeNode dtn)
 {
     if (dtn.DirectoryInfo.IsLink && dtn.DirectoryInfo.IsDirectory)
     {
         dtn.SelectedImageIndex = dtn.ImageIndex = 3;
     }
     else
     {
         dtn.SelectedImageIndex = dtn.ImageIndex = 1;
     }
 }
Ejemplo n.º 2
0
 private void SetCollapsedImageIndex(DirectoryTreeNode dtn)
 {
     if (dtn.DirectoryInfo.IsLink && dtn.DirectoryInfo.IsDirectory)
     {
         dtn.SelectedImageIndex = dtn.ImageIndex = 2;
     }
     else
     {
         dtn.SelectedImageIndex = dtn.ImageIndex = 0;
     }
 }
Ejemplo n.º 3
0
        private void BuildTree( )
        {
            if ( this.InvokeRequired ) {
                this.Invoke ( new GenericDelegate ( directoryTree.Nodes.Clear ) );
                this.Invoke ( new AddTreeNodeDelegate ( AddTreeNode ), directoryTree.Nodes, rootNode );
            } else {
                directoryTree.Nodes.Clear ( );
                AddTreeNode ( directoryTree.Nodes, rootNode );
            }

            foreach ( DroidExplorer.Core.IO.FileSystemInfo dir in CommandRunner.Instance.ListDirectories ( rootNode.LinuxPath ) ) {
                DirectoryTreeNode tn = new DirectoryTreeNode ( dir );
                if ( dir is DroidExplorer.Core.IO.SymbolicLinkInfo ) {
                    tn.SelectedImageIndex = tn.ImageIndex = 2;
                }
                if ( this.InvokeRequired ) {
                    this.Invoke ( new AddTreeNodeDelegate ( AddTreeNode ), rootNode.Nodes, tn );
                } else {
                    AddTreeNode ( rootNode.Nodes, tn );
                }
            }

            if ( this.InvokeRequired ) {
                this.Invoke ( new SetSelectedTreeNodeDelegate ( SetSelectedTreeNode ), directoryTree, rootNode );
                this.Invoke ( new GenericDelegate ( rootNode.Expand ) );
            } else {
                SetSelectedTreeNode ( directoryTree, rootNode );
                rootNode.Expand ( );
            }
        }
Ejemplo n.º 4
0
        public MainForm( )
        {
            rootNode = new DirectoryTreeNode ( DroidExplorer.Core.IO.DirectoryInfo.CreateRoot ( ) );
            Program.SplashManager.SplashDialog.IncrementLoadStep ( 1 );
            CommandRunner.Instance.DeviceStateChanged += new EventHandler<DeviceEventArgs> ( CommandRunner_DeviceStateChanged );
            CommandRunner.Instance.Connected += new EventHandler<DeviceEventArgs> ( CommandRunner_Connected );
            CommandRunner.Instance.Disconnected += new EventHandler<DeviceEventArgs> ( CommandRunner_Disconnected );
            FileTypeActionHandlers = new FileTypeActionHandlers ( );
            FileTypeIconHandlers = new FileTypeIconHandlers ( );
            OpenWithItems = new List<ToolStripMenuItem> ( );

            InitializeComponent ( );

            askForHelpToolStripMenuItem.Image = DroidExplorer.Resources.Images.Bubble_16xLG;
            askForHelpToolStripMenuItem1.Image = DroidExplorer.Resources.Images.Bubble_16xLG;

            newFolderContextToolStripMenuItem.Image = DroidExplorer.Resources.Images.NewSolutionFolder_6289;
            newFileContextToolStripMenuItem.Image = DroidExplorer.Resources.Images.NewFile_6276;

            this.StickyWindow = new StickyWindow ( this );
            this.StickyWindow.StickToOther = true;
            this.StickyWindow.StickOnResize = true;
            this.StickyWindow.StickOnMove = true;

            this.LogDebug ( "Initializing the breadcumb bar" );
            SetupBreadcrumbBar ( );
            Program.SplashManager.SplashDialog.IncrementLoadStep ( 1 );

            // vista / win7 + themeing
            ToolStripManager.Renderer = new VisualStudio2012Renderer ( );
            this.directoryTree.SetVistaExplorerStyle ( false, false );
            this.itemsList.SetVistaExplorerStyle ( );
            this.itemsList.SetAllowDraggableColumns ( true );
            Program.SplashManager.SplashDialog.IncrementLoadStep ( 1 );

            // TODO: [workitem:17419]
            this.LogDebug ( "Loading toolstrip settings" );
            ToolStripManager.LoadSettings ( this, "DroidExplorer" );

            Program.SplashManager.SplashDialog.IncrementLoadStep ( 1 );

            this.LogDebug ( "Initializing the treeview images" );
            InitializeTreeViewImages ( );
            Program.SplashManager.SplashDialog.IncrementLoadStep ( 1 );

            this.LogDebug ( "Initializing the listview" );
            InitializeListView ( );
            Program.SplashManager.SplashDialog.IncrementLoadStep ( 1 );

            itemsList.MouseDoubleClick += new MouseEventHandler ( itemsList_MouseDoubleClick );
            itemsList.DragDrop += new DragEventHandler ( itemsList_DragDrop );
            itemsList.DragEnter += new DragEventHandler ( itemsList_DragEnter );
            itemsList.DragOver += new DragEventHandler ( itemsList_DragOver );
            itemsList.SelectedIndexChanged += new EventHandler ( itemsList_SelectedIndexChanged );
            itemsList.DragLeave += new EventHandler ( itemsList_DragLeave );
            itemsList.ItemDrag += new ItemDragEventHandler ( itemsList_ItemDrag );
            itemsList.ViewChanged += new EventHandler ( itemsList_ViewChanged );
            itemsList.AfterLabelEdit += new LabelEditEventHandler ( itemsList_AfterLabelEdit );
            itemsList.BeforeLabelEdit += new LabelEditEventHandler ( itemsList_BeforeLabelEdit );
            // begin edit when pressing f2
            itemsList.KeyUp += delegate ( object sender, KeyEventArgs e ) {
                if ( e.KeyCode == Keys.F2 && !InLabelEdit && itemsList.SelectedItems.Count > 0 ) {
                    itemsList.SelectedItems[0].BeginEdit ( );
                }
            };
            itemsList.View = View.Details;

            directoryTree.BeforeExpand += new TreeViewCancelEventHandler ( directoryTree_BeforeExpand );
            directoryTree.AfterExpand += new TreeViewEventHandler ( directoryTree_AfterExpand );
            directoryTree.BeforeCollapse += new TreeViewCancelEventHandler ( directoryTree_BeforeCollapse );
            directoryTree.AfterCollapse += new TreeViewEventHandler ( directoryTree_AfterCollapse );
            directoryTree.AfterSelect += new TreeViewEventHandler ( directoryTree_AfterSelect );

            this.editToolStripMenuItem.DropDownOpening += delegate ( object sender, EventArgs e ) {
                fileListContextMenuStrip_Opening ( sender, new CancelEventArgs ( false ) );
            };

            this.imageLink.Click += delegate ( object s, EventArgs e ) {
                CommandRunner.Instance.LaunchProcessWindow ( Resources.Strings.DontateLink, string.Empty, true );
            };

            // initialize Active Menu buttons
            IActiveMenu menu = ActiveMenu.GetInstance ( this );
            // define a new button
            ActiveButton button = new ActiveButton ( );
            // todo: fix it so it renders with the icon correctly.
            button.Text = "        Ask for Help";
            button.TextAlign = ContentAlignment.MiddleRight;
            button.Image = DroidExplorer.Resources.Images.Bubble_16xLG;
            button.ImageAlign = ContentAlignment.MiddleLeft;
            button.Margin = new Padding ( 20, button.Margin.Top, button.Margin.Right, button.Margin.Bottom );
            button.TextImageRelation = TextImageRelation.ImageBeforeText;
            button.BackColor = Color.FromArgb ( 255, 38, 114, 236 );
            button.ForeColor = Color.White;
            menu.ToolTip.SetToolTip ( button, button.Text.Trim ( ) );
            button.Click += askForHelpToolStripMenuItem1_Click;

            // add the button to the menu
            menu.Items.Add ( button );
            this.askForHelpToolStripMenuItem.Visible = false;

            this.LogDebug ( "Loading application settings" );
            Program.SplashManager.SplashDialog.SetStepText ( "Loading Application Settings" );
            LoadSettings ( );
            Program.SplashManager.SplashDialog.IncrementLoadStep ( 1 );

            this.LogDebug ( "Connecting to device: {0}", this.Device );
            CommandRunner.Instance.Connect ( );
            Program.SplashManager.SplashDialog.IncrementLoadStep ( 1 );

            this.LogDebug ( "Loading Plugins" );
            Program.SplashManager.SplashDialog.SetStepText ( "Loading Droid Explorer Plugins" );
            LoadPlugins ( );
            Program.SplashManager.SplashDialog.IncrementLoadStep ( 1 );

            Program.SplashManager.CloseSplashDialog ( );
            //Task.Run(async () =>await new ApkCacheBuilder().RunAsync());
        }
Ejemplo n.º 5
0
 private void SetExpandedImageIndex( DirectoryTreeNode dtn )
 {
     if ( dtn.DirectoryInfo.IsLink && dtn.DirectoryInfo.IsDirectory ) {
     dtn.SelectedImageIndex = dtn.ImageIndex = 3;
       } else {
     dtn.SelectedImageIndex = dtn.ImageIndex = 1;
       }
 }
Ejemplo n.º 6
0
 private void SetCollapsedImageIndex( DirectoryTreeNode dtn )
 {
     if ( dtn.DirectoryInfo.IsLink && dtn.DirectoryInfo.IsDirectory ) {
     dtn.SelectedImageIndex = dtn.ImageIndex = 2;
       } else {
     dtn.SelectedImageIndex = dtn.ImageIndex = 0;
       }
 }