41 changed files
BExplorer/BetterExplorer | ||
_MainWindow | ||
MainWindow_Updating.cs | ||
BetterExplorer.csproj | ||
MainWindow.xaml.cs | ||
Shell | ||
Interop | ||
User32.cs | ||
Extensions.cs | ||
ShellTreeViewEx.cs | ||
ShellViewEx.cs | ||
TaskDialog | ||
DesignData | ||
DesignerCommandLink.xaml + | ||
DesignerTaskDialogViewModel.xaml + | ||
Properties | ||
AssemblyInfo.cs + | ||
Resources.Designer.cs + | ||
Resources.resx + | ||
ResourceDictionaries | ||
Common.xaml + | ||
Resources | ||
cmdarr1.png + | ||
cmdarr2.png + | ||
exparr-down1.bmp + | ||
exparr-down2.bmp + | ||
exparr-down3.bmp + | ||
exparr-up1.bmp + | ||
exparr-up2.bmp + | ||
exparr-up3.bmp + | ||
shield-16.png + | ||
shield-32.png + | ||
CommandLink.xaml + | ||
CommandLink.xaml.cs + | ||
Converters.cs + | ||
NativeMethods.cs + | ||
RelayCommand.cs + | ||
SafeNativeMethods.cs + | ||
TaskDialog.cs + | ||
TaskDialog.csproj + | ||
TaskDialog.xaml + | ||
TaskDialog.xaml.cs + | ||
TaskDialogEvents.cs + | ||
TaskDialogInterop.cs + | ||
TaskDialogResult.cs + | ||
TaskDialogTypes.cs + | ||
TaskDialogViewModel.cs + | ||
UnsafeNativeMethods.cs + | ||
VistaActiveTaskDialog.cs + | ||
BExplorer.sln | ||
MainWindow_Updating.cs
/BExplorer/BetterExplorer/_MainWindow/MainWindow_Updating.cs-29+5/BExplorer/BetterExplorer/_MainWindow/MainWindow_Updating.cs
Add comment 10 partial class MainWindow {
Add comment 11 private BackgroundWorker UpdaterWorker;
Add comment 12 private int UpdateCheckType;
Add comment 13 Minus
Add comment 13 Plus private Boolean _IsCheckUpdateFromTimer = false;
Add comment 14 Plus private Boolean _IsUpdateNotificationMessageBoxShown = false;
Add comment 14 15 private void CheckForUpdate(bool ShowUpdateUI = true) {
Add comment 15 16 this.UpdaterWorker = new BackgroundWorker();
Add comment 16 17 this.UpdaterWorker.WorkerSupportsCancellation = true;
Add comment 21 22 this.UpdaterWorker.RunWorkerAsync(ShowUpdateUI);
Add comment 22 23 else if (ShowUpdateUI)
Add comment 23 24 MessageBox.Show("Update in progress! Please wait!");
Add comment 24 Minus
Add comment 25 Minus // var informalVersion = (Assembly.GetExecutingAssembly().GetCustomAttributes(
Add comment 26 Minus //typeof(AssemblyInformationalVersionAttribute), false).FirstOrDefault() as AssemblyInformationalVersionAttribute).InformationalVersion;
Add comment 27 25 }
Add comment 28 26
Add comment 29 27 private void UpdaterWorker_DoWork(object sender, DoWorkEventArgs e) {
Add comment 30 Minus Updater updater = new Updater("http://update.better-explorer.com/update.xml", 5, UpdateCheckType == 1);
Add comment 31 Minus if (updater.LoadUpdateFile()) {
Add comment 32 Minus if ((bool)e.Argument) {
Add comment 28 Plus this._IsCheckUpdateFromTimer = true;
Add comment 33 29 Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Normal,
Add comment 34 Minus (Action)(() => {
Add comment 35 Minus UpdateWizard updateWizzard = new UpdateWizard(updater);
Add comment 36 Minus updateWizzard.ShowDialog(this.GetWin32Window());
Add comment 37 Minus }));
Add comment 38 Minus }
Add comment 39 Minus else {
Add comment 40 Minus Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Normal,
Add comment 41 Minus (Action)(() => {
Add comment 42 Minus stiUpdate.Content = FindResource("stUpdateAvailableCP").ToString().Replace("VER", updater.AvailableUpdates[0].Version);
Add comment 43 Minus stiUpdate.Foreground = System.Windows.Media.Brushes.Red;
Add comment 30 Plus (Action) (() => {
Add comment 31 Plus autoUpdater.ForceCheckForUpdate(true);
Add comment 44 32 }));
Add comment 45 Minus }
Add comment 46 Minus }
Add comment 47 Minus else {
Add comment 48 Minus Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Normal,
Add comment 49 Minus (Action)(() => {
Add comment 50 Minus stiUpdate.Content = FindResource("stUpdateNotAvailableCP").ToString();
Add comment 51 Minus stiUpdate.Foreground = System.Windows.Media.Brushes.Black;
Add comment 52 Minus if ((bool)e.Argument)
Add comment 53 Minus MessageBox.Show(FindResource("stUpdateNotAvailableCP").ToString());
Add comment 54 Minus }));
Add comment 55 Minus }
Add comment 56 Minus
Add comment 57 33 Utilities.SetRegistryValue("LastUpdateCheck", DateTime.Now.ToBinary(), RegistryValueKind.QWord);
Add comment 58 34 LastUpdateCheck = DateTime.Now;
Add comment 59 35 }
BetterExplorer.csproj
/BExplorer/BetterExplorer/BetterExplorer.csproj-1+5/BExplorer/BetterExplorer/BetterExplorer.csproj
Add comment 694 <Project>{509d06bd-aeb6-4e92-8e5b-21188ebdbd9c}</Project>
Add comment 695 <Name>Wpf.TabControl</Name>
Add comment 696 </ProjectReference>
Add comment 697 Plus <ProjectReference Include="..\..\TaskDialog\TaskDialog.csproj">
Add comment 698 Plus <Project>{37fd53f7-8a8f-4427-8ff4-6299e2933a7e}</Project>
Add comment 699 Plus <Name>TaskDialog</Name>
Add comment 700 Plus </ProjectReference>
Add comment 697 701 <ProjectReference Include="..\..\UsbEject\UsbEject.csproj">
Add comment 698 702 <Project>{ae269158-dfa5-4dd7-8afc-f45faf2b958c}</Project>
Add comment 699 703 <Name>UsbEject</Name>
Add comment 1162 1166 <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
Add comment 1163 1167 <ProjectExtensions>
Add comment 1164 1168 <VisualStudio>
Add comment 1165 Minus <UserProperties BuildVersion_BuildVersioningStyle="None.None.None.Increment" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_UpdateFileVersion="True" BuildVersion_UseGlobalSettings="True" />
Add comment 1169 Plus <UserProperties BuildVersion_UseGlobalSettings="True" BuildVersion_UpdateFileVersion="True" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.None.None.Increment" />
Add comment 1166 1170 </VisualStudio>
Add comment 1167 1171 </ProjectExtensions>
Add comment 1168 1172 <Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
MainWindow.xaml.cs
/BExplorer/BetterExplorer/MainWindow.xaml.cs-11+74/BExplorer/BetterExplorer/MainWindow.xaml.cs
Add comment 46
Add comment 47 using WIN = System.Windows;
Add comment 48 using BExplorer.Shell._Plugin_Interfaces;
Add comment 49 Plus using TaskDialogInterop;
Add comment 49 50
Add comment 50 51
Add comment 51 52 namespace BetterExplorer
Add comment 1163 1164 }
Add comment 1164 1165 }
Add comment 1165 1166
Add comment 1166 Minus private void Button_Click_7(object sender, RoutedEventArgs e) => Process.Start("http://better-explorer.com/");
Add comment 1167 Plus private void Button_Click_7(object sender, RoutedEventArgs e) => Process.Start("http://gainedge.org/better-explorer/");
Add comment 1167 1168
Add comment 1168 1169 #endregion
Add comment 1169 1170
Add comment 1194 1195
Add comment 1195 1196 Utilities.SetRegistryValue("CheCkForUpdates", 1);
Add comment 1196 1197 IsUpdateCheck = true;
Add comment 1197 Minus updateCheckTimer.Interval = 3600000 * 3;
Add comment 1198 Minus updateCheckTimer.Tick += new EventHandler(updateCheckTimer_Tick);
Add comment 1199 1198 updateCheckTimer.Start();
Add comment 1200 1199
Add comment 1201 Minus if (DateTime.Now.Subtract(LastUpdateCheck).Days >= UpdateCheckInterval) CheckForUpdate(false);
Add comment 1200 Plus //if (DateTime.Now.Subtract(LastUpdateCheck).Days >= UpdateCheckInterval) CheckForUpdate(false);
Add comment 1202 1201 }
Add comment 1203 1202
Add comment 1204 1203 private void CheckBox_Unchecked(object sender, RoutedEventArgs e) {
Add comment 1506 1505
Add comment 1507 1506 try {
Add comment 1508 1507 autoUpdater.UpdateType = IsUpdateCheck ? UpdateType.OnlyCheck : UpdateType.DoNothing;
Add comment 1509 Minus if (IsUpdateCheckStartup) autoUpdater.ForceCheckForUpdate();
Add comment 1508 Plus if (IsUpdateCheckStartup) this.CheckForUpdate();
Add comment 1510 1509 } catch (IOException) {
Add comment 1511 1510 this.stiUpdate.Content = "Switch to another BetterExplorer window or restart to check for updates.";
Add comment 1512 1511 this.btnUpdateCheck.IsEnabled = false;
Add comment 1558 1557
Add comment 1559 1558 ShellTree.ShellListView = _ShellListView;
Add comment 1560 1559 this.ctrlConsole.ShellListView = this._ShellListView;
Add comment 1560 Plus this.autoUpdater.UpdateAvailable += AutoUpdater_UpdateAvailable;
Add comment 1561 Plus this.updateCheckTimer.Interval = 10000;//3600000 * 3;
Add comment 1562 Plus this.updateCheckTimer.Tick += new EventHandler(updateCheckTimer_Tick);
Add comment 1563 Plus this.updateCheckTimer.Enabled = false;
Add comment 1561 1564
Add comment 1562 1565 UpdateRecycleBinInfos();
Add comment 1563 1566 bool exitApp = false;
Add comment 1589 1592 isOnLoad = true;
Add comment 1590 1593
Add comment 1591 1594 //'load from Registry
Add comment 1592 Minus LoadRegistryRelatedSettings();
Add comment 1595 Plus this.LoadRegistryRelatedSettings();
Add comment 1593 1596
Add comment 1594 1597 //'set up Explorer control
Add comment 1595 1598 InitializeExplorerControl();
Add comment 1596 1599
Add comment 1597 1600 ViewGallery.SelectedIndex = 2;
Add comment 1598 1601
Add comment 1602 Plus if (this.chkUpdateCheck.IsChecked.Value) {
Add comment 1603 Plus this.updateCheckTimer.Start();
Add comment 1604 Plus }
Add comment 1605 Plus
Add comment 1599 1606 AddToLog("Session Began");
Add comment 1600 1607 isOnLoad = false;
Add comment 1601 1608 SetsUpJumpList();
Add comment 1639 1646 }
Add comment 1640 1647 }
Add comment 1641 1648
Add comment 1649 Plus private void AutoUpdater_UpdateAvailable(object sender, EventArgs e) {
Add comment 1650 Plus if (this._IsCheckUpdateFromTimer && !this._IsUpdateNotificationMessageBoxShown) {
Add comment 1651 Plus this._IsUpdateNotificationMessageBoxShown = true;
Add comment 1652 Plus var newVersion = this.autoUpdater.Version;
Add comment 1653 Plus var changes = this.autoUpdater.Changes;
Add comment 1654 Plus TaskDialogOptions config = new TaskDialogOptions();
Add comment 1642 1655
Add comment 1656 Plus config.Owner = this;
Add comment 1657 Plus config.Title = "Update";
Add comment 1658 Plus config.MainInstruction = "There is new updated version " + newVersion + " available!";
Add comment 1659 Plus config.Content = "The new version have the following changes:\r\n" + changes;
Add comment 1660 Plus config.ExpandedInfo = "You can download and install the new version immediately by clicking \"Download & Install\" button.\r\nYou can skip this version from autoupdate check by clicking \"Skip this version\" button.";
Add comment 1661 Plus //config.VerificationText = "Don't show me this message again";
Add comment 1662 Plus config.CustomButtons = new string[] {"&Download & Install", "Skip this version", "&Close"};
Add comment 1663 Plus config.MainIcon = VistaTaskDialogIcon.SecurityWarning;
Add comment 1664 Plus if (newVersion.Contains("RC") || newVersion.Contains("Nightly") || newVersion.Contains("Beta") ||
Add comment 1665 Plus newVersion.Contains("Alpha")) {
Add comment 1666 Plus config.FooterText = "This is an experimental version and may contains bugs. Use at your own risk!";
Add comment 1667 Plus config.FooterIcon = VistaTaskDialogIcon.Warning;
Add comment 1668 Plus }
Add comment 1669 Plus else {
Add comment 1670 Plus config.FooterText = "This is a final version and can be installed safely!";
Add comment 1671 Plus config.FooterIcon = VistaTaskDialogIcon.SecuritySuccess;
Add comment 1672 Plus }
Add comment 1673 Plus config.AllowDialogCancellation = true;
Add comment 1674 Plus config.Callback = taskDialog_Callback;
Add comment 1675 Plus
Add comment 1676 Plus TaskDialogResult res = TaskDialog.Show(config);
Add comment 1677 Plus this._IsCheckUpdateFromTimer = false;
Add comment 1678 Plus this._IsUpdateNotificationMessageBoxShown = false;
Add comment 1679 Plus }
Add comment 1680 Plus
Add comment 1681 Plus }
Add comment 1682 Plus
Add comment 1683 Plus private bool taskDialog_Callback(IActiveTaskDialog dialog, VistaTaskDialogNotificationArgs args, object callbackData) {
Add comment 1684 Plus bool result = false;
Add comment 1685 Plus
Add comment 1686 Plus switch (args.Notification) {
Add comment 1687 Plus case VistaTaskDialogNotification.ButtonClicked:
Add comment 1688 Plus if (args.ButtonId == 500) {
Add comment 1689 Plus
Add comment 1690 Plus this.autoUpdater.ReadyToBeInstalled += AutoUpdater_ReadyToBeInstalled;
Add comment 1691 Plus this.autoUpdater.InstallNow();
Add comment 1692 Plus } else if (args.ButtonId == 501) {
Add comment 1693 Plus
Add comment 1694 Plus }
Add comment 1695 Plus break;
Add comment 1696 Plus }
Add comment 1697 Plus
Add comment 1698 Plus return result;
Add comment 1699 Plus }
Add comment 1700 Plus
Add comment 1701 Plus private void AutoUpdater_ReadyToBeInstalled(object sender, EventArgs e) {
Add comment 1702 Plus this.autoUpdater.ReadyToBeInstalled -= AutoUpdater_ReadyToBeInstalled;
Add comment 1703 Plus this.autoUpdater.InstallNow();
Add comment 1704 Plus }
Add comment 1705 Plus
Add comment 1643 1706 //Boolean _IsTabSelectionChangedNotAllowed = true;
Add comment 1644 1707 void tcMain_OnTabClicked(object sender, Wpf.Controls.TabClickEventArgs e) {
Add comment 1645 1708 //this.tcMain.IsInTabDragDrop = false;
Add comment 3468 3531 sbiItemsCount.Visibility = itemsCount == 0 ? Visibility.Collapsed : Visibility.Visible;
Add comment 3469 3532 sbiItemsCount.Content = itemsCount == 1 ? "1 item" : itemsCount + " items";
Add comment 3470 3533 }
Add comment 3471 Minus if (e.UpdateType == ItemUpdateType.Created && this._ShellListView.IsRenameNeeded) {
Add comment 3472 Minus _ShellListView.SelectItemByIndex(e.NewItemIndex, true, true);
Add comment 3473 Minus _ShellListView.RenameSelectedItem();
Add comment 3474 Minus this._ShellListView.IsRenameNeeded = false;
Add comment 3475 Minus }
Add comment 3534 Plus //if (e.UpdateType == ItemUpdateType.Created && this._ShellListView.IsRenameNeeded) {
Add comment 3535 Plus // _ShellListView.SelectItemByIndex(e.NewItemIndex, true, true);
Add comment 3536 Plus // _ShellListView.RenameSelectedItem();
Add comment 3537 Plus // this._ShellListView.IsRenameNeeded = false;
Add comment 3538 Plus //}
Add comment 3476 3539 if (e.UpdateType == ItemUpdateType.DriveRemoved) {
Add comment 3477 3540 foreach (var tab in this.tcMain.Items.OfType<Wpf.Controls.TabItem>().ToArray().Where(w => w.ShellObject.ParsingName.StartsWith(e.NewItem.ParsingName))) {
Add comment 3478 3541 this.tcMain.RemoveTabItem(tab, false);
Add comment 801 public static extern bool RedrawWindow(IntPtr hWnd, ref RECT lprcUpdate, IntPtr hrgnUpdate, uint flags);
Add comment 802 */
Add comment 803
Add comment 804 Minus //[DllImport("user32.dll")]
Add comment 805 Minus //public static extern bool InvalidateRect(IntPtr hWnd, ref RECT lpRect, bool bErase);
Add comment 804 Plus [DllImport("user32.dll")]
Add comment 805 Plus public static extern bool InvalidateRect(IntPtr hWnd, ref RECT lpRect, bool bErase);
Add comment 806
Add comment 807 Minus //[DllImport("user32.dll")]
Add comment 808 Minus //public static extern bool InvalidateRect(IntPtr hWnd, IntPtr lpRect, bool bErase);
Add comment 807 Plus [DllImport("user32.dll")]
Add comment 808 Plus public static extern bool InvalidateRect(IntPtr hWnd, IntPtr lpRect, bool bErase);
Add comment 809
Add comment 810 [DllImport("user32.dll")]
Add comment 811 public static extern void PostMessage(IntPtr hWnd, uint Msg, IntPtr wParam, IntPtr lParam);
Add comment 348 var nativeGroup = new LVGROUP2 {
Add comment 349 cbSize = (UInt32) Marshal.SizeOf(typeof (LVGROUP2)),
Add comment 350 mask = (UInt32) (GroupMask.LVGF_HEADER ^ GroupMask.LVGF_STATE ^ GroupMask.LVGF_GROUPID),
Add comment 351 Minus stateMask = (UInt32) GroupState.LVGS_COLLAPSIBLE,
Add comment 352 Minus state = (UInt32) GroupState.LVGS_COLLAPSIBLE,
Add comment 353 Minus pszHeader = @group.Header,
Add comment 354 Minus iGroupId = @group.Index
Add comment 351 Plus stateMask = (UInt32)GroupState.LVGS_COLLAPSIBLE,
Add comment 352 Plus state = (UInt32)GroupState.LVGS_COLLAPSIBLE,
Add comment 353 Plus pszHeader = group.Header,
Add comment 354 Plus iGroupId = group.Index
Add comment 355 };
Add comment 356
Add comment 357 if (group.Items.Any()) {
Add comment 181 } else {
Add comment 182 while (parents.Count > 0) {
Add comment 183 var obj = parents.Pop();
Add comment 184 Minus this.Invoke((Action)(() => {
Add comment 184 Plus this.BeginInvoke((Action)(() => {
Add comment 185 var newNode = this.FromItem(obj);
Add comment 186 if (newNode != null && !newNode.IsExpanded) {
Add comment 187 newNode.Expand();
Add comment 194 public void SelItem(IListItemEx item) {
Add comment 195 var node = this.FromItem(item);
Add comment 196 if (node != null) {
Add comment 197 Minus this.Invoke((Action)(() => {
Add comment 197 Plus this.BeginInvoke((Action)(() => {
Add comment 198 this.ShellTreeView.SelectedNode = node;
Add comment 199 }));
Add comment 200 return;
Add comment 429 var pidl = IntPtr.Zero;
Add comment 430 var visible = false;
Add comment 431 if (this.ShellTreeView != null) {
Add comment 432 Minus this.ShellTreeView.Invoke((Action)(() => {
Add comment 432 Plus this.ShellTreeView.BeginInvoke((Action)(() => {
Add comment 433 node = TreeNode.FromHandle(ShellTreeView, handle);
Add comment 434 treeHandle = ShellTreeView.Handle;
Add comment 435 if (node != null) {
Add comment 461 var visible = true;
Add comment 462 //var pidl = IntPtr.Zero;
Add comment 463 if (ShellTreeView != null) {
Add comment 464 Minus this.ShellTreeView.Invoke((Action)(() => {
Add comment 464 Plus this.ShellTreeView.BeginInvoke((Action)(() => {
Add comment 465 node = TreeNode.FromHandle(ShellTreeView, handle);
Add comment 466 treeHandle = this.ShellTreeView.Handle;
Add comment 467 if (node != null)
Add comment 502 var visible = true;
Add comment 503 //var pidl = IntPtr.Zero;
Add comment 504 if (ShellTreeView != null) {
Add comment 505 Minus this.ShellTreeView.Invoke((Action)(() => {
Add comment 505 Plus this.ShellTreeView.BeginInvoke((Action)(() => {
Add comment 506 node = TreeNode.FromHandle(ShellTreeView, handle);
Add comment 507 treeHandle = this.ShellTreeView.Handle;
Add comment 508 if (node != null) visible = node.IsVisible;
Add comment 720 }
Add comment 721 //return nodesTemp;
Add comment 722 //});
Add comment 723 Minus this.Invoke((Action)(() => {
Add comment 723 Plus this.BeginInvoke((Action)(() => {
Add comment 724 if (node.Nodes.Count == 1 && node.Nodes[0].Text == _SearchingForFolders)
Add comment 725 node.Nodes.RemoveAt(0);
Add comment 726 node.Nodes.AddRange(nodesTemp.ToArray());
DesignerCommandLink.xaml
/TaskDialog/DesignData/DesignerCommandLink.xaml/TaskDialog/DesignData/DesignerCommandLink.xaml
DesignerTaskDialogViewModel.xaml
/TaskDialog/DesignData/DesignerTaskDialogViewModel.xaml/TaskDialog/DesignData/DesignerTaskDialogViewModel.xaml
Resources.Designer.cs
/TaskDialog/Properties/Resources.Designer.cs/TaskDialog/Properties/Resources.Designer.cs
Common.xaml
/TaskDialog/ResourceDictionaries/Common.xaml/TaskDialog/ResourceDictionaries/Common.xaml
VistaActiveTaskDialog.cs
/TaskDialog/VistaActiveTaskDialog.cs/TaskDialog/VistaActiveTaskDialog.cs