public ArchiveViewWindow(ShellObject loc, bool IsPreviewPaneEnabled, bool IsInfoPaneEnabled)
        {
            InitializeComponent();

            archive = loc;

            this.Title = "View Archive - " + archive.GetDisplayName(DisplayNameType.Default);

            ShellVView.Child = Explorer;

            Explorer.NavigationOptions.PaneVisibility.Commands = PaneVisibilityState.Hide;
            Explorer.NavigationOptions.PaneVisibility.CommandsOrganize = PaneVisibilityState.Hide;
            Explorer.NavigationOptions.PaneVisibility.CommandsView = PaneVisibilityState.Hide;
            Explorer.NavigationOptions.PaneVisibility.Preview =
                IsPreviewPaneEnabled ? PaneVisibilityState.Show : PaneVisibilityState.Hide;
            Explorer.NavigationOptions.PaneVisibility.Details =
                IsInfoPaneEnabled ? PaneVisibilityState.Show : PaneVisibilityState.Hide;
            Explorer.NavigationOptions.PaneVisibility.Navigation = PaneVisibilityState.Hide;

            Explorer.ContentOptions.FullRowSelect = true;
            Explorer.ContentOptions.CheckSelect = false;
            Explorer.ContentOptions.ViewMode = ExplorerBrowserViewMode.Tile;

            Explorer.NavigationComplete += new EventHandler<NavigationCompleteEventArgs>(Explorer_NavigationComplete);
            Explorer.Navigate(loc);
        }
Пример #2
0
        private void ShareWizzard_Load(object sender, EventArgs e)
        {
            ShellObject sho = ShellObject.FromParsingName(CurrentPath);

            txtShareName.Text = sho.GetDisplayName(Microsoft.WindowsAPICodePack.Shell.DisplayNameType.Default);
            sho.Dispose();
        }
        public ArchiveViewWindow(ShellObject loc, bool IsPreviewPaneEnabled, bool IsInfoPaneEnabled)
        {
            InitializeComponent();

            archive = loc;

            this.Title = "View Archive - " + archive.GetDisplayName(DisplayNameType.Default);

            ShellVView.Child = Explorer;

            Explorer.NavigationOptions.PaneVisibility.Commands         = PaneVisibilityState.Hide;
            Explorer.NavigationOptions.PaneVisibility.CommandsOrganize = PaneVisibilityState.Hide;
            Explorer.NavigationOptions.PaneVisibility.CommandsView     = PaneVisibilityState.Hide;
            Explorer.NavigationOptions.PaneVisibility.Preview          =
                IsPreviewPaneEnabled ? PaneVisibilityState.Show : PaneVisibilityState.Hide;
            Explorer.NavigationOptions.PaneVisibility.Details =
                IsInfoPaneEnabled ? PaneVisibilityState.Show : PaneVisibilityState.Hide;
            Explorer.NavigationOptions.PaneVisibility.Navigation = PaneVisibilityState.Hide;

            Explorer.ContentOptions.FullRowSelect = true;
            Explorer.ContentOptions.CheckSelect   = false;
            Explorer.ContentOptions.ViewMode      = ExplorerBrowserViewMode.Tile;

            Explorer.NavigationComplete += new EventHandler <NavigationCompleteEventArgs>(Explorer_NavigationComplete);
            Explorer.Navigate(loc);
        }
 public void LoadData(NavigationLog log)
 {
     nav = log;
     ShellObject obj = log.CurrentLocation;
     tabTitle.Text = obj.GetDisplayName(DisplayNameType.Default);
     image1.Source = obj.Thumbnail.BitmapSource;
     this.ToolTip = obj.ParsingName;
 }
Пример #5
0
        public List <string> LoadListOfTabListFiles()
        {
            List <string> o = new List <string>();

            foreach (string item in Directory.GetFiles(GetSavedTabsLocation()))
            {
                ShellObject obj = ShellObject.FromParsingName(item);
                o.Add(RemoveExtensionsFromFile(obj.GetDisplayName(DisplayNameType.Default), GetExtension(item)));
            }
            return(o);
        }
Пример #6
0
        protected virtual TabItemUI CreateTabItem(ShellObject path)
        {
            TabItemUI ti = new TabItemUI();

            ti.MaxWidth = 100;
            ti.Header   = System.IO.Path.GetFileName(path.GetDisplayName(DisplayNameType.Default));

            ti.Go(path);

            ti.DispExpBrowser.ExplorerBrowserControl.NavigationComplete += (o, e) =>
            {
                Microsoft.WindowsAPICodePack.Controls.WindowsForms.ExplorerBrowser b = (Microsoft.WindowsAPICodePack.Controls.WindowsForms.ExplorerBrowser)o;
                b.Tag = e.NewLocation;

                TabItemUI tiui = this.tabControl.SelectedItem as TabItemUI;
                if (ti != null)
                {
                    this.pathUI.PropertyChanged -= PathPropertyChanged;
                    this.pathUI.Path             = tiui.Get();
                    this.pathUI.PropertyChanged += PathPropertyChanged;

                    tiui.Header = e.NewLocation.Name;
                    tiui.DispExpBrowser.ViewMode = Microsoft.WindowsAPICodePack.Controls.ExplorerBrowserViewMode.Details;
                }
            };

            ContextMenu cm = new ContextMenu();
            MenuItem    mi = new MenuItem();

            mi.Header = "Close";
            mi.Click += (o, e) =>
            {
                this.tabControl.Items.Remove(ti);
            };
            cm.Items.Add(mi);

            mi        = new MenuItem();
            mi.Header = "BookMark";
            mi.Click += (o, e) =>
            {
                ShellObject shobj = (ShellObject)((TabItemUI)this.tabControl.SelectedItem).DispExpBrowser.ExplorerBrowserControl.Tag;
                string      key   = shobj.ParsingName;
                string      val   = shobj.Name;
                this.BookMarks.Add(new KeyValuePair <string, string>(key, val));
            };
            cm.Items.Add(mi);

            ti.ContextMenu = cm;

            return(ti);
        }
        public void LoadDirectory(ShellObject obj)
        {
            obj.Thumbnail.FormatOption = ShellThumbnailFormatOption.IconOnly;
            obj.Thumbnail.CurrentSize = new Size(16, 16);
            this.PathImage.Source = obj.Thumbnail.BitmapSource;
            this.pathName.Text = obj.GetDisplayName(DisplayNameType.Default);
            this.so = obj;
            path = obj.ParsingName;

            Dispatcher.BeginInvoke(DispatcherPriority.Normal, (ThreadStart)(() =>
            {




                if (obj.ParsingName == KnownFolders.Network.ParsingName || obj.ParsingName.StartsWith(@"\\"))
                {
                    SetChildren(true);
                    grid1.Visibility = System.Windows.Visibility.Visible;
                    MenuBorder.Visibility = System.Windows.Visibility.Visible;

                }
                else
                {
                    try
                    {
                        ShellContainer con = (ShellContainer)obj;
                        List<ShellObject> joe = new List<ShellObject>();
                        foreach (ShellObject item in con)
                        {
                            if (item.IsFolder == true)
                            {
                                if (item.ParsingName.ToLower().EndsWith(".zip") == false && item.ParsingName.ToLower().EndsWith(".cab") == false)
                                {
                                    joe.Add(item);
                                }
                            }
                        }
                        SetChildren(joe.Count > 0);
                    }
                    catch
                    {
                        SetChildren(false);
                    }
                    
                }
            }));

        }
Пример #8
0
 public CollisionDialog(List <CollisionInfo> _collisions, ShellObject SourceDestination, ShellObject Destination)
 {
     InitializeComponent();
     this.collisions = _collisions;
     Contents        = new ObservableCollection <CollisionItem>();
     foreach (var item in _collisions)
     {
         Contents.Add(new CollisionItem()
         {
             DataContext = item
         });
     }
     this.lblFromfolder.Text = SourceDestination.GetDisplayName(DisplayNameType.Default);
     this.lblTofolder.Text   = Destination.GetDisplayName(DisplayNameType.Default);
     this.DataContext        = this;
 }
        public ResizeImage(ShellObject file, string height, string width, string imagename)
        {
            InitializeComponent();

            textBlock1.Text = imagename + ": " + file.GetDisplayName(DisplayNameType.Default);
            cvt = new Bitmap(file.ParsingName);
            textBlock2.Text = height + ": " + cvt.Height.ToString();
            textBlock3.Text = width + ": " + cvt.Width.ToString();

            spinner1.Value = 100;

            percsetting = true;

            textBox1.Text = cvt.Width.ToString();
            textBox2.Text = cvt.Height.ToString();

            percsetting = false;
        }
Пример #10
0
        public ResizeImage(ShellObject file)
        {
            InitializeComponent();

            textBlock1.Text = FindResource("txtFilename") + ": " + file.GetDisplayName(DisplayNameType.Default);
            cvt             = new Bitmap(file.ParsingName);
            textBlock2.Text = FindResource("lblHeightCP") + ": " + cvt.Height.ToString();
            textBlock3.Text = FindResource("lblWidthCP") + ": " + cvt.Width.ToString();

            spinner1.Value = 100;

            percsetting = true;

            textBox1.Text = cvt.Width.ToString();
            textBox2.Text = cvt.Height.ToString();

            percsetting = false;
        }
        public void LoadDirectory(ShellObject obj)
        {
            obj.Thumbnail.FormatOption = ShellThumbnailFormatOption.IconOnly;
            obj.Thumbnail.CurrentSize  = new Size(16, 16);
            this.PathImage.Source      = obj.Thumbnail.BitmapSource;
            this.pathName.Text         = obj.GetDisplayName(DisplayNameType.Default);
            this.so = obj;
            path    = obj.ParsingName;

            Dispatcher.BeginInvoke(DispatcherPriority.Normal, (ThreadStart)(() =>
            {
                if (obj.ParsingName == KnownFolders.Network.ParsingName || obj.ParsingName.StartsWith(@"\\"))
                {
                    SetChildren(true);
                    grid1.Visibility = System.Windows.Visibility.Visible;
                    MenuBorder.Visibility = System.Windows.Visibility.Visible;
                }
                else
                {
                    try
                    {
                        ShellContainer con = (ShellContainer)obj;
                        List <ShellObject> joe = new List <ShellObject>();
                        foreach (ShellObject item in con)
                        {
                            if (item.IsFolder == true)
                            {
                                if (item.ParsingName.ToLower().EndsWith(".zip") == false && item.ParsingName.ToLower().EndsWith(".cab") == false)
                                {
                                    joe.Add(item);
                                }
                            }
                        }
                        SetChildren(joe.Count > 0);
                    }
                    catch
                    {
                        SetChildren(false);
                    }
                }
            }));
        }
        public void EnterEditMode()
        {
            IsInEditMode       = true;
            elPanel.Visibility = System.Windows.Visibility.Collapsed;
            elPanel.Focusable  = false;
            if (Undertextbox != null)
            {
                Undertextbox.Visibility = System.Windows.Visibility.Visible;
                //Undertextbox.SelectAll();
            }
            var obj = furthestrightitem.ShellObject;

            if (obj.ParsingName.StartsWith(":"))
            {
                var correctItems = KnownFolders.All.Where(w => obj.ParsingName.Contains(w.ParsingName)).ToArray();
                foreach (var item in correctItems)
                {
                    ShellObject realItem = (ShellObject)item;
                    HistoryCombo.Text = obj.ParsingName.Replace(realItem.ParsingName, realItem.GetDisplayName(DisplayNameType.Default)).Replace(".library-ms", "");
                    realItem.Dispose();
                }
            }
            else
            {
                HistoryCombo.Text = furthestrightitem.ShellObject.ParsingName;
            }
            FocusManager.SetIsFocusScope(this, true);
        }
Пример #13
0
        /// <summary>
        /// Single instance callback handler.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="args">The <see cref="SingleInstanceApplication.InstanceCallbackEventArgs"/> instance containing the event data.</param>
        private void SingleInstanceCallback(object sender, InstanceCallbackEventArgs args)
        {
            string      StartUpLocation = KnownFolders.Libraries.ParsingName;
            RegistryKey rk  = Registry.CurrentUser;
            RegistryKey rks = rk.OpenSubKey(@"Software\BExplorer", false);

            StartUpLocation =
                rks.GetValue(@"StartUpLoc", KnownFolders.Libraries.ParsingName).ToString();



            if (args == null || Dispatcher == null)
            {
                return;
            }


            Action <bool> d = (bool x) =>
            {
                var win = MainWindow as MainWindow;
                if (win == null)
                {
                    return;
                }
                var hwnd = (HwndSource.FromVisual(win) as HwndSource).Handle;
                win.ApendArgs(args.CommandLineArgs);

                if (x)
                {
                    ShellObject sho = null;
                    if (args != null && args.CommandLineArgs != null)
                    {
                        if (args.CommandLineArgs.Length > 1 && args.CommandLineArgs[1] != null && args.CommandLineArgs[1] != "-minimized")
                        {
                            if (args.CommandLineArgs[1] != "t")
                            {
                                if (args.CommandLineArgs[1] == "nw")
                                {
                                    MainWindow g = new MainWindow();
                                    g.Show();
                                    return;
                                }
                                else
                                {
                                    win.Visibility = Visibility.Visible;
                                    if (win.WindowState == WindowState.Minimized)
                                    {
                                        WindowsAPI.ShowWindow(hwnd,
                                                              (int)WindowsAPI.ShowCommands.SW_RESTORE);
                                    }

                                    String cmd = args.CommandLineArgs[1];
                                    if (cmd.IndexOf("::") == 0)
                                    {
                                        sho = ShellObject.FromParsingName("shell:" + cmd);
                                    }
                                    else
                                    {
                                        sho = ShellObject.FromParsingName(args.CommandLineArgs[1].Replace("\"", ""));
                                    }
                                }
                            }
                            else
                            {
                                win.Visibility = Visibility.Visible;
                                if (win.WindowState == WindowState.Minimized)
                                {
                                    WindowsAPI.ShowWindow(hwnd,
                                                          (int)WindowsAPI.ShowCommands.SW_RESTORE);
                                }
                                sho = win.GetShellObjectFromLocation(StartUpLocation);
                            }
                        }
                        else
                        {
                            win.Visibility = Visibility.Visible;
                            if (win.WindowState == WindowState.Minimized)
                            {
                                WindowsAPI.ShowWindow(hwnd,
                                                      (int)WindowsAPI.ShowCommands.SW_RESTORE);
                            }
                            sho = win.GetShellObjectFromLocation(StartUpLocation);
                        }

                        if (!isStartMinimized || win.tabControl1.Items.Count == 0)
                        {
                            sho.Thumbnail.FormatOption = ShellThumbnailFormatOption.IconOnly;
                            sho.Thumbnail.CurrentSize  = new Size(16, 16);
                            ClosableTabItem newt = new ClosableTabItem();
                            newt.Header            = sho.GetDisplayName(DisplayNameType.Default);
                            newt.TabIcon           = sho.Thumbnail.BitmapSource;
                            newt.PreviewMouseMove += newt_PreviewMouseMove;
                            newt.TabSelected      += win.newt_TabSelected;
                            newt.Path              = sho;
                            win.CloneTab(newt);
                        }
                        else
                        {
                            int RestoreTabs = (int)rks.GetValue(@"IsRestoreTabs", 1);
                            if (RestoreTabs == 0)
                            {
                                win.tabControl1.Items.Clear();
                                sho.Thumbnail.FormatOption = ShellThumbnailFormatOption.IconOnly;
                                sho.Thumbnail.CurrentSize  = new Size(16, 16);
                                ClosableTabItem newt = new ClosableTabItem();
                                newt.Header            = sho.GetDisplayName(DisplayNameType.Default);
                                newt.TabIcon           = sho.Thumbnail.BitmapSource;
                                newt.PreviewMouseMove += newt_PreviewMouseMove;
                                newt.TabSelected      += win.newt_TabSelected;
                                newt.Path              = sho;
                                win.CloneTab(newt);
                            }
                            if (args.CommandLineArgs.Length > 1 && args.CommandLineArgs[1] != null)
                            {
                                String cmd = args.CommandLineArgs[1];
                                if (cmd.IndexOf("::") == 0)
                                {
                                    sho = ShellObject.FromParsingName("shell:" + cmd);
                                }
                                else
                                {
                                    sho = ShellObject.FromParsingName(args.CommandLineArgs[1].Replace("\"", ""));
                                }

                                sho.Thumbnail.FormatOption = ShellThumbnailFormatOption.IconOnly;
                                sho.Thumbnail.CurrentSize  = new Size(16, 16);
                                ClosableTabItem newt = new ClosableTabItem();
                                newt.Header            = sho.GetDisplayName(DisplayNameType.Default);
                                newt.TabIcon           = sho.Thumbnail.BitmapSource;
                                newt.PreviewMouseMove += newt_PreviewMouseMove;
                                newt.TabSelected      += win.newt_TabSelected;
                                newt.Path              = sho;
                                win.CloneTab(newt);
                            }
                        }

                        rks.Close();
                        rk.Close();

                        win.Activate();
                        win.Topmost = true;  // important
                        win.Topmost = false; // important
                        win.Focus();         // important
                    }
                }
            };

            Dispatcher.BeginInvoke(d, true);
        }