Prevented Last Tab from being deleted
0a356d1c
Aaron Campf
committed
13 changed files
MainWindow_Tabs.cs
/BExplorer/BetterExplorer/_MainWindow/MainWindow_Tabs.cs-18+10
/BExplorer/BetterExplorer/_MainWindow/MainWindow_Tabs.cs
Add comment 80 //}
Add comment 81 }
Add comment 82
Add comment 83 Plus   /*
Add comment 83 84 private void CloseTab(Wpf.Controls.TabItem thetab, bool allowreopening = true) {
Add comment 84 85 if (tcMain.SelectedIndex == 0 && tcMain.Items.Count == 1) {
Add comment 85 Minus   if (chkIsLastTabCloseApp.IsChecked.Value)
Add comment 86 Minus   Close();
Add comment 87 Minus   else
Add comment 86 Plus   //if (chkIsLastTabCloseApp.IsChecked.Value)
Add comment 87 Plus   // Close();
Add comment 88 Plus   //else
Add comment 88 89 NavigationController(new ShellItem(tcMain.StartUpLocation));
Add comment 89 90 }
Add comment 90 91 else {
Add comment 93 94 SelectTab(tcMain.SelectedItem as Wpf.Controls.TabItem);
Add comment 94 95 }
Add comment 95 96 }
Add comment 96 Minus  
Add comment 97 Plus   */
Add comment 97 98 private void ConstructMoveToCopyToMenu() {
Add comment 98 99 btnMoveto.Items.Clear();
Add comment 99 100 btnCopyto.Items.Clear();
Add comment 124 125
Add comment 125 126 MenuItem mimDownloads = new MenuItem(), micDownloads = new MenuItem();
Add comment 126 127 try {
Add comment 127 Minus   ShellItem sodd = (ShellItem)KnownFolders.Downloads;
Add comment 128 Plus   var sodd = (ShellItem)KnownFolders.Downloads;
Add comment 128 129 sodd.Thumbnail.FormatOption = ShellThumbnailFormatOption.IconOnly;
Add comment 129 130 sodd.Thumbnail.CurrentSize = new System.Windows.Size(16, 16);
Add comment 130 131
Add comment 153 154 btnCopyto.Items.Add(micDesktop);
Add comment 154 155 btnCopyto.Items.Add(new Separator());
Add comment 155 156
Add comment 156 Minus   foreach (var item in tcMain.Items.OfType<Wpf.Controls.TabItem>().ToList()) {
Add comment 157 Plus   foreach (var item in tcMain.Items.OfType<Wpf.Controls.TabItem>()) {
Add comment 157 158 bool IsAdditem = true;
Add comment 158 159
Add comment 159 160 foreach (object mii in btnCopyto.Items.OfType<MenuItem>().Where(mii => (mii as MenuItem).Tag != null)) {
Add comment 161 162 IsAdditem = false;
Add comment 162 163 break;
Add comment 163 164 }
Add comment 164 Minus   /*
Add comment 165 Minus   foreach (object mii in btnCopyto.Items) {
Add comment 166 Minus   if (mii is MenuItem) {
Add comment 167 Minus   if ((mii as MenuItem).Tag != null) {
Add comment 168 Minus   if (((mii as MenuItem).Tag as ShellItem) == item.ShellObject) {
Add comment 169 Minus   IsAdditem = false;
Add comment 170 Minus   break;
Add comment 171 Minus   }
Add comment 172 165 }
Add comment 173 Minus   }
Add comment 174 Minus   */
Add comment 175 Minus   }
Add comment 176 166
Add comment 177 167 if (IsAdditem && item.ShellObject.IsFileSystem) {
Add comment 178 168 try {
Add comment 187 177 }
Add comment 188 178 catch {
Add comment 189 179 //Do nothing if ShellItem is not available anymore and close the problematic item
Add comment 190 Minus   CloseTab(item);
Add comment 180 Plus   //CloseTab(item);
Add comment 181 Plus   tcMain.RemoveTabItem(item);
Add comment 182 Plus  
Add comment 191 183 }
Add comment 192 184 }
Add comment 193 185 }
MainWindow.xaml
/BExplorer/BetterExplorer/MainWindow.xaml+4
/BExplorer/BetterExplorer/MainWindow.xaml
Add comment 1041 VerticalAlignment="Top"
Add comment 1042 Header="Actions"
Add comment 1043 Style="{DynamicResource InnerBackstageSeparatorTabItemStyle}" />
Add comment 1044 Plus  
Add comment 1045 Plus   <!--
Add comment 1044 1046 <Ribbon:CheckBox x:Name="chkIsLastTabCloseApp"
Add comment 1045 1047 Height="22"
Add comment 1046 1048 Margin="7,275,0,0"
Add comment 1047 1049 VerticalAlignment="Top"
Add comment 1048 1050 Click="chkIsLastTabCloseApp_Click"
Add comment 1049 1051 Header="Closing last Tab closes Application" />
Add comment 1052 Plus   -->
Add comment 1053 Plus  
Add comment 1050 1054 </Grid>
Add comment 1051 1055 </TabItem>
Add comment 1052 1056 <!--
MainWindow.xaml.cs
/BExplorer/BetterExplorer/MainWindow.xaml.cs-62+26
/BExplorer/BetterExplorer/MainWindow.xaml.cs
Add comment 52 /// </summary>
Add comment 53 public partial class MainWindow : Fluent.RibbonWindow {
Add comment 54
Add comment 55 Minus   [Obsolete("Can remove move this!!! Someone should!!!")]
Add comment 56 Minus   public bool IsCalledFromLoading;
Add comment 57 Minus  
Add comment 58 Minus   /*
Add comment 59 Minus   [Obsolete("Do we really need this?!!")]
Add comment 60 Minus   bool ReadyToChangeLanguage;
Add comment 61 Minus   */
Add comment 62 Minus  
Add comment 63 Minus   public bool isOnLoad;
Add comment 64 Minus  
Add comment 65 Minus  
Add comment 66 Minus   //[Obsolete("Does nothing")]
Add comment 67 Minus   //private bool IsCloseLastTabCloseApp;
Add comment 68 Minus  
Add comment 69 Minus   [Obsolete("Does nothing")]
Add comment 70 Minus   private void chkIsLastTabCloseApp_Click(object sender, RoutedEventArgs e) {
Add comment 71 Minus   //var b = this.chkIsLastTabCloseApp.IsChecked;
Add comment 72 Minus   //if (b != null)
Add comment 73 Minus   // this.IsCloseLastTabCloseApp = b.Value;
Add comment 74 Minus   }
Add comment 75 Minus  
Add comment 76 Minus  
Add comment 77 55 [Obsolete("Try to remove. Items are added and removed but this has no functionality")]
Add comment 78 56 NetworkAccountManager nam = new NetworkAccountManager();
Add comment 79 57
Add comment 97 75 #region Variables and Constants
Add comment 98 76
Add comment 99 77 #region Public member
Add comment 100 Minus   public bool IsrestoreTabs;
Add comment 78 Plus   private bool IsrestoreTabs;
Add comment 101 79 //public static UpdateManager Updater;
Add comment 102 80 #endregion
Add comment 103 81
Add comment 104 82 #region Private Members
Add comment 83 Plus   private bool IsCalledFromLoading, isOnLoad;
Add comment 105 84 private bool asFolder = false, asImage = false, asArchive = false, asDrive = false, asApplication = false, asLibrary = false, asVirtualDrive = false;
Add comment 106 85 private MenuItem misa, misd, misag, misdg;
Add comment 107 86 private bool IsInfoPaneEnabled, IsConsoleShown, IsPreviewPaneEnabled;
Add comment 114 93 private ContextMenu cmHistory = new ContextMenu();
Add comment 115 94 private System.Windows.Shell.JumpList AppJL = new System.Windows.Shell.JumpList();
Add comment 116 95 private IntPtr Handle;
Add comment 117 Minus  
Add comment 118 96 private List<string> Archives = new List<string>(new[] { ".rar", ".zip", ".7z", ".tar", ".gz", ".xz", ".bz2" });
Add comment 119 97 private List<string> Images = new List<string>(new[] { ".jpg", ".jpeg", ".png", ".bmp", ".gif", ".wmf" });
Add comment 120 Minus   //private List<string> VirDisks = new List<string>(new[] { ".iso", ".bin", ".vhd" });
Add comment 121 98 private string SelectedArchive = "";
Add comment 122 99 private bool KeepBackstageOpen = false;
Add comment 123 Minus   private string ICON_DLLPATH = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.System), "shell32.dll");
Add comment 124 100 bool canlogactions = false;
Add comment 125 101 string sessionid = DateTime.UtcNow.ToFileTimeUtc().ToString();
Add comment 126 102 string logdir = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\BExplorer\\ActionLog\\";
Add comment 127 103 string satdir = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + "\\BExplorer_SavedTabs\\";
Add comment 128 Minus   //string naddir = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\BExplorer\\NetworkAccounts\\";
Add comment 129 104 string sstdir;
Add comment 130 105 bool OverwriteOnRotate = false;
Add comment 131 Minus   //NLog.Logger logger = NLog.LogManager.GetCurrentClassLogger();
Add comment 132 106 System.Windows.Forms.Timer updateCheckTimer = new System.Windows.Forms.Timer();
Add comment 133 107 DateTime LastUpdateCheck;
Add comment 134 108 Int32 UpdateCheckInterval;
Add comment 1130 1104 root.ToLowerInvariant() == String.Format("{0}:\\", DriveLetter).ToLowerInvariant());
Add comment 1131 1105 }).ToArray();
Add comment 1132 1106 foreach (Wpf.Controls.TabItem tab in tabsForRemove) {
Add comment 1133 Minus   CloseTab(tab, false);
Add comment 1107 Plus   //CloseTab(tab, false);
Add comment 1108 Plus   tcMain.RemoveTabItem(tab);
Add comment 1134 1109 }
Add comment 1135 1110 }));
Add comment 1136 1111 }
Add comment 1583 1558 IsrestoreTabs = false;
Add comment 1584 1559 }
Add comment 1585 1560
Add comment 1586 Minus   this.chkIsLastTabCloseApp.IsChecked = (int)rks.GetValue("IsLastTabCloseApp", 1) == 1;
Add comment 1561 Plus   //this.chkIsLastTabCloseApp.IsChecked = (int)rks.GetValue("IsLastTabCloseApp", 1) == 1;
Add comment 1587 1562
Add comment 1588 1563 canlogactions = (int)rks.GetValue("EnableActionLog", 0) == 1;
Add comment 1589 1564 chkLogHistory.IsChecked = canlogactions;
Add comment 1744 1719 IsCalledFromLoading = true;
Add comment 1745 1720 var statef = new BExplorer.Shell.Interop.Shell32.SHELLSTATE();
Add comment 1746 1721 BExplorer.Shell.Interop.Shell32.SHGetSetSettings(ref statef, BExplorer.Shell.Interop.Shell32.SSF.SSF_SHOWALLOBJECTS | BExplorer.Shell.Interop.Shell32.SSF.SSF_SHOWEXTENSIONS, false);
Add comment 1747 Minus   chkHiddenFiles.IsChecked = (statef.fShowAllObjects == 1);
Add comment 1722 Plus   chkHiddenFiles.IsChecked = statef.fShowAllObjects == 1;
Add comment 1748 1723 ShellListView.ShowHidden = chkHiddenFiles.IsChecked.Value;
Add comment 1749 1724 ShellTree.IsShowHiddenItems = chkHiddenFiles.IsChecked.Value;
Add comment 1750 Minus   chkExtensions.IsChecked = (statef.fShowExtensions == 1);
Add comment 1725 Plus   chkExtensions.IsChecked = statef.fShowExtensions == 1;
Add comment 1751 1726 IsCalledFromLoading = false;
Add comment 1752 1727
Add comment 1753 1728 isOnLoad = true;
Add comment 1858 1833 rks.SetValue("AutoSwitchDriveTools", Convert.ToInt32(asDrive));
Add comment 1859 1834 rks.SetValue("AutoSwitchVirtualDriveTools", Convert.ToInt32(asVirtualDrive));
Add comment 1860 1835 //rks.SetValue("IsLastTabCloseApp", Convert.ToInt32(this.IsCloseLastTabCloseApp));
Add comment 1861 Minus   rks.SetValue("IsLastTabCloseApp", Convert.ToInt32(chkIsLastTabCloseApp.IsChecked.Value));
Add comment 1836 Plus   //rks.SetValue("IsLastTabCloseApp", Convert.ToInt32(chkIsLastTabCloseApp.IsChecked.Value));
Add comment 1862 1837
Add comment 1863 1838 rks.SetValue("IsConsoleShown", this.IsConsoleShown ? 1 : 0);
Add comment 1864 1839 rks.SetValue("TabBarAlignment", this.TabbaBottom.IsChecked == true ? "bottom" : "top");
Add comment 2126 2101
Add comment 2127 2102 private void btnViewArchive_Click(object sender, RoutedEventArgs e) {
Add comment 2128 2103 var name = ShellListView.SelectedItems.First().ParsingName;
Add comment 2104 Plus   string ICON_DLLPATH = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.System), "shell32.dll");
Add comment 2129 2105 var archiveDetailView = new ArchiveDetailView(ICON_DLLPATH, name);
Add comment 2130 2106 archiveDetailView.Show(this.GetWin32Window());
Add comment 2131 2107
Add comment 3592 3568 }
Add comment 3593 3569
Add comment 3594 3570 private void btnTabCloseC_Click(object sender, RoutedEventArgs e) {
Add comment 3595 Minus   CloseTab(tcMain.SelectedItem as Wpf.Controls.TabItem);
Add comment 3571 Plus   //CloseTab(tcMain.SelectedItem as Wpf.Controls.TabItem);
Add comment 3572 Plus  
Add comment 3573 Plus   tcMain.RemoveTabItem(tcMain.SelectedItem as Wpf.Controls.TabItem);
Add comment 3596 3574 }
Add comment 3597 3575
Add comment 3598 3576 /*
Add comment 3717 3695 else
Add comment 3718 3696 e.Effects = DragDropEffects.None;
Add comment 3719 3697
Add comment 3720 Minus   Win32Point ptw = new Win32Point();
Add comment 3698 Plus   var ptw = new Win32Point();
Add comment 3721 3699 GetCursorPos(ref ptw);
Add comment 3722 3700 e.Handled = true;
Add comment 3723 3701
Add comment 4184 4162 this.Title = "Better Explorer - " + e.Folder.GetDisplayName(BExplorer.Shell.Interop.SIGDN.NORMALDISPLAY);
Add comment 4185 4163 e.Folder.Thumbnail.CurrentSize = new System.Windows.Size(16, 16);
Add comment 4186 4164 e.Folder.Thumbnail.FormatOption = ShellThumbnailFormatOption.IconOnly;
Add comment 4187 Minus   Wpf.Controls.TabItem selectedTabItem = (tcMain.SelectedItem as Wpf.Controls.TabItem);
Add comment 4188 Minus   try {
Add comment 4165 Plus  
Add comment 4166 Plus   var selectedTabItem = tcMain.SelectedItem as Wpf.Controls.TabItem;
Add comment 4189 4167 selectedTabItem.Header = e.Folder.DisplayName;
Add comment 4190 4168 selectedTabItem.Icon = e.Folder.Thumbnail.BitmapSource;
Add comment 4191 4169 selectedTabItem.ShellObject = e.Folder;
Add comment 4192 4170 selectedTabItem.ToolTip = e.Folder.ParsingName;
Add comment 4193 4171 }
Add comment 4194 Minus   catch (Exception) {
Add comment 4195 Minus   }
Add comment 4196 Minus   }
Add comment 4197 4172
Add comment 4198 4173 /*
Add comment 4199 4174 [Obsolete("I don't think we need this")]
Add comment 4255 4230 if (e.UpdateType == ItemUpdateType.Created && this.ShellListView.IsRenameNeeded) {
Add comment 4256 4231 ShellListView.SelectItemByIndex(e.NewItemIndex, true, true);
Add comment 4257 4232 ShellListView.RenameSelectedItem();
Add comment 4258 Minus   //ShellListView.RenameItem(e.NewItemIndex);
Add comment 4259 4233 this.ShellListView.IsRenameNeeded = false;
Add comment 4260 4234 }
Add comment 4261 4235
Add comment 4262 Minus   //IsRenameFromCreate = false; //Note: Moved this below the if(...) to ensure it WILL always end up being false
Add comment 4263 4236 this.ShellListView.Focus();
Add comment 4264 4237 }
Add comment 4265 4238
Add comment 4378 4351
Add comment 4379 4352 try {
Add comment 4380 4353 pIDL = this.ShellListView.CurrentFolder.AbsolutePidl;
Add comment 4381 Minus   SHFILEINFO sfi = new SHFILEINFO();
Add comment 4354 Plus   var sfi = new SHFILEINFO();
Add comment 4382 4355
Add comment 4383 4356 //TODO: Why do we even have this if(...)
Add comment 4384 4357 if (pIDL != IntPtr.Zero && !ShellListView.CurrentFolder.IsFileSystem) {
Add comment 4443 4416 ctgVirtualDisk.Visibility = Visibility.Collapsed;
Add comment 4444 4417 ctgExe.Visibility = Visibility.Collapsed;
Add comment 4445 4418
Add comment 4446 Minus   try {
Add comment 4447 4419 SetupLibrariesTab(ShellLibrary.Load(ShellListView.CurrentFolder.GetDisplayName(SIGDN.NORMALDISPLAY), false));
Add comment 4448 4420 }
Add comment 4449 Minus   catch {
Add comment 4450 Minus   }
Add comment 4451 Minus   }
Add comment 4452 4421 else if (!ShellListView.CurrentFolder.ParsingName.ToLowerInvariant().EndsWith("library-ms")) {
Add comment 4453 4422 btnDefSave.Items.Clear();
Add comment 4454 4423 ctgLibraries.Visibility = Visibility.Collapsed;
Add comment 4498 4467 tcMain.SelectedItem = tcMain.SelectedIndex == 0 ? tcMain.Items[1] : tcMain.Items[CurSelIndex - 1];
Add comment 4499 4468 tcMain.Items.RemoveAt(CurSelIndex);
Add comment 4500 4469 })
Add comment 4501 Minus   }
Add comment 4502 Minus   );
Add comment 4470 Plus   });
Add comment 4503 4471
Add comment 4504 4472 RegistryKey rk = Registry.CurrentUser;
Add comment 4505 4473 RegistryKey rks = rk.OpenSubKey(@"Software\BExplorer", true);
Add comment 4506 4474
Add comment 4507 4475 // loads current Ribbon color theme
Add comment 4508 4476 try {
Add comment 4509 Minus   switch (Convert.ToString(rks.GetValue("CurrentTheme", "Blue"))) {
Add comment 4477 Plus   var Color = Convert.ToString(rks.GetValue("CurrentTheme", "Blue"));
Add comment 4478 Plus   switch (Color) {
Add comment 4510 4479 case "Blue":
Add comment 4511 Minus   ChangeRibbonTheme("Blue");
Add comment 4512 Minus   break;
Add comment 4513 4480 case "Silver":
Add comment 4514 Minus   ChangeRibbonTheme("Silver");
Add comment 4515 Minus   break;
Add comment 4516 4481 case "Black":
Add comment 4517 Minus   ChangeRibbonTheme("Black");
Add comment 4518 Minus   break;
Add comment 4519 4482 case "Green":
Add comment 4520 Minus   ChangeRibbonTheme("Green");
Add comment 4483 Plus   ChangeRibbonTheme(Color);
Add comment 4521 4484 break;
Add comment 4522 4485 default:
Add comment 4523 4486 ChangeRibbonTheme("Blue");
Add comment 4530 4493
Add comment 4531 4494 // loads current UI language (uses en-US if default)
Add comment 4532 4495 try {
Add comment 4533 Minus   string loc;
Add comment 4496 Plus   string loc = Convert.ToString(rks.GetValue("Locale", ":null:")) == ":null:" ? //load current UI language in case there is no specified registry value
Add comment 4497 Plus   Thread.CurrentThread.CurrentUICulture.Name : Convert.ToString(rks.GetValue("Locale", ":null:"));
Add comment 4498 Plus   /*
Add comment 4534 4499 if (Convert.ToString(rks.GetValue("Locale", ":null:")) == ":null:") {
Add comment 4535 Minus   //load current UI language in case there is no specified registry value
Add comment 4500 Plus  
Add comment 4536 4501 loc = Thread.CurrentThread.CurrentUICulture.Name;
Add comment 4537 4502 }
Add comment 4538 4503 else {
Add comment 4539 4504 loc = Convert.ToString(rks.GetValue("Locale", ":null:"));
Add comment 4540 4505 }
Add comment 4541 Minus  
Add comment 4506 Plus   */
Add comment 4542 4507 ((App)Application.Current).SelectCulture(loc, Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\BExplorer\\translation.xaml");
Add comment 4543 4508 }
Add comment 4544 4509 catch (Exception ex) {
Add comment 4843 4808 }
Add comment 4844 4809
Add comment 4845 4810 private void Refresh_Click(object sender, RoutedEventArgs e) {
Add comment 4846 Minus   var da = new DoubleAnimation(100, new Duration(new TimeSpan(0, 0, 0, 1, 100)));
Add comment 4847 Minus   da.FillBehavior = FillBehavior.Stop;
Add comment 4811 Plus   var da = new DoubleAnimation(100, new Duration(new TimeSpan(0, 0, 0, 1, 100))) { FillBehavior = FillBehavior.Stop };
Add comment 4848 4812 this.bcbc.BeginAnimation(Odyssey.Controls.BreadcrumbBar.ProgressValueProperty, da);
Add comment 4849 4813 this.ShellListView.RefreshContents();
Add comment 4850 4814 }
WinApi.cs
/NotifyIcon/NotifyIconWpf/Interop/WinApi.cs-3
/NotifyIcon/NotifyIconWpf/Interop/WinApi.cs
Add comment 52 [DllImport("USER32.DLL", SetLastError = true)]
Add comment 53 public static extern bool DestroyWindow(IntPtr hWnd);
Add comment 54
Add comment 55 Minus  
Add comment 56 55 /// <summary>
Add comment 57 56 /// Gives focus to a given window.
Add comment 58 57 /// </summary>
Add comment 61 60 [DllImport("USER32.DLL")]
Add comment 62 61 public static extern bool SetForegroundWindow(IntPtr hWnd);
Add comment 63 62
Add comment 64 Minus  
Add comment 65 63 /// <summary>
Add comment 66 64 /// Gets the maximum number of milliseconds that can elapse between a
Add comment 67 65 /// first click and a second click for the OS to consider the
Add comment 73 71 [DllImport("user32.dll", CharSet = CharSet.Auto, ExactSpelling = true)]
Add comment 74 72 public static extern int GetDoubleClickTime();
Add comment 75 73
Add comment 76 Minus  
Add comment 77 74 /// <summary>
Add comment 78 75 /// Gets the screen coordinates of the current mouse position.
Add comment 79 76 /// </summary>
Util.cs
/NotifyIcon/NotifyIconWpf/Util.cs-48+25
/NotifyIcon/NotifyIconWpf/Util.cs
Add comment 32 using System.Windows.Threading;
Add comment 33 using Hardcodet.Wpf.TaskbarNotification.Interop;
Add comment 34
Add comment 35 Minus  namespace Hardcodet.Wpf.TaskbarNotification
Add comment 36 Minus  {
Add comment 35 Plus  namespace Hardcodet.Wpf.TaskbarNotification {
Add comment 37 36 /// <summary>
Add comment 38 37 /// Util and extension methods.
Add comment 39 38 /// </summary>
Add comment 40 Minus   internal static class Util
Add comment 41 Minus   {
Add comment 39 Plus   internal static class Util {
Add comment 42 40 public static readonly object SyncRoot = new object();
Add comment 43 41
Add comment 44 42 #region IsDesignMode
Add comment 48 46 /// <summary>
Add comment 49 47 /// Checks whether the application is currently in design mode.
Add comment 50 48 /// </summary>
Add comment 51 Minus   public static bool IsDesignMode
Add comment 52 Minus   {
Add comment 49 Plus   public static bool IsDesignMode {
Add comment 53 50 get { return isDesignMode; }
Add comment 54 51 }
Add comment 55 52
Add comment 57 54
Add comment 58 55 #region construction
Add comment 59 56
Add comment 60 Minus   static Util()
Add comment 61 Minus   {
Add comment 57 Plus   static Util() {
Add comment 62 58 isDesignMode =
Add comment 63 Minus   (bool)
Add comment 64 Minus   DependencyPropertyDescriptor.FromProperty(DesignerProperties.IsInDesignModeProperty,
Add comment 65 Minus   typeof (FrameworkElement))
Add comment 66 Minus   .Metadata.DefaultValue;
Add comment 59 Plus   (bool)DependencyPropertyDescriptor.FromProperty(DesignerProperties.IsInDesignModeProperty, typeof(FrameworkElement)).Metadata.DefaultValue;
Add comment 67 60 }
Add comment 68 61
Add comment 69 62 #endregion
Add comment 70 63
Add comment 64 Plus   /*
Add comment 71 65 #region CreateHelperWindow
Add comment 72 66
Add comment 73 67 /// <summary>
Add comment 76 70 /// be used as a window message sink.
Add comment 77 71 /// </summary>
Add comment 78 72 /// <returns>Empty window.</returns>
Add comment 79 Minus   public static Window CreateHelperWindow()
Add comment 80 Minus   {
Add comment 81 Minus   return new Window
Add comment 82 Minus   {
Add comment 73 Plus   public static Window CreateHelperWindow() {
Add comment 74 Plus   return new Window {
Add comment 83 75 Width = 0,
Add comment 84 76 Height = 0,
Add comment 85 77 ShowInTaskbar = false,
Add comment 90 82 }
Add comment 91 83
Add comment 92 84 #endregion
Add comment 85 Plus   */
Add comment 93 86
Add comment 94 87 #region WriteIconData
Add comment 95 88
Add comment 101 94 /// <param name="command">Operation on the icon (e.g. delete the icon).</param>
Add comment 102 95 /// <returns>True if the data was successfully written.</returns>
Add comment 103 96 /// <remarks>See Shell_NotifyIcon documentation on MSDN for details.</remarks>
Add comment 104 Minus   public static bool WriteIconData(ref NotifyIconData data, NotifyCommand command)
Add comment 105 Minus   {
Add comment 97 Plus   public static bool WriteIconData(ref NotifyIconData data, NotifyCommand command) {
Add comment 106 98 return WriteIconData(ref data, command, data.ValidMembers);
Add comment 107 99 }
Add comment 108 100
Add comment 117 109 /// structure are set.</param>
Add comment 118 110 /// <returns>True if the data was successfully written.</returns>
Add comment 119 111 /// <remarks>See Shell_NotifyIcon documentation on MSDN for details.</remarks>
Add comment 120 Minus   public static bool WriteIconData(ref NotifyIconData data, NotifyCommand command, IconDataMembers flags)
Add comment 121 Minus   {
Add comment 112 Plus   public static bool WriteIconData(ref NotifyIconData data, NotifyCommand command, IconDataMembers flags) {
Add comment 122 113 //do nothing if in design mode
Add comment 123 114 if (IsDesignMode) return true;
Add comment 124 115
Add comment 125 116 data.ValidMembers = flags;
Add comment 126 Minus   lock (SyncRoot)
Add comment 127 Minus   {
Add comment 117 Plus   lock (SyncRoot) {
Add comment 128 118 return WinApi.Shell_NotifyIcon(command, ref data);
Add comment 129 119 }
Add comment 130 120 }
Add comment 137 127 /// Gets a <see cref="BalloonFlags"/> enum value that
Add comment 138 128 /// matches a given <see cref="BalloonIcon"/>.
Add comment 139 129 /// </summary>
Add comment 140 Minus   public static BalloonFlags GetBalloonFlag(this BalloonIcon icon)
Add comment 141 Minus   {
Add comment 142 Minus   switch (icon)
Add comment 143 Minus   {
Add comment 130 Plus   public static BalloonFlags GetBalloonFlag(this BalloonIcon icon) {
Add comment 131 Plus   switch (icon) {
Add comment 144 132 case BalloonIcon.None:
Add comment 145 133 return BalloonFlags.None;
Add comment 146 134 case BalloonIcon.Info:
Add comment 165 153 /// an icon file (*.ico).</param>
Add comment 166 154 /// <returns>An icon object that can be used with the
Add comment 167 155 /// taskbar area.</returns>
Add comment 168 Minus   public static Icon ToIcon(this ImageSource imageSource)
Add comment 169 Minus   {
Add comment 156 Plus   public static Icon ToIcon(this ImageSource imageSource) {
Add comment 170 157 if (imageSource == null) return null;
Add comment 171 158
Add comment 172 159 Uri uri = new Uri(imageSource.ToString());
Add comment 173 160 StreamResourceInfo streamInfo = Application.GetResourceStream(uri);
Add comment 174 161
Add comment 175 Minus   if (streamInfo == null)
Add comment 176 Minus   {
Add comment 162 Plus   if (streamInfo == null) {
Add comment 177 163 string msg = "The supplied image source '{0}' could not be resolved.";
Add comment 178 164 msg = String.Format(msg, imageSource);
Add comment 179 165 throw new ArgumentException(msg);
Add comment 200 186 /// which allows to check with null values, too.</returns>
Add comment 201 187 /// <exception cref="ArgumentNullException">If <paramref name="candidates"/>
Add comment 202 188 /// is a null reference.</exception>
Add comment 203 Minus   public static bool Is<T>(this T value, params T[] candidates)
Add comment 204 Minus   {
Add comment 189 Plus   public static bool Is<T>(this T value, params T[] candidates) {
Add comment 205 190 if (candidates == null) return false;
Add comment 206 191
Add comment 207 Minus   foreach (var t in candidates)
Add comment 208 Minus   {
Add comment 192 Plus   foreach (var t in candidates) {
Add comment 209 193 if (value.Equals(t)) return true;
Add comment 210 194 }
Add comment 211 195
Add comment 220 204 /// Checks if a given <see cref="PopupActivationMode"/> is a match for
Add comment 221 205 /// an effectively pressed mouse button.
Add comment 222 206 /// </summary>
Add comment 223 Minus   public static bool IsMatch(this MouseEvent me, PopupActivationMode activationMode)
Add comment 224 Minus   {
Add comment 225 Minus   switch (activationMode)
Add comment 226 Minus   {
Add comment 207 Plus   public static bool IsMatch(this MouseEvent me, PopupActivationMode activationMode) {
Add comment 208 Plus   switch (activationMode) {
Add comment 227 209 case PopupActivationMode.LeftClick:
Add comment 228 210 return me == MouseEvent.IconLeftMouseUp;
Add comment 229 211 case PopupActivationMode.RightClick:
Add comment 256 238 /// <param name="commandParameter">An optional parameter that is associated with
Add comment 257 239 /// the command.</param>
Add comment 258 240 /// <param name="target">The target element on which to raise the command.</param>
Add comment 259 Minus   public static void ExecuteIfEnabled(this ICommand command, object commandParameter, IInputElement target)
Add comment 260 Minus   {
Add comment 241 Plus   public static void ExecuteIfEnabled(this ICommand command, object commandParameter, IInputElement target) {
Add comment 261 242 if (command == null) return;
Add comment 262 243
Add comment 263 244 RoutedCommand rc = command as RoutedCommand;
Add comment 264 Minus   if (rc != null)
Add comment 265 Minus   {
Add comment 245 Plus   if (rc != null) {
Add comment 266 246 //routed commands work on a target
Add comment 267 247 if (rc.CanExecute(commandParameter, target)) rc.Execute(commandParameter, target);
Add comment 268 248 }
Add comment 269 Minus   else if (command.CanExecute(commandParameter))
Add comment 270 Minus   {
Add comment 249 Plus   else if (command.CanExecute(commandParameter)) {
Add comment 271 250 command.Execute(commandParameter);
Add comment 272 251 }
Add comment 273 252 }
Add comment 278 257 /// Returns a dispatcher for multi-threaded scenarios
Add comment 279 258 /// </summary>
Add comment 280 259 /// <returns></returns>
Add comment 281 Minus   internal static Dispatcher GetDispatcher(this DispatcherObject source)
Add comment 282 Minus   {
Add comment 260 Plus   internal static Dispatcher GetDispatcher(this DispatcherObject source) {
Add comment 283 261 //use the application's dispatcher by default
Add comment 284 262 if (Application.Current != null) return Application.Current.Dispatcher;
Add comment 285 263
Add comment 300 278 /// binding expression.</returns>
Add comment 301 279 /// <exception cref="ArgumentNullException">If <paramref name="element"/>
Add comment 302 280 /// is a null reference.</exception>
Add comment 303 Minus   public static bool IsDataContextDataBound(this FrameworkElement element)
Add comment 304 Minus   {
Add comment 281 Plus   public static bool IsDataContextDataBound(this FrameworkElement element) {
Add comment 305 282 if (element == null) throw new ArgumentNullException("element");
Add comment 306 283 return element.GetBindingExpression(FrameworkElement.DataContextProperty) != null;
Add comment 307 284 }
Axis.cs
/Progress/Common/Axis.cs-48+24
/Progress/Common/Axis.cs
Add comment 10 using System.Windows.Media;
Add comment 11 using System.Windows.Shapes;
Add comment 12
Add comment 13 Minus  namespace RateBar
Add comment 14 Minus  {
Add comment 13 Plus  namespace RateBar {
Add comment 15 14 /// <summary>
Add comment 16 15 /// Axis Control
Add comment 17 16 /// </summary>
Add comment 18 Minus   public class Axis : ContentControl
Add comment 19 Minus   {
Add comment 17 Plus   public class Axis : ContentControl {
Add comment 20 18 #region Locals
Add comment 21 19
Add comment 22 20 private Canvas canvas;
Add comment 34 32 /// <summary>
Add comment 35 33 /// Initializes a new instance of the <see cref="Axis"/> class.
Add comment 36 34 /// </summary>
Add comment 37 Minus   public Axis()
Add comment 38 Minus   {
Add comment 35 Plus   public Axis() {
Add comment 39 36 #region Initialize Defaults
Add comment 40 37
Add comment 41 38 this.IsHitTestVisible = false;
Add comment 65 62 /// <value>
Add comment 66 63 /// <c>true</c> if the horizontal grid is visible; otherwise, <c>false</c>.
Add comment 67 64 /// </value>
Add comment 68 Minus   public bool HorizontalGridVisible
Add comment 69 Minus   {
Add comment 65 Plus   public bool HorizontalGridVisible {
Add comment 70 66 get { return this.horizontalGridVisible; }
Add comment 71 67 set { this.horizontalGridVisible = value; }
Add comment 72 68 }
Add comment 77 73 /// <value>
Add comment 78 74 /// The horizontal grid line count.
Add comment 79 75 /// </value>
Add comment 80 Minus   public int HorizontalGridLineCount
Add comment 81 Minus   {
Add comment 76 Plus   public int HorizontalGridLineCount {
Add comment 82 77 get { return this.horizontalGridLineCount; }
Add comment 83 Minus   set
Add comment 84 Minus   {
Add comment 78 Plus   set {
Add comment 85 79 if (value < 0)
Add comment 86 80 throw new ArgumentOutOfRangeException("The HorizontalGridLineCount must be at least 1");
Add comment 87 81
Add comment 95 89 /// <value>
Add comment 96 90 /// The vertical grid line count.
Add comment 97 91 /// </value>
Add comment 98 Minus   public int VerticalGridLineCount
Add comment 99 Minus   {
Add comment 92 Plus   public int VerticalGridLineCount {
Add comment 100 93 get { return this.verticalGridLineCount; }
Add comment 101 Minus   set
Add comment 102 Minus   {
Add comment 94 Plus   set {
Add comment 103 95 if (value < 0)
Add comment 104 96 throw new ArgumentOutOfRangeException("The VerticalGridLineCount must be at least 1");
Add comment 105 97
Add comment 113 105 /// <value>
Add comment 114 106 /// <c>true</c> if the vertical grid is visible; otherwise, <c>false</c>.
Add comment 115 107 /// </value>
Add comment 116 Minus   public bool VerticalGridVisible
Add comment 117 Minus   {
Add comment 108 Plus   public bool VerticalGridVisible {
Add comment 118 109 get { return this.verticalGridVisible; }
Add comment 119 Minus   set
Add comment 120 Minus   {
Add comment 110 Plus   set {
Add comment 121 111 this.verticalGridVisible = value;
Add comment 122 112 }
Add comment 123 113 }
Add comment 128 118 /// <value>
Add comment 129 119 /// The brush.
Add comment 130 120 /// </value>
Add comment 131 Minus   public Brush Brush
Add comment 132 Minus   {
Add comment 121 Plus   public Brush Brush {
Add comment 133 122 get { return this.brush; }
Add comment 134 Minus   set
Add comment 135 Minus   {
Add comment 123 Plus   set {
Add comment 136 124 this.brush = value;
Add comment 137 125 }
Add comment 138 126 }
Add comment 143 131 /// <value>
Add comment 144 132 /// The thickness.
Add comment 145 133 /// </value>
Add comment 146 Minus   public Double Thickness
Add comment 147 Minus   {
Add comment 134 Plus   public Double Thickness {
Add comment 148 135 get { return this.thickness; }
Add comment 149 Minus   set
Add comment 150 Minus   {
Add comment 136 Plus   set {
Add comment 151 137 this.thickness = value;
Add comment 152 138 }
Add comment 153 139 }
Add comment 157 143 /// <summary>
Add comment 158 144 /// Update the Rendering of the Control when the render size changes
Add comment 159 145 /// </summary>
Add comment 160 Minus   protected override void OnRenderSizeChanged(SizeChangedInfo sizeInfo)
Add comment 161 Minus   {
Add comment 146 Plus   protected override void OnRenderSizeChanged(SizeChangedInfo sizeInfo) {
Add comment 162 147 base.OnRenderSizeChanged(sizeInfo);
Add comment 163 148 this.UpdateUI();
Add comment 164 149 }
Add comment 166 151 /// <summary>
Add comment 167 152 /// Render the control
Add comment 168 153 /// </summary>
Add comment 169 Minus   private void UpdateUI()
Add comment 170 Minus   {
Add comment 154 Plus   private void UpdateUI() {
Add comment 171 155 if (Double.IsNaN(this.Height) || Double.IsNaN(this.Width))
Add comment 172 156 return;
Add comment 173 157
Add comment 180 164 /// <summary>
Add comment 181 165 /// Render the Horizontal Grid
Add comment 182 166 /// </summary>
Add comment 183 Minus   protected virtual void RenderHorizontalGrid()
Add comment 184 Minus   {
Add comment 167 Plus   protected virtual void RenderHorizontalGrid() {
Add comment 185 168 // We aren't displaying the horizontal grid
Add comment 186 169 if (this.HorizontalGridVisible == false)
Add comment 187 170 return;
Add comment 190 173 Double relativeHeight = this.RenderSize.Height / (double)this.HorizontalGridLineCount;
Add comment 191 174
Add comment 192 175 // Render each line
Add comment 193 Minus   for (int i = 0; i <= this.HorizontalGridLineCount; i++)
Add comment 194 Minus   {
Add comment 195 Minus   Line line = new Line()
Add comment 196 Minus   {
Add comment 176 Plus   for (int i = 0; i <= this.HorizontalGridLineCount; i++) {
Add comment 177 Plus   Line line = new Line() {
Add comment 197 178 X1 = 0,
Add comment 198 179 X2 = this.Width,
Add comment 199 180 Y1 = (double)i * relativeHeight,
Add comment 208 189 /// <summary>
Add comment 209 190 /// Render the Vertical Grid
Add comment 210 191 /// </summary>
Add comment 211 Minus   protected virtual void RenderVerticalGrid()
Add comment 212 Minus   {
Add comment 192 Plus   protected virtual void RenderVerticalGrid() {
Add comment 213 193 // We aren't displaying the horizontal grid
Add comment 214 194 if (this.VerticalGridVisible == false)
Add comment 215 195 return;
Add comment 218 198 Double relativeWidth = this.RenderSize.Width / (double)this.VerticalGridLineCount;
Add comment 219 199
Add comment 220 200 // Render each line
Add comment 221 Minus   for (int i = 0; i <= this.VerticalGridLineCount; i++)
Add comment 222 Minus   {
Add comment 223 Minus   Line line = new Line()
Add comment 224 Minus   {
Add comment 201 Plus   for (int i = 0; i <= this.VerticalGridLineCount; i++) {
Add comment 202 Plus   Line line = new Line() {
Add comment 225 203 X1 = (double)i * relativeWidth,
Add comment 226 204 X2 = (double)i * relativeWidth,
Add comment 227 205 Y1 = 0,
Add comment 241 219 public event PropertyChangedEventHandler PropertyChanged;
Add comment 242 220
Add comment 243 221 /// <inheritdoc />
Add comment 244 Minus   public void FirePropertyChangedEvent(object sender, PropertyChangedEventArgs e)
Add comment 245 Minus   {
Add comment 222 Plus   public void FirePropertyChangedEvent(object sender, PropertyChangedEventArgs e) {
Add comment 246 223 PropertyChangedEventHandler handler = this.PropertyChanged;
Add comment 247 Minus   if (handler != null)
Add comment 248 Minus   {
Add comment 224 Plus   if (handler != null) {
Add comment 249 225 handler(sender, e);
Add comment 250 226 }
Add comment 251 227 }
Constants.cs
/Shell/Interop/Constants.cs
/Shell/Interop/Constants.cs
Extensions.cs
/Shell/Extensions.cs
/Shell/Extensions.cs
Reflector.cs
/Shell/Reflector.cs
/Shell/Reflector.cs
ShellViewEx.cs
/Shell/ShellViewEx.cs
/Shell/ShellViewEx.cs
TabControl.cs
/TabControl/TabControl.cs
/TabControl/TabControl.cs
TabItem.cs
/TabControl/TabItem.cs
/TabControl/TabItem.cs
BetterExplorerControls.csproj
/WpfControlLibrary1/BetterExplorerControls.csproj
/WpfControlLibrary1/BetterExplorerControls.csproj