20 changed files
BExplorer/BetterExplorer | ||
MainWindow.xaml | ||
MainWindow.xaml.cs | ||
Shell | ||
FileOperation | ||
FileOperationProgressSink.cs | ||
Interop | ||
IAssocHandler.cs | ||
IContextMenu.cs | ||
IThumbnailCache.cs | ||
Shell32.cs | ||
ShellNotifications.cs | ||
ShellThumbnail.cs | ||
User32.cs | ||
AssociationItem.cs | ||
Collumns.cs | ||
Defaults.cs | ||
Extensions.cs | ||
ShellContextMenu.cs | ||
ShellItem.cs | ||
ShellViewEx.cs | ||
UnbufferedFO/GS.Common.IO | ||
AsyncJob.cs | ||
OverlappedStream.cs | ||
OverlappedStreamUnbuffered.cs | ||
MainWindow.xaml
/BExplorer/BetterExplorer/MainWindow.xaml-5+2/BExplorer/BetterExplorer/MainWindow.xaml
Add comment 1408 Icon="Images\open16.png"
Add comment 1409 IsEnabled="False"
Add comment 1410 Ribbon:KeyTip.Keys="O"
Add comment 1411 Minus Ribbon:RibbonAttachedProperties.RibbonSizeDefinition="Middle,Middle,Small"/>
Add comment 1411 Plus Ribbon:RibbonAttachedProperties.RibbonSizeDefinition="Middle,Middle,Small" DropDownOpened="btnOpenWith_DropDownOpened"/>
Add comment 1412 <Ribbon:Button x:Name="btnEdit"
Add comment 1413 Click="btnEdit_Click"
Add comment 1414 Header="{DynamicResource btnEditCP}"
Add comment 3010 </Button>
Add comment 3011 </odc:BreadcrumbBar.Buttons>
Add comment 3012 <odc:BreadcrumbBar.DropDownItems>
Add comment 3013 Minus <TextBlock Text="C:\Windows"/>
Add comment 3014 Minus <TextBlock Text="C:\Windows\System32"/>
Add comment 3015 Minus <TextBlock Text="C:\Users"/>
Add comment 3016 3013 </odc:BreadcrumbBar.DropDownItems>
Add comment 3017 3014 </odc:BreadcrumbBar>
Add comment 3018 3015
Add comment 3241 3238 </Ribbon:StatusBarItem>
Add comment 3242 3239
Add comment 3243 3240 </Ribbon:StatusBar>
Add comment 3244 Minus <Button x:Name="btnTest" Grid.ColumnSpan="2" Content="Button" Margin="673,23,0,0" VerticalAlignment="Top" Width="75" Click="btnTest_Click"/>
Add comment 3241 Plus <Button x:Name="btnTest" Grid.ColumnSpan="2" Content="Button" Margin="673,23,0,0" VerticalAlignment="Top" Width="75" Click="btnTest_Click" Visibility="Collapsed"/>
Add comment 3245 3242
Add comment 3246 3243 </Grid>
Add comment 3247 3244 </Ribbon:RibbonWindow>
MainWindow.xaml.cs
/BExplorer/BetterExplorer/MainWindow.xaml.cs-224+122/BExplorer/BetterExplorer/MainWindow.xaml.cs
Displayed content is truncated due to maximum viewable content limit.
Add comment 164 spCommandPrompt.Height = GridLength.Auto;
Add comment 165 if (!ctrlConsole.IsProcessRunning)
Add comment 166 ctrlConsole.ChangeFolder(ShellListView.CurrentFolder.ParsingName, ShellListView.CurrentFolder.IsFileSystem);
Add comment 167 Minus }
Add comment 168 Minus else {
Add comment 167 Plus } else {
Add comment 169 168 rCommandPrompt.MinHeight = 0;
Add comment 170 169 rCommandPrompt.Height = new GridLength(0);
Add comment 171 170 spCommandPrompt.Height = new GridLength(0);
Add comment 206 205 if (TheRibbon.IsMinimized && this.IsGlassOnRibonMinimized) {
Add comment 207 206 System.Windows.Point p = ShellViewHost.TransformToAncestor(this).Transform(new System.Windows.Point(0, 0));
Add comment 208 207 this.GlassBorderThickness = new Thickness(8, this.WindowState == WindowState.Maximized ? p.Y : p.Y - 2, 8, 8);
Add comment 209 Minus }
Add comment 210 Minus else if (this.IsGlassOnRibonMinimized) {
Add comment 208 Plus } else if (this.IsGlassOnRibonMinimized) {
Add comment 211 209 System.Windows.Point p = backstage.TransformToAncestor(this).Transform(new System.Windows.Point(0, 0));
Add comment 212 210 this.GlassBorderThickness = new Thickness(8, p.Y + backstage.ActualHeight + 2, 8, 8);
Add comment 213 211 }
Add comment 214 212
Add comment 215 213 try {
Add comment 216 214 this.SetBlur(!TheRibbon.IsMinimized);
Add comment 215 Plus } catch (Exception) {
Add comment 217 216 }
Add comment 218 Minus catch (Exception) {
Add comment 219 217 }
Add comment 220 Minus }
Add comment 221 218
Add comment 222 219 private void TheRibbon_CustomizeQuickAccessToolbar(object sender, EventArgs e) {
Add comment 223 220 CustomizeQAT.Open(this, TheRibbon);
Add comment 239 236 Convert.ToInt32(rks.GetValue(@"LastWindowPosLeft", "0")),
Add comment 240 237 Convert.ToInt32(rks.GetValue(@"LastWindowPosTop", "0"))
Add comment 241 238 );
Add comment 242 Minus }
Add comment 243 Minus catch { }
Add comment 239 Plus } catch { }
Add comment 244 240 if (Location != null) {
Add comment 245 241 this.Left = Location.X;
Add comment 246 242 this.Top = Location.Y;
Add comment 275 271 rCommandPrompt.MinHeight = 100;
Add comment 276 272 rCommandPrompt.Height = new GridLength(this.CommandPromptWinHeight);
Add comment 277 273 spCommandPrompt.Height = GridLength.Auto;
Add comment 278 Minus }
Add comment 279 Minus else {
Add comment 274 Plus } else {
Add comment 280 275 rCommandPrompt.MinHeight = 0;
Add comment 281 276 rCommandPrompt.Height = new GridLength(0);
Add comment 282 277 spCommandPrompt.Height = new GridLength(0);
Add comment 335 330 var IsCheckable2 = ShellListView.LastGroupCollumn != null && (item.pkey.fmtid == ShellListView.LastGroupCollumn.pkey.fmtid) && (item.pkey.pid == ShellListView.LastGroupCollumn.pkey.pid);
Add comment 336 331 btnGroup.Items.Add(Utilities.Build_MenuItem(item.Name, item, checkable: true, isChecked: IsCheckable2, GroupName: "GR3", onClick: mig_Click));
Add comment 337 332 }
Add comment 338 Minus }
Add comment 339 Minus catch (Exception ex) {
Add comment 333 Plus } catch (Exception ex) {
Add comment 340 334 //FIXME: I disable this message because of strange null after filter
Add comment 341 335 MessageBox.Show("BetterExplorer had an issue loading the visible columns for the current view. You might not be able to sort or group items.", ex.ToString(), MessageBoxButton.OK, MessageBoxImage.Error);
Add comment 342 336 }
Add comment 351 345
Add comment 352 346 if (this.ShellListView.LastSortOrder == System.Windows.Forms.SortOrder.Ascending) {
Add comment 353 347 misa.IsChecked = true;
Add comment 354 Minus }
Add comment 355 Minus else {
Add comment 348 Plus } else {
Add comment 356 349 misd.IsChecked = true;
Add comment 357 350 }
Add comment 358 351
Add comment 371 364
Add comment 372 365 if (this.ShellListView.LastGroupOrder == System.Windows.Forms.SortOrder.Ascending) {
Add comment 373 366 misag.IsChecked = true;
Add comment 374 Minus }
Add comment 375 Minus else {
Add comment 367 Plus } else {
Add comment 376 368 misdg.IsChecked = true;
Add comment 377 369 }
Add comment 378 370
Add comment 403 395 }
Add comment 404 396 }
Add comment 405 397 btnMoreColls.Items.Add(mic);
Add comment 398 Plus } catch (Exception) {
Add comment 406 399 }
Add comment 407 Minus catch (Exception) {
Add comment 408 Minus }
Add comment 409 400
Add comment 410 401 try {
Add comment 411 402 MenuItem mic = Utilities.Build_MenuItem(allAvailColls[j].Name, allAvailColls[j], checkable: true, onClick: mic_Click);
Add comment 422 413 }
Add comment 423 414 }
Add comment 424 415 chcm.Items.Add(mic);
Add comment 416 Plus } catch (Exception) {
Add comment 425 417 }
Add comment 426 Minus catch (Exception) {
Add comment 427 418 }
Add comment 428 Minus }
Add comment 429 419
Add comment 430 420 int ItemsCount = ShellListView.GetItemsCount();
Add comment 431 421 sbiItemsCount.Visibility = ItemsCount == 0 ? Visibility.Collapsed : Visibility.Visible;
Add comment 519 509 ShellLibrary lib = ShellLibrary.Load(ShellListView.CurrentFolder.DisplayName, false);
Add comment 520 510 lib.DefaultSaveFolder = SaveLoc.ParsingName;
Add comment 521 511 lib.Close();
Add comment 522 Minus }
Add comment 523 Minus else if (ShellListView.GetFirstSelectedItem().ParsingName.Contains(KnownFolders.Libraries.ParsingName)) {
Add comment 512 Plus } else if (ShellListView.GetFirstSelectedItem().ParsingName.Contains(KnownFolders.Libraries.ParsingName)) {
Add comment 524 513 ShellLibrary lib = ShellLibrary.Load(ShellListView.GetFirstSelectedItem().DisplayName, false);
Add comment 525 514 lib.DefaultSaveFolder = SaveLoc.ParsingName;
Add comment 526 515 lib.Close();
Add comment 635 624 private void SetUpOpenWithButton(ShellItem SelectedItem) {
Add comment 636 625 btnOpenWith.Items.Clear();
Add comment 637 626 foreach (var item in SelectedItem.GetAssocList()) {
Add comment 638 Minus btnOpenWith.Items.Add(Utilities.Build_MenuItem(item.DisplayName, item.InvokePtr, item.Icon, ToolTip: item.ApplicationPath, onClick: miow_Click));
Add comment 627 Plus btnOpenWith.Items.Add(Utilities.Build_MenuItem(item.DisplayName, item, item.Icon, ToolTip: item.ApplicationPath, onClick: miow_Click));
Add comment 639 628 }
Add comment 640 629
Add comment 641 630 btnOpenWith.IsEnabled = btnOpenWith.HasItems;
Add comment 676 665 if (ctgLibraries.Visibility == Visibility.Visible && ShellListView.CurrentFolder.Equals(KnownFolders.Libraries)) {
Add comment 677 666 if (selectedItem != null && selectedItemsCount == 1)
Add comment 678 667 SetupLibrariesTab(ShellLibrary.Load(selectedItem.DisplayName, false));
Add comment 679 Minus }
Add comment 680 Minus else if (ctgLibraries.Visibility == Visibility.Visible && ShellListView.CurrentFolder.Parent.Equals(KnownFolders.Libraries)) {
Add comment 668 Plus } else if (ctgLibraries.Visibility == Visibility.Visible && ShellListView.CurrentFolder.Parent.Equals(KnownFolders.Libraries)) {
Add comment 681 669 if (selectedItemsCount == 1)
Add comment 682 670 SetupLibrariesTab(ShellLibrary.Load(ShellListView.CurrentFolder.DisplayName, false));
Add comment 683 671 }
Add comment 796 784
Add comment 797 785 if (selectedItem != null && selectedItem.IsFileSystem && IsPreviewPaneEnabled && !selectedItem.IsFolder && SelItemsCount == 1) {
Add comment 798 786 this.Previewer.FileName = selectedItem.ParsingName;
Add comment 799 Minus }
Add comment 800 Minus else if (!String.IsNullOrEmpty(this.Previewer.FileName)) {
Add comment 787 Plus } else if (!String.IsNullOrEmpty(this.Previewer.FileName)) {
Add comment 801 788 this.Previewer.FileName = null;
Add comment 802 789 }
Add comment 803 790 //Set up ribbon contextual tabs on selection changed
Add comment 947 934 }
Add comment 948 935
Add comment 949 936 private void btnHistory_Click(object sender, RoutedEventArgs e) {
Add comment 950 Minus //TODO: Fix this!!!!
Add comment 951 Minus //ShellListView.ShowPropPage(this.Handle, ShellListView.GetFirstSelectedItem().ParsingName,
Add comment 952 Minus // WindowsAPI.LoadResourceString(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.System),"twext.dll"),1024,"Previous Versions"));
Add comment 937 Plus ShellListView.ShowPropPage(this.Handle, ShellListView.GetFirstSelectedItem().ParsingName,
Add comment 938 Plus WindowsAPI.LoadResourceString(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.System),"twext.dll"),1024,"Previous Versions"));
Add comment 953 939 }
Add comment 954 940
Add comment 955 941 private void btnBackstageExit_Click(object sender, RoutedEventArgs e) {
Add comment 968 954
Add comment 969 955
Add comment 970 956 void miow_Click(object sender, RoutedEventArgs e) {
Add comment 971 Minus //TODO: fix this as this not work!!!!!
Add comment 972 957 MenuItem item = (sender as MenuItem);
Add comment 973 Minus var ptr = (IntPtr)item.Tag;
Add comment 974 Minus var invokepFunc = Marshal.ReadIntPtr(ptr + 5 * IntPtr.Size);
Add comment 975 Minus ShellView.funcInvoke Invoke = (ShellView.funcInvoke)Marshal.GetDelegateForFunctionPointer(invokepFunc, typeof(ShellView.funcInvoke));
Add comment 976 Minus var j = Invoke(ptr, this.ShellListView.GetFirstSelectedItem().GetIDataObject());
Add comment 977 Minus //if (j != 0)
Add comment 978 Minus //{
Add comment 979 Minus // var ex = Marshal.GetExceptionForHR(j);
Add comment 980 Minus // throw ex;
Add comment 981 Minus //}
Add comment 982 Minus //Process.Start(item.Tag.ToString(), String.Format("\"{0}\"", ShellListView.GetFirstSelectedItem().ParsingName));
Add comment 958 Plus var assocItem = (AssociationItem)item.Tag;
Add comment 959 Plus assocItem.Invoke();
Add comment 983 960 }
Add comment 984 961
Add comment 985 962 void mif_Click(object sender, RoutedEventArgs e) {
Add comment 1025 1002 foreach (ShellItem item in ShellListView.SelectedItems) {
Add comment 1026 1003 if (string.IsNullOrEmpty(path)) {
Add comment 1027 1004 path = item.ParsingName;
Add comment 1028 Minus }
Add comment 1029 Minus else {
Add comment 1005 Plus } else {
Add comment 1030 1006 path = String.Format("{0}\r\n{1}", path, item.ParsingName);
Add comment 1031 1007 }
Add comment 1032 1008 }
Add comment 1033 1009
Add comment 1034 1010 Clipboards.SetText(path);
Add comment 1035 Minus }
Add comment 1036 Minus else if (ShellListView.SelectedItems.Count() == 1) {
Add comment 1011 Plus } else if (ShellListView.SelectedItems.Count() == 1) {
Add comment 1037 1012 Clipboards.SetText(ShellListView.GetFirstSelectedItem().ParsingName);
Add comment 1038 Minus }
Add comment 1039 Minus else {
Add comment 1013 Plus } else {
Add comment 1040 1014 Clipboards.SetText(ShellListView.CurrentFolder.ParsingName);
Add comment 1041 1015 }
Add comment 1042 1016 }
Add comment 1056 1030 foreach (ShellItem item in ShellListView.SelectedItems) {
Add comment 1057 1031 if (string.IsNullOrEmpty(path)) {
Add comment 1058 1032 path = item.ParsingName;
Add comment 1059 Minus }
Add comment 1060 Minus else {
Add comment 1033 Plus } else {
Add comment 1061 1034 path = String.Format("{0} {1}", path, item.ParsingName);
Add comment 1062 1035 }
Add comment 1063 1036 }
Add comment 1084 1057 if (ShellListView.CurrentFolder.ParsingName == KnownFolders.Libraries.ParsingName) {
Add comment 1085 1058 path = ShellListView.CreateNewLibrary(FindResource("btnNewLibraryCP").ToString()).DisplayName;
Add comment 1086 1059 //IsLib = true;
Add comment 1087 Minus }
Add comment 1088 Minus else {
Add comment 1060 Plus } else {
Add comment 1089 1061 path = ShellListView.CreateNewFolder(FindResource("btnNewFolderCP").ToString());
Add comment 1090 1062 }
Add comment 1091 1063
Add comment 1309 1281 CloseTab(tab, false);
Add comment 1310 1282 }
Add comment 1311 1283 }));
Add comment 1312 Minus }
Add comment 1313 Minus else {
Add comment 1284 Plus } else {
Add comment 1314 1285 var message = String.Empty;
Add comment 1315 1286 var obj = new ShellItem(item.LogicalDrive);
Add comment 1316 1287 switch (veto) {
Add comment 1370 1341 try {
Add comment 1371 1342 ImDiskAPI.GetDeviceList();
Add comment 1372 1343 return true;
Add comment 1373 Minus }
Add comment 1374 Minus catch (System.DllNotFoundException) {
Add comment 1344 Plus } catch (System.DllNotFoundException) {
Add comment 1375 1345 return false;
Add comment 1376 1346 }
Add comment 1377 1347 }
Add comment 1447 1417
Add comment 1448 1418 var freeDriveLetter = String.Format("{0}:", ImDiskAPI.FindFreeDriveLetter());
Add comment 1449 1419 ImDiskAPI.CreateDevice(0, 0, 0, 0, 0, ImDiskFlags.Auto, ShellListView.GetFirstSelectedItem().ParsingName, false, freeDriveLetter, IntPtr.Zero);
Add comment 1450 Minus }
Add comment 1451 Minus catch (System.DllNotFoundException) {
Add comment 1420 Plus } catch (System.DllNotFoundException) {
Add comment 1452 1421 ShowInstallImDiskMessage();
Add comment 1453 Minus }
Add comment 1454 Minus catch (Exception ex) {
Add comment 1422 Plus } catch (Exception ex) {
Add comment 1455 1423 MessageBox.Show("An error occurred while trying to mount this file. \n\n" + ex.Message, ex.ToString(), MessageBoxButton.OK, MessageBoxImage.Error);
Add comment 1456 1424 }
Add comment 1457 1425 }
Add comment 1472 1440 ImDiskAPI.ForceRemoveDevice(SelectedDriveID);
Add comment 1473 1441 else
Add comment 1474 1442 ImDiskAPI.RemoveDevice(SelectedDriveID);
Add comment 1475 Minus }
Add comment 1476 Minus catch {
Add comment 1443 Plus } catch {
Add comment 1477 1444 if (MessageBox.Show("The drive could not be removed. Would you like to try to force a removal?", "Remove Drive Failed", MessageBoxButton.YesNo, MessageBoxImage.Error) == MessageBoxResult.Yes) {
Add comment 1478 1445 ImDiskAPI.ForceRemoveDevice(SelectedDriveID);
Add comment 1479 1446 }
Add comment 1583 1550 sw.WriteLine(DateTime.Now.ToShortDateString() + " " + DateTime.Now.ToShortTimeString() + " : " + value);
Add comment 1584 1551 }
Add comment 1585 1552 }
Add comment 1586 Minus }
Add comment 1587 Minus catch (Exception exe) {
Add comment 1553 Plus } catch (Exception exe) {
Add comment 1588 1554 MessageBox.Show("An error occurred while writing to the log file. This error can be avoided if you disable the action logging feature. Please report this issue at http://bugtracker.better-explorer.com/. \r\n\r\n Here is some information about the error: \r\n\r\n" + exe.Message + "\r\n\r\n" + exe.ToString(), "Error While Writing to Log", MessageBoxButton.OK, MessageBoxImage.Error);
Add comment 1589 1555 }
Add comment 1590 1556 }
Add comment 1619 1585 private void rbCheckInterval_Click(object sender, RoutedEventArgs e) {
Add comment 1620 1586 if (rbDaily.IsChecked.Value) {
Add comment 1621 1587 UpdateCheckInterval = 1;
Add comment 1622 Minus }
Add comment 1623 Minus else if (rbMonthly.IsChecked.Value) {
Add comment 1588 Plus } else if (rbMonthly.IsChecked.Value) {
Add comment 1624 1589 UpdateCheckInterval = 30;
Add comment 1625 Minus }
Add comment 1626 Minus else {
Add comment 1590 Plus } else {
Add comment 1627 1591 UpdateCheckInterval = 7;
Add comment 1628 1592 }
Add comment 1629 1593
Add comment 1663 1627 //mi.Icon = item.Thumbnail.BitmapSource;
Add comment 1664 1628 //mi.Click += new RoutedEventHandler(mif_Click);
Add comment 1665 1629 //btnFavorites.Items.Add(mi);
Add comment 1630 Plus } catch (Exception) {
Add comment 1666 1631 }
Add comment 1667 Minus catch (Exception) {
Add comment 1668 1632 }
Add comment 1669 Minus }
Add comment 1670 Minus }
Add comment 1671 Minus catch (Exception) {
Add comment 1633 Plus } catch (Exception) {
Add comment 1672 1634 btnFavorites.Visibility = Visibility.Collapsed;
Add comment 1673 1635 }
Add comment 1674 1636 }));
Add comment 1728 1690 if (tab != null && this.ShellListView.GetSelectedCount() > 0) {
Add comment 1729 1691 if (tab.SelectedItems != null) {
Add comment 1730 1692 tab.SelectedItems.AddRange(this.ShellListView.SelectedItems.Select(s => s.ParsingName).ToList());
Add comment 1731 Minus }
Add comment 1732 Minus else {
Add comment 1693 Plus } else {
Add comment 1733 1694 tab.SelectedItems = this.ShellListView.SelectedItems.Select(s => s.ParsingName).ToList();
Add comment 1734 1695 }
Add comment 1735 1696 }
Add comment 1742 1703 selectedTabItem.Icon = e.Folder.Thumbnail.BitmapSource;
Add comment 1743 1704 selectedTabItem.ShellObject = e.Folder;
Add comment 1744 1705 selectedTabItem.ToolTip = e.Folder.ParsingName;
Add comment 1706 Plus } catch (Exception) {
Add comment 1745 1707 }
Add comment 1746 Minus catch (Exception) {
Add comment 1747 1708 }
Add comment 1748 Minus }
Add comment 1749 1709
Add comment 1750 1710
Add comment 1751 1711 void ShellListView_ItemDisplayed(object sender, ItemDisplayedEventArgs e) {
Add comment 1794 1754 sbiItemsCount.Visibility = ItemsCount == 0 ? Visibility.Collapsed : Visibility.Visible;
Add comment 1795 1755 sbiItemsCount.Content = ItemsCount == 1 ? "1 item" : ItemsCount + " items";
Add comment 1796 1756 }
Add comment 1797 Minus if (e.UpdateType == ItemUpdateType.Created && IsRenameFromCreate) {
Add comment 1757 Plus if (e.UpdateType == ItemUpdateType.Created && (IsRenameFromCreate || this.ShellListView.IsRenameNeeded)) {
Add comment 1798 1758 this.ShellListView.SelectItemByIndex(e.NewItemIndex, true, true);
Add comment 1799 1759 ShellListView.RenameItem(e.NewItemIndex);
Add comment 1800 1760 IsRenameFromCreate = false;
Add comment 1761 Plus this.ShellListView.IsRenameNeeded = false;
Add comment 1801 1762 }
Add comment 1802 1763 this.ShellListView.Focus();
Add comment 1803 1764 }
Add comment 1898 1859 if (IsInfoPaneEnabled) {
Add comment 1899 1860 rPreviewPane.Height = new GridLength(InfoPaneHeight);
Add comment 1900 1861 rPreviewPaneSplitter.Height = new GridLength(1);
Add comment 1901 Minus }
Add comment 1902 Minus else {
Add comment 1862 Plus } else {
Add comment 1903 1863 rPreviewPane.Height = new GridLength(0);
Add comment 1904 1864 rPreviewPaneSplitter.Height = new GridLength(0);
Add comment 1905 1865 }
Add comment 1914 1874 if (IsPreviewPaneEnabled) {
Add comment 1915 1875 clPreview.Width = new GridLength((double)PreviewPaneWidth);
Add comment 1916 1876 clPreviewSplitter.Width = new GridLength(1);
Add comment 1917 Minus }
Add comment 1918 Minus else {
Add comment 1877 Plus } else {
Add comment 1919 1878 clPreview.Width = new GridLength(0);
Add comment 1920 1879 clPreviewSplitter.Width = new GridLength(0);
Add comment 1921 1880 }
Add comment 2014 1973 chkIsDefault.IsEnabled = true;
Add comment 2015 1974 rksbe.Close();
Add comment 2016 1975 rkbe.Close();
Add comment 2017 Minus }
Add comment 2018 Minus catch (Exception) {
Add comment 1976 Plus } catch (Exception) {
Add comment 2019 1977 chkIsDefault.IsChecked = false;
Add comment 2020 1978 chkIsDefault.IsEnabled = false;
Add comment 2021 1979 }
Add comment 2044 2002 try {
Add comment 2045 2003 autoUpdater.UpdateType = IsUpdateCheck ? UpdateType.OnlyCheck : UpdateType.DoNothing;
Add comment 2046 2004 if (IsUpdateCheckStartup) autoUpdater.ForceCheckForUpdate();
Add comment 2047 Minus }
Add comment 2048 Minus catch (IOException) {
Add comment 2005 Plus } catch (IOException) {
Add comment 2049 2006 this.stiUpdate.Content = "Switch to another BetterExplorer window or restart to check for updates.";
Add comment 2050 2007 this.btnUpdateCheck.IsEnabled = false;
Add comment 2051 2008 }
Add comment 2084 2041 });
Add comment 2085 2042
Add comment 2086 2043 AppJL.Apply();
Add comment 2087 Minus }
Add comment 2088 Minus catch {
Add comment 2044 Plus } catch {
Add comment 2089 2045
Add comment 2090 2046 }
Add comment 2091 2047 }
Add comment 2135 2091 fsw.Deleted += fsw_Deleted;
Add comment 2136 2092 fsw.Renamed += fsw_Renamed;
Add comment 2137 2093 fsw.EnableRaisingEvents = true;
Add comment 2094 Plus } catch {
Add comment 2138 2095 }
Add comment 2139 Minus catch {
Add comment 2140 Minus }
Add comment 2141 2096
Add comment 2142 2097 //Set up breadcrumb bar drag/drop functionality
Add comment 2143 2098 //breadcrumbBarControl1.SetDragHandlers(new DragEventHandler(bbi_DragEnter), new DragEventHandler(bbi_DragLeave), new DragEventHandler(bbi_DragOver), new DragEventHandler(bbi_Drop));
Add comment 2177 2132 //breadcrumbBarControl1.ClearHistory();
Add comment 2178 2133 //breadcrumbBarControl1.HistoryItems = ReadHistoryFromFile(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + "\\history.txt");
Add comment 2179 2134 });
Add comment 2180 Minus }
Add comment 2181 Minus catch (FileNotFoundException) {
Add comment 2135 Plus } catch (FileNotFoundException) {
Add comment 2182 2136 logger.Warn(String.Format("History file not found at location:{0}\\history.txt", Environment.SpecialFolder.LocalApplicationData));
Add comment 2183 2137 }
Add comment 2184 2138
Add comment 2209 2163
Add comment 2210 2164 if (cmd == "/nw")
Add comment 2211 2165 tcMain.NewTab(ShellListView.CurrentFolder, true);
Add comment 2212 Minus }
Add comment 2213 Minus else {
Add comment 2166 Plus } else {
Add comment 2214 2167 InitializeInitialTabs();
Add comment 2215 2168 }
Add comment 2216 2169 //this.Activate(true);
Add comment 2217 2170
Add comment 2218 Minus }
Add comment 2219 Minus catch (Exception exe) {
Add comment 2171 Plus } catch (Exception exe) {
Add comment 2220 2172 MessageBox.Show(String.Format("An error occurred while loading the window. Please report this issue at http://bugtracker.better-explorer.com/. \r\n\r\n Here is some information about the error: \r\n\r\n{0}\r\n\r\n{1}", exe.Message, exe), "Error While Loading", MessageBoxButton.OK, MessageBoxImage.Error);
Add comment 2221 2173 }
Add comment 2222 2174
Add comment 2241 2193 rks.SetValue(@"LastWindowPosTop", this.Top);
Add comment 2242 2194 if (btnBlue.IsChecked == true) {
Add comment 2243 2195 rks.SetValue(@"CurrentTheme", "Blue");
Add comment 2244 Minus }
Add comment 2245 Minus else if (btnSilver.IsChecked == true) {
Add comment 2196 Plus } else if (btnSilver.IsChecked == true) {
Add comment 2246 2197 rks.SetValue(@"CurrentTheme", "Silver");
Add comment 2247 Minus }
Add comment 2248 Minus else if (btnBlack.IsChecked == true) {
Add comment 2198 Plus } else if (btnBlack.IsChecked == true) {
Add comment 2249 2199 rks.SetValue(@"CurrentTheme", "Black");
Add comment 2250 Minus }
Add comment 2251 Minus else if (btnGreen.IsChecked == true) {
Add comment 2200 Plus } else if (btnGreen.IsChecked == true) {
Add comment 2252 2201 rks.SetValue(@"CurrentTheme", "Green");
Add comment 2253 2202 }
Add comment 2254 2203 switch (this.WindowState) {
Add comment 2387 2336
Add comment 2388 2337 if (e.Folder.ParsingName == KnownFolders.RecycleBin.ParsingName) {
Add comment 2389 2338 if (ShellListView.GetItemsCount() > 0) miRestoreALLRB.Visibility = Visibility.Visible;
Add comment 2390 Minus }
Add comment 2391 Minus else {
Add comment 2339 Plus } else {
Add comment 2392 2340 miRestoreALLRB.Visibility = Visibility.Collapsed;
Add comment 2393 2341 }
Add comment 2394 2342 int selectedItemsCount = ShellListView.GetSelectedCount();
Add comment 2396 2344 bool isFuncAvail;
Add comment 2397 2345 if (selectedItemsCount == 1) {
Add comment 2398 2346 isFuncAvail = ShellListView.GetFirstSelectedItem().IsFileSystem || ShellListView.CurrentFolder.ParsingName == KnownFolders.Libraries.ParsingName;
Add comment 2399 Minus }
Add comment 2400 Minus else {
Add comment 2347 Plus } else {
Add comment 2401 2348 if (!(ShellListView.CurrentFolder.IsFolder && !ShellListView.CurrentFolder.IsDrive && !ShellListView.CurrentFolder.IsSearchFolder))
Add comment 2402 2349 ctgFolderTools.Visibility = Visibility.Collapsed;
Add comment 2403 2350 isFuncAvail = true;
Add comment 2442 2389 });
Add comment 2443 2390
Add comment 2444 2391 AppJL.Apply();
Add comment 2445 Minus }
Add comment 2446 Minus finally {
Add comment 2392 Plus } finally {
Add comment 2447 2393 if (pIDL != IntPtr.Zero) Marshal.FreeCoTaskMem(pIDL);
Add comment 2448 2394 }
Add comment 2449 2395 }
Add comment 2451 2397 private bool SetUpNewFolderButtons() {
Add comment 2452 2398 if (ShellListView.CurrentFolder.Parent == null) {
Add comment 2453 2399 return false;
Add comment 2454 Minus }
Add comment 2455 Minus else if (ShellListView.CurrentFolder.ParsingName == KnownFolders.Libraries.ParsingName) {
Add comment 2400 Plus } else if (ShellListView.CurrentFolder.ParsingName == KnownFolders.Libraries.ParsingName) {
Add comment 2456 2401 btnCreateFolder.Header = FindResource("btnNewLibraryCP"); //"New Library";
Add comment 2457 2402 stNewFolder.Title = FindResource("btnNewLibraryCP").ToString();//"New Library";
Add comment 2458 2403 stNewFolder.Text = "Creates a new library in the current folder.";
Add comment 2461 2406 btnCreateFolder.Icon = @"..\Images\newlib16.png";
Add comment 2462 2407
Add comment 2463 2408 return true;
Add comment 2464 Minus }
Add comment 2465 Minus else if (this.ShellListView.CurrentFolder.IsFileSystem || this.ShellListView.CurrentFolder.Parent.ParsingName == KnownFolders.Libraries.ParsingName) {
Add comment 2409 Plus } else if (this.ShellListView.CurrentFolder.IsFileSystem || this.ShellListView.CurrentFolder.Parent.ParsingName == KnownFolders.Libraries.ParsingName) {
Add comment 2466 2410 btnCreateFolder.Header = FindResource("btnNewFolderCP");//"New Folder";
Add comment 2467 2411 stNewFolder.Title = FindResource("btnNewFolderCP").ToString(); //"New Folder";
Add comment 2468 2412 stNewFolder.Text = "Creates a new folder in the current folder";
Add comment 2471 2415 btnCreateFolder.Icon = @"..\Images\folder_new16.png";
Add comment 2472 2416
Add comment 2473 2417 return false;
Add comment 2474 Minus }
Add comment 2475 Minus else {
Add comment 2418 Plus } else {
FileOperationProgressSink.cs
/Shell/FileOperation/FileOperationProgressSink.cs+4/Shell/FileOperation/FileOperationProgressSink.cs
Add comment 4 using System.Diagnostics;
Add comment 5 using System.Linq;
Add comment 6 using System.Text;
Add comment 7 Plus using System.Threading;
Add comment 7 8 using System.Threading.Tasks;
Add comment 8 9
Add comment 9 10 namespace BExplorer.Shell
Add comment 74 75 uint dwFlags, IShellItem psiItem,
Add comment 75 76 uint hrDelete, IShellItem psiNewlyCreated)
Add comment 76 77 {
Add comment 78 Plus var item = new ShellItem(psiItem);
Add comment 79 Plus Shell32.SHChangeNotify(Shell32.HChangeNotifyEventID.SHCNE_DELETE, Shell32.HChangeNotifyFlags.SHCNF_IDLIST | Shell32.HChangeNotifyFlags.SHCNF_FLUSHNOWAIT, item.Pidl, IntPtr.Zero);
Add comment 80 Plus item.Dispose();
Add comment 77 81 TraceAction("PostDeleteItem", psiItem, hrDelete);
Add comment 78 82 }
Add comment 79 83
Add comment 21 out uint pceltFetched);
Add comment 22 }
Add comment 23
Add comment 24 Minus [ComImport]
Add comment 25 Minus [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
Add comment 26 Minus [Guid("F04061AC-1659-4a3f-A954-775AA57FC083")]
Add comment 27 Minus public interface IAssocHandler
Add comment 28 Minus {
Add comment 24 Plus [ComImport, Guid("F04061AC-1659-4a3f-A954-775AA57FC083"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown), ComConversionLoss]
Add comment 25 Plus public interface IAssocHandler {
Add comment 26 Plus
Add comment 29 27 [PreserveSig]
Add comment 30 Minus HResult GetName(out String ppsz);
Add comment 28 Plus [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
Add comment 29 Plus HResult GetName([MarshalAs(UnmanagedType.LPWStr), Out] String ppsz);
Add comment 31 30
Add comment 32 31 [PreserveSig]
Add comment 33 Minus HResult GetUIName(out String ppsz);
Add comment 32 Plus [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
Add comment 33 Plus HResult GetUIName([MarshalAs(UnmanagedType.LPWStr), Out] String ppsz);
Add comment 34 Plus
Add comment 35 Plus [PreserveSig]
Add comment 36 Plus [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
Add comment 37 Plus HResult GetIconLocation([MarshalAs(UnmanagedType.LPWStr), Out] String ppszPath, [Out] int pIndex);
Add comment 34 38
Add comment 35 39 [PreserveSig]
Add comment 40 Plus [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
Add comment 36 41 HResult IsRecommended();
Add comment 37 42
Add comment 38 43 [PreserveSig]
Add comment 39 Minus HResult Invoke(IDataObject pdo);
Add comment 44 Plus [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
Add comment 45 Plus HResult MakeDefault([MarshalAs(UnmanagedType.LPWStr), In] String pszDescription);
Add comment 46 Plus
Add comment 47 Plus [PreserveSig]
Add comment 48 Plus [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
Add comment 49 Plus HResult Invoke([In] IDataObject pdo);
Add comment 50 Plus
Add comment 51 Plus [PreserveSig]
Add comment 52 Plus [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
Add comment 53 Plus HResult CreateInvoker([In] IDataObject pdo, [Out] IntPtr ppInvoker);
Add comment 40 54 }
Add comment 41 55
Add comment 56 Plus
Add comment 42 57 }
Add comment 43 58
Add comment 17 // Boston, MA 2110-1301, USA.
Add comment 18 //
Add comment 19 using System;
Add comment 20 Plus using System.Drawing;
Add comment 20 21 using System.Runtime.InteropServices;
Add comment 21 22 using System.Text;
Add comment 22 23
Add comment 37 38 RESERVED = 0xffff0000,
Add comment 38 39 }
Add comment 39 40
Add comment 40 Minus [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
Add comment 41 Plus [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
Add comment 41 42 public struct CMINVOKECOMMANDINFO {
Add comment 42 43 public int cbSize;
Add comment 43 44 public int fMask;
Add comment 48 49 public int nShow;
Add comment 49 50 public int dwHotKey;
Add comment 50 51 public IntPtr hIcon;
Add comment 52 Plus }
Add comment 53 Plus
Add comment 54 Plus [StructLayout(LayoutKind.Sequential)]
Add comment 55 Plus public struct CMINVOKECOMMANDINFOEX {
Add comment 56 Plus public int cbSize;
Add comment 57 Plus public int fMask;
Add comment 58 Plus public IntPtr hwnd;
Add comment 59 Plus public IntPtr lpVerb;
Add comment 60 Plus [MarshalAs(UnmanagedType.LPStr)] public string lpParameters;
Add comment 61 Plus [MarshalAs(UnmanagedType.LPStr)]
Add comment 62 Plus public string lpDirectory;
Add comment 63 Plus public int nShow;
Add comment 64 Plus public int dwHotKey;
Add comment 65 Plus public IntPtr hIcon;
Add comment 66 Plus [MarshalAs(UnmanagedType.LPStr)] public string lpTitle;
Add comment 67 Plus public IntPtr lpVerbW;
Add comment 68 Plus [MarshalAs(UnmanagedType.LPStr)] public string lpParametersW;
Add comment 69 Plus [MarshalAs(UnmanagedType.LPStr)] public string lpDirectoryW;
Add comment 70 Plus [MarshalAs(UnmanagedType.LPStr)] public string lpTitleW;
Add comment 71 Plus public Point ptInvoke;
Add comment 51 72 }
Add comment 52 73
Add comment 53 Minus [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
Add comment 74 Plus [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
Add comment 54 75 public struct CMINVOKECOMMANDINFO_ByIndex {
Add comment 55 76 public int cbSize;
Add comment 56 77 public int fMask;
Add comment 71 92 HResult QueryContextMenu(IntPtr hMenu, uint indexMenu, int idCmdFirst,
Add comment 72 93 int idCmdLast, CMF uFlags);
Add comment 73 94
Add comment 74 Minus void InvokeCommand(ref CMINVOKECOMMANDINFO pici);
Add comment 95 Plus void InvokeCommand(ref CMINVOKECOMMANDINFOEX pici);
Add comment 75 96
Add comment 76 97 [PreserveSig]
Add comment 77 98 HResult GetCommandString(int idcmd, uint uflags, int reserved,
Add comment 88 109 int idCmdFirst, int idCmdLast,
Add comment 89 110 CMF uFlags);
Add comment 90 111
Add comment 91 Minus void InvokeCommand(ref CMINVOKECOMMANDINFO_ByIndex pici);
Add comment 112 Plus void InvokeCommand(ref CMINVOKECOMMANDINFOEX pici);
Add comment 92 113
Add comment 93 114 [PreserveSig]
Add comment 94 115 HResult GetCommandString(int idcmd, uint uflags, int reserved,
Add comment 122 143 HResult HandleMenuMsg2(int uMsg, IntPtr wParam, IntPtr lParam,
Add comment 123 144 out IntPtr plResult);
Add comment 124 145 }
Add comment 146 Plus
Add comment 147 Plus [ComImport()]
Add comment 148 Plus [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
Add comment 149 Plus [GuidAttribute("000214e8-0000-0000-c000-000000000046")]
Add comment 150 Plus public interface IShellExtInit {
Add comment 151 Plus [PreserveSig()]
Add comment 152 Plus int Initialize(
Add comment 153 Plus IntPtr pidlFolder,
Add comment 154 Plus IntPtr lpdobj,
Add comment 155 Plus uint hKeyProgID);
Add comment 156 Plus }
Add comment 125 157 }
Add comment 126 158
Add comment 10 [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
Add comment 11 [Guid("F676C15D-596A-4ce2-8234-33996F445DB1")]
Add comment 12 public interface IThumbnailCache {
Add comment 13 Minus uint GetThumbnail(
Add comment 13 Plus [PreserveSig]
Add comment 14 Plus HResult GetThumbnail(
Add comment 14 15 [In] IShellItem pShellItem,
Add comment 15 16 [In] uint cxyRequestedThumbSize,
Add comment 16 17 [In] WTS_FLAGS flags /*default: WTS_FLAGS.WTS_EXTRACT*/,
Add comment 18 19 [Out] out WTS_CACHEFLAGS pOutFlags,
Add comment 19 20 [Out] out WTS_THUMBNAILID pThumbnailID
Add comment 20 21 );
Add comment 21 Minus
Add comment 22 Minus void GetThumbnailByID(
Add comment 22 Plus [PreserveSig]
Add comment 23 Plus HResult GetThumbnailByID(
Add comment 23 24 [In, MarshalAs(UnmanagedType.Struct)] WTS_THUMBNAILID thumbnailID,
Add comment 24 25 [In] uint cxyRequestedThumbSize,
Add comment 25 26 [Out][MarshalAs(UnmanagedType.Interface)] out ISharedBitmap ppvThumb,
OverlappedStream.cs
/UnbufferedFO/GS.Common.IO/OverlappedStream.cs/UnbufferedFO/GS.Common.IO/OverlappedStream.cs
OverlappedStreamUnbuffered.cs
/UnbufferedFO/GS.Common.IO/OverlappedStreamUnbuffered.cs/UnbufferedFO/GS.Common.IO/OverlappedStreamUnbuffered.cs