Added ExplorerBrowser implementation (not currently visible or functional)

pull/30/head
David Hall 2019-01-11 18:07:23 -07:00
parent 2da25331d2
commit 15e758c9ee
6 changed files with 1617 additions and 4 deletions

View File

@ -0,0 +1,29 @@
using NUnit.Framework;
using System.Windows.Forms;
namespace Vanara.Windows.Forms.Tests
{
[TestFixture()]
public class ExplorerBrowserTests
{
[OneTimeSetUp]
public void SetupFixture() => Application.EnableVisualStyles();
[Test()]
public void ExplorerBrowserTest()
{
var frm = MakeTestForm(out var eb);
eb.ContentFlags = ExplorerBrowserContentSectionOptions.NoSubfolders | ExplorerBrowserContentSectionOptions.NoWebView | ExplorerBrowserContentSectionOptions.HideFileNames
| ExplorerBrowserContentSectionOptions.NoColumnHeader | ExplorerBrowserContentSectionOptions.UseSearchFolder;
eb.ViewMode = ExplorerBrowserViewMode.Icon;
frm.ShowDialog();
}
private static Form MakeTestForm(out ExplorerBrowser eb)
{
var frm = new Form { Size = new System.Drawing.Size(300, 300) };
frm.Controls.Add(eb = new ExplorerBrowser { Name = "eb", Dock = DockStyle.Fill });
return frm;
}
}
}

View File

@ -43,6 +43,7 @@
</Reference>
<Reference Include="System" />
<Reference Include="System.ComponentModel.Composition" />
<Reference Include="System.Data" />
<Reference Include="System.DirectoryServices" />
<Reference Include="System.Drawing" />
<Reference Include="System.IO.Compression.FileSystem" />
@ -134,6 +135,7 @@
<Compile Include="UI\Dialogs\AccessControlEditorTests.cs" />
<Compile Include="UI\Dialogs\TaskDialogTests.cs" />
<Compile Include="UI\Dialogs\NetworkConnectionDialogTests.cs" />
<Compile Include="UI\ExplorerBrowserTests.cs" />
<Compile Include="UI\VisualThemeTests.cs" />
<Compile Include="UI\Extensions\ImageListTests.cs" />
<Compile Include="UI\Dialogs\CredentialsDialogTests.cs" />
@ -264,7 +266,6 @@
<Name>Vanara.Windows.Shell</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>

Binary file not shown.

After

Width:  |  Height:  |  Size: 822 B

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,30 @@
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing.Design;
using System.Windows.Forms.Design;
namespace Vanara.Windows.Forms.Design
{
[global::System.Security.Permissions.PermissionSet(global::System.Security.Permissions.SecurityAction.Demand, Name = "FullTrust")]
[EditorBrowsable(EditorBrowsableState.Never)]
internal class ExplorerBrowserDesigner : AttributedControlDesigner<ExplorerBrowser>, IToolboxUser
{
public ExplorerBrowserDesigner() { }
public override SelectionRules SelectionRules => (SelectionRules.Visible | SelectionRules.AllSizeable | SelectionRules.Moveable);
protected override IEnumerable<string> PropertiesToRemove { get; } = new string[] { "AutoEllipsis", "BackColor",
"BackgroundImage", "BackgroundImageLayout", "CausesValidation", "ContextMenuStrip", "Cursor", "Font",
"ForeColor", "IMEMode", "Padding", "Text" };
public override void Initialize(IComponent component)
{
base.Initialize(component);
AutoResizeHandles = true;
}
bool IToolboxUser.GetToolSupported(ToolboxItem tool) => true;
void IToolboxUser.ToolPicked(ToolboxItem tool) { }
}
}

View File

@ -43,6 +43,12 @@ BitmapProperty, BoolProperty, CloakingSource, CollapsiblePanelBorderCondition, C
<ItemGroup>
<Compile Remove="_InProgress_\**\*" />
</ItemGroup>
<ItemGroup>
<Compile Remove="Controls\ExplorerBrowser.cs" />
</ItemGroup>
<ItemGroup>
<None Remove="Controls\ExplorerBrowser.bmp" />
</ItemGroup>
<ItemGroup>
<Reference Include="System.Design" />
<Reference Include="System.Drawing" />
@ -51,8 +57,12 @@ BitmapProperty, BoolProperty, CloakingSource, CollapsiblePanelBorderCondition, C
<Reference Include="System" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Controls\ExplorerBrowser.bmp" />
<EmbeddedResource Include="Extenders\GlassExtenderProvider.bmp" />
</ItemGroup>
<ItemGroup>
<None Include="Controls\ExplorerBrowser.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Core\Vanara.Core.csproj" />
<ProjectReference Include="..\PInvoke\AclUI\Vanara.PInvoke.AclUI.csproj" />
@ -66,6 +76,7 @@ BitmapProperty, BoolProperty, CloakingSource, CollapsiblePanelBorderCondition, C
<ProjectReference Include="..\PInvoke\User32\Vanara.PInvoke.User32.csproj" />
<ProjectReference Include="..\PInvoke\UxTheme\Vanara.PInvoke.UxTheme.csproj" />
<ProjectReference Include="..\Security\Vanara.Security.csproj" />
<ProjectReference Include="..\Windows.Shell\Vanara.Windows.Shell.csproj" />
</ItemGroup>
<ItemGroup>
<Compile Update="Controls\CollapsiblePanel.cs">
@ -98,9 +109,6 @@ BitmapProperty, BoolProperty, CloakingSource, CollapsiblePanelBorderCondition, C
<Compile Update="Controls\IPAddressBox.cs">
<SubType>Component</SubType>
</Compile>
<Compile Update="Controls\IPAddressBox.Designer.cs">
<SubType>Component</SubType>
</Compile>
<Compile Update="Controls\SplitButton.cs">
<SubType>Component</SubType>
</Compile>