Skip to content

Commit b12c6bd

Browse files
committed
[Updated] Lots of improvments!!!
1 parent 24f2bc8 commit b12c6bd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+1549
-509
lines changed

.editorconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# IDE1006: Naming Styles
44
dotnet_diagnostic.IDE1006.severity = none
55
dotnet_diagnostic.SA1121.severity = none
6+
dotnet_diagnostic.CA1416.severity = none
67

78
[*.cs]
89
#### Naming styles ####
@@ -67,6 +68,7 @@ csharp_style_expression_bodied_indexers = true:silent
6768
csharp_style_expression_bodied_accessors = true:silent
6869
csharp_style_expression_bodied_lambdas = true:silent
6970
csharp_style_expression_bodied_local_functions = false:silent
71+
csharp_prefer_system_threading_lock = true:suggestion
7072

7173
[*.{cs,vb}]
7274
#### Naming styles ####

BEHelper/BEHelper.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<Import Project="..\packages\EntityFramework.6.4.4\build\EntityFramework.props" Condition="Exists('..\packages\EntityFramework.6.4.4\build\EntityFramework.props')" />
33
<PropertyGroup>
4-
<TargetFramework>net6.0-windows</TargetFramework>
4+
<TargetFramework>net9.0-windows7.0</TargetFramework>
55
<OutputType>Library</OutputType>
66
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
77
<UseWindowsForms>true</UseWindowsForms>

BEHelper/TransPicBox.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@
22
using System.Drawing;
33
using System.Drawing.Drawing2D;
44
using System.Windows.Forms;
5+
using System.ComponentModel;
56

67
namespace BEHelper {
78

89
public class TransPicBox : Control {
9-
public Bitmap Image { get; set; }
10+
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
11+
public Bitmap Image { get; set; }
1012

1113
#region Constructors
1214

BExplorer.sln

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1380,7 +1380,6 @@ Global
13801380
{A563DBE3-9C87-474D-9FA8-D7483E5FA8E7}.Debug|Any CPU.ActiveCfg = ExeBuild
13811381
{A563DBE3-9C87-474D-9FA8-D7483E5FA8E7}.Debug|Any CPU.Build.0 = ExeBuild
13821382
{A563DBE3-9C87-474D-9FA8-D7483E5FA8E7}.Debug|Mixed Platforms.ActiveCfg = ExeBuild
1383-
{A563DBE3-9C87-474D-9FA8-D7483E5FA8E7}.Debug|Mixed Platforms.Build.0 = ExeBuild
13841383
{A563DBE3-9C87-474D-9FA8-D7483E5FA8E7}.Debug|Win32.ActiveCfg = ExeBuild
13851384
{A563DBE3-9C87-474D-9FA8-D7483E5FA8E7}.Debug|Win32.Build.0 = ExeBuild
13861385
{A563DBE3-9C87-474D-9FA8-D7483E5FA8E7}.Debug|x64.ActiveCfg = ExeBuild
@@ -1592,8 +1591,8 @@ Global
15921591
HideSolutionNode = FALSE
15931592
EndGlobalSection
15941593
GlobalSection(ExtensibilityGlobals) = postSolution
1595-
VisualSVNWorkingCopyRoot = .
15961594
SolutionGuid = {4801FBB8-3BD6-441D-B354-3299AD2610E5}
1595+
VisualSVNWorkingCopyRoot = .
15971596
EndGlobalSection
15981597
GlobalSection(NDepend) = preSolution
15991598
Project = ".\BFExplorer.ndproj"

BExplorer/BetterExplorer/App.xaml.cs

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -137,12 +137,14 @@ protected override void OnSessionEnding(SessionEndingCancelEventArgs e) {
137137
base.OnSessionEnding(e);
138138
}
139139

140+
void OnPreviewMouseDown(Object sender, MouseButtonEventArgs e) {
141+
142+
}
140143
/// <summary>
141144
/// On app start
142145
/// </summary>
143146
/// <param name="e">Startup EventArgs</param>
144147
protected override void OnStartup(StartupEventArgs e) {
145-
146148
var dllPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
147149
if (IntPtr.Size == 8) {
148150
dllPath = Path.Combine(dllPath, "X64");
@@ -156,19 +158,19 @@ protected override void OnStartup(StartupEventArgs e) {
156158
var updaterThread = new Thread(new ThreadStart(this.RunAutomaticUpdateChecker));
157159
updaterThread.Start();
158160

159-
ToastNotificationManagerCompat.OnActivated += toastArgs => {
160-
// Obtain the arguments from the notification
161-
ToastArguments args = ToastArguments.Parse(toastArgs.Argument);
161+
//ToastNotificationManagerCompat.OnActivated += toastArgs => {
162+
// // Obtain the arguments from the notification
163+
// ToastArguments args = ToastArguments.Parse(toastArgs.Argument);
162164

163-
// Obtain any user input (text boxes, menu selections) from the notification
164-
var userInput = toastArgs.UserInput;
165+
// // Obtain any user input (text boxes, menu selections) from the notification
166+
// var userInput = toastArgs.UserInput;
165167

166-
// Need to dispatch to UI thread if performing UI operations
167-
Application.Current.Dispatcher.Invoke(delegate {
168-
// TODO: Show the corresponding content
169-
MessageBox.Show("Toast activated. Args: " + toastArgs.Argument);
170-
});
171-
};
168+
// // Need to dispatch to UI thread if performing UI operations
169+
// Application.Current.Dispatcher.Invoke(delegate {
170+
// // TODO: Show the corresponding content
171+
// MessageBox.Show("Toast activated. Args: " + toastArgs.Argument);
172+
// });
173+
//};
172174

173175
Settings.BESettings.LoadSettings();
174176

BExplorer/BetterExplorer/BetterExplorer.csproj

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<SuppressPseudoWarning Condition="'$(Configuration)' == 'Debug'">true</SuppressPseudoWarning>
88
</PropertyGroup>
99
<PropertyGroup>
10-
<TargetFramework>net6.0-windows10.0.22000.0</TargetFramework>
10+
<TargetFramework>net9.0-windows10.0.22000.0</TargetFramework>
1111
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
1212
<OutputType>WinExe</OutputType>
1313
<SccProjectName></SccProjectName>
@@ -149,7 +149,6 @@
149149
<ProjectReference Include="..\..\ShellLibrary\ShellLibrary.csproj" />
150150
<ProjectReference Include="..\..\TabControl\Wpf.TabControl.csproj" />
151151
<ProjectReference Include="..\..\TaskDialog\TaskDialog.csproj" />
152-
<ProjectReference Include="..\..\UsbEject\UsbEject.csproj" />
153152
<ProjectReference Include="..\..\WpfControlLibrary1\BetterExplorerControls.csproj" />
154153
<ProjectReference Include="..\..\WpfDocumentPreviewer\WpfDocumentPreviewer.csproj" />
155154
<ProjectReference Include="..\..\WPFUI\WPFUI.csproj" />

BExplorer/BetterExplorer/MainWindow.xaml.cs

Lines changed: 70 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
namespace BetterExplorer {
1616
using BEHelper;
17-
using BetterExplorer.UsbEject;
17+
//using BetterExplorer.UsbEject;
1818
using BetterExplorerControls;
1919
using BExplorer.Shell;
2020
using BExplorer.Shell._Plugin_Interfaces;
@@ -934,75 +934,75 @@ private void btnCloseTray_Click(object sender, RoutedEventArgs e) {
934934
}
935935

936936
private void EjectDisk(char DriveLetter) {
937-
Thread t = new Thread(() => {
938-
Thread.Sleep(10);
939-
var vdc = new VolumeDeviceClass();
940-
foreach (Volume item in vdc.Devices) {
941-
if (this.GetDriveLetterFromDrivePath(item.LogicalDrive) == DriveLetter) {
942-
var veto = item.Eject(false);
943-
if (veto != Native.PNP_VETO_TYPE.TypeUnknown) {
944-
if (veto == Native.PNP_VETO_TYPE.Ok) {
945-
this.Dispatcher.BeginInvoke(DispatcherPriority.Normal,
946-
(Action)(() => {
947-
//this.beNotifyIcon.ShowBalloonTip("Information", $"It is safe to remove {item.LogicalDrive}", Hardcodet.Wpf.TaskbarNotification.BalloonIcon.Info);
948-
var tabsForRemove = this.tcMain.Items.OfType<Wpf.Controls.TabItem>().Where(w => {
949-
var root = String.Empty;
950-
try {
951-
root = Path.GetPathRoot(w.ShellObject.ParsingName.ToShellParsingName());
952-
} catch { }
953-
return !String.IsNullOrEmpty(root) && (w.ShellObject.IsFileSystem &&
954-
root.ToLowerInvariant() == $"{DriveLetter}:\\".ToLowerInvariant());
955-
}).ToArray();
956-
957-
foreach (Wpf.Controls.TabItem tab in tabsForRemove) {
958-
this.tcMain.RemoveTabItem(tab);
959-
}
960-
}));
961-
} else {
962-
var message = String.Empty;
963-
var obj = new ShellItem(item.LogicalDrive);
964-
switch (veto) {
965-
case Native.PNP_VETO_TYPE.Ok:
966-
break;
967-
case Native.PNP_VETO_TYPE.TypeUnknown:
968-
break;
969-
case Native.PNP_VETO_TYPE.LegacyDevice:
970-
break;
971-
case Native.PNP_VETO_TYPE.PendingClose:
972-
break;
973-
case Native.PNP_VETO_TYPE.WindowsApp:
974-
break;
975-
case Native.PNP_VETO_TYPE.WindowsService:
976-
break;
977-
case Native.PNP_VETO_TYPE.OutstandingOpen:
978-
message = $"The device {obj.GetDisplayName(SIGDN.NORMALDISPLAY)} can not be disconnected because is in use!";
979-
break;
980-
case Native.PNP_VETO_TYPE.Device:
981-
break;
982-
case Native.PNP_VETO_TYPE.Driver:
983-
break;
984-
case Native.PNP_VETO_TYPE.IllegalDeviceRequest:
985-
break;
986-
case Native.PNP_VETO_TYPE.InsufficientPower:
987-
break;
988-
case Native.PNP_VETO_TYPE.NonDisableable:
989-
message = $"The device {obj.GetDisplayName(SIGDN.NORMALDISPLAY)} does not support disconnecting!";
990-
break;
991-
case Native.PNP_VETO_TYPE.LegacyDriver:
992-
break;
993-
default:
994-
break;
995-
}
996-
997-
//this.Dispatcher.BeginInvoke(DispatcherPriority.Normal, (Action)(() => this.beNotifyIcon.ShowBalloonTip("Error", message, Hardcodet.Wpf.TaskbarNotification.BalloonIcon.Error)));
998-
}
999-
}
1000-
break;
1001-
}
1002-
}
1003-
});
1004-
t.SetApartmentState(ApartmentState.STA);
1005-
t.Start();
937+
//Thread t = new Thread(() => {
938+
// Thread.Sleep(10);
939+
// var vdc = new VolumeDeviceClass();
940+
// foreach (Volume item in vdc.Devices) {
941+
// if (this.GetDriveLetterFromDrivePath(item.LogicalDrive) == DriveLetter) {
942+
// var veto = item.Eject(false);
943+
// if (veto != Native.PNP_VETO_TYPE.TypeUnknown) {
944+
// if (veto == Native.PNP_VETO_TYPE.Ok) {
945+
// this.Dispatcher.BeginInvoke(DispatcherPriority.Normal,
946+
// (Action)(() => {
947+
// //this.beNotifyIcon.ShowBalloonTip("Information", $"It is safe to remove {item.LogicalDrive}", Hardcodet.Wpf.TaskbarNotification.BalloonIcon.Info);
948+
// var tabsForRemove = this.tcMain.Items.OfType<Wpf.Controls.TabItem>().Where(w => {
949+
// var root = String.Empty;
950+
// try {
951+
// root = Path.GetPathRoot(w.ShellObject.ParsingName.ToShellParsingName());
952+
// } catch { }
953+
// return !String.IsNullOrEmpty(root) && (w.ShellObject.IsFileSystem &&
954+
// root.ToLowerInvariant() == $"{DriveLetter}:\\".ToLowerInvariant());
955+
// }).ToArray();
956+
957+
// foreach (Wpf.Controls.TabItem tab in tabsForRemove) {
958+
// this.tcMain.RemoveTabItem(tab);
959+
// }
960+
// }));
961+
// } else {
962+
// var message = String.Empty;
963+
// var obj = new ShellItem(item.LogicalDrive);
964+
// switch (veto) {
965+
// case Native.PNP_VETO_TYPE.Ok:
966+
// break;
967+
// case Native.PNP_VETO_TYPE.TypeUnknown:
968+
// break;
969+
// case Native.PNP_VETO_TYPE.LegacyDevice:
970+
// break;
971+
// case Native.PNP_VETO_TYPE.PendingClose:
972+
// break;
973+
// case Native.PNP_VETO_TYPE.WindowsApp:
974+
// break;
975+
// case Native.PNP_VETO_TYPE.WindowsService:
976+
// break;
977+
// case Native.PNP_VETO_TYPE.OutstandingOpen:
978+
// message = $"The device {obj.GetDisplayName(SIGDN.NORMALDISPLAY)} can not be disconnected because is in use!";
979+
// break;
980+
// case Native.PNP_VETO_TYPE.Device:
981+
// break;
982+
// case Native.PNP_VETO_TYPE.Driver:
983+
// break;
984+
// case Native.PNP_VETO_TYPE.IllegalDeviceRequest:
985+
// break;
986+
// case Native.PNP_VETO_TYPE.InsufficientPower:
987+
// break;
988+
// case Native.PNP_VETO_TYPE.NonDisableable:
989+
// message = $"The device {obj.GetDisplayName(SIGDN.NORMALDISPLAY)} does not support disconnecting!";
990+
// break;
991+
// case Native.PNP_VETO_TYPE.LegacyDriver:
992+
// break;
993+
// default:
994+
// break;
995+
// }
996+
997+
// //this.Dispatcher.BeginInvoke(DispatcherPriority.Normal, (Action)(() => this.beNotifyIcon.ShowBalloonTip("Error", message, Hardcodet.Wpf.TaskbarNotification.BalloonIcon.Error)));
998+
// }
999+
// }
1000+
// break;
1001+
// }
1002+
// }
1003+
//});
1004+
//t.SetApartmentState(ApartmentState.STA);
1005+
//t.Start();
10061006
}
10071007

10081008
private void btnEjectDevice_Click(object sender, RoutedEventArgs e) {

BreadcrumbBar/Odyssey.Controls.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<Import Project="..\packages\EntityFramework.6.4.4\build\EntityFramework.props" Condition="Exists('..\packages\EntityFramework.6.4.4\build\EntityFramework.props')" />
33
<PropertyGroup>
4-
<TargetFramework>net6.0-windows10.0.22000.0</TargetFramework>
4+
<TargetFramework>net9.0-windows10.0.22000.0</TargetFramework>
55
<OutputType>Library</OutputType>
66
<AssemblyName>Odyssey</AssemblyName>
77
<SccProjectName>

BreadcrumbBar/Themes/Generic.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@
422422
TargetType="ContextMenu">
423423
<mwt:SystemDropShadowChrome
424424
Name="Shdw"
425-
MaxHeight="400"
425+
MaxHeight="410"
426426
SnapsToDevicePixels="True"
427427
Color="#00FFFFFF">
428428
<Border

ConsoleControl/ConsoleControl.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ public partial class ConsoleControl : UserControl {
3838

3939
private bool _IsCodepageSet = false;
4040

41+
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
4142
public ShellView ShellListView { get; set; }
4243

4344
/// <summary>
@@ -78,8 +79,10 @@ protected override CreateParams CreateParams {
7879
/// <summary> Gets or sets a value indicating whether to show diagnostics. </summary>
7980
/// <value> <c>true</c> if show diagnostics; otherwise, <c>false</c>. </value>
8081
[Category("Console Control"), Description("Show diagnostic information, such as exceptions.")]
82+
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
8183
public bool ShowDiagnostics { get; set; }
8284

85+
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
8386
public String LastLinePath { get; set; }
8487

8588

0 commit comments

Comments
 (0)