pull/1/head
dl2alf 2019-03-19 22:09:03 +01:00
rodzic 9b4effb8ea
commit 9a020ccaef
1934 zmienionych plików z 413100 dodań i 0 usunięć

Wyświetl plik

@ -0,0 +1,258 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{199C12C4-3EEF-4D08-BAC3-F2A62BCF969C}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>AeroWizard</RootNamespace>
<AssemblyName>AeroWizard</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<StartupObject>
</StartupObject>
<SccProjectName>
</SccProjectName>
<SccLocalPath>
</SccLocalPath>
<SccAuxPath>
</SccAuxPath>
<SccProvider>
</SccProvider>
<FileUpgradeFlags>
</FileUpgradeFlags>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
<OldToolsVersion>3.5</OldToolsVersion>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
<TargetFrameworkProfile>
</TargetFrameworkProfile>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<DefineConstants>
</DefineConstants>
<OutputPath>bin\Debug\</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<PlatformTarget>AnyCPU</PlatformTarget>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<DefineConstants>TRACE;</DefineConstants>
<OutputPath>bin\$(Configuration)\$(TargetFrameworkVersion)</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>bin\Release\$(TargetFrameworkVersion)\AeroWizard.XML</DocumentationFile>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup>
<!-- Adding a custom constant will auto-magically append a comma and space to the pre-built constants. -->
<!-- Move the comma delimiter to the end of each constant and remove the trailing comma when we're done. -->
<DefineConstants Condition=" !$(DefineConstants.Contains(', NET')) ">$(DefineConstants)$(TargetFrameworkVersion.Replace("v", "NET").Replace(".", "")), </DefineConstants>
<DefineConstants Condition=" $(DefineConstants.Contains(', NET')) ">$(DefineConstants.Remove($(DefineConstants.LastIndexOf(", NET"))))$(TargetFrameworkVersion.Replace("v", "NET").Replace(".", "")), </DefineConstants>
<!-- <DefineConstants Condition=" $(TargetFrameworkVersion.Replace('v', '')) &gt;= 2.0 ">$(DefineConstants)NET_20_OR_GREATER, </DefineConstants>
<DefineConstants Condition=" $(TargetFrameworkVersion.Replace('v', '')) &gt;= 3.5 ">$(DefineConstants)NET_35_OR_GREATER, </DefineConstants>
<DefineConstants Condition=" $(TargetFrameworkVersion.Replace('v', '')) &gt;= 4.0 ">$(DefineConstants)NET_40_OR_GREATER</DefineConstants> -->
<DefineConstants Condition=" $(DefineConstants.EndsWith(', ')) ">$(DefineConstants.Remove($(DefineConstants.LastIndexOf(", "))))</DefineConstants>
</PropertyGroup>
<PropertyGroup>
<SignAssembly>false</SignAssembly>
</PropertyGroup>
<PropertyGroup>
<AssemblyOriginatorKeyFile>
</AssemblyOriginatorKeyFile>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>Resources\WizardHat.ico</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\..\packages\Newtonsoft.Json.12.0.1\lib\net40\Newtonsoft.Json.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data.SQLite, Version=1.0.110.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL">
<HintPath>..\..\packages\System.Data.SQLite.Core.1.0.110.0\lib\net40\System.Data.SQLite.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Design" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
</ItemGroup>
<ItemGroup>
<Compile Include="ExtensionAttributeFor.NET_2.0.cs" Condition=" $(TargetFrameworkVersion.Replace('v', '')) &lt; 3.5 " />
<Compile Include="GenericDesigner.cs" />
<Compile Include="GlassExtenderProvider.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="GlobalSuppressions.cs" />
<Compile Include="Native\ButtonExtension.cs" />
<Compile Include="Native\InteropUtil.cs" />
<Compile Include="Native\LOGFONT.cs" />
<Compile Include="Native\SafeDCHandles.cs" />
<Compile Include="Native\SafeHGlobalHandle.cs" />
<Compile Include="Native\SHELL32.cs" />
<Compile Include="Native\ShObjIdl.cs" />
<Compile Include="Native\SIZE.cs" />
<Compile Include="Native\TaskbarList.cs" />
<Compile Include="Native\BITMAPINFO.cs" />
<Compile Include="Native\DesktopWindowManager.cs" />
<Compile Include="Native\DWMAPI.cs" />
<Compile Include="Native\GDI32.cs" />
<Compile Include="Native\RECT.cs" />
<Compile Include="Native\USER32.cs" />
<Compile Include="Native\UXTHEME.cs" />
<Compile Include="Native\UXTHEME_GDI.cs" />
<Compile Include="Native\VisualStylesRendererExtension.cs" />
<Compile Include="Native\VisualStylesRendererExtensionGDI.cs" />
<Compile Include="Native\WIN32_FIND_DATA.cs" />
<Compile Include="StepList.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="StepWizardControl.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="VisualStyleElementEx.cs" />
<Compile Include="ControlExtension.cs" />
<Compile Include="ThemedImageButton.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="EventedList.cs" />
<Compile Include="ThemedTableLayoutPanel.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="WizardPageContainer.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="WizardPageContainerDesigner.cs" />
<Compile Include="WizardPageCollection.cs" />
<Compile Include="WizardPageDesigner.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime>
</Compile>
<Compile Include="ThemedLabel.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="WizardControl.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="WizardControl.designer.cs">
<DependentUpon>WizardControl.cs</DependentUpon>
</Compile>
<Compile Include="WizardControlDesigner.cs" />
<Compile Include="WizardPage.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="WizardPage.designer.cs">
<DependentUpon>WizardPage.cs</DependentUpon>
</Compile>
<EmbeddedResource Include="StepWizardControl.resx">
<DependentUpon>StepWizardControl.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="WizardControl.bmp" />
<EmbeddedResource Include="WizardControl.resx">
<DependentUpon>WizardControl.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="GlassExtenderProvider.bmp" />
<EmbeddedResource Include="StepWizardControl.bmp" />
<EmbeddedResource Include="ThemedImageButton.bmp" />
<EmbeddedResource Include="ThemedLabel.bmp" />
<EmbeddedResource Include="ThemedTableLayoutPanel.bmp" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
<None Include="Resources\WizardHat.ico" />
<None Include="Resources\BackBtnStrip.png" />
<None Include="Resources\BackBtnStrip2.png" />
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
<Visible>False</Visible>
<ProductName>Windows Installer 3.1</ProductName>
<Install>true</Install>
</BootstrapperPackage>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\ScoutBase\ScoutBase.Core\ScoutBase.Core.csproj">
<Project>{ee86e933-d883-4b18-80eb-0fba55ec67c6}</Project>
<Name>ScoutBase.Core</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(VSToolsPath)\VSSDK\Microsoft.VsSDK.targets" Condition="'$(VSToolsPath)' != ''" />
<!-- <PropertyGroup Condition=" '$(Configuration)|$(TargetFrameworkVersion)' == 'Release|v4.0' ">
<PostBuildEvent>"$(SolutionDir)..\NuGet.exe" pack "$(ProjectDir)$(ProjectName).nuspec" /o "$(SolutionDir)AeroWizardTemplates\Packages"</PostBuildEvent>
</PropertyGroup> -->
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
-->
<UsingTask TaskName="ThreeDotVer" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll">
<ParameterGroup>
<AssemblyPath ParameterType="System.String" Required="true" />
<Ver ParameterType="System.String" Output="true" />
</ParameterGroup>
<Task>
<Using Namespace="System.Diagnostics" />
<Code Type="Fragment" Language="cs">
this.Ver = Version.Parse(FileVersionInfo.GetVersionInfo(this.AssemblyPath).FileVersion).ToString(3);
</Code>
</Task>
</UsingTask>
<Target Name="AfterBuild">
<MSBuild Condition=" $(TargetFrameworkVersion.Replace(&quot;v&quot;,&quot;&quot;)) == 2.0 " Projects="$(MSBuildProjectFile)" Properties="TargetFrameworkVersion=v3.5" RunEachTargetSeparately="true" />
<MSBuild Condition=" $(TargetFrameworkVersion.Replace(&quot;v&quot;,&quot;&quot;)) == 3.5 " Projects="$(MSBuildProjectFile)" Properties="TargetFrameworkVersion=v4.0" RunEachTargetSeparately="true" />
</Target>
<Import Project="..\..\packages\System.Data.SQLite.Core.1.0.110.0\build\net40\System.Data.SQLite.Core.targets" Condition="Exists('..\..\packages\System.Data.SQLite.Core.1.0.110.0\build\net40\System.Data.SQLite.Core.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>Dieses Projekt verweist auf mindestens ein NuGet-Paket, das auf diesem Computer fehlt. Verwenden Sie die Wiederherstellung von NuGet-Paketen, um die fehlenden Dateien herunterzuladen. Weitere Informationen finden Sie unter "http://go.microsoft.com/fwlink/?LinkID=322105". Die fehlende Datei ist "{0}".</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\..\packages\System.Data.SQLite.Core.1.0.110.0\build\net40\System.Data.SQLite.Core.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\System.Data.SQLite.Core.1.0.110.0\build\net40\System.Data.SQLite.Core.targets'))" />
</Target>
</Project>

Wyświetl plik

@ -0,0 +1,64 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AeroWizard", "AeroWizard.csproj", "{199C12C4-3EEF-4D08-BAC3-F2A62BCF969C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestWizard", "TestWizard\TestWizard.csproj", "{EAA3C12F-D499-476C-9500-524EAEE3373A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AeroWizardTemplates", "AeroWizardTemplates\AeroWizardTemplates.csproj", "{438228D8-C9EB-41DC-A7C9-9A0C3D8EEAAA}"
ProjectSection(ProjectDependencies) = postProject
{199C12C4-3EEF-4D08-BAC3-F2A62BCF969C} = {199C12C4-3EEF-4D08-BAC3-F2A62BCF969C}
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AeroWizardItemTemplate", "AeroWizardItemTemplate\AeroWizardItemTemplate.csproj", "{BE2F5D91-AB68-432F-A94D-E68F05071324}"
ProjectSection(ProjectDependencies) = postProject
{199C12C4-3EEF-4D08-BAC3-F2A62BCF969C} = {199C12C4-3EEF-4D08-BAC3-F2A62BCF969C}
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CustomWizardItemTemplate", "CustomWizardItemTemplate\CustomWizardItemTemplate.csproj", "{D8029003-7A3F-4840-B441-E15D6E2BAFC2}"
ProjectSection(ProjectDependencies) = postProject
{199C12C4-3EEF-4D08-BAC3-F2A62BCF969C} = {199C12C4-3EEF-4D08-BAC3-F2A62BCF969C}
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Wizard97ItemTemplate", "Wizard97ItemTemplate\Wizard97ItemTemplate.csproj", "{D127643F-69AA-4C4C-A624-7754289E798C}"
ProjectSection(ProjectDependencies) = postProject
{199C12C4-3EEF-4D08-BAC3-F2A62BCF969C} = {199C12C4-3EEF-4D08-BAC3-F2A62BCF969C}
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{199C12C4-3EEF-4D08-BAC3-F2A62BCF969C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{199C12C4-3EEF-4D08-BAC3-F2A62BCF969C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{199C12C4-3EEF-4D08-BAC3-F2A62BCF969C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{199C12C4-3EEF-4D08-BAC3-F2A62BCF969C}.Release|Any CPU.Build.0 = Release|Any CPU
{EAA3C12F-D499-476C-9500-524EAEE3373A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EAA3C12F-D499-476C-9500-524EAEE3373A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EAA3C12F-D499-476C-9500-524EAEE3373A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EAA3C12F-D499-476C-9500-524EAEE3373A}.Release|Any CPU.Build.0 = Release|Any CPU
{438228D8-C9EB-41DC-A7C9-9A0C3D8EEAAA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{438228D8-C9EB-41DC-A7C9-9A0C3D8EEAAA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{438228D8-C9EB-41DC-A7C9-9A0C3D8EEAAA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{438228D8-C9EB-41DC-A7C9-9A0C3D8EEAAA}.Release|Any CPU.Build.0 = Release|Any CPU
{BE2F5D91-AB68-432F-A94D-E68F05071324}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BE2F5D91-AB68-432F-A94D-E68F05071324}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BE2F5D91-AB68-432F-A94D-E68F05071324}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BE2F5D91-AB68-432F-A94D-E68F05071324}.Release|Any CPU.Build.0 = Release|Any CPU
{D8029003-7A3F-4840-B441-E15D6E2BAFC2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D8029003-7A3F-4840-B441-E15D6E2BAFC2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D8029003-7A3F-4840-B441-E15D6E2BAFC2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D8029003-7A3F-4840-B441-E15D6E2BAFC2}.Release|Any CPU.Build.0 = Release|Any CPU
{D127643F-69AA-4C4C-A624-7754289E798C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D127643F-69AA-4C4C-A624-7754289E798C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D127643F-69AA-4C4C-A624-7754289E798C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D127643F-69AA-4C4C-A624-7754289E798C}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

Wyświetl plik

@ -0,0 +1,142 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<PropertyGroup>
<!-- The configuration and platform will be used to determine which
assemblies to include from solution and project documentation
sources -->
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{d62d015e-12be-42d0-a62c-997aae54d654}</ProjectGuid>
<SHFBSchemaVersion>2015.6.5.0</SHFBSchemaVersion>
<!-- AssemblyName, Name, and RootNamespace are not used by SHFB but Visual
Studio adds them anyway -->
<AssemblyName>AeroWizardHelp</AssemblyName>
<RootNamespace>AeroWizardHelp</RootNamespace>
<Name>AeroWizardHelp</Name>
<!-- SHFB properties -->
<OutputPath>.\Help\</OutputPath>
<HtmlHelpName>AeroWizard</HtmlHelpName>
<Language>en-US</Language>
<ApiFilter>
<Filter entryType="Namespace" fullName="System.Collections.Generic" isExposed="False">
<Filter entryType="Structure" fullName="System.Collections.Generic.EventedList`1.Enumerator" filterName="EventedList`1.Enumerator" isExposed="True" />
<Filter entryType="Class" fullName="System.Collections.Generic.EventedList`1" filterName="EventedList`1" isExposed="True" />
<Filter entryType="Class" fullName="System.Collections.Generic.EventedList`1.ListChangedEventArgs`1" filterName="EventedList`1.ListChangedEventArgs`1" isExposed="True" />
</Filter>
</ApiFilter>
<ComponentConfigurations>
<ComponentConfig id="API Token Resolution" enabled="True">
<component id="API Token Resolution">{@TokenFiles}
<replace elements="/*//token" item="string(.)" /></component>
</ComponentConfig>
<ComponentConfig id="Code Block Component" enabled="True">
<component id="Code Block Component">
<basePath value="{@HtmlEncProjectFolder}" />
<outputPaths>{@HelpFormatOutputPaths}</outputPaths>
<allowMissingSource value="false" />
<removeRegionMarkers value="false" />
<colorizer syntaxFile="{@SHFBFolder}PresentationStyles\Colorizer\highlight.xml" styleFile="{@SHFBFolder}PresentationStyles\Colorizer\highlight.xsl" stylesheet="{@SHFBFolder}PresentationStyles\Colorizer\highlight.css" scriptFile="{@SHFBFolder}PresentationStyles\Colorizer\highlight.js" disabled="{@DisableCodeBlockComponent}" language="cs" tabSize="0" numberLines="false" outlining="false" keepSeeTags="false" defaultTitle="true" />
</component>
</ComponentConfig>
<ComponentConfig id="IntelliSense Component" enabled="True">
<component id="IntelliSense Component">
<!-- Output options (optional)
Attributes:
Include namespaces (false by default)
Namespaces comments filename ("Namespaces" if not specified or empty)
Output folder (current folder if not specified or empty) -->
<output includeNamespaces="false" namespacesFile="Namespaces" folder="{@OutputFolder}" />
</component>
</ComponentConfig>
<ComponentConfig id="Syntax Component" enabled="True">
<component id="Syntax Component">
<syntax input="/document/reference" output="/document/syntax" renderReferenceLinks="true" />
<generators>
{@SyntaxFilters}
</generators>
<configurations />
</component>
</ComponentConfig>
</ComponentConfigurations>
<DocumentationSources>
<DocumentationSource sourceFile="..\bin\Release\v4.0\AeroWizard.dll" />
<DocumentationSource sourceFile="..\bin\Release\v4.0\AeroWizard.xml" />
</DocumentationSources>
<HelpAttributes />
<NamespaceSummaries>
<NamespaceSummaryItem name="Microsoft.Win32.DesktopWindowManager" isDocumented="True">The Microsoft.Win32.DesktopWindowManager namespace includes the DesktopWindowManager class and an extender control which allows the manipulation of the Desktop Window Manager and encapsulates API calls to that end. The DWM controls the glass effect on windows and painting on those affected surfaces.</NamespaceSummaryItem>
<NamespaceSummaryItem name="AeroWizard" isDocumented="True">The AeroWizard namespace provides the classes and components necessary for the creation of wizards.</NamespaceSummaryItem>
<NamespaceSummaryItem name="System.Collections.Generic" isDocumented="False" />
<NamespaceSummaryItem name="AeroWizard.VisualStyles" isDocumented="True">Extensions to the VisualStyles classes native to .NET that accomodate the AEROWIZARD tag.</NamespaceSummaryItem>
</NamespaceSummaries>
<PlugInConfigurations>
</PlugInConfigurations>
<BuildLogFile />
<HtmlHelp1xCompilerPath />
<HtmlHelp2xCompilerPath />
<SandcastlePath />
<WorkingPath />
<BuildAssemblerVerbosity>OnlyWarningsAndErrors</BuildAssemblerVerbosity>
<HelpFileFormat>MSHelpViewer</HelpFileFormat>
<IndentHtml>False</IndentHtml>
<FrameworkVersion>.NET Framework 4.0</FrameworkVersion>
<KeepLogFile>True</KeepLogFile>
<DisableCodeBlockComponent>False</DisableCodeBlockComponent>
<CppCommentsFixup>False</CppCommentsFixup>
<CleanIntermediates>True</CleanIntermediates>
<SyntaxFilters>C#, Visual Basic, Managed C++</SyntaxFilters>
<SdkLinkTarget>Blank</SdkLinkTarget>
<RootNamespaceTitle>Wizard .NET Library Help</RootNamespaceTitle>
<RootNamespaceContainer>True</RootNamespaceContainer>
<PresentationStyle>VS2013</PresentationStyle>
<Preliminary>False</Preliminary>
<NamingMethod>Guid</NamingMethod>
<HelpTitle>Wizard .NET Library</HelpTitle>
<CopyrightText>&amp;#169%3b 2015 Codeplex Community. All rights reserved.</CopyrightText>
<CopyrightHref>http://aerowizard.codeplex.com/license</CopyrightHref>
<ContentPlacement>AboveNamespaces</ContentPlacement>
<CatalogName>VisualStudio12</CatalogName>
<TocParentId>-1</TocParentId>
<TocParentVersion>100</TocParentVersion>
<TopicVersion>100</TopicVersion>
<TocOrder>-1</TocOrder>
<ProductTitle>
</ProductTitle>
<MSHelpViewerSdkLinkType>Msdn</MSHelpViewerSdkLinkType>
<CatalogVersion>100</CatalogVersion>
<CatalogProductId>VS</CatalogProductId>
<SccProjectName>SAK</SccProjectName>
<SccProvider>SAK</SccProvider>
<SccAuxPath>SAK</SccAuxPath>
<SccLocalPath>SAK</SccLocalPath>
<ProjectSummary>The Wizard project provides components allowing for the simple creation of Aero Wizards %28new wizard format in Vista and later%29 and other wizards which strictly follow Microsoft guidelines and use Visual Styles to pull specific settings from the system.</ProjectSummary>
<VisibleItems>Attributes, InheritedMembers, InheritedFrameworkMembers, Protected, SealedProtected</VisibleItems>
<FooterText>
</FooterText>
<ComponentPath />
<MaximumGroupParts>2</MaximumGroupParts>
<NamespaceGrouping>True</NamespaceGrouping>
</PropertyGroup>
<!-- There are no properties for these groups. AnyCPU needs to appear in
order for Visual Studio to perform the build. The others are optional
common platform types that may appear. -->
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|Win32' ">
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|Win32' ">
</PropertyGroup>
<!-- Import the SHFB build targets -->
<Import Project="$(SHFBROOT)\SandcastleHelpFileBuilder.targets" />
</Project>

Wyświetl plik

@ -0,0 +1,69 @@
namespace $rootnamespace$
{
partial class $safeitemname$
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.wizardControl1 = new AeroWizard.WizardControl();
this.wizardPage1 = new AeroWizard.WizardPage();
((System.ComponentModel.ISupportInitialize)(this.wizardControl1)).BeginInit();
this.SuspendLayout();
//
// wizardControl1
//
this.wizardControl1.Location = new System.Drawing.Point(0, 0);
this.wizardControl1.Name = "wizardControl1";
this.wizardControl1.Pages.Add(this.wizardPage1);
this.wizardControl1.Size = new System.Drawing.Size(574, 415);
this.wizardControl1.TabIndex = 0;
//
// wizardPage1
//
this.wizardPage1.Name = "wizardPage1";
this.wizardPage1.Size = new System.Drawing.Size(527, 260);
this.wizardPage1.TabIndex = 0;
this.wizardPage1.Text = "Page Title";
//
// $safeitemname$
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(574, 415);
this.Controls.Add(this.wizardControl1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.Name = "$safeitemname$";
((System.ComponentModel.ISupportInitialize)(this.wizardControl1)).EndInit();
this.ResumeLayout(false);
}
#endregion
private AeroWizard.WizardControl wizardControl1;
private AeroWizard.WizardPage wizardPage1;
}
}

Wyświetl plik

@ -0,0 +1,13 @@
using System;
using System.Windows.Forms;
namespace $rootnamespace$
{
public partial class $safeitemname$ : Form
{
public $safeitemname$()
{
InitializeComponent();
}
}
}

Wyświetl plik

@ -0,0 +1,129 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">11.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
<FileUpgradeFlags>
</FileUpgradeFlags>
<OldToolsVersion>12.0</OldToolsVersion>
<SccProjectName>SAK</SccProjectName>
<SccLocalPath>SAK</SccLocalPath>
<SccAuxPath>SAK</SccAuxPath>
<SccProvider>SAK</SccProvider>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
</PropertyGroup>
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectTypeGuids>{82b43b9b-a64c-4715-b499-d71e9ca2bd60};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<ProjectGuid>{BE2F5D91-AB68-432F-A94D-E68F05071324}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>AeroWizardItemTemplate</RootNamespace>
<AssemblyName>AeroWizardItemTemplate</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<GeneratePkgDefFile>false</GeneratePkgDefFile>
<IncludeAssemblyInVSIXContainer>false</IncludeAssemblyInVSIXContainer>
<IncludeDebugSymbolsInVSIXContainer>false</IncludeDebugSymbolsInVSIXContainer>
<IncludeDebugSymbolsInLocalVSIXDeployment>false</IncludeDebugSymbolsInLocalVSIXDeployment>
<CreateVsixContainer>false</CreateVsixContainer>
<DeployExtension>false</DeployExtension>
<DeployVSTemplates>false</DeployVSTemplates>
<CopyVsixManifestToOutput>false</CopyVsixManifestToOutput>
<CopyBuildOutputToOutputDirectory>false</CopyBuildOutputToOutputDirectory>
<CopyOutputSymbolsToOutputDirectory>false</CopyOutputSymbolsToOutputDirectory>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<None Include="AeroWizardItemTemplate.cs" />
<None Include="AeroWizardItemTemplate.Designer.cs">
<DependentUpon>AeroWizardItemTemplate.cs</DependentUpon>
</None>
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<VSTemplate Include="AeroWizardItemTemplate.vstemplate">
<OutputSubPath>Windows Forms</OutputSubPath>
<SubType>Designer</SubType>
</VSTemplate>
</ItemGroup>
<ItemGroup>
<None Include="AeroWizardItemTemplate.resx">
<DependentUpon>AeroWizardItemTemplate.cs</DependentUpon>
</None>
</ItemGroup>
<ItemGroup>
<None Include="__PreviewImage.PNG" />
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include=".NETFramework,Version=v4.5">
<Visible>False</Visible>
<ProductName>Microsoft .NET Framework 4.5 %28x86 and x64%29</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
<ItemGroup>
<None Include="WizardControlTemplate.ico" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(VSToolsPath)\VSSDK\Microsoft.VsSDK.targets" Condition="'$(VSToolsPath)' != ''" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

Wyświetl plik

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

Wyświetl plik

@ -0,0 +1,46 @@
<?xml version="1.0" encoding="utf-8"?>
<VSTemplate Version="3.0.0" xmlns="http://schemas.microsoft.com/developer/vstemplate/2005" Type="Item">
<TemplateData>
<DefaultName>AeroWizard.cs</DefaultName>
<Name>AeroWizard Control</Name>
<Description>Windows Form hosting a WizardControl to create an Aero style wizard</Description>
<ProjectType>CSharp</ProjectType>
<CreateNewFolder>true</CreateNewFolder>
<NumberOfParentCategoriesToRollUp>1</NumberOfParentCategoriesToRollUp>
<RequiredFrameworkVersion>2.0</RequiredFrameworkVersion>
<SortOrder>100</SortOrder>
<Icon>WizardControlTemplate.ico</Icon>
<PreviewImage>__PreviewImage.PNG</PreviewImage>
</TemplateData>
<TemplateContent>
<References>
<Reference>
<Assembly>System</Assembly>
</Reference>
<Reference>
<Assembly>System.Design</Assembly>
</Reference>
<Reference>
<Assembly>System.Drawing</Assembly>
</Reference>
<Reference>
<Assembly>System.Windows.Forms</Assembly>
</Reference>
<Reference>
<Assembly>AeroWizard</Assembly>
</Reference>
</References>
<ProjectItem SubType="Form" TargetFileName="$fileinputname$.cs" ReplaceParameters="true" OpenInEditor="true">AeroWizardItemTemplate.cs</ProjectItem>
<ProjectItem SubType="" TargetFileName="$fileinputname$.Designer.cs" ReplaceParameters="true">AeroWizardItemTemplate.Designer.cs</ProjectItem>
<ProjectItem SubType="" TargetFileName="$fileinputname$.resx" ReplaceParameters="true">AeroWizardItemTemplate.resx</ProjectItem>
</TemplateContent>
<WizardExtension>
<Assembly>NuGet.VisualStudio.Interop, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</Assembly>
<FullClassName>NuGet.VisualStudio.TemplateWizard</FullClassName>
</WizardExtension>
<WizardData>
<packages repository="extension" repositoryId="AeroWizardTemplates..134dde00-8c48-450a-926c-63377b215799" >
<package id="AeroWizard" version="2.1.8" />
</packages>
</WizardData>
</VSTemplate>

Wyświetl plik

@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("AeroWizardItemTemplate")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("AeroWizardItemTemplate")]
[assembly: AssemblyCopyright("Copyright © 2013")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("b944454d-35f5-4278-a467-a2fdbb9ce699")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

Plik binarny nie jest wyświetlany.

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 9.9 KiB

Plik binarny nie jest wyświetlany.

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 16 KiB

Wyświetl plik

@ -0,0 +1,151 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">11.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
<FileUpgradeFlags>
</FileUpgradeFlags>
<OldToolsVersion>12.0</OldToolsVersion>
<SccProjectName>SAK</SccProjectName>
<SccLocalPath>SAK</SccLocalPath>
<SccAuxPath>SAK</SccAuxPath>
<SccProvider>SAK</SccProvider>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
<IsWebBootstrapper>false</IsWebBootstrapper>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<SchemaVersion>2.0</SchemaVersion>
<ProjectTypeGuids>{82b43b9b-a64c-4715-b499-d71e9ca2bd60};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<ProjectGuid>{438228D8-C9EB-41DC-A7C9-9A0C3D8EEAAA}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>AeroWizardTemplates</RootNamespace>
<AssemblyName>AeroWizardTemplates</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<GeneratePkgDefFile>false</GeneratePkgDefFile>
<IncludeAssemblyInVSIXContainer>false</IncludeAssemblyInVSIXContainer>
<IncludeDebugSymbolsInVSIXContainer>false</IncludeDebugSymbolsInVSIXContainer>
<IncludeDebugSymbolsInLocalVSIXDeployment>false</IncludeDebugSymbolsInLocalVSIXDeployment>
<CopyBuildOutputToOutputDirectory>false</CopyBuildOutputToOutputDirectory>
<CopyOutputSymbolsToOutputDirectory>false</CopyOutputSymbolsToOutputDirectory>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
<DeployExtension>False</DeployExtension>
</PropertyGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="__PreviewImage.PNG">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
<IncludeInVSIX>true</IncludeInVSIX>
</Content>
<Content Include="Packages\AeroWizard.2.1.8.nupkg">
<IncludeInVSIX>true</IncludeInVSIX>
</Content>
<None Include="source.extension.vsixmanifest">
<SubType>Designer</SubType>
</None>
</ItemGroup>
<ItemGroup>
<Content Include="License.txt">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
<IncludeInVSIX>true</IncludeInVSIX>
</Content>
<Content Include="WizardControlTemplate.ico">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
<IncludeInVSIX>true</IncludeInVSIX>
</Content>
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include=".NETFramework,Version=v4.5">
<Visible>False</Visible>
<ProductName>Microsoft .NET Framework 4.5 %28x86 and x64%29</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\AeroWizardItemTemplate\AeroWizardItemTemplate.csproj">
<Project>{BE2F5D91-AB68-432F-A94D-E68F05071324}</Project>
<Name>AeroWizardItemTemplate</Name>
<VSIXSubPath>ItemTemplatesA</VSIXSubPath>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
<IncludeOutputGroupsInVSIX>TemplateProjectOutputGroup%3b</IncludeOutputGroupsInVSIX>
</ProjectReference>
<ProjectReference Include="..\CustomWizardItemTemplate\CustomWizardItemTemplate.csproj">
<Project>{D8029003-7A3F-4840-B441-E15D6E2BAFC2}</Project>
<Name>CustomWizardItemTemplate</Name>
<VSIXSubPath>ItemTemplatesB</VSIXSubPath>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
<IncludeOutputGroupsInVSIX>TemplateProjectOutputGroup%3b</IncludeOutputGroupsInVSIX>
</ProjectReference>
<ProjectReference Include="..\Wizard97ItemTemplate\Wizard97ItemTemplate.csproj">
<Project>{d127643f-69aa-4c4c-a624-7754289e798c}</Project>
<Name>Wizard97ItemTemplate</Name>
<VSIXSubPath>ItemTemplatesC</VSIXSubPath>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
<IncludeOutputGroupsInVSIX>TemplateProjectOutputGroup%3b</IncludeOutputGroupsInVSIX>
</ProjectReference>
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(VSToolsPath)\VSSDK\Microsoft.VsSDK.targets" Condition="'$(VSToolsPath)' != ''" />
<PropertyGroup>
<PreBuildEvent>
</PreBuildEvent>
</PropertyGroup>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

Wyświetl plik

@ -0,0 +1,9 @@
The MIT License (MIT)
Copyright (c) 2012-2014 David Hall
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Wyświetl plik

@ -0,0 +1,33 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("AeroWizardTemplates")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("AeroWizardTemplates")]
[assembly: AssemblyCopyright("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

Plik binarny nie jest wyświetlany.

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 11 KiB

Plik binarny nie jest wyświetlany.

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 16 KiB

Wyświetl plik

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">
<Metadata>
<Identity Id="AeroWizardTemplates..134dde00-8c48-450a-926c-63377b215799" Version="2.1.8" Language="en-US" Publisher="CodePlex Community" />
<DisplayName>Windows Forms Wizard Templates</DisplayName>
<Description xml:space="preserve">Library for creating wizards for Windows Forms</Description>
<MoreInfo>https://aerowizard.codeplex.com/</MoreInfo>
<License>License.txt</License>
<GettingStartedGuide>http://aerowizard.codeplex.com/documentation</GettingStartedGuide>
<ReleaseNotes>https://aerowizard.codeplex.com/SourceControl/list/changesets</ReleaseNotes>
<Icon>WizardControlTemplate.ico</Icon>
<PreviewImage>__PreviewImage.PNG</PreviewImage>
<Tags>winforms;wizard;aero</Tags>
</Metadata>
<Installation InstalledByMsi="false">
<InstallationTarget Version="[11.0,)" Id="Microsoft.VisualStudio.Pro" />
<InstallationTarget Version="[11.0,)" Id="Microsoft.VisualStudio.Ultimate" />
<InstallationTarget Version="[11.0,)" Id="Microsoft.VisualStudio.Premium" />
<InstallationTarget Version="[11.0,)" Id="Microsoft.VisualStudio.Enterprise" />
<InstallationTarget Version="[11.0,)" Id="Microsoft.VisualStudio.Community" />
</Installation>
<Assets>
<Asset Type="AeroWizard.2.1.8.nupkg" d:Source="File" Path="Packages\AeroWizard.2.1.8.nupkg" d:VsixSubPath="Packages" />
<Asset Type="Microsoft.VisualStudio.ItemTemplate" d:Source="Project" d:ProjectName="AeroWizardItemTemplate" d:TargetPath="|AeroWizardItemTemplate;TemplateProjectOutputGroup|" Path="ItemTemplatesA" d:VsixSubPath="ItemTemplates" />
<Asset Type="Microsoft.VisualStudio.ItemTemplate" d:Source="Project" d:ProjectName="CustomWizardItemTemplate" d:TargetPath="|CustomWizardItemTemplate;TemplateProjectOutputGroup|" Path="ItemTemplatesB" d:VsixSubPath="ItemTemplates" />
<Asset Type="Microsoft.VisualStudio.ItemTemplate" d:Source="Project" d:ProjectName="Wizard97ItemTemplate" d:TargetPath="|Wizard97ItemTemplate;TemplateProjectOutputGroup|" Path="ItemTemplatesC" d:VsixSubPath="ItemTemplates" />
</Assets>
</PackageManifest>

Wyświetl plik

@ -0,0 +1,98 @@

namespace System.Windows.Forms
{
static class ControlExtension
{
/// <summary>
/// Performs an action on a control after its handle has been created. If the control's handle has already been created, the action is executed immediately.
/// </summary>
/// <param name="ctrl">This control.</param>
/// <param name="action">The action to execute.</param>
public static void CallWhenHandleValid(this Control ctrl, Action<Control> action)
{
if (ctrl.IsHandleCreated)
{
action(ctrl);
}
else
{
LayoutEventHandler handler = null;
handler = (sender, e) =>
{
if (ctrl.IsHandleCreated)
{
ctrl.Layout -= handler;
action(ctrl);
}
};
ctrl.Layout += handler;
}
}
/// <summary>
/// Gets the control in the list of parents of type <c>T</c>.
/// </summary>
/// <typeparam name="T">The <see cref="Control"/> based <see cref="Type"/> of the parent control to retrieve.</typeparam>
/// <param name="ctrl">This control.</param>
/// <returns>The parent control matching T or null if not found.</returns>
[Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")]
public static T GetParent<T>(this Control ctrl) where T : Control, new()
{
Control p = ctrl.Parent;
while (p != null & !(p is T))
p = p.Parent;
return p as T;
}
/// <summary>
/// Gets the top-most control in the list of parents of type <c>T</c>.
/// </summary>
/// <typeparam name="T">The <see cref="Control"/> based <see cref="Type"/> of the parent control to retrieve.</typeparam>
/// <param name="ctrl">This control.</param>
/// <returns>The top-most parent control matching T or null if not found.</returns>
public static T GetTopMostParent<T>(this Control ctrl) where T : Control, new()
{
var stack = new System.Collections.Generic.Stack<Control>();
Control p = ctrl.Parent;
while (p != null)
{
stack.Push(p);
p = p.Parent;
}
while (stack.Count > 0)
if ((p = stack.Pop()) is T)
return p as T;
return null;
}
/// <summary>
/// Gets the right to left property.
/// </summary>
/// <param name="ctrl">This control.</param>
/// <returns>Culture defined direction of text for this control.</returns>
public static RightToLeft GetRightToLeftProperty(this Control ctrl)
{
if (ctrl.RightToLeft == RightToLeft.Inherit)
return GetRightToLeftProperty(ctrl.Parent);
return ctrl.RightToLeft;
}
/// <summary>
/// Determines whether this control is in design mode.
/// </summary>
/// <param name="ctrl">This control.</param>
/// <returns><c>true</c> if in design mode; otherwise, <c>false</c>.</returns>
public static bool IsDesignMode(this Control ctrl)
{
Control p = ctrl;
while (p != null)
{
var site = p.Site;
if (site != null && site.DesignMode)
return true;
p = p.Parent;
}
return false;
}
}
}

Wyświetl plik

@ -0,0 +1,130 @@
namespace $rootnamespace$
{
partial class $safeitemname$
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.backBtn = new System.Windows.Forms.Button();
this.cancelBtn = new System.Windows.Forms.Button();
this.nextBtn = new System.Windows.Forms.Button();
this.wizardPageContainer1 = new AeroWizard.WizardPageContainer();
this.wizardPage1 = new AeroWizard.WizardPage();
this.headingControl = new System.Windows.Forms.Label();
((System.ComponentModel.ISupportInitialize)(this.wizardPageContainer1)).BeginInit();
this.wizardPageContainer1.SuspendLayout();
this.SuspendLayout();
//
// backBtn
//
this.backBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.backBtn.Location = new System.Drawing.Point(93, 204);
this.backBtn.Name = "backBtn";
this.backBtn.Size = new System.Drawing.Size(75, 23);
this.backBtn.TabIndex = 1;
this.backBtn.Text = "&Back";
//
// cancelBtn
//
this.cancelBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.cancelBtn.Location = new System.Drawing.Point(255, 204);
this.cancelBtn.Name = "cancelBtn";
this.cancelBtn.Size = new System.Drawing.Size(75, 23);
this.cancelBtn.TabIndex = 1;
this.cancelBtn.Text = "&Cancel";
//
// nextBtn
//
this.nextBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.nextBtn.Location = new System.Drawing.Point(174, 204);
this.nextBtn.Name = "nextBtn";
this.nextBtn.Size = new System.Drawing.Size(75, 23);
this.nextBtn.TabIndex = 1;
this.nextBtn.Text = "&Next";
//
// wizardPageContainer1
//
this.wizardPageContainer1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.wizardPageContainer1.BackButton = this.backBtn;
this.wizardPageContainer1.CancelButton = this.cancelBtn;
this.wizardPageContainer1.Controls.Add(this.wizardPage1);
this.wizardPageContainer1.Location = new System.Drawing.Point(12, 25);
this.wizardPageContainer1.Name = "wizardPageContainer1";
this.wizardPageContainer1.NextButton = this.nextBtn;
this.wizardPageContainer1.Pages.Add(this.wizardPage1);
this.wizardPageContainer1.Size = new System.Drawing.Size(318, 173);
this.wizardPageContainer1.TabIndex = 2;
this.wizardPageContainer1.Cancelling += new System.ComponentModel.CancelEventHandler(this.wizardPageContainer1_Cancelling);
this.wizardPageContainer1.Finished += new System.EventHandler(this.wizardPageContainer1_Finished);
this.wizardPageContainer1.SelectedPageChanged += new System.EventHandler(this.wizardPageContainer1_SelectedPageChanged);
//
// wizardPage1
//
this.wizardPage1.Name = "wizardPage1";
this.wizardPage1.Size = new System.Drawing.Size(318, 173);
this.wizardPage1.TabIndex = 0;
this.wizardPage1.Text = "Page 1";
//
// headingControl
//
this.headingControl.AutoSize = true;
this.headingControl.Location = new System.Drawing.Point(9, 9);
this.headingControl.Name = "headingControl";
this.headingControl.Size = new System.Drawing.Size(59, 13);
this.headingControl.TabIndex = 3;
this.headingControl.Text = "<Heading>";
//
// $safeitemname$
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(342, 239);
this.Controls.Add(this.headingControl);
this.Controls.Add(this.wizardPageContainer1);
this.Controls.Add(this.cancelBtn);
this.Controls.Add(this.nextBtn);
this.Controls.Add(this.backBtn);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.Name = "$safeitemname$";
((System.ComponentModel.ISupportInitialize)(this.wizardPageContainer1)).EndInit();
this.wizardPageContainer1.ResumeLayout(false);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Button backBtn;
private System.Windows.Forms.Button cancelBtn;
private System.Windows.Forms.Button nextBtn;
private AeroWizard.WizardPageContainer wizardPageContainer1;
private AeroWizard.WizardPage wizardPage1;
private System.Windows.Forms.Label headingControl;
}
}

Wyświetl plik

@ -0,0 +1,28 @@
using System;
using System.Windows.Forms;
namespace $rootnamespace$
{
public partial class $safeitemname$ : Form
{
public $safeitemname$()
{
InitializeComponent();
}
private void wizardPageContainer1_Cancelling(object sender, System.ComponentModel.CancelEventArgs e)
{
this.Close();
}
private void wizardPageContainer1_Finished(object sender, EventArgs e)
{
this.Close();
}
private void wizardPageContainer1_SelectedPageChanged(object sender, EventArgs e)
{
headingControl.Text = wizardPageContainer1.SelectedPage.Text;
}
}
}

Wyświetl plik

@ -0,0 +1,129 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">11.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
<FileUpgradeFlags>
</FileUpgradeFlags>
<OldToolsVersion>12.0</OldToolsVersion>
<SccProjectName>SAK</SccProjectName>
<SccLocalPath>SAK</SccLocalPath>
<SccAuxPath>SAK</SccAuxPath>
<SccProvider>SAK</SccProvider>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
</PropertyGroup>
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectTypeGuids>{82b43b9b-a64c-4715-b499-d71e9ca2bd60};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<ProjectGuid>{D8029003-7A3F-4840-B441-E15D6E2BAFC2}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>CustomWizardItemTemplate</RootNamespace>
<AssemblyName>CustomWizardItemTemplate</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<GeneratePkgDefFile>false</GeneratePkgDefFile>
<IncludeAssemblyInVSIXContainer>false</IncludeAssemblyInVSIXContainer>
<IncludeDebugSymbolsInVSIXContainer>false</IncludeDebugSymbolsInVSIXContainer>
<IncludeDebugSymbolsInLocalVSIXDeployment>false</IncludeDebugSymbolsInLocalVSIXDeployment>
<CreateVsixContainer>false</CreateVsixContainer>
<DeployExtension>false</DeployExtension>
<DeployVSTemplates>false</DeployVSTemplates>
<CopyVsixManifestToOutput>false</CopyVsixManifestToOutput>
<CopyBuildOutputToOutputDirectory>false</CopyBuildOutputToOutputDirectory>
<CopyOutputSymbolsToOutputDirectory>false</CopyOutputSymbolsToOutputDirectory>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<None Include="CustomWizardItemTemplate.cs" />
<None Include="CustomWizardItemTemplate.Designer.cs">
<DependentUpon>CustomWizardItemTemplate.cs</DependentUpon>
</None>
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<VSTemplate Include="CustomWizardItemTemplate.vstemplate">
<OutputSubPath>Windows Forms</OutputSubPath>
<SubType>Designer</SubType>
</VSTemplate>
</ItemGroup>
<ItemGroup>
<None Include="CustomWizardItemTemplate.resx">
<DependentUpon>CustomWizardItemTemplate.cs</DependentUpon>
</None>
</ItemGroup>
<ItemGroup>
<None Include="__PreviewImage.PNG" />
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include=".NETFramework,Version=v4.5">
<Visible>False</Visible>
<ProductName>Microsoft .NET Framework 4.5 %28x86 and x64%29</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
<ItemGroup>
<None Include="WizardControlTemplate.ico" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(VSToolsPath)\VSSDK\Microsoft.VsSDK.targets" Condition="'$(VSToolsPath)' != ''" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

Wyświetl plik

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

Wyświetl plik

@ -0,0 +1,46 @@
<?xml version="1.0" encoding="utf-8"?>
<VSTemplate Version="3.0.0" xmlns="http://schemas.microsoft.com/developer/vstemplate/2005" Type="Item">
<TemplateData>
<DefaultName>CustomWizard.cs</DefaultName>
<Name>Custom Wizard Control</Name>
<Description>Windows Form hosting controls that allow it to behave as a custom wizard.</Description>
<ProjectType>CSharp</ProjectType>
<CreateNewFolder>true</CreateNewFolder>
<NumberOfParentCategoriesToRollUp>1</NumberOfParentCategoriesToRollUp>
<RequiredFrameworkVersion>2.0</RequiredFrameworkVersion>
<SortOrder>100</SortOrder>
<Icon>WizardControlTemplate.ico</Icon>
<PreviewImage>__PreviewImage.PNG</PreviewImage>
</TemplateData>
<TemplateContent>
<References>
<Reference>
<Assembly>System</Assembly>
</Reference>
<Reference>
<Assembly>System.Design</Assembly>
</Reference>
<Reference>
<Assembly>System.Drawing</Assembly>
</Reference>
<Reference>
<Assembly>System.Windows.Forms</Assembly>
</Reference>
<Reference>
<Assembly>AeroWizard</Assembly>
</Reference>
</References>
<ProjectItem SubType="Form" TargetFileName="$fileinputname$.cs" ReplaceParameters="true" OpenInEditor="true">CustomWizardItemTemplate.cs</ProjectItem>
<ProjectItem SubType="" TargetFileName="$fileinputname$.Designer.cs" ReplaceParameters="true">CustomWizardItemTemplate.Designer.cs</ProjectItem>
<ProjectItem SubType="" TargetFileName="$fileinputname$.resx" ReplaceParameters="true">CustomWizardItemTemplate.resx</ProjectItem>
</TemplateContent>
<WizardExtension>
<Assembly>NuGet.VisualStudio.Interop, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</Assembly>
<FullClassName>NuGet.VisualStudio.TemplateWizard</FullClassName>
</WizardExtension>
<WizardData>
<packages repository="extension" repositoryId="AeroWizardTemplates..134dde00-8c48-450a-926c-63377b215799" >
<package id="AeroWizard" version="2.1.8" />
</packages>
</WizardData>
</VSTemplate>

Wyświetl plik

@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("CustomWizardItemTemplate")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("CustomWizardItemTemplate")]
[assembly: AssemblyCopyright("Copyright © 2013")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("26d5a2d9-ef16-4d09-a4f5-1b401d26db14")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

Plik binarny nie jest wyświetlany.

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 9.9 KiB

Plik binarny nie jest wyświetlany.

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 12 KiB

Plik diff jest za duży Load Diff

Wyświetl plik

@ -0,0 +1,9 @@
namespace System.Runtime.CompilerServices
{
/// <summary>
/// Attribute allowing extenders to be used with .NET Framework 2.0.
/// </summary>
internal sealed class ExtensionAttribute : Attribute
{
}
}

Wyświetl plik

@ -0,0 +1,6 @@
# Load vsix tools
. "C:\Users\dahall\Documents\Visual Studio 2010\Projects\VsixTools2.ps1"
# Set the version number of 'MyPackage' and fix the zip issue for uploading to the gallery.
$vsixPath = "C:\Users\dahall\Documents\Visual Studio 2010\Projects\AeroWizard\AeroWizardTemplates\bin\Release\AeroWizardTemplates.vsix"
Vsix-SetVersion -VsixPath $vsixPath -Version "2.0.3"
Vsix-FixInvalidMultipleFiles -VsixPath $vsixPath

Wyświetl plik

@ -0,0 +1,779 @@
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.Windows.Forms.Design;
using System.Windows.Forms.Design.Behavior;
namespace System.ComponentModel.Design
{
internal static class ComponentDesignerExtension
{
public const System.Reflection.BindingFlags AllInstBind = System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Instance;
public static object EditValue(this ComponentDesigner designer, object objectToChange, string propName)
{
PropertyDescriptor prop = TypeDescriptor.GetProperties(objectToChange)[propName];
EditorServiceContext context = new EditorServiceContext(designer, prop);
var editor = prop.GetEditor(typeof(System.Drawing.Design.UITypeEditor)) as System.Drawing.Design.UITypeEditor;
object curVal = prop.GetValue(objectToChange);
object newVal = editor.EditValue(context, context, curVal);
if (newVal != curVal)
try { prop.SetValue(objectToChange, newVal); }
catch (CheckoutException) { }
return newVal;
}
public static List<DesignerActionItem> GetAllAttributedActionItems(this DesignerActionList actionList)
{
var fullAIList = new List<DesignerActionItem>();
foreach (var mbr in actionList.GetType().GetMethods(AllInstBind))
{
foreach (IActionGetItem attr in mbr.GetCustomAttributes(typeof(DesignerActionMethodAttribute), false))
{
if (mbr.ReturnType == typeof(void) && mbr.GetParameters().Length == 0)
fullAIList.Add(attr.GetItem(actionList, mbr));
else
throw new FormatException("DesignerActionMethodAttribute must be applied to a method returning void and having no parameters.");
}
}
foreach (var mbr in actionList.GetType().GetProperties(AllInstBind))
{
foreach (IActionGetItem attr in mbr.GetCustomAttributes(typeof(DesignerActionPropertyAttribute), false))
fullAIList.Add(attr.GetItem(actionList, mbr));
}
fullAIList.Sort(CompareItems);
return fullAIList;
}
public static DesignerVerbCollection GetAttributedVerbs(this ComponentDesigner designer)
{
var verbs = new DesignerVerbCollection();
foreach (var m in designer.GetType().GetMethods(AllInstBind))
{
foreach (DesignerVerbAttribute attr in m.GetCustomAttributes(typeof(DesignerVerbAttribute), true))
{
verbs.Add(attr.GetDesignerVerb(designer, m));
}
}
return verbs;
}
public static DesignerActionItemCollection GetFilteredActionItems(this DesignerActionList actionList, List<DesignerActionItem> fullAIList)
{
DesignerActionItemCollection col = new DesignerActionItemCollection();
fullAIList.ForEach(ai => { if (CheckCondition(actionList, ai)) { col.Add(ai); } });
// Add header items for displayed items
int i = 0; string cat = null;
while (i < col.Count)
{
string curCat = col[i].Category;
if (string.Compare(curCat, cat, true, Globalization.CultureInfo.CurrentCulture) != 0)
{
col.Insert(i++, new DesignerActionHeaderItem(curCat));
cat = curCat;
}
i++;
}
return col;
}
public static IDictionary<string, List<Attribute>> GetRedirectedProperties(this ComponentDesigner d)
{
var ret = new Dictionary<string, List<Attribute>>();
foreach (var prop in d.GetType().GetProperties(AllInstBind))
{
foreach (RedirectedDesignerPropertyAttribute attr in prop.GetCustomAttributes(typeof(RedirectedDesignerPropertyAttribute), false))
{
List<Attribute> attributes;
if (attr.ApplyOtherAttributes)
{
attributes = new List<Attribute>(Array.ConvertAll<object, Attribute>(prop.GetCustomAttributes(false), o => o as System.Attribute));
attributes.RemoveAll(a => a is RedirectedDesignerPropertyAttribute);
}
else
attributes = new List<Attribute>();
ret.Add(prop.Name, attributes);
}
}
return ret;
}
public static void RedirectRegisteredProperties(this ComponentDesigner d, System.Collections.IDictionary properties, IDictionary<string, List<Attribute>> redirectedProps)
{
foreach (var propName in redirectedProps.Keys)
{
PropertyDescriptor oldPropertyDescriptor = (PropertyDescriptor)properties[propName];
if (oldPropertyDescriptor != null)
{
List<Attribute> attributes = redirectedProps[propName];
properties[propName] = TypeDescriptor.CreateProperty(d.GetType(), oldPropertyDescriptor, attributes.ToArray());
}
}
}
[Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "d")]
public static void RemoveProperties(this ComponentDesigner d, System.Collections.IDictionary properties, IEnumerable<string> propertiesToRemove)
{
foreach (string p in propertiesToRemove)
if (properties.Contains(p))
properties.Remove(p);
}
public static void SetComponentProperty<T>(this ComponentDesigner d, string propName, T value)
{
PropertyDescriptor propDesc = TypeDescriptor.GetProperties(d.Component)[propName];
if (propDesc != null && propDesc.PropertyType == typeof(T) && !propDesc.IsReadOnly && propDesc.IsBrowsable)
propDesc.SetValue(d.Component, value);
}
public static System.Windows.Forms.DialogResult ShowDialog(this ComponentDesigner designer, System.Windows.Forms.Form dialog)
{
EditorServiceContext context = new EditorServiceContext(designer);
return context.ShowDialog(dialog);
}
private static bool CheckCondition(DesignerActionList actionList, DesignerActionItem ai)
{
if (ai.Properties["Condition"] != null)
{
var p = actionList.GetType().GetProperty((string)ai.Properties["Condition"], AllInstBind, null, typeof(bool), Type.EmptyTypes, null);
if (p != null)
return (bool)p.GetValue(actionList, null);
}
return true;
}
private static int CompareItems(DesignerActionItem a, DesignerActionItem b)
{
int c = string.Compare(a.Category ?? string.Empty, b.Category ?? string.Empty, true, Globalization.CultureInfo.CurrentCulture);
if (c != 0)
return c;
c = (int)a.Properties["Order"] - (int)b.Properties["Order"];
if (c != 0)
return c;
return string.Compare(a.DisplayName, b.DisplayName, true, Globalization.CultureInfo.CurrentCulture);
}
}
[System.AttributeUsage(System.AttributeTargets.Property, Inherited = true, AllowMultiple = false)]
internal sealed class RedirectedDesignerPropertyAttribute : System.Attribute
{
public RedirectedDesignerPropertyAttribute() { ApplyOtherAttributes = true; }
public bool ApplyOtherAttributes { get; set; }
}
}
namespace System.Windows.Forms.Design
{
internal interface IActionGetItem
{
string Category { get; }
DesignerActionItem GetItem(DesignerActionList actions, Reflection.MemberInfo mbr);
}
[System.AttributeUsage(System.AttributeTargets.Method, Inherited = true, AllowMultiple = false)]
internal sealed class DesignerActionMethodAttribute : System.Attribute, IActionGetItem
{
public DesignerActionMethodAttribute(string displayName, int displayOrder = 0)
{
DisplayName = displayName;
DisplayOrder = displayOrder;
}
public bool AllowAssociate { get; set; }
public string Category { get; set; }
public string Condition { get; set; }
public string Description { get; set; }
public string DisplayName { get; }
public int DisplayOrder { get; }
public bool IncludeAsDesignerVerb { get; set; }
DesignerActionItem IActionGetItem.GetItem(DesignerActionList actions, Reflection.MemberInfo mbr)
{
var ret = new DesignerActionMethodItem(actions, mbr.Name, DisplayName, Category, Description, IncludeAsDesignerVerb)
{ AllowAssociate = AllowAssociate };
if (!string.IsNullOrEmpty(Condition))
ret.Properties.Add("Condition", Condition);
ret.Properties.Add("Order", DisplayOrder);
return ret;
}
}
[System.AttributeUsage(System.AttributeTargets.Property, Inherited = true, AllowMultiple = false)]
internal sealed class DesignerActionPropertyAttribute : System.Attribute, IActionGetItem
{
public DesignerActionPropertyAttribute(string displayName, int displayOrder = 0)
{
DisplayName = displayName;
DisplayOrder = displayOrder;
}
public bool AllowAssociate { get; set; }
public string Category { get; set; }
public string Condition { get; set; }
public string Description { get; set; }
public string DisplayName { get; }
public int DisplayOrder { get; }
DesignerActionItem IActionGetItem.GetItem(DesignerActionList actions, Reflection.MemberInfo mbr)
{
var ret = new DesignerActionPropertyItem(mbr.Name, DisplayName, Category, Description)
{ AllowAssociate = AllowAssociate };
if (!string.IsNullOrEmpty(Condition))
ret.Properties.Add("Condition", Condition);
ret.Properties.Add("Order", DisplayOrder);
return ret;
}
}
[System.AttributeUsage(System.AttributeTargets.Method, Inherited = true, AllowMultiple = false)]
internal sealed class DesignerVerbAttribute : System.Attribute
{
private CommandID cmdId;
private string menuText;
public DesignerVerbAttribute(string menuText)
{
this.menuText = menuText;
}
public DesignerVerbAttribute(string menuText, Guid commandMenuGroup, int commandId)
{
this.menuText = menuText;
cmdId = new CommandID(commandMenuGroup, commandId);
}
internal DesignerVerb GetDesignerVerb(object obj, Reflection.MethodInfo mi)
{
EventHandler handler = (EventHandler)Delegate.CreateDelegate(typeof(EventHandler), obj, mi);
if (cmdId != null)
return new DesignerVerb(menuText, handler, cmdId);
return new DesignerVerb(menuText, handler);
}
}
internal class EditorServiceContext : IWindowsFormsEditorService, ITypeDescriptorContext, IServiceProvider
{
private IComponentChangeService _componentChangeSvc;
private ComponentDesigner _designer;
private PropertyDescriptor _targetProperty;
internal EditorServiceContext(ComponentDesigner designer)
{
_designer = designer;
}
internal EditorServiceContext(ComponentDesigner designer, PropertyDescriptor prop)
{
_designer = designer;
_targetProperty = prop;
if (prop == null)
{
prop = TypeDescriptor.GetDefaultProperty(designer.Component);
if ((prop != null) && typeof(System.Collections.ICollection).IsAssignableFrom(prop.PropertyType))
_targetProperty = prop;
}
}
internal EditorServiceContext(ComponentDesigner designer, PropertyDescriptor prop, string newVerbText)
: this(designer, prop)
{
_designer.Verbs.Add(new DesignerVerb(newVerbText, new EventHandler(OnEditItems)));
}
private T GetService<T>() => (T)((IServiceProvider)this).GetService(typeof(T));
private void OnEditItems(object sender, EventArgs e)
{
object component = _targetProperty.GetValue(_designer.Component);
if (component != null)
{
CollectionEditor editor = TypeDescriptor.GetEditor(component, typeof(System.Drawing.Design.UITypeEditor)) as CollectionEditor;
if (editor != null)
editor.EditValue(this, this, component);
}
}
void ITypeDescriptorContext.OnComponentChanged()
{
ChangeService.OnComponentChanged(_designer.Component, _targetProperty, null, null);
}
bool ITypeDescriptorContext.OnComponentChanging()
{
try
{
ChangeService.OnComponentChanging(_designer.Component, _targetProperty);
}
catch (CheckoutException exception)
{
if (exception != CheckoutException.Canceled)
throw;
return false;
}
return true;
}
object IServiceProvider.GetService(Type serviceType)
{
if ((serviceType == typeof(ITypeDescriptorContext)) || (serviceType == typeof(IWindowsFormsEditorService)))
return this;
if ((_designer.Component != null) && (_designer.Component.Site != null))
return _designer.Component.Site.GetService(serviceType);
return null;
}
void IWindowsFormsEditorService.CloseDropDown()
{
}
void IWindowsFormsEditorService.DropDownControl(Control control)
{
}
public DialogResult ShowDialog(Form dialog)
{
if (dialog == null)
throw new ArgumentNullException(nameof(dialog));
IUIService service = GetService<IUIService>();
if (service != null)
return service.ShowDialog(dialog);
return dialog.ShowDialog(_designer.Component as IWin32Window);
}
private IComponentChangeService ChangeService
{
get
{
if (_componentChangeSvc == null)
_componentChangeSvc = GetService<IComponentChangeService>();
return _componentChangeSvc;
}
}
IContainer ITypeDescriptorContext.Container
{
get
{
if (_designer.Component.Site != null)
return _designer.Component.Site.Container;
return null;
}
}
object ITypeDescriptorContext.Instance => _designer.Component;
PropertyDescriptor ITypeDescriptorContext.PropertyDescriptor => _targetProperty;
}
internal abstract class RichBehavior<D> : Behavior.Behavior where D : ControlDesigner
{
public RichBehavior(D designer)
{
Designer = designer;
}
public D Designer { get; }
}
internal class RichComponentDesigner<C, A> : ComponentDesigner
where C : Component
where A : _BaseDesignerActionList
{
private A actions;
private Adorner adorner;
private IDictionary<string, List<Attribute>> redirectedProps;
private DesignerVerbCollection verbs;
public override DesignerActionListCollection ActionLists
{
get
{
if (actions == null)
actions = Activator.CreateInstance(typeof(A), this, Component) as A;
return new DesignerActionListCollection(new DesignerActionList[] { actions });
}
}
public BehaviorService BehaviorService { get; private set; }
public IComponentChangeService ComponentChangeService { get; private set; }
public new C Component => (C)base.Component;
public virtual GlyphCollection Glyphs => Adorner.Glyphs;
public ISelectionService SelectionService { get; private set; }
public override DesignerVerbCollection Verbs
{
get
{
if (verbs == null)
verbs = this.GetAttributedVerbs();
return verbs;
}
}
internal Adorner Adorner
{
get
{
if (adorner == null)
{
adorner = new Adorner();
BehaviorService.Adorners.Add(adorner);
}
return adorner;
}
}
protected virtual IEnumerable<string> PropertiesToRemove => new string[0];
public override void Initialize(IComponent component)
{
base.Initialize(component);
BehaviorService = GetService<BehaviorService>();
SelectionService = GetService<ISelectionService>();
if (SelectionService != null)
SelectionService.SelectionChanged += OnSelectionChanged;
ComponentChangeService = GetService<IComponentChangeService>();
if (ComponentChangeService != null)
ComponentChangeService.ComponentChanged += OnComponentChanged;
}
protected override void Dispose(bool disposing)
{
if (disposing)
{
if (BehaviorService != null & adorner != null)
BehaviorService.Adorners.Remove(adorner);
ISelectionService ss = SelectionService;
if (ss != null)
ss.SelectionChanged -= OnSelectionChanged;
IComponentChangeService cs = ComponentChangeService;
if (cs != null)
cs.ComponentChanged -= OnComponentChanged;
}
base.Dispose(disposing);
}
protected virtual S GetService<S>() where S : class => (S)GetService(typeof(S));
protected virtual void OnComponentChanged(object sender, ComponentChangedEventArgs e)
{
}
protected virtual void OnSelectionChanged(object sender, EventArgs e)
{
}
protected override void PreFilterProperties(System.Collections.IDictionary properties)
{
base.PreFilterProperties(properties);
// RedirectRegisteredProperties
if (redirectedProps == null)
redirectedProps = this.GetRedirectedProperties();
this.RedirectRegisteredProperties(properties, redirectedProps);
// Remove properties
this.RemoveProperties(properties, PropertiesToRemove);
}
}
internal class RichControlDesigner<C, A> : ControlDesigner
where C : Control
where A : _BaseDesignerActionList
{
private A actions;
private Adorner adorner;
private IDictionary<string, List<Attribute>> redirectedProps;
private DesignerVerbCollection verbs;
public override DesignerActionListCollection ActionLists
{
get
{
if (actions == null)
actions = Activator.CreateInstance(typeof(A), this, Component) as A;
return new DesignerActionListCollection(new DesignerActionList[] { actions });
}
}
public new BehaviorService BehaviorService => base.BehaviorService;
public IComponentChangeService ComponentChangeService { get; private set; }
public new C Control => (C)base.Control;
public virtual GlyphCollection Glyphs => Adorner.Glyphs;
public ISelectionService SelectionService { get; private set; }
public override DesignerVerbCollection Verbs
{
get
{
if (verbs == null)
verbs = this.GetAttributedVerbs();
return verbs;
}
}
internal Adorner Adorner
{
get
{
if (adorner == null)
{
adorner = new Adorner();
BehaviorService.Adorners.Add(adorner);
}
return adorner;
}
}
protected virtual IEnumerable<string> PropertiesToRemove => new string[0];
public override void Initialize(IComponent component)
{
base.Initialize(component);
SelectionService = GetService<ISelectionService>();
if (SelectionService != null)
SelectionService.SelectionChanged += OnSelectionChanged;
ComponentChangeService = GetService<IComponentChangeService>();
if (ComponentChangeService != null)
ComponentChangeService.ComponentChanged += OnComponentChanged;
}
protected override void Dispose(bool disposing)
{
if (disposing)
{
if (BehaviorService != null)
BehaviorService.Adorners.Remove(adorner);
ISelectionService ss = SelectionService;
if (ss != null)
ss.SelectionChanged -= OnSelectionChanged;
IComponentChangeService cs = ComponentChangeService;
if (cs != null)
cs.ComponentChanged -= OnComponentChanged;
}
base.Dispose(disposing);
}
protected virtual S GetService<S>() where S : class => (S)GetService(typeof(S));
protected virtual void OnComponentChanged(object sender, ComponentChangedEventArgs e)
{
}
protected virtual void OnSelectionChanged(object sender, EventArgs e)
{
}
protected override void PreFilterProperties(System.Collections.IDictionary properties)
{
base.PreFilterProperties(properties);
// RedirectRegisteredProperties
if (redirectedProps == null)
redirectedProps = this.GetRedirectedProperties();
this.RedirectRegisteredProperties(properties, redirectedProps);
// Remove properties
this.RemoveProperties(properties, PropertiesToRemove);
}
}
internal abstract class _BaseDesignerActionList : DesignerActionList
{
private List<DesignerActionItem> fullAIList;
public _BaseDesignerActionList(ComponentDesigner designer, IComponent component)
: base(component)
{
base.AutoShow = true;
ParentDesigner = designer;
}
public ComponentDesigner ParentDesigner { get; }
public override DesignerActionItemCollection GetSortedActionItems()
{
// Retrieve all attributed methods and properties
if (fullAIList == null)
fullAIList = this.GetAllAttributedActionItems();
// Filter for conditions and load
return this.GetFilteredActionItems(fullAIList);
}
protected T GetComponentProperty<T>(string propName)
{
var p = ComponentProp(propName, typeof(T));
if (p != null)
return (T)p.GetValue(Component, null);
return default(T);
}
protected void SetComponentProperty<T>(string propName, T value)
{
var p = ComponentProp(propName, typeof(T));
if (p != null)
p.SetValue(Component, value, null);
}
private Reflection.PropertyInfo ComponentProp(string propName, Type retType) => Component.GetType().GetProperty(propName, ComponentDesignerExtension.AllInstBind, null, retType, Type.EmptyTypes, null);
}
internal abstract class RichDesignerActionList<D, C> : _BaseDesignerActionList where D : ComponentDesigner where C : Component
{
public RichDesignerActionList(D designer, C component) : base(designer, component)
{
ParentDesigner = designer;
}
public new C Component => (C)base.Component;
public new D ParentDesigner { get; }
}
internal abstract class RichGlyph<D> : Glyph, IDisposable where D : ControlDesigner
{
public RichGlyph(D designer, Behavior.Behavior behavior)
: base(behavior)
{
Designer = designer;
}
public D Designer { get; }
public virtual void Dispose()
{
}
public void SetBehavior(RichBehavior<D> b) { base.SetBehavior(b); }
}
internal class RichParentControlDesigner<C, A> : ParentControlDesigner
where C : Control
where A : _BaseDesignerActionList
{
private A actions;
private Adorner adorner;
private IDictionary<string, List<Attribute>> redirectedProps;
private DesignerVerbCollection verbs;
public override DesignerActionListCollection ActionLists
{
get
{
if (actions == null)
actions = Activator.CreateInstance(typeof(A), this, Component) as A;
return new DesignerActionListCollection(new DesignerActionList[] { actions });
}
}
public new BehaviorService BehaviorService => base.BehaviorService;
public IComponentChangeService ComponentChangeService { get; private set; }
public new C Control => (C)base.Control;
public virtual GlyphCollection Glyphs => Adorner.Glyphs;
public ISelectionService SelectionService { get; private set; }
public override DesignerVerbCollection Verbs
{
get
{
if (verbs == null)
verbs = this.GetAttributedVerbs();
return verbs;
}
}
internal Adorner Adorner
{
get
{
if (adorner == null)
{
adorner = new Adorner();
BehaviorService.Adorners.Add(adorner);
}
return adorner;
}
}
protected virtual IEnumerable<string> PropertiesToRemove => new string[0];
public override void Initialize(IComponent component)
{
base.Initialize(component);
SelectionService = GetService<ISelectionService>();
if (SelectionService != null)
SelectionService.SelectionChanged += OnSelectionChanged;
ComponentChangeService = GetService<IComponentChangeService>();
if (ComponentChangeService != null)
ComponentChangeService.ComponentChanged += OnComponentChanged;
}
protected override void Dispose(bool disposing)
{
if (disposing)
{
if (BehaviorService != null & adorner != null)
BehaviorService.Adorners.Remove(adorner);
ISelectionService ss = SelectionService;
if (ss != null)
ss.SelectionChanged -= OnSelectionChanged;
IComponentChangeService cs = ComponentChangeService;
if (cs != null)
cs.ComponentChanged -= OnComponentChanged;
}
base.Dispose(disposing);
}
protected virtual S GetService<S>() where S : class => (S)GetService(typeof(S));
protected virtual void OnComponentChanged(object sender, ComponentChangedEventArgs e)
{
}
protected virtual void OnSelectionChanged(object sender, EventArgs e)
{
}
protected override void PreFilterProperties(System.Collections.IDictionary properties)
{
base.PreFilterProperties(properties);
// RedirectRegisteredProperties
if (redirectedProps == null)
redirectedProps = this.GetRedirectedProperties();
this.RedirectRegisteredProperties(properties, redirectedProps);
// Remove properties
this.RemoveProperties(properties, PropertiesToRemove);
}
}
}

Plik binarny nie jest wyświetlany.

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 822 B

Wyświetl plik

@ -0,0 +1,277 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics.CodeAnalysis;
using System.Drawing;
using System.Windows.Forms;
namespace Vanara.Interop.DesktopWindowManager
{
/// <summary>
/// GlassExtenderProvider extends a <see cref="System.Windows.Forms.Form"/> and provides glass margins.
/// </summary>
[ProvideProperty("GlassEnabled", typeof(Form))]
[ProvideProperty("GlassMarginMovesForm", typeof(Form))]
[ProvideProperty("GlassMargins", typeof(Form))]
[ToolboxItem(true), ToolboxBitmap(typeof(AeroWizard.WizardControl), "GlassExtenderProvider.bmp")]
[Description("Extender for a Form that adds Aero glass properties.")]
public class GlassExtenderProvider : Component, IExtenderProvider
{
private readonly Dictionary<Control, GlassFormProperties> formProps = new Dictionary<Control, GlassFormProperties>();
/// <summary>
/// Properties for each form that is extended.
/// </summary>
[SuppressMessage("ReSharper", "InconsistentNaming")]
private class GlassFormProperties
{
public Point FormMoveLastMousePos = Point.Empty;
public bool FormMoveTracking;
public bool GlassEnabled = true;
public Padding GlassMargins = Padding.Empty;
public bool GlassMarginMovesForm = true;
}
/// <summary>
/// Gets whether glass should be extended into the client space.
/// </summary>
/// <param name="form">The <see cref="System.Windows.Forms.Form"/> to be extended.</param>
/// <returns><c>true</c> if the glass is enabled; otherwise <c>false</c>.</returns>
[DisplayName(@"GlassEnabled")]
[DefaultValue(true)]
[Category("Behavior")]
[Description("Indicates whether extending glass into the client area is enabled.")]
public bool GetGlassEnabled(Form form)
{
GlassFormProperties prop;
if (formProps.TryGetValue(form, out prop))
return prop.GlassEnabled;
return true;
}
/// <summary>
/// Gets a value indicating whether clicking and dragging within the top margin will move the form.
/// </summary>
/// <param name="form">The <see cref="System.Windows.Forms.Form"/> to be extended.</param>
/// <returns><c>true</c> if clicking and dragging on the top margin moves the form; otherwise, <c>false</c>.</returns>
[DisplayName(@"GlassMarginMovesForm")]
[DefaultValue(true)]
[Category("Behavior")]
[Description("Specifies if clicking and dragging within the margin will move the form. ")]
public bool GetGlassMarginMovesForm(Form form)
{
GlassFormProperties prop;
if (formProps.TryGetValue(form, out prop))
return prop.GlassMarginMovesForm;
return true;
}
/// <summary>
/// Gets the glass margins.
/// </summary>
/// <param name="form">The <see cref="System.Windows.Forms.Form"/> to be extended.</param>
/// <returns>The margins where the glass will be extended.</returns>
[DefaultValue(typeof(Padding), "0")]
[DisplayName(@"GlassMargins")]
[Description("Specifies the interior glass margin of the form. Set to -1 for full window glass.")]
[Category("Layout")]
public Padding GetGlassMargins(Form form)
{
GlassFormProperties prop;
if (formProps.TryGetValue(form, out prop))
return prop.GlassMargins;
return Padding.Empty;
}
/// <summary>
/// Specifies whether this object can provide its extender properties to the specified object.
/// </summary>
/// <param name="form">The <see cref="T:System.Object"/> to receive the extender properties.</param>
/// <returns>
/// true if this object can provide extender properties to the specified object; otherwise, false.
/// </returns>
bool IExtenderProvider.CanExtend(object form) => (form != this) && (form is Form);
/// <summary>
/// Set whether the glass should be extended into the client space.
/// </summary>
/// <param name="form">The <see cref="System.Windows.Forms.Form"/> to be extended.</param>
/// <param name="value">The enabled value.</param>
public void SetGlassEnabled(Form form, bool value)
{
var prop = GetFormProperties(form);
prop.GlassEnabled = value;
GlassifyForm(form);
}
/// <summary>
/// Sets a value indicating whether clicking and dragging within the margin will move the form.
/// </summary>
/// <param name="form">The <see cref="System.Windows.Forms.Form"/> to be extended.</param>
/// <param name="value"><c>true</c> if clicking and dragging within the margin moves the form; otherwise, <c>false</c>.</param>
public void SetGlassMarginMovesForm(Form form, bool value)
{
var prop = GetFormProperties(form);
prop.GlassMarginMovesForm = value;
}
/// <summary>
/// Sets the glass margins.
/// </summary>
/// <param name="form">The <see cref="System.Windows.Forms.Form"/> to be extended.</param>
/// <param name="value">The margins where the glass will be extended.</param>
public void SetGlassMargins(Form form, Padding value)
{
if (form == null)
throw new ArgumentNullException(nameof(form));
var prop = GetFormProperties(form);
if (value == Padding.Empty)
{
prop.GlassMargins = Padding.Empty;
UnhookForm(form);
}
else
{
prop.GlassMargins = value;
form.Paint += form_Paint;
if (!form.IsDesignMode())
{
form.MouseDown += form_MouseDown;
form.MouseMove += form_MouseMove;
form.MouseUp += form_MouseUp;
form.Resize += form_Resize;
form.Shown += form_Shown;
}
}
form.Invalidate();
}
/// <summary>
/// Releases the unmanaged resources used by the <see cref="T:System.ComponentModel.Component"/> and optionally releases the managed resources.
/// </summary>
/// <param name="disposing">true to release both managed and unmanaged resources; false to release only unmanaged resources.</param>
protected override void Dispose(bool disposing)
{
if (disposing)
{
foreach (var control in formProps.Keys)
{
var form = control as Form;
if (form != null && !form.IsDisposed)
UnhookForm(form);
}
}
base.Dispose(disposing);
}
private void form_MouseDown(object sender, MouseEventArgs e)
{
if (e.Button != MouseButtons.Left) return;
var prop = GetFormProperties(sender as Form);
if (!prop.GlassMarginMovesForm) return;
prop.FormMoveTracking = true;
prop.FormMoveLastMousePos = ((Control)sender).PointToScreen(e.Location);
}
private void form_MouseMove(object sender, MouseEventArgs e)
{
var form = sender as Form;
if (form == null) return;
var prop = GetFormProperties(form);
if (!prop.FormMoveTracking || GetNonGlassArea(form, prop).Contains(e.Location)) return;
var screen = form.PointToScreen(e.Location);
var diff = new Point(screen.X - prop.FormMoveLastMousePos.X, screen.Y - prop.FormMoveLastMousePos.Y);
var loc = form.Location;
loc.Offset(diff);
form.Location = loc;
prop.FormMoveLastMousePos = screen;
}
private void form_MouseUp(object sender, MouseEventArgs e)
{
if (e.Button != MouseButtons.Left) return;
var prop = GetFormProperties(sender as Form);
prop.FormMoveTracking = false;
}
private void form_Paint(object sender, PaintEventArgs e)
{
GlassifyForm(sender as Form, e.Graphics);
}
private void form_Resize(object sender, EventArgs e)
{
var form = sender as Form;
if (form != null && (DesktopWindowManager.IsCompositionEnabled() && GetGlassEnabled(form)) || form.IsDesignMode())
InvalidateNonGlassClientArea(form);
}
private void form_Shown(object sender, EventArgs e)
{
GlassifyForm(sender as Form);
}
private GlassFormProperties GetFormProperties(Form form)
{
GlassFormProperties prop;
if (!formProps.TryGetValue(form, out prop))
formProps.Add(form, prop = new GlassFormProperties());
return prop;
}
private static Rectangle GetNonGlassArea(Form form, GlassFormProperties prop)
{
if (prop == null)
return form.ClientRectangle;
return new Rectangle(form.ClientRectangle.Left + prop.GlassMargins.Left, form.ClientRectangle.Top + prop.GlassMargins.Top,
form.ClientRectangle.Width - prop.GlassMargins.Horizontal, form.ClientRectangle.Height - prop.GlassMargins.Vertical);
}
private void GlassifyForm(Form form, Graphics g = null)
{
if (!(DesktopWindowManager.IsCompositionEnabled() && GetGlassEnabled(form)) && !form.IsDesignMode())
return;
if (g == null) g = form.CreateGraphics();
GlassFormProperties prop;
if (!formProps.TryGetValue(form, out prop))
return;
// Paint the glass effect.
if (prop.GlassMargins == new Padding(-1))
g.FillRectangle(Brushes.Black, form.ClientRectangle);
else
{
using (var r = new Region(form.ClientRectangle))
{
r.Exclude(GetNonGlassArea(form, prop));
g.FillRegion(Brushes.Black, r);
}
}
if (!form.IsDesignMode())
form.ExtendFrameIntoClientArea(prop.GlassMargins);
}
private void InvalidateNonGlassClientArea(Form form)
{
var glassMargin = GetGlassMargins(form);
if (glassMargin == Padding.Empty) return;
var rect = new Rectangle(glassMargin.Left, glassMargin.Top, form.ClientRectangle.Width - glassMargin.Right,
form.ClientRectangle.Height - glassMargin.Bottom);
form.Invalidate(rect, false);
}
private void UnhookForm(Form form)
{
form.MouseDown -= form_MouseDown;
form.MouseMove -= form_MouseMove;
form.MouseUp -= form_MouseUp;
form.Shown -= form_Shown;
form.Resize -= form_Resize;
form.Paint -= form_Paint;
}
}
}

Plik binarny nie jest wyświetlany.

Wyświetl plik

@ -0,0 +1,436 @@
using System;
using System.Runtime.InteropServices;
namespace Vanara.Interop
{
internal static partial class NativeMethods
{
/// <summary>The BITMAPINFO structure defines the dimensions and color information for a DIB.</summary>
/// <remarks>
/// A DIB consists of two distinct parts: a BITMAPINFO structure describing the dimensions and colors of the
/// bitmap, and an array of bytes defining the pixels of the bitmap. The bits in the array are packed together,
/// but each scan line must be padded with zeros to end on a LONG data-type boundary. If the height of the bitmap
/// is positive, the bitmap is a bottom-up DIB and its origin is the lower-left corner. If the height is
/// negative, the bitmap is a top-down DIB and its origin is the upper left corner.
/// <para>
/// A bitmap is packed when the bitmap array immediately follows the BITMAPINFO header. Packed bitmaps are
/// referenced by a single pointer. For packed bitmaps, the biClrUsed member must be set to an even number when
/// using the DIB_PAL_COLORS mode so that the DIB bitmap array starts on a DWORD boundary.
/// </para>
/// <para><c>Note</c></para>
/// <para>
/// The bmiColors member should not contain palette indexes if the bitmap is to be stored in a file or
/// transferred to another application.
/// </para>
/// <para>
/// Unless the application has exclusive use and control of the bitmap, the bitmap color table should contain
/// explicit RGB values.
/// </para>
/// </remarks>
[StructLayout(LayoutKind.Sequential)]
public struct BITMAPINFO
{
/// <summary>A BITMAPINFOHEADER structure that contains information about the dimensions of color format.</summary>
public BITMAPINFOHEADER bmiHeader;
/// <summary>
/// The bmiColors member contains one of the following:
/// <list type="bullet">
/// <item>
/// <description>An array of RGBQUAD. The elements of the array that make up the color table.</description>
/// </item>
/// <item>
/// <description>
/// An array of 16-bit unsigned integers that specifies indexes into the currently realized logical palette.
/// This use of bmiColors is allowed for functions that use DIBs. When bmiColors elements contain indexes to
/// a realized logical palette, they must also call the following bitmap functions: CreateDIBitmap,
/// CreateDIBPatternBrush, CreateDIBSection (The iUsage parameter of CreateDIBSection must be set to DIB_PAL_COLORS.)
/// </description>
/// </item>
/// </list>
/// <para>
/// The number of entries in the array depends on the values of the biBitCount and biClrUsed members of the
/// BITMAPINFOHEADER structure.
/// </para>
/// <para>
/// The colors in the bmiColors table appear in order of importance. For more information, see the Remarks section.
/// </para>
/// </summary>
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 1, ArraySubType = UnmanagedType.Struct)]
public RGBQUAD[] bmiColors;
/// <summary>
/// Initializes a new instance of the <see cref="BITMAPINFO"/> structure.
/// </summary>
/// <param name="width">The width.</param>
/// <param name="height">The height.</param>
/// <param name="bitCount">The bit count.</param>
public BITMAPINFO(int width, int height, ushort bitCount = 32)
: this()
{
bmiHeader.biSize = Marshal.SizeOf(typeof(BITMAPINFO));
bmiHeader.biWidth = width;
bmiHeader.biHeight = height;
bmiHeader.biPlanes = 1;
bmiHeader.biBitCount = bitCount;
bmiHeader.biCompression = BitmapCompressionMode.BI_RGB;
bmiHeader.biSizeImage = 0; // (uint)width * (uint)height * bitCount / 8;
}
}
/// <summary>The type of compression for a compressed bottom-up bitmap (top-down DIBs cannot be compressed). Used in <see cref="BITMAPINFOHEADER"/>.</summary>
public enum BitmapCompressionMode : uint
{
/// <summary>An uncompressed format.</summary>
BI_RGB = 0,
/// <summary>A run-length encoded (RLE) format for bitmaps with 8 bpp. The compression format is a 2-byte format consisting of a count byte followed by a byte containing a color index.</summary>
BI_RLE8 = 1,
/// <summary>An RLE format for bitmaps with 4 bpp. The compression format is a 2-byte format consisting of a count byte followed by two word-length color indexes.</summary>
BI_RLE4 = 2,
/// <summary>Specifies that the bitmap is not compressed and that the color table consists of three DWORD color masks that specify the red, green, and blue components, respectively, of each pixel. This is valid when used with 16- and 32-bpp bitmaps.</summary>
BI_BITFIELDS = 3,
/// <summary>Indicates that the image is a JPEG image.</summary>
BI_JPEG = 4,
/// <summary>Indicates that the image is a PNG image.</summary>
BI_PNG = 5
}
/// <summary>The BITMAPINFOHEADER structure contains information about the dimensions and color format of a DIB.</summary>
[StructLayout(LayoutKind.Sequential)]
public struct BITMAPINFOHEADER
{
/// <summary>The number of bytes required by the structure.</summary>
public int biSize;
/// <summary>
/// The width of the bitmap, in pixels. If biCompression is BI_JPEG or BI_PNG, the biWidth member specifies the width of the decompressed JPEG or PNG
/// image file, respectively.
/// </summary>
public int biWidth;
/// <summary>
/// The height of the bitmap, in pixels. If biHeight is positive, the bitmap is a bottom-up DIB and its origin is the lower-left corner. If biHeight
/// is negative, the bitmap is a top-down DIB and its origin is the upper-left corner.
/// <para>If biHeight is negative, indicating a top-down DIB, biCompression must be either BI_RGB or BI_BITFIELDS. Top-down DIBs cannot be compressed.</para>
/// <para>If biCompression is BI_JPEG or BI_PNG, the biHeight member specifies the height of the decompressed JPEG or PNG image file, respectively.</para>
/// </summary>
public int biHeight;
/// <summary>The number of planes for the target device. This value must be set to 1.</summary>
public ushort biPlanes;
/// <summary>
/// The number of bits-per-pixel. The biBitCount member of the BITMAPINFOHEADER structure determines the number of bits that define each pixel and
/// the maximum number of colors in the bitmap. This member must be one of the following values.
/// <list type="table">
/// <listheader>
/// <term>Value</term>
/// <description>Meaning</description>
/// </listheader>
/// <item>
/// <term>0</term>
/// <description>The number of bits-per-pixel is specified or is implied by the JPEG or PNG format.</description>
/// </item>
/// <item>
/// <term>1</term>
/// <description>
/// The bitmap is monochrome, and the bmiColors member of BITMAPINFO contains two entries. Each bit in the bitmap array represents a pixel. If the
/// bit is clear, the pixel is displayed with the color of the first entry in the bmiColors table; if the bit is set, the pixel has the color of the
/// second entry in the table.
/// </description>
/// </item>
/// <item>
/// <term>4</term>
/// <description>
/// The bitmap has a maximum of 16 colors, and the bmiColors member of BITMAPINFO contains up to 16 entries. Each pixel in the bitmap is represented
/// by a 4-bit index into the color table. For example, if the first byte in the bitmap is 0x1F, the byte represents two pixels. The first pixel
/// contains the color in the second table entry, and the second pixel contains the color in the sixteenth table entry.
/// </description>
/// </item>
/// <item>
/// <term>8</term>
/// <description>
/// The bitmap has a maximum of 256 colors, and the bmiColors member of BITMAPINFO contains up to 256 entries. In this case, each byte in the array
/// represents a single pixel.
/// </description>
/// </item>
/// <item>
/// <term>16</term>
/// <description>
/// The bitmap has a maximum of 2^16 colors. If the biCompression member of the BITMAPINFOHEADER is BI_RGB, the bmiColors member of BITMAPINFO is
/// NULL. Each WORD in the bitmap array represents a single pixel. The relative intensities of red, green, and blue are represented with five bits
/// for each color component. The value for blue is in the least significant five bits, followed by five bits each for green and red. The most
/// significant bit is not used. The bmiColors color table is used for optimizing colors used on palette-based devices, and must contain the number
/// of entries specified by the biClrUsed member of the BITMAPINFOHEADER.
/// <para>
/// If the biCompression member of the BITMAPINFOHEADER is BI_BITFIELDS, the bmiColors member contains three DWORD color masks that specify the red,
/// green, and blue components, respectively, of each pixel. Each WORD in the bitmap array represents a single pixel.
/// </para>
/// <para>
/// When the biCompression member is BI_BITFIELDS, bits set in each DWORD mask must be contiguous and should not overlap the bits of another mask.
/// All the bits in the pixel do not have to be used.
/// </para>
/// </description>
/// </item>
/// <item>
/// <term>24</term>
/// <description>
/// The bitmap has a maximum of 2^24 colors, and the bmiColors member of BITMAPINFO is NULL. Each 3-byte triplet in the bitmap array represents the
/// relative intensities of blue, green, and red, respectively, for a pixel. The bmiColors color table is used for optimizing colors used on
/// palette-based devices, and must contain the number of entries specified by the biClrUsed member of the BITMAPINFOHEADER.
/// </description>
/// </item>
/// <item>
/// <term>32</term>
/// <description>
/// The bitmap has a maximum of 2^32 colors. If the biCompression member of the BITMAPINFOHEADER is BI_RGB, the bmiColors member of BITMAPINFO is
/// NULL. Each DWORD in the bitmap array represents the relative intensities of blue, green, and red for a pixel. The value for blue is in the least
/// significant 8 bits, followed by 8 bits each for green and red. The high byte in each DWORD is not used. The bmiColors color table is used for
/// optimizing colors used on palette-based devices, and must contain the number of entries specified by the biClrUsed member of the BITMAPINFOHEADER.
/// <para>
/// If the biCompression member of the BITMAPINFOHEADER is BI_BITFIELDS, the bmiColors member contains three DWORD color masks that specify the red,
/// green, and blue components, respectively, of each pixel. Each DWORD in the bitmap array represents a single pixel.
/// </para>
/// <para>
/// When the biCompression member is BI_BITFIELDS, bits set in each DWORD mask must be contiguous and should not overlap the bits of another mask.
/// All the bits in the pixel do not need to be used.
/// </para>
/// </description>
/// </item>
/// </list>
/// </summary>
public ushort biBitCount;
/// <summary>The type of compression for a compressed bottom-up bitmap (top-down DIBs cannot be compressed).</summary>
public BitmapCompressionMode biCompression;
/// <summary>
/// The size, in bytes, of the image. This may be set to zero for BI_RGB bitmaps. If biCompression is BI_JPEG or BI_PNG, biSizeImage indicates the
/// size of the JPEG or PNG image buffer, respectively.
/// </summary>
public uint biSizeImage;
/// <summary>
/// The horizontal resolution, in pixels-per-meter, of the target device for the bitmap. An application can use this value to select a bitmap from a
/// resource group that best matches the characteristics of the current device.
/// </summary>
public int biXPelsPerMeter;
/// <summary>The vertical resolution, in pixels-per-meter, of the target device for the bitmap.</summary>
public int biYPelsPerMeter;
/// <summary>
/// The number of color indexes in the color table that are actually used by the bitmap. If this value is zero, the bitmap uses the maximum number of
/// colors corresponding to the value of the biBitCount member for the compression mode specified by biCompression.
/// <para>
/// If biClrUsed is nonzero and the biBitCount member is less than 16, the biClrUsed member specifies the actual number of colors the graphics engine
/// or device driver accesses. If biBitCount is 16 or greater, the biClrUsed member specifies the size of the color table used to optimize
/// performance of the system color palettes. If biBitCount equals 16 or 32, the optimal color palette starts immediately following the three DWORD masks.
/// </para>
/// <para>
/// When the bitmap array immediately follows the BITMAPINFO structure, it is a packed bitmap. Packed bitmaps are referenced by a single pointer.
/// Packed bitmaps require that the biClrUsed member must be either zero or the actual size of the color table.
/// </para>
/// </summary>
public uint biClrUsed;
/// <summary>The number of color indexes that are required for displaying the bitmap. If this value is zero, all colors are required.</summary>
public uint biClrImportant;
}
/// <summary>The RGBQUAD structure describes a color consisting of relative intensities of red, green, and blue.</summary>
[StructLayout(LayoutKind.Sequential)]
public struct RGBQUAD
{
/// <summary>The intensity of blue in the color.</summary>
public byte rgbBlue;
/// <summary>The intensity of green in the color.</summary>
public byte rgbGreen;
/// <summary>The intensity of red in the color.</summary>
public byte rgbRed;
/// <summary>This member is reserved and must be zero.</summary>
public byte rgbReserved;
/// <summary>Gets or sets the color associated with the <see cref="RGBQUAD"/> structure.</summary>
/// <value>The color.</value>
public System.Drawing.Color Color
{
get { return System.Drawing.Color.FromArgb(rgbReserved, rgbRed, rgbGreen, rgbBlue); }
set { rgbReserved = value.A; rgbBlue = value.B; rgbGreen = value.G; rgbRed = value.R; }
}
}
public enum DIBColorMode : int
{
/// <summary>The BITMAPINFO structure contains an array of literal RGB values.</summary>
DIB_RGB_COLORS = 0,
/// <summary>
/// The bmiColors member of the BITMAPINFO structure is an array of 16-bit indexes into the logical palette of the device context specified by hdc.
/// </summary>
DIB_PAL_COLORS = 1
}
/// <summary>
/// The CreateDIBSection function creates a DIB that applications can write to directly. The function gives you a pointer to the location of the bitmap
/// bit values. You can supply a handle to a file-mapping object that the function will use to create the bitmap, or you can let the system allocate the
/// memory for the bitmap.
/// </summary>
/// <param name="hdc">
/// A handle to a device context. If the value of iUsage is DIB_PAL_COLORS, the function uses this device context's logical palette to initialize the DIB colors.
/// </param>
/// <param name="pbmi">A pointer to a BITMAPINFO structure that specifies various attributes of the DIB, including the bitmap dimensions and colors.</param>
/// <param name="iUsage">
/// The type of data contained in the bmiColors array member of the BITMAPINFO structure pointed to by pbmi (either logical palette indexes or literal
/// RGB values).
/// </param>
/// <param name="ppvBits">A pointer to a variable that receives a pointer to the location of the DIB bit values.</param>
/// <param name="hSection">
/// A handle to a file-mapping object that the function will use to create the DIB. This parameter can be NULL.
/// <para>
/// If hSection is not NULL, it must be a handle to a file-mapping object created by calling the CreateFileMapping function with the PAGE_READWRITE or
/// PAGE_WRITECOPY flag. Read-only DIB sections are not supported. Handles created by other means will cause CreateDIBSection to fail.
/// </para>
/// <para>
/// If hSection is not NULL, the CreateDIBSection function locates the bitmap bit values at offset dwOffset in the file-mapping object referred to by
/// hSection. An application can later retrieve the hSection handle by calling the GetObject function with the HBITMAP returned by CreateDIBSection.
/// </para>
/// <para>
/// If hSection is NULL, the system allocates memory for the DIB. In this case, the CreateDIBSection function ignores the dwOffset parameter. An
/// application cannot later obtain a handle to this memory. The dshSection member of the DIBSECTION structure filled in by calling the GetObject
/// function will be NULL.
/// </para>
/// </param>
/// <param name="dwOffset">
/// The offset from the beginning of the file-mapping object referenced by hSection where storage for the bitmap bit values is to begin. This value is
/// ignored if hSection is NULL. The bitmap bit values are aligned on doubleword boundaries, so dwOffset must be a multiple of the size of a DWORD.
/// </param>
/// <returns>
/// If the function succeeds, the return value is a handle to the newly created DIB, and *ppvBits points to the bitmap bit values.
/// <para>If the function fails, the return value is NULL, and *ppvBits is NULL.</para>
/// </returns>
/// <remarks>
/// As noted above, if hSection is NULL, the system allocates memory for the DIB. The system closes the handle to that memory when you later delete the
/// DIB by calling the DeleteObject function. If hSection is not NULL, you must close the hSection memory handle yourself after calling DeleteObject to
/// delete the bitmap.
/// <para>You cannot paste a DIB section from one application into another application.</para>
/// <para>
/// CreateDIBSection does not use the BITMAPINFOHEADER parameters biXPelsPerMeter or biYPelsPerMeter and will not provide resolution information in the
/// BITMAPINFO structure.
/// </para>
/// <para>
/// You need to guarantee that the GDI subsystem has completed any drawing to a bitmap created by CreateDIBSection before you draw to the bitmap
/// yourself. Access to the bitmap must be synchronized. Do this by calling the GdiFlush function. This applies to any use of the pointer to the bitmap
/// bit values, including passing the pointer in calls to functions such as SetDIBits.
/// </para>
/// <para>ICM: No color management is done.</para>
/// </remarks>
[DllImport(GDI32, ExactSpelling = true, SetLastError = true)]
public static extern IntPtr CreateDIBSection(SafeDCHandle hdc, ref BITMAPINFO pbmi, DIBColorMode iUsage, out IntPtr ppvBits, IntPtr hSection, int dwOffset);
/// <summary>
/// The GetDIBits function retrieves the bits of the specified compatible bitmap and copies them into a buffer as a DIB using the specified format.
/// </summary>
/// <param name="hdc">A handle to the device context.</param>
/// <param name="hbmp">A handle to the bitmap. This must be a compatible bitmap (DDB).</param>
/// <param name="uStartScan">The first scan line to retrieve.</param>
/// <param name="cScanLines">The number of scan lines to retrieve.</param>
/// <param name="lpvBits">
/// A pointer to a buffer to receive the bitmap data. If this parameter is NULL, the function passes the dimensions and format of the bitmap to the
/// BITMAPINFO structure pointed to by the lpbi parameter.
/// </param>
/// <param name="lpbi">A pointer to a BITMAPINFO structure that specifies the desired format for the DIB data.</param>
/// <param name="uUsage">The format of the bmiColors member of the BITMAPINFO structure.</param>
/// <returns>
/// If the lpvBits parameter is non-NULL and the function succeeds, the return value is the number of scan lines copied from the bitmap.
/// <para>If the lpvBits parameter is NULL and GetDIBits successfully fills the BITMAPINFO structure, the return value is nonzero.</para>
/// <para>If the function fails, the return value is zero.</para>
/// </returns>
/// <remarks>
/// If the requested format for the DIB matches its internal format, the RGB values for the bitmap are copied. If the requested format doesn't match the
/// internal format, a color table is synthesized. The following table describes the color table synthesized for each format.
/// <list type="table">
/// <listheader><term>Value</term><description>Meaning</description></listheader>
/// <item><term>1_BPP</term><description>The color table consists of a black and a white entry.</description></item>
/// <item><term>4_BPP</term><description>The color table consists of a mix of colors identical to the standard VGA palette.</description></item>
/// <item><term>8_BPP</term><description>The color table consists of a general mix of 256 colors defined by GDI. (Included in these 256 colors are the 20 colors found in the default logical palette.)</description></item>
/// <item><term>24_BPP</term><description>No color table is returned.</description></item>
/// </list>
/// <para>
/// If the lpvBits parameter is a valid pointer, the first six members of the BITMAPINFOHEADER structure must be initialized to specify the size and
/// format of the DIB. The scan lines must be aligned on a DWORD except for RLE compressed bitmaps.
/// </para>
/// <para>
/// A bottom-up DIB is specified by setting the height to a positive number, while a top-down DIB is specified by setting the height to a negative
/// number. The bitmap color table will be appended to the BITMAPINFO structure.
/// </para>
/// <para>
/// If lpvBits is NULL, GetDIBits examines the first member of the first structure pointed to by lpbi. This member must specify the size, in bytes, of a
/// BITMAPCOREHEADER or a BITMAPINFOHEADER structure. The function uses the specified size to determine how the remaining members should be initialized.
/// </para>
/// <para>
/// If lpvBits is NULL and the bit count member of BITMAPINFO is initialized to zero, GetDIBits fills in a BITMAPINFOHEADER structure or BITMAPCOREHEADER
/// without the color table. This technique can be used to query bitmap attributes.
/// </para>
/// <para>The bitmap identified by the hbmp parameter must not be selected into a device context when the application calls this function.</para>
/// <para>The origin for a bottom-up DIB is the lower-left corner of the bitmap; the origin for a top-down DIB is the upper-left corner.</para>
/// </remarks>
[DllImport(GDI32, ExactSpelling = true, SetLastError = true)]
public static extern int GetDIBits(SafeDCHandle hdc, IntPtr hbmp, int uStartScan, int cScanLines, ref byte[] lpvBits, ref BITMAPINFO lpbi, DIBColorMode uUsage);
/// <summary>
/// The GetDIBits function retrieves the bits of the specified compatible bitmap and copies them into a buffer as a DIB using the specified format.
/// </summary>
/// <param name="hdc">A handle to the device context.</param>
/// <param name="hbmp">A handle to the bitmap. This must be a compatible bitmap (DDB).</param>
/// <param name="uStartScan">The first scan line to retrieve.</param>
/// <param name="cScanLines">The number of scan lines to retrieve.</param>
/// <param name="lpvBits">
/// A pointer to a buffer to receive the bitmap data. If this parameter is NULL, the function passes the dimensions and format of the bitmap to the
/// BITMAPINFO structure pointed to by the lpbi parameter.
/// </param>
/// <param name="lpbi">A pointer to a BITMAPINFO structure that specifies the desired format for the DIB data.</param>
/// <param name="uUsage">The format of the bmiColors member of the BITMAPINFO structure.</param>
/// <returns>
/// If the lpvBits parameter is non-NULL and the function succeeds, the return value is the number of scan lines copied from the bitmap.
/// <para>If the lpvBits parameter is NULL and GetDIBits successfully fills the BITMAPINFO structure, the return value is nonzero.</para>
/// <para>If the function fails, the return value is zero.</para>
/// </returns>
/// <remarks>
/// If the requested format for the DIB matches its internal format, the RGB values for the bitmap are copied. If the requested format doesn't match the
/// internal format, a color table is synthesized. The following table describes the color table synthesized for each format.
/// <list type="table">
/// <listheader><term>Value</term><description>Meaning</description></listheader>
/// <item><term>1_BPP</term><description>The color table consists of a black and a white entry.</description></item>
/// <item><term>4_BPP</term><description>The color table consists of a mix of colors identical to the standard VGA palette.</description></item>
/// <item><term>8_BPP</term><description>The color table consists of a general mix of 256 colors defined by GDI. (Included in these 256 colors are the 20 colors found in the default logical palette.)</description></item>
/// <item><term>24_BPP</term><description>No color table is returned.</description></item>
/// </list>
/// <para>
/// If the lpvBits parameter is a valid pointer, the first six members of the BITMAPINFOHEADER structure must be initialized to specify the size and
/// format of the DIB. The scan lines must be aligned on a DWORD except for RLE compressed bitmaps.
/// </para>
/// <para>
/// A bottom-up DIB is specified by setting the height to a positive number, while a top-down DIB is specified by setting the height to a negative
/// number. The bitmap color table will be appended to the BITMAPINFO structure.
/// </para>
/// <para>
/// If lpvBits is NULL, GetDIBits examines the first member of the first structure pointed to by lpbi. This member must specify the size, in bytes, of a
/// BITMAPCOREHEADER or a BITMAPINFOHEADER structure. The function uses the specified size to determine how the remaining members should be initialized.
/// </para>
/// <para>
/// If lpvBits is NULL and the bit count member of BITMAPINFO is initialized to zero, GetDIBits fills in a BITMAPINFOHEADER structure or BITMAPCOREHEADER
/// without the color table. This technique can be used to query bitmap attributes.
/// </para>
/// <para>The bitmap identified by the hbmp parameter must not be selected into a device context when the application calls this function.</para>
/// <para>The origin for a bottom-up DIB is the lower-left corner of the bitmap; the origin for a top-down DIB is the upper-left corner.</para>
/// </remarks>
[DllImport(GDI32, ExactSpelling = true, SetLastError = true)]
public static extern int GetDIBits(SafeDCHandle hdc, IntPtr hbmp, int uStartScan, int cScanLines, IntPtr lpvBits, ref BITMAPINFO lpbi, DIBColorMode uUsage);
}
}

Wyświetl plik

@ -0,0 +1,19 @@

namespace System.Windows.Forms
{
internal static class TextBoxExtension
{
public static void SetElevationRequiredState(this ButtonBase btn, bool required = true)
{
if (System.Environment.OSVersion.Version.Major >= 6)
{
const uint BCM_SETSHIELD = 0x160C; //Elevated button
btn.FlatStyle = required ? FlatStyle.System : FlatStyle.Standard;
Vanara.Interop.NativeMethods.SendMessage(btn.Handle, BCM_SETSHIELD, IntPtr.Zero, required ? new IntPtr(1) : IntPtr.Zero);
btn.Invalidate();
}
else
throw new PlatformNotSupportedException();
}
}
}

Wyświetl plik

@ -0,0 +1,167 @@
using System;
using System.Runtime.InteropServices;
namespace Vanara.Interop
{
internal static partial class NativeMethods
{
internal const string DWMAPI = "dwmapi.dll";
public enum DWMWINDOWATTRIBUTE : uint
{
NCRenderingEnabled = 1,
NCRenderingPolicy,
TransitionsForceDisabled,
AllowNCPaint,
CaptionButtonBounds,
NonClientRtlLayout,
ForceIconicRepresentation,
Flip3DPolicy,
ExtendedFrameBounds,
HasIconicBitmap,
DisallowPeek,
ExceludedFromPeek,
Cloak,
Cloaked,
FreezeRepresentation
}
public enum BlurBehindFlags : int
{
Enable = 0x00000001,
BlurRegion = 0x00000002,
TransitionOnMaximized = 0x00000004
}
[StructLayout(LayoutKind.Sequential)]
public struct BlurBehind
{
BlurBehindFlags dwFlags;
int fEnable;
IntPtr hRgnBlur;
int fTransitionOnMaximized;
public BlurBehind(bool enabled)
{
fEnable = enabled ? 1 : 0;
hRgnBlur = IntPtr.Zero;
fTransitionOnMaximized = 0;
dwFlags = BlurBehindFlags.Enable;
}
public System.Drawing.Region Region => System.Drawing.Region.FromHrgn(hRgnBlur);
public bool TransitionOnMaximized
{
get { return fTransitionOnMaximized > 0; }
set
{
fTransitionOnMaximized = value ? 1 : 0;
dwFlags |= BlurBehindFlags.TransitionOnMaximized;
}
}
public void SetRegion(System.Drawing.Graphics graphics, System.Drawing.Region region)
{
hRgnBlur = region.GetHrgn(graphics);
dwFlags |= BlurBehindFlags.BlurRegion;
}
}
[StructLayout(LayoutKind.Sequential)]
public struct ColorizationParams
{
public uint Color1, Color2, Intensity, Unk1, Unk2, Unk3, Opaque;
}
/// <summary>Margins structure for theme related functions.</summary>
[StructLayout(LayoutKind.Sequential)]
public struct Margins
{
public int Left;
public int Right;
public int Top;
public int Bottom;
public static readonly Margins Empty = new Margins(0);
public static readonly Margins Infinite = new Margins(-1);
public Margins(int left, int right, int top, int bottom)
{
Left = left;
Right = right;
Top = top;
Bottom = bottom;
}
public Margins(int allMargins)
{
Left = Right = Top = Bottom = allMargins;
}
public Margins(System.Windows.Forms.Padding padding)
: this(padding.Left, padding.Right, padding.Top, padding.Bottom)
{
}
public static bool operator !=(Margins m1, Margins m2) => !m1.Equals(m2);
public static bool operator ==(Margins m1, Margins m2) => m1.Equals(m2);
public override bool Equals(object obj)
{
if (obj is Margins)
{
Margins m2 = (Margins)obj;
return Left == m2.Left && Right == m2.Right && Top == m2.Top && Bottom == m2.Bottom;
}
return base.Equals(obj);
}
public override int GetHashCode() => (((Left ^ RotateLeft(Top, 8)) ^ RotateLeft(Right, 0x10)) ^ RotateLeft(Bottom, 0x18));
public override string ToString() => $"{{Left={Left},Right={Right},Top={Top},Bottom={Bottom}}}";
internal static int RotateLeft(int value, int nBits)
{
nBits = nBits % 0x20;
return ((value << nBits) | (value >> (0x20 - nBits)));
}
}
[DllImport(DWMAPI, EntryPoint = "#127", PreserveSig = false)]
[System.Security.SecurityCritical]
public static extern void DwmGetColorizationParameters(ref ColorizationParams parameters);
[DllImport(DWMAPI, EntryPoint = "#131", PreserveSig = false)]
[System.Security.SecurityCritical]
public static extern void DwmSetColorizationParameters(ref ColorizationParams parameters, uint unk);
[DllImport(DWMAPI, ExactSpelling = true, PreserveSig = false)]
[System.Security.SecurityCritical]
public static extern void DwmEnableBlurBehindWindow(IntPtr hWnd, ref BlurBehind pBlurBehind);
[DllImport(DWMAPI, ExactSpelling = true, PreserveSig = false)]
[System.Security.SecurityCritical]
public static extern void DwmEnableComposition(int compositionAction);
[DllImport(DWMAPI, ExactSpelling = true, PreserveSig = false)]
[System.Security.SecurityCritical]
public static extern void DwmExtendFrameIntoClientArea(IntPtr hWnd, ref Margins pMarInset);
//[DllImport(DWMAPI, ExactSpelling = true, PreserveSig = false)]
//public static extern void DwmGetColorizationColor(out uint ColorizationColor, [MarshalAs(UnmanagedType.Bool)]out bool ColorizationOpaqueBlend);
[DllImport(DWMAPI, ExactSpelling = true, PreserveSig = false)]
[System.Security.SecurityCritical]
public static extern void DwmGetWindowAttribute(IntPtr hwnd, DWMWINDOWATTRIBUTE dwAttribute, IntPtr pvAttribute, int cbAttribute);
[DllImport(DWMAPI, ExactSpelling = true, PreserveSig = false)]
[System.Security.SecurityCritical]
public static extern void DwmIsCompositionEnabled(ref int pfEnabled);
[DllImport(DWMAPI, ExactSpelling = true, PreserveSig = false)]
[System.Security.SecurityCritical]
public static extern void DwmSetWindowAttribute(IntPtr hwnd, DWMWINDOWATTRIBUTE dwAttribute, [In] IntPtr pvAttribute, int cbAttribute);
}
}

Wyświetl plik

@ -0,0 +1,409 @@
using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
namespace Vanara.Interop.DesktopWindowManager
{
/// <summary>Main DWM class, provides glass sheet effect and blur behind.</summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1724:TypeNamesShouldNotMatchNamespaces")]
[System.Security.Permissions.PermissionSet(System.Security.Permissions.SecurityAction.Demand, Name = "FullTrust")]
[System.Security.SecuritySafeCritical]
public static class DesktopWindowManager
{
static object ColorizationColorChangedKey = new object();
static object CompositionChangedKey = new object();
static EventHandlerList eventHandlerList;
static object NonClientRenderingChangedKey = new object();
//static object WindowMaximizedChangedKey = new object();
static object[] keys = new object[] { CompositionChangedKey, NonClientRenderingChangedKey, ColorizationColorChangedKey/*, WindowMaximizedChangedKey*/ };
static object _lock = new object();
static MessageWindow _window;
/// <summary>
/// Occurs when the colorization color has changed.
/// </summary>
public static event EventHandler ColorizationColorChanged
{
add { AddEventHandler(ColorizationColorChangedKey, value); }
remove { RemoveEventHandler(ColorizationColorChangedKey, value); }
}
/// <summary>
/// Occurs when the desktop window composition has been enabled or disabled.
/// </summary>
public static event EventHandler CompositionChanged
{
add { AddEventHandler(CompositionChangedKey, value); }
remove { RemoveEventHandler(CompositionChangedKey, value); }
}
/// <summary>
/// Occurs when the non-client area rendering policy has changed.
/// </summary>
public static event EventHandler NonClientRenderingChanged
{
add { AddEventHandler(NonClientRenderingChangedKey, value); }
remove { RemoveEventHandler(NonClientRenderingChangedKey, value); }
}
/// <summary>
/// Gets or sets the current color used for Desktop Window Manager (DWM) glass composition. This value is based on the current color scheme and can be modified by the user.
/// </summary>
/// <value>The color of the glass composition.</value>
public static Color CompositionColor
{
get
{
if (!CompositionSupported)
return Color.Transparent;
int value = (int)Microsoft.Win32.Registry.CurrentUser.GetValue(@"Software\Microsoft\Windows\DWM\ColorizationColor", 0);
return Color.FromArgb(value);
}
set
{
if (!CompositionSupported)
return;
NativeMethods.ColorizationParams p = new NativeMethods.ColorizationParams();
NativeMethods.DwmGetColorizationParameters(ref p);
p.Color1 = (uint)value.ToArgb();
NativeMethods.DwmSetColorizationParameters(ref p, 1);
Microsoft.Win32.Registry.CurrentUser.SetValue(@"Software\Microsoft\Windows\DWM\ColorizationColor", value.ToArgb(), Microsoft.Win32.RegistryValueKind.DWord);
}
}
/// <summary>
/// Gets or sets a value indicating whether composition (Windows Aero) is enabled.
/// </summary>
/// <value><c>true</c> if composition is enabled; otherwise, <c>false</c>.</value>
public static bool CompositionEnabled
{
get { return IsCompositionEnabled(); }
set { if (CompositionSupported) EnableComposition(value); }
}
/// <summary>
/// Gets or sets a value indicating whether composition (Windows Aero) is supported.
/// </summary>
/// <value><c>true</c> if composition is supported; otherwise, <c>false</c>.</value>
public static bool CompositionSupported => System.Environment.OSVersion.Version.Major >= 6;
/// <summary>
/// Gets or sets a value that indicates whether the <see cref="CompositionColor"/> is transparent.
/// </summary>
/// <value><c>true</c> if transparent; otherwise, <c>false</c>.</value>
public static bool TransparencyEnabled
{
get
{
if (!CompositionSupported)
return false;
int value = (int)Microsoft.Win32.Registry.CurrentUser.GetValue(@"Software\Microsoft\Windows\DWM\ColorizationOpaqueBlend", 1);
return value == 0;
}
set
{
if (!CompositionSupported)
return;
NativeMethods.ColorizationParams p = new NativeMethods.ColorizationParams();
NativeMethods.DwmGetColorizationParameters(ref p);
p.Opaque = value ? 0u : 1u;
NativeMethods.DwmSetColorizationParameters(ref p, 1);
Microsoft.Win32.Registry.CurrentUser.SetValue(@"Software\Microsoft\Windows\DWM\ColorizationOpaqueBlend", p.Opaque, Microsoft.Win32.RegistryValueKind.DWord);
}
}
/*/// <summary>
/// Occurs when a Desktop Window Manager (DWM) composed window is maximized.
/// </summary>
public static event EventHandler WindowMaximizedChanged
{
add { AddEventHandler(WindowMaximizedChangedKey, value); }
remove { RemoveEventHandler(WindowMaximizedChangedKey, value); }
}*/
/// <summary>
/// Enable the Aero "Blur Behind" effect on the whole client area. Background must be black.
/// </summary>
/// <param name="window">The window.</param>
/// <param name="enabled"><c>true</c> to enable blur behind for this window, <c>false</c> to disable it.</param>
public static void EnableBlurBehind(this IWin32Window window, bool enabled)
{
EnableBlurBehind(window, null, null, enabled, false);
}
/// <summary>
/// Enable the Aero "Blur Behind" effect on a specific region of a drawing area. Background must be black.
/// </summary>
/// <param name="window">The window.</param>
/// <param name="graphics">The graphics area on which the region resides.</param>
/// <param name="region">The region within the client area to apply the blur behind.</param>
/// <param name="enabled"><c>true</c> to enable blur behind for this region, <c>false</c> to disable it.</param>
/// <param name="transitionOnMaximized"><c>true</c> if the window's colorization should transition to match the maximized windows; otherwise, <c>false</c>.</param>
public static void EnableBlurBehind(this IWin32Window window, System.Drawing.Graphics graphics, System.Drawing.Region region, bool enabled, bool transitionOnMaximized)
{
if (window == null)
throw new ArgumentNullException(nameof(window));
NativeMethods.BlurBehind bb = new NativeMethods.BlurBehind(enabled);
if (graphics != null && region != null)
bb.SetRegion(graphics, region);
if (transitionOnMaximized)
bb.TransitionOnMaximized = true;
NativeMethods.DwmEnableBlurBehindWindow(window.Handle, ref bb);
}
/// <summary>
/// Enables or disables Desktop Window Manager (DWM) composition.
/// </summary>
/// <param name="value"><c>true</c> to enable DWM composition; <c>false</c> to disable composition.</param>
public static void EnableComposition(bool value)
{
NativeMethods.DwmEnableComposition(value ? 1 : 0);
}
/// <summary>
/// Excludes the specified child control from the glass effect.
/// </summary>
/// <param name="parent">The parent control.</param>
/// <param name="control">The control to exclude.</param>
/// <exception cref="ArgumentNullException">Occurs if control is null.</exception>
/// <exception cref="ArgumentException">Occurs if control is not a child control.</exception>
public static void ExcludeChildFromGlass(this Control parent, Control control)
{
if (parent == null)
throw new ArgumentNullException(nameof(parent));
if (control == null)
throw new ArgumentNullException(nameof(control));
if (!parent.Contains(control))
throw new ArgumentException("Control must be a child control.");
if (IsCompositionEnabled())
{
System.Drawing.Rectangle clientScreen = parent.RectangleToScreen(parent.ClientRectangle);
System.Drawing.Rectangle controlScreen = control.RectangleToScreen(control.ClientRectangle);
NativeMethods.Margins margins = new NativeMethods.Margins(controlScreen.Left - clientScreen.Left, controlScreen.Top - clientScreen.Top,
clientScreen.Right - controlScreen.Right, clientScreen.Bottom - controlScreen.Bottom);
// Extend the Frame into client area
NativeMethods.DwmExtendFrameIntoClientArea(parent.Handle, ref margins);
}
}
/// <summary>
/// Extends the window frame beyond the client area.
/// </summary>
/// <param name="window">The window.</param>
/// <param name="padding">The padding to use as the area into which the frame is extended.</param>
public static void ExtendFrameIntoClientArea(this IWin32Window window, Padding padding)
{
if (window == null)
throw new ArgumentNullException(nameof(window));
NativeMethods.Margins m = new NativeMethods.Margins(padding);
NativeMethods.DwmExtendFrameIntoClientArea(window.Handle, ref m);
}
/// <summary>
/// Flags used by the SetWindowAttr method to specify the non-client area rendering policy.
/// </summary>
public enum NonClientRenderingPolicy
{
/// <summary>The non-client rendering area is rendered based on the window style.</summary>
UseWindowStyle,
/// <summary>The non-client area rendering is disabled; the window style is ignored.</summary>
Disabled,
/// <summary>The non-client area rendering is enabled; the window style is ignored.</summary>
Enabled
}
/// <summary>
/// Flags used by the SetWindowAttr method to specify the Flip3D window policy.
/// </summary>
public enum Flip3DWindowPolicy
{
/// <summary>Use the window's style and visibility settings to determine whether to hide or include the window in Flip3D rendering.</summary>
Default,
/// <summary>Exclude the window from Flip3D and display it below the Flip3D rendering.</summary>
ExcludeBelow,
/// <summary>Exclude the window from Flip3D and display it above the Flip3D rendering.</summary>
ExcludeAbove
}
/// <summary>
/// Use with GetWindowAttr and WindowAttribute.Cloaked. If the window is cloaked, provides one of the following values explaining why.
/// </summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1714:FlagsEnumsShouldHavePluralNames")]
[Flags]
public enum CloakingSource
{
/// <summary>The window was cloaked by its owner application.</summary>
App = 0x01,
/// <summary>The window was cloaked by the Shell.</summary>
Shell = 0x02,
/// <summary>The cloak value was inherited from its owner window.</summary>
Inherited = 0x04
}
/// <summary>
/// Window attribute to get through the <see cref="GetWindowAttr"/> methods.
/// </summary>
public enum GetWindowAttr
{
/// <summary>No attribute.</summary>
None = 0,
/// <summary>Gets whether non-client rendering is enabled. The retrieved value is of type bool. True if non-client rendering is enabled; otherwise, False.</summary>
NonClientRenderingEnabled = 1,
/// <summary>Gets the bounds of the caption button area in the window-relative space. The retrieved value is of type RECT.</summary>
CaptionButtonBounds = 5,
/// <summary>Gets the extended frame bounds rectangle in screen space. The retrieved value is of type RECT.</summary>
ExtendedFrameBounds = 9,
/// <summary>Win8+. Get CloakingSource flags explaining why a window is cloaked.</summary>
Cloaked = 14
}
/// <summary>
/// Window attribute to set through the <see cref="SetWindowAttr"/> methods.
/// </summary>
public enum SetWindowAttr
{
/// <summary>No attribute.</summary>
None = 0,
/// <summary>Sets the non-client rendering policy. The retrieved value is from the NonClientRenderingPolicy enumeration.</summary>
NonClientRenderingPolicy = 2,
/// <summary>Enables or forcibly disables DWM transitions. The retrieved value is of type bool. True to disable transitions or False to enable transitions.</summary>
TransitionsForceDisabled = 3,
/// <summary>Enables content rendered in the non-client area to be visible on the frame drawn by DWM. The retrieved value is of type bool. True to enable content rendered in the non-client area to be visible on the frame; otherwise, False.</summary>
AllowNonClientPaint = 4,
/// <summary>Sets whether non-client content is right-to-left (RTL) mirrored. The retrieved value is of type bool. True if the non-client content is right-to-left (RTL) mirrored; otherwise False.</summary>
NonClientRtlLayout = 6,
/// <summary>Forces the window to display an iconic thumbnail or peek representation (a static bitmap), even if a live or snapshot representation of the window is available. This value normally is set during a window's creation and not changed throughout the window's lifetime. Some scenarios, however, might require the value to change over time. The retrieved value is of type bool. True to require a iconic thumbnail or peek representation; otherwise, False.</summary>
ForceIconicRepresentation = 7,
/// <summary>Sets how Flip3D treats the window. The pvAttribute parameter points to a value from the Flip3DWindowPolicy enumeration.</summary>
Flip3DPolicy = 8,
/// <summary>Win7+. Sets if the window will provide a bitmap for use by DWM as an iconic thumbnail or peek representation (a static bitmap) for the window. HasIconicBitmap can be specified with ForceIconicRepresentation. HasIconicBitmap normally is set during a window's creation and not changed throughout the window's lifetime. Some scenarios, however, might require the value to change over time. The retrieved value is of type bool. True to inform DWM that the window will provide an iconic thumbnail or peek representation; otherwise, False.</summary>
HasIconicBitmap = 10,
/// <summary>Win7+. Set true to not show peek preview for the window. The peek view shows a full-sized preview of the window when the mouse hovers over the window's thumbnail in the taskbar. If this attribute is set, hovering the mouse pointer over the window's thumbnail dismisses peek (in case another window in the group has a peek preview showing). The retrieved value is of type bool. True to prevent peek functionality or False to allow it.</summary>
DisallowPeek = 11,
/// <summary>Win7+. Sets value preventing a window from fading to a glass sheet when peek is invoked. The retrieved value is of type bool. True to prevent the window from fading during another window's peek or False for normal behavior.</summary>
ExcludedFromPeek = 12,
/// <summary>Win8+. Cloaks the window such that it is not visible to the user. The window is still composed by DWM. True to cloak or False to not cloak.</summary>
Cloak = 13,
/// <summary>Win8+. Freeze the window's thumbnail image with its current visuals. Do no further live updates on the thumbnail image to match the window's contents.</summary>
FreezeRepresentation = 15
}
/// <summary>
/// Gets the specified window attribute from the Desktop Window Manager (DWM).
/// </summary>
/// <typeparam name="T">Return type. Must match the attribute.</typeparam>
/// <param name="window">The window.</param>
/// <param name="attribute">The attribute.</param>
/// <returns>Value of the windows attribute.</returns>
public static T GetWindowAttribute<T>(this IWin32Window window, GetWindowAttr attribute) where T : struct
{
if (window == null)
throw new ArgumentNullException(nameof(window));
using (var ptr = System.Runtime.InteropServices.SafeHGlobalHandle.AllocHGlobal<T>())
{
NativeMethods.DwmGetWindowAttribute(window.Handle, (NativeMethods.DWMWINDOWATTRIBUTE)attribute, ptr, ptr.Size);
return ptr.ToStructure<T>();
}
}
/// <summary>
/// Sets the specified window attribute through the Desktop Window Manager (DWM).
/// </summary>
/// <param name="window">The window.</param>
/// <param name="attribute">The attribute.</param>
/// <param name="value">The value.</param>
public static void SetWindowAttribute(this IWin32Window window, SetWindowAttr attribute, object value)
{
if (window == null)
throw new ArgumentNullException(nameof(window));
if (value == null)
throw new ArgumentNullException(nameof(value));
using (var ptr = new System.Runtime.InteropServices.SafeHGlobalHandle(value))
NativeMethods.DwmSetWindowAttribute(window.Handle, (NativeMethods.DWMWINDOWATTRIBUTE)attribute, ptr, ptr.Size);
}
/// <summary>
/// Indicates whether Desktop Window Manager (DWM) composition is enabled.
/// </summary>
/// <returns><c>true</c> if is composition enabled; otherwise, <c>false</c>.</returns>
public static bool IsCompositionEnabled()
{
if (!CompositionSupported || !System.IO.File.Exists(System.IO.Path.Combine(System.Environment.GetFolderPath(System.Environment.SpecialFolder.System), NativeMethods.DWMAPI)))
return false;
int res = 0;
NativeMethods.DwmIsCompositionEnabled(ref res);
return res != 0;
}
private static void AddEventHandler(object id, EventHandler value)
{
lock (_lock)
{
if (_window == null)
_window = new MessageWindow();
if (eventHandlerList == null)
eventHandlerList = new EventHandlerList();
eventHandlerList.AddHandler(id, value);
}
}
private static void RemoveEventHandler(object id, EventHandler value)
{
lock (_lock)
{
if (eventHandlerList != null)
{
eventHandlerList.RemoveHandler(id, value);
}
}
}
[System.Security.Permissions.PermissionSet(System.Security.Permissions.SecurityAction.Demand, Name = "FullTrust")]
[System.Security.SecuritySafeCritical]
private class MessageWindow : NativeWindow, IDisposable
{
const int WM_DWMCOLORIZATIONCOLORCHANGED = 0x0320;
const int WM_DWMCOMPOSITIONCHANGED = 0x031E;
const int WM_DWMNCRENDERINGCHANGED = 0x031F;
//const int WM_DWMWINDOWMAXIMIZEDCHANGE = 0x0321;
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
public MessageWindow()
{
CreateParams cp = new CreateParams() { Style = 0, ExStyle = 0, ClassStyle = 0, Parent = IntPtr.Zero };
cp.Caption = base.GetType().Name;
CreateHandle(cp);
}
public void Dispose()
{
DestroyHandle();
}
[System.Security.Permissions.PermissionSet(System.Security.Permissions.SecurityAction.Demand, Name = "FullTrust")]
protected override void WndProc(ref Message m)
{
if (m.Msg >= WM_DWMCOMPOSITIONCHANGED && m.Msg <= WM_DWMCOLORIZATIONCOLORCHANGED)
ExecuteEvents(m.Msg - WM_DWMCOMPOSITIONCHANGED);
base.WndProc(ref m);
}
private void ExecuteEvents(int idx)
{
if (eventHandlerList != null)
{
lock (_lock)
{
try { ((EventHandler)eventHandlerList[keys[idx]]).Invoke(null, EventArgs.Empty); }
catch { };
}
}
}
}
}
}

Wyświetl plik

@ -0,0 +1,491 @@
using System;
using System.Runtime.InteropServices;
namespace Vanara.Interop
{
internal static partial class NativeMethods
{
const string GDI32 = "gdi32.dll";
/// <summary>
/// The background mode used by the <see cref="SetBkMode"/> function.
/// </summary>
public enum BackgroundMode
{
/// <summary>Indicates that on return, the <see cref="SetBkMode"/> has failed.</summary>
ERROR = 0,
/// <summary>Background remains untouched.</summary>
TRANSPARENT = 1,
/// <summary>Background is filled with the current background color before the text, hatched brush, or pen is drawn.</summary>
OPAQUE = 2,
}
/// <summary>
/// The DC layout used by the <see cref="SetLayout"/> function.
/// </summary>
public enum DCLayout
{
/// <summary>Indicates that on return, the <see cref="SetLayout"/> has failed.</summary>
GDI_ERROR = -1,
/// <summary>Sets the default horizontal layout to be right to left.</summary>
LAYOUT_RTL = 1,
/// <summary>Sets the default horizontal layout to be bottom to top.</summary>
LAYOUT_BTT = 2,
/// <summary>Sets the default horizontal layout to be vertical before horizontal.</summary>
LAYOUT_VBH = 4,
/// <summary>Disables any reflection during BitBlt and StretchBlt operations.</summary>
LAYOUT_BITMAPORIENTATIONPRESERVED = 8,
}
/// <summary>
/// Defines how the color data for the source rectangle is to be combined with the color data for the destination rectangle to achieve the final color when using the <see cref="BitBlt"/> function.
/// </summary>
public enum RasterOperationMode
{
/// <summary>Copies the source rectangle directly to the destination rectangle.</summary>
SRCCOPY = 0x00CC0020,
/// <summary>Combines the colors of the source and destination rectangles by using the Boolean OR operator.</summary>
SRCPAINT = 0x00EE0086,
/// <summary>Combines the colors of the source and destination rectangles by using the Boolean AND operator.</summary>
SRCAND = 0x008800C6,
/// <summary>Combines the colors of the source and destination rectangles by using the Boolean XOR operator.</summary>
SRCINVERT = 0x00660046,
/// <summary>Combines the inverted colors of the destination rectangle with the colors of the source rectangle by using the Boolean AND operator.</summary>
SRCERASE = 0x00440328,
/// <summary></summary>
NOTSRCCOPY = 0x00330008,
/// <summary>Copies the inverted source rectangle to the destination.</summary>
NOTSRCERASE = 0x001100A6,
/// <summary>Merges the colors of the source rectangle with the brush currently selected in hdcDest, by using the Boolean AND operator.</summary>
MERGECOPY = 0x00C000CA,
/// <summary>Merges the colors of the inverted source rectangle with the colors of the destination rectangle by using the Boolean OR operator.</summary>
MERGEPAINT = 0x00BB0226,
/// <summary>Copies the brush currently selected in hdcDest, into the destination bitmap.</summary>
PATCOPY = 0x00F00021,
/// <summary>Combines the colors of the brush currently selected in hdcDest, with the colors of the inverted source rectangle by using the Boolean OR operator. The result of this operation is combined with the colors of the destination rectangle by using the Boolean OR operator.</summary>
PATPAINT = 0x00FB0A09,
/// <summary>Combines the colors of the brush currently selected in hdcDest, with the colors of the destination rectangle by using the Boolean XOR operator.</summary>
PATINVERT = 0x005A0049,
/// <summary>Inverts the destination rectangle.</summary>
DSTINVERT = 0x00550009,
/// <summary>Fills the destination rectangle using the color associated with index 0 in the physical palette. (This color is black for the default physical palette.)</summary>
BLACKNESS = 0x00000042,
/// <summary>Fills the destination rectangle using the color associated with index 1 in the physical palette. (This color is white for the default physical palette.)</summary>
WHITENESS = 0x00FF0062,
/// <summary>Prevents the bitmap from being mirrored.</summary>
NOMIRRORBITMAP = -2147483648,
/// <summary>Includes any windows that are layered on top of your window in the resulting image.By default, the image only contains your window.Note that this generally cannot be used for printing device contexts.</summary>
CAPTUREBLT = 0x40000000
}
/// <summary>The AlphaBlend function displays bitmaps that have transparent or semitransparent pixels.</summary>
/// <param name="hdcDest">A handle to the destination device context.</param>
/// <param name="nXOriginDest">The x-coordinate, in logical units, of the upper-left corner of the destination rectangle.</param>
/// <param name="nYOriginDest">The y-coordinate, in logical units, of the upper-left corner of the destination rectangle.</param>
/// <param name="nWidthDest">The width, in logical units, of the destination rectangle.</param>
/// <param name="nHeightDest">The height, in logical units, of the destination rectangle.</param>
/// <param name="hdcSrc">A handle to the source device context.</param>
/// <param name="nXOriginSrc">The x-coordinate, in logical units, of the upper-left corner of the source rectangle.</param>
/// <param name="nYOriginSrc">The y-coordinate, in logical units, of the upper-left corner of the source rectangle.</param>
/// <param name="nWidthSrc">The width, in logical units, of the source rectangle.</param>
/// <param name="nHeightSrc">The height, in logical units, of the source rectangle.</param>
/// <param name="blendFunction">
/// The alpha-blending function for source and destination bitmaps, a global alpha value to be applied to the entire source bitmap, and format
/// information for the source bitmap. The source and destination blend functions are currently limited to AC_SRC_OVER.
/// </param>
/// <returns>If the function succeeds, the return value is TRUE. If the function fails, the return value is FALSE.</returns>
/// <remarks>
/// If the source rectangle and destination rectangle are not the same size, the source bitmap is stretched to match the destination rectangle. If the
/// SetStretchBltMode function is used, the iStretchMode value is automatically converted to COLORONCOLOR for this function (that is, BLACKONWHITE,
/// WHITEONBLACK, and HALFTONE are changed to COLORONCOLOR).
/// <para>
/// The destination coordinates are transformed by using the transformation currently specified for the destination device context. The source
/// coordinates are transformed by using the transformation currently specified for the source device context.
/// </para>
/// <para>An error occurs (and the function returns FALSE) if the source device context identifies an enhanced metafile device context.</para>
/// <para>If destination and source bitmaps do not have the same color format, AlphaBlend converts the source bitmap to match the destination bitmap.</para>
/// <para>AlphaBlend does not support mirroring. If either the width or height of the source or destination is negative, this call will fail.</para>
/// <para>
/// When rendering to a printer, first call GetDeviceCaps with SHADEBLENDCAPS to determine if the printer supports blending with AlphaBlend. Note that,
/// for a display DC, all blending operations are supported and these flags represent whether the operations are accelerated.
/// </para>
/// <para>
/// If the source and destination are the same surface that is, they are both the screen or the same memory bitmap and the source and destination
/// rectangles overlap, an error occurs and the function returns FALSE.
/// </para>
/// <para>The source rectangle must lie completely within the source surface, otherwise an error occurs and the function returns FALSE.</para>
/// <para>AlphaBlend fails if the width or height of the source or destination is negative.</para>
/// <para>
/// The SourceConstantAlpha member of BLENDFUNCTION specifies an alpha transparency value to be used on the entire source bitmap. The SourceConstantAlpha
/// value is combined with any per-pixel alpha values. If SourceConstantAlpha is 0, it is assumed that the image is transparent. Set the
/// SourceConstantAlpha value to 255 (which indicates that the image is opaque) when you only want to use per-pixel alpha values.
/// </para>
/// </remarks>
[DllImport(GDI32, SetLastError = true, EntryPoint = "GdiAlphaBlend")]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool AlphaBlend(SafeDCHandle hdcDest, int nXOriginDest, int nYOriginDest, int nWidthDest, int nHeightDest, SafeDCHandle hdcSrc, int nXOriginSrc, int nYOriginSrc, int nWidthSrc, int nHeightSrc, BLENDFUNCTION blendFunction);
/// <summary>
/// The BitBlt function performs a bit-block transfer of the color data corresponding to a rectangle of pixels from the specified source device context
/// into a destination device context.
/// </summary>
/// <param name="hdc">A handle to the destination device context.</param>
/// <param name="nXDest">The x-coordinate, in logical units, of the upper-left corner of the destination rectangle.</param>
/// <param name="nYDest">The y-coordinate, in logical units, of the upper-left corner of the destination rectangle.</param>
/// <param name="nWidth">The width, in logical units, of the destination rectangle.</param>
/// <param name="nHeight">The height, in logical units, of the destination rectangle.</param>
/// <param name="hdcSrc">A handle to the source device context.</param>
/// <param name="nXSrc">The x-coordinate, in logical units, of the upper-left corner of the source rectangle.</param>
/// <param name="nYSrc">The y-coordinate, in logical units, of the upper-left corner of the source rectangle.</param>
/// <param name="dwRop">
/// A raster-operation code. These codes define how the color data for the source rectangle is to be combined with the color data for the destination
/// rectangle to achieve the final color.
/// </param>
/// <returns>
/// If the function succeeds, the return value is nonzero.
/// <para>If the function fails, the return value is zero. To get extended error information, call GetLastError.</para>
/// </returns>
/// <remarks>
/// BitBlt only does clipping on the destination DC.
/// <para>
/// If a rotation or shear transformation is in effect in the source device context, BitBlt returns an error. If other transformations exist in the
/// source device context (and a matching transformation is not in effect in the destination device context), the rectangle in the destination device
/// context is stretched, compressed, or rotated, as necessary.
/// </para>
/// <para>
/// If the color formats of the source and destination device contexts do not match, the BitBlt function converts the source color format to match the
/// destination format.
/// </para>
/// <para>When an enhanced metafile is being recorded, an error occurs if the source device context identifies an enhanced-metafile device context.</para>
/// <para>
/// Not all devices support the BitBlt function. For more information, see the RC_BITBLT raster capability entry in the GetDeviceCaps function as well as
/// the following functions: MaskBlt, PlgBlt, and StretchBlt.
/// </para>
/// <para>
/// BitBlt returns an error if the source and destination device contexts represent different devices. To transfer data between DCs for different
/// devices, convert the memory bitmap to a DIB by calling GetDIBits. To display the DIB to the second device, call SetDIBits or StretchDIBits.
/// </para>
/// <para>ICM: No color management is performed when blits occur.</para>
/// </remarks>
[DllImport(GDI32, ExactSpelling = true, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool BitBlt(SafeDCHandle hdc, int nXDest, int nYDest, int nWidth, int nHeight, SafeDCHandle hdcSrc, int nXSrc, int nYSrc, RasterOperationMode dwRop);
/// <summary>The CreateCompatibleDC function creates a memory device context (DC) compatible with the specified device.</summary>
/// <param name="hDC">
/// A handle to an existing DC. If this handle is NULL, the function creates a memory DC compatible with the application's current screen.
/// </param>
/// <returns>
/// If the function succeeds, the return value is the handle to a memory DC.
/// <para>If the function fails, the return value is NULL.</para>
/// </returns>
/// <remarks>
/// A memory DC exists only in memory. When the memory DC is created, its display surface is exactly one monochrome pixel wide and one monochrome pixel
/// high. Before an application can use a memory DC for drawing operations, it must select a bitmap of the correct width and height into the DC. To
/// select a bitmap into a DC, use the CreateCompatibleBitmap function, specifying the height, width, and color organization required.
/// <para>
/// When a memory DC is created, all attributes are set to normal default values. The memory DC can be used as a normal DC. You can set the attributes;
/// obtain the current settings of its attributes; and select pens, brushes, and regions.
/// </para>
/// <para>
/// The CreateCompatibleDC function can only be used with devices that support raster operations. An application can determine whether a device supports
/// these operations by calling the GetDeviceCaps function.
/// </para>
/// <para>
/// When you no longer need the memory DC, call the DeleteDC function. We recommend that you call DeleteDC to delete the DC. However, you can also call
/// DeleteObject with the HDC to delete the DC.
/// </para>
/// <para>
/// If hdc is NULL, the thread that calls CreateCompatibleDC owns the HDC that is created. When this thread is destroyed, the HDC is no longer valid.
/// Thus, if you create the HDC and pass it to another thread, then exit the first thread, the second thread will not be able to use the HDC.
/// </para>
/// <para>
/// ICM: If the DC that is passed to this function is enabled for Image Color Management (ICM), the DC created by the function is ICM-enabled. The source
/// and destination color spaces are specified in the DC.
/// </para>
/// </remarks>
[DllImport(GDI32, ExactSpelling = true, SetLastError = true)]
public static extern IntPtr CreateCompatibleDC(IntPtr hDC);
/// <summary>The DeleteDC function deletes the specified device context (DC).</summary>
/// <param name="hdc">A handle to the device context.</param>
/// <returns>If the function succeeds, the return value is nonzero. If the function fails, the return value is zero.</returns>
/// <remarks>
/// An application must not delete a DC whose handle was obtained by calling the GetDC function. Instead, it must call the ReleaseDC function to free the DC.
/// </remarks>
[DllImport(GDI32, ExactSpelling = true, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
[System.Security.SecurityCritical]
public static extern bool DeleteDC(IntPtr hdc);
/// <summary>
/// The DeleteObject function deletes a logical pen, brush, font, bitmap, region, or palette, freeing all system resources associated with the object.
/// After the object is deleted, the specified handle is no longer valid.
/// </summary>
/// <param name="hObject">A handle to a logical pen, brush, font, bitmap, region, or palette.</param>
/// <returns>
/// If the function succeeds, the return value is nonzero. If the specified handle is not valid or is currently selected into a DC, the return value is zero.
/// </returns>
/// <remarks>
/// Do not delete a drawing object (pen or brush) while it is still selected into a DC.
/// <para>When a pattern brush is deleted, the bitmap associated with the brush is not deleted. The bitmap must be deleted independently.</para>
/// </remarks>
[DllImport(GDI32, ExactSpelling = true, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool DeleteObject(IntPtr hObject);
/// <summary>The GdiFlush function flushes the calling thread's current batch.</summary>
/// <returns>
/// If all functions in the current batch succeed, the return value is nonzero.
/// <para>If not all functions in the current batch succeed, the return value is zero, indicating that at least one function returned an error.</para>
/// </returns>
[DllImport(GDI32, ExactSpelling = true, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
[System.Security.SecurityCritical]
public static extern bool GdiFlush();
/// <summary>The GetObject function retrieves information for the specified graphics object.</summary>
/// <param name="hgdiobj">
/// A handle to the graphics object of interest. This can be a handle to one of the following: a logical bitmap,
/// a brush, a font, a palette, a pen, or a device independent bitmap created by calling the CreateDIBSection function.
/// </param>
/// <param name="cbBuffer">The number of bytes of information to be written to the buffer.</param>
/// <param name="lpvObject">
/// A pointer to a buffer that receives the information about the specified graphics object. If the <paramref
/// name="lpvObject"/> parameter is NULL, the function return value is the number of bytes required to store the
/// information it writes to the buffer for the specified graphics object.
/// </param>
/// <returns>
/// If the function succeeds, and <paramref name="lpvObject"/> is a valid pointer, the return value is the number
/// of bytes stored into the buffer.
/// <para>
/// If the function succeeds, and <paramref name="lpvObject"/> is NULL, the return value is the number of bytes
/// required to hold the information the function would store into the buffer.
/// </para>
/// <para>If the function fails, the return value is zero.</para>
/// </returns>
/// <remarks>
/// The buffer pointed to by the <paramref name="lpvObject"/> parameter must be sufficiently large to receive the
/// information about the graphics object. Depending on the graphics object, the function uses a BITMAP,
/// DIBSECTION, EXTLOGPEN, LOGBRUSH, LOGFONT, or LOGPEN structure, or a count of table entries (for a logical palette).
/// <para>
/// If <paramref name="hgdiobj"/> is a handle to a bitmap created by calling CreateDIBSection, and the specified
/// buffer is large enough, the GetObject function returns a DIBSECTION structure. In addition, the bmBits member
/// of the BITMAP structure contained within the DIBSECTION will contain a pointer to the bitmap's bit values.
/// </para>
/// <para>
/// If <paramref name="hgdiobj"/> is a handle to a bitmap created by any other means, GetObject returns only the
/// width, height, and color format information of the bitmap. You can obtain the bitmap's bit values by calling
/// the GetDIBits or GetBitmapBits function.
/// </para>
/// <para>
/// If <paramref name="hgdiobj"/> is a handle to a logical palette, GetObject retrieves a 2-byte integer that
/// specifies the number of entries in the palette. The function does not retrieve the LOGPALETTE structure
/// defining the palette. To retrieve information about palette entries, an application can call the
/// GetPaletteEntries function.
/// </para>
/// <para>
/// If <paramref name="hgdiobj"/> is a handle to a font, the LOGFONT that is returned is the LOGFONT used to
/// create the font. If Windows had to make some interpolation of the font because the precise LOGFONT could not
/// be represented, the interpolation will not be reflected in the LOGFONT. For example, if you ask for a
/// vertical version of a font that doesn't support vertical painting, the LOGFONT indicates the font is
/// vertical, but Windows will paint it horizontally.
/// </para>
/// </remarks>
[DllImport(GDI32, ExactSpelling = true, SetLastError = true)]
public static extern int GetObject(IntPtr hgdiobj, int cbBuffer, IntPtr lpvObject);
/// <summary>The GetObject function retrieves information for the specified graphics object.</summary>
/// <typeparam name="T">The output structure type.</typeparam>
/// <param name="hgdiobj">
/// A handle to the graphics object of interest. This can be a handle to one of the following: a logical bitmap, a brush, a font, a palette, a pen, or a
/// device independent bitmap created by calling the CreateDIBSection function.
/// </param>
/// <returns>The output structure holding the information for the graphics object.</returns>
public static T GetObject<T>(IntPtr hgdiobj) where T : struct
{
var result = default(T);
var hGC = GCHandle.Alloc(result, GCHandleType.Pinned);
try
{
var ptr = hGC.AddrOfPinnedObject();
var ret = GetObject(hgdiobj, Marshal.SizeOf(typeof(T)), ptr);
if (ret == 0 || ptr == IntPtr.Zero)
throw new System.ComponentModel.Win32Exception();
return (T)Marshal.PtrToStructure(ptr, typeof(T));
}
finally
{
if (hGC.IsAllocated)
hGC.Free();
}
}
/// <summary>
/// The SelectObject function selects an object into the specified device context (DC). The new object replaces
/// the previous object of the same type.
/// </summary>
/// <param name="hDC">A handle to the DC.</param>
/// <param name="hObject">
/// A handle to the object to be selected. The specified object must have been created by using one of the
/// following functions.
/// </param>
/// <returns>
/// If the selected object is not a region and the function succeeds, the return value is a handle to the object
/// being replaced. If the selected object is a region and the function succeeds, the return value is one of the
/// following values.
/// </returns>
[DllImport(GDI32, ExactSpelling = true, SetLastError = true)]
public static extern IntPtr SelectObject(SafeDCHandle hDC, IntPtr hObject);
/// <summary>
/// The SetBkMode function sets the background mix mode of the specified device context. The background mix mode
/// is used with text, hatched brushes, and pen styles that are not solid lines.
/// </summary>
/// <param name="hdc">A handle to the device context.</param>
/// <param name="mode">The background mode.</param>
/// <returns>
/// If the function succeeds, the return value specifies the previous background mode. If the function fails, the
/// return value is zero.
/// </returns>
[DllImport(GDI32, ExactSpelling = true, SetLastError = true)]
public static extern BackgroundMode SetBkMode(SafeDCHandle hdc, BackgroundMode mode);
/// <summary>The SetLayout function changes the layout of a device context (DC).</summary>
/// <param name="hdc">A handle to the DC.</param>
/// <param name="dwLayout">The DC layout.</param>
/// <returns>
/// If the function succeeds, it returns the previous layout of the DC. If the function fails, it returns GDI_ERROR.
/// </returns>
/// <remarks>
/// The layout specifies the order in which text and graphics are revealed in a window or a device context. The
/// default is left to right. The SetLayout function changes this to be right to left, which is the standard in
/// Arabic and Hebrew cultures.
/// </remarks>
[DllImport(GDI32, ExactSpelling = true, SetLastError = true)]
public static extern DCLayout SetLayout(SafeDCHandle hdc, DCLayout dwLayout);
/// <summary>
/// The TransparentBlt function performs a bit-block transfer of the color data corresponding to a rectangle of
/// pixels from the specified source device context into a destination device context.
/// </summary>
/// <param name="hdcDest">A handle to the destination device context.</param>
/// <param name="xOriginDest">
/// The x-coordinate, in logical units, of the upper-left corner of the destination rectangle.
/// </param>
/// <param name="yOriginDest">
/// The y-coordinate, in logical units, of the upper-left corner of the destination rectangle.
/// </param>
/// <param name="wDest">The width, in logical units, of the destination rectangle.</param>
/// <param name="hDest">The height, in logical units, of the destination rectangle.</param>
/// <param name="hdcSrc">A handle to the source device context.</param>
/// <param name="xOriginSrc">The x-coordinate, in logical units, of the upper-left corner of the source rectangle.</param>
/// <param name="yOriginSrc">The y-coordinate, in logical units, of the upper-left corner of the source rectangle.</param>
/// <param name="wSrc">The width, in logical units, of the source rectangle.</param>
/// <param name="hSrc">The height, in logical units, of the source rectangle.</param>
/// <param name="crTransparent">The RGB color in the source bitmap to treat as transparent.</param>
/// <returns>
/// If the function succeeds, the return value is TRUE. If the function fails, the return value is FALSE.
/// </returns>
/// <remarks>
/// The TransparentBlt function works with compatible bitmaps (DDBs).
/// <para>
/// The TransparentBlt function supports all formats of source bitmaps. However, for 32 bpp bitmaps, it just
/// copies the alpha value over. Use AlphaBlend to specify 32 bits-per-pixel bitmaps with transparency.
/// </para>
/// <para>
/// If the source and destination rectangles are not the same size, the source bitmap is stretched to match the
/// destination rectangle. When the SetStretchBltMode function is used, the iStretchMode modes of BLACKONWHITE
/// and WHITEONBLACK are converted to COLORONCOLOR for the TransparentBlt function.
/// </para>
/// <para>
/// The destination device context specifies the transformation type for the destination coordinates. The source
/// device context specifies the transformation type for the source coordinates.
/// </para>
/// <para>
/// TransparentBlt does not mirror a bitmap if either the width or height, of either the source or destination,
/// is negative.
/// </para>
/// <para>
/// When used in a multiple monitor system, both hdcSrc and hdcDest must refer to the same device or the function
/// will fail. To transfer data between DCs for different devices, convert the memory bitmap to a DIB by calling
/// GetDIBits. To display the DIB to the second device, call SetDIBits or StretchDIBits.
/// </para>
/// </remarks>
[DllImport(GDI32, SetLastError = true, EntryPoint = "GdiTransparentBlt")]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool TransparentBlt(SafeDCHandle hdcDest, int xOriginDest, int yOriginDest, int wDest, int hDest, SafeDCHandle hdcSrc, int xOriginSrc, int yOriginSrc, int wSrc, int hSrc, int crTransparent);
/// <summary>
/// The BLENDFUNCTION structure controls blending by specifying the blending functions for source and destination bitmaps.
/// </summary>
/// <remarks>See information on how this function determines the resulting values on <a href="https://msdn.microsoft.com/en-us/library/dd183393(v=vs.85).aspx">MSDN</a>.</remarks>
[StructLayout(LayoutKind.Sequential)]
public struct BLENDFUNCTION
{
/// <summary>
/// The source blend operation. Currently, the only source and destination blend operation that has been defined is AC_SRC_OVER. For details, see the
/// following Remarks section.
/// </summary>
public byte BlendOp;
/// <summary>Must be zero.</summary>
public byte BlendFlags;
/// <summary>
/// Specifies an alpha transparency value to be used on the entire source bitmap. The SourceConstantAlpha value is combined with any per-pixel alpha
/// values in the source bitmap. If you set SourceConstantAlpha to 0, it is assumed that your image is transparent. Set the SourceConstantAlpha value
/// to 255 (opaque) when you only want to use per-pixel alpha values.
/// </summary>
public byte SourceConstantAlpha;
/// <summary>
/// This member controls the way the source and destination bitmaps are interpreted. AlphaFormat has the following value.
/// <para>
/// <c>AC_SRC_ALPHA</c> This flag is set when the bitmap has an Alpha channel (that is, per-pixel alpha). Note that the APIs use premultiplied alpha,
/// which means that the red, green and blue channel values in the bitmap must be premultiplied with the alpha channel value. For example, if the
/// alpha channel value is x, the red, green and blue channels must be multiplied by x and divided by 0xff prior to the call.
/// </para>
/// </summary>
public byte AlphaFormat;
/// <summary>Initializes a new instance of the <see cref="BLENDFUNCTION"/> struct and sets the alpha value.</summary>
/// <param name="alpha">The alpha.</param>
public BLENDFUNCTION(byte alpha)
{
// AC_SRC_OVER is the only possible value for BlendOp and it equals 0
this.BlendOp = 0;
this.BlendFlags = 0;
this.SourceConstantAlpha = alpha;
// AC_SRC_ALPHA is the only possible value for AlphaFormat and it equals 1
this.AlphaFormat = 1;
}
public bool IsEmpty => BlendOp == 0 && BlendFlags == 0 && AlphaFormat == 0 && SourceConstantAlpha == 0;
}
}
}

Wyświetl plik

@ -0,0 +1,138 @@

using System.Collections.Generic;
namespace System.Runtime.InteropServices
{
internal static class InteropUtil
{
internal const int cbBuffer = 256;
[Security.Permissions.SecurityPermission(Security.Permissions.SecurityAction.LinkDemand, Flags = Security.Permissions.SecurityPermissionFlag.UnmanagedCode)]
public static T ToStructure<T>(this IntPtr ptr) => (T)Marshal.PtrToStructure(ptr, typeof(T));
public static IntPtr StructureToPtr<T>(this T value) where T : struct
{
var ret = Marshal.AllocHGlobal(Marshal.SizeOf(value));
Marshal.StructureToPtr(value, ret, false);
return ret;
}
[Security.Permissions.SecurityPermission(Security.Permissions.SecurityAction.LinkDemand, Flags = Security.Permissions.SecurityPermissionFlag.UnmanagedCode)]
public static void AllocString(ref IntPtr ptr, ref uint size)
{
FreeString(ref ptr, ref size);
if (size == 0) size = cbBuffer;
ptr = Marshal.AllocHGlobal(cbBuffer);
}
[Security.Permissions.SecurityPermission(Security.Permissions.SecurityAction.LinkDemand, Flags = Security.Permissions.SecurityPermissionFlag.UnmanagedCode)]
public static void FreeString(ref IntPtr ptr, ref uint size)
{
if (ptr == IntPtr.Zero) return;
Marshal.FreeHGlobal(ptr);
ptr = IntPtr.Zero;
size = 0;
}
[Security.Permissions.SecurityPermission(Security.Permissions.SecurityAction.LinkDemand, Flags = Security.Permissions.SecurityPermissionFlag.UnmanagedCode)]
public static string GetString(IntPtr pString) => Marshal.PtrToStringUni(pString);
[Security.Permissions.SecurityPermission(Security.Permissions.SecurityAction.LinkDemand, Flags = Security.Permissions.SecurityPermissionFlag.UnmanagedCode)]
public static bool SetString(ref IntPtr ptr, ref uint size, string value = null)
{
var s = GetString(ptr);
if (value == string.Empty) value = null;
if (string.CompareOrdinal(s, value) == 0) return false;
FreeString(ref ptr, ref size);
if (value == null) return true;
ptr = Marshal.StringToHGlobalUni(value);
size = (uint)value.Length + 1;
return true;
}
/// <summary>
/// Converts an <see cref="IntPtr"/> that points to a C-style array into a CLI array.
/// </summary>
/// <typeparam name="TS">Type of native structure used by the C-style array.</typeparam>
/// <typeparam name="T">Output type for the CLI array. <typeparamref name="TS"/> must be able to convert to <typeparamref name="T"/>.</typeparam>
/// <param name="ptr">The <see cref="IntPtr"/> pointing to the native array.</param>
/// <param name="count">The number of items in the native array.</param>
/// <param name="prefixBytes">Bytes to skip before reading the array.</param>
/// <returns>An array of type <typeparamref name="T"/> containing the converted elements of the native array.</returns>
public static T[] ToArray<TS, T>(this IntPtr ptr, int count, int prefixBytes = 0) where TS : IConvertible
{
var ret = new T[count];
var stSize = Marshal.SizeOf(typeof(TS));
for (var i = 0; i < count; i++)
{
var val = ToStructure<TS>(Marshal.ReadIntPtr(ptr, prefixBytes + i * stSize));
ret[i] = (T)Convert.ChangeType(val, typeof(T));
}
return ret;
}
/// <summary>
/// Converts an <see cref="IntPtr"/> that points to a C-style array into a CLI array.
/// </summary>
/// <typeparam name="T">Type of native structure used by the C-style array.</typeparam>
/// <param name="ptr">The <see cref="IntPtr"/> pointing to the native array.</param>
/// <param name="count">The number of items in the native array.</param>
/// <param name="prefixBytes">Bytes to skip before reading the array.</param>
/// <returns>An array of type <typeparamref name="T"/> containing the elements of the native array.</returns>
public static T[] ToArray<T>(this IntPtr ptr, int count, int prefixBytes = 0)
{
var ret = new T[count];
var stSize = Marshal.SizeOf(typeof(T));
for (var i = 0; i < count; i++)
ret[i] = ToStructure<T>(Marshal.ReadIntPtr(ptr, prefixBytes + i * stSize));
return ret;
}
/// <summary>
/// Converts an <see cref="IntPtr"/> that points to a C-style array into an <see cref="IEnumerable{T}"/>.
/// </summary>
/// <typeparam name="T">Type of native structure used by the C-style array.</typeparam>
/// <param name="ptr">The <see cref="IntPtr"/> pointing to the native array.</param>
/// <param name="count">The number of items in the native array.</param>
/// <param name="prefixBytes">Bytes to skip before reading the array.</param>
/// <returns>An <see cref="IEnumerable{T}"/> exposing the elements of the native array.</returns>
public static IEnumerable<T> ToIEnum<T>(this IntPtr ptr, int count, int prefixBytes = 0)
{
if (count == 0) yield break;
var stSize = Marshal.SizeOf(typeof(T));
for (var i = 0; i < count; i++)
yield return ToStructure<T>(Marshal.ReadIntPtr(ptr, prefixBytes + i * stSize));
}
/// <summary>
/// Converts an <see cref="IntPtr" /> to a structure. If pointer has no value, <c>null</c> is returned.
/// </summary>
/// <typeparam name="T">Type of the structure.</typeparam>
/// <param name="ptr">The <see cref="IntPtr" /> that points to allocated memory holding a structure or <see cref="IntPtr.Zero"/>.</param>
/// <returns>The converted structure or <c>null</c>.</returns>
public static T? PtrToStructure<T>(this IntPtr ptr) where T : struct => ptr != IntPtr.Zero ? ptr.ToStructure<T>() : (T?)null;
/// <summary>
/// Converts a structure or null value to an <see cref="IntPtr" />. If memory has not been allocated for the <paramref name="ptr"/>, it will be via a call to <see cref="Marshal.AllocHGlobal(int)"/>.
/// </summary>
/// <typeparam name="T">Type of the structure.</typeparam>
/// <param name="value">The structure to convert. If this value is <c>null</c>, <paramref name="ptr"/> will be set to <see cref="IntPtr.Zero"/> and memory will be released.</param>
/// <param name="ptr">The <see cref="IntPtr" /> that will point to allocated memory holding the structure or <see cref="IntPtr.Zero"/>.</param>
/// <param name="isEmpty">An optional predicate check to determine if the structure is non-essential and can be replaced with an empty pointer (<c>null</c>).</param>
public static void StructureToPtr<T>(T? value, ref IntPtr ptr, Predicate<T> isEmpty = null) where T : struct
{
if (value == null || (isEmpty != null && isEmpty(value.Value)))
{
if (ptr == IntPtr.Zero) return;
Marshal.FreeHGlobal(ptr);
ptr = IntPtr.Zero;
}
else
{
if (ptr == IntPtr.Zero)
ptr = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(T)));
Marshal.StructureToPtr(value, ptr, false);
}
}
}
}

Wyświetl plik

@ -0,0 +1,236 @@
using System.Drawing;
using System.Runtime.InteropServices;
namespace Vanara.Interop
{
internal static partial class NativeMethods
{
public enum LogFontCharSet : byte
{
ANSI_CHARSET = 0,
DEFAULT_CHARSET = 1,
SYMBOL_CHARSET = 2,
SHIFTJIS_CHARSET = 128,
HANGEUL_CHARSET = 129,
HANGUL_CHARSET = 129,
GB2312_CHARSET = 134,
CHINESEBIG5_CHARSET = 136,
OEM_CHARSET = 255,
JOHAB_CHARSET = 130,
HEBREW_CHARSET = 177,
ARABIC_CHARSET = 178,
GREEK_CHARSET = 161,
TURKISH_CHARSET = 162,
VIETNAMESE_CHARSET = 163,
THAI_CHARSET = 222,
EASTEUROPE_CHARSET = 238,
RUSSIAN_CHARSET = 204,
MAC_CHARSET = 77,
BALTIC_CHARSET = 186
}
public enum LogFontClippingPrecision : byte
{
CLIP_DEFAULT_PRECIS = 0,
CLIP_CHARACTER_PRECIS = 1,
CLIP_STROKE_PRECIS = 2,
CLIP_MASK = 0xf,
CLIP_LH_ANGLES = 1 << 4,
CLIP_TT_ALWAYS = 2 << 4,
CLIP_DFA_DISABLE = 4 << 4,
CLIP_EMBEDDED = 8 << 4
}
public enum LogFontFontFamily : byte
{
FF_DONTCARE = 0 << 4,
FF_ROMAN = 1 << 4,
FF_SWISS = 2 << 4,
FF_MODERN = 3 << 4,
FF_SCRIPT = 4 << 4,
FF_DECORATIVE = 5 << 4,
}
public enum LogFontOutputPrecision : byte
{
OUT_DEFAULT_PRECIS = 0,
OUT_STRING_PRECIS = 1,
OUT_CHARACTER_PRECIS = 2,
OUT_STROKE_PRECIS = 3,
OUT_TT_PRECIS = 4,
OUT_DEVICE_PRECIS = 5,
OUT_RASTER_PRECIS = 6,
OUT_TT_ONLY_PRECIS = 7,
OUT_OUTLINE_PRECIS = 8,
OUT_SCREEN_OUTLINE_PRECIS = 9,
OUT_PS_ONLY_PRECIS = 10
}
public enum LogFontOutputQuality : byte
{
DEFAULT_QUALITY = 0,
DRAFT_QUALITY = 1,
PROOF_QUALITY = 2,
NONANTIALIASED_QUALITY = 3,
ANTIALIASED_QUALITY = 4,
CLEARTYPE_QUALITY = 5,
CLEARTYPE_NATURAL_QUALITY = 6
}
public enum LogFontPitch : byte
{
DEFAULT_PITCH = 0,
FIXED_PITCH = 1,
VARIABLE_PITCH = 2
}
/// <summary>The LOGFONT structure defines the attributes of a font.</summary>
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
public struct LOGFONT
{
/// <summary>
/// The height, in logical units, of the font's character cell or character. The character height value (also known as the em height) is the
/// character cell height value minus the internal-leading value. The font mapper interprets the value specified in lfHeight in the following manner.
/// <list type="table">
/// <listheader>
/// <term>Value</term>
/// <definition>Meaning</definition>
/// </listheader>
/// <item>
/// <term>&gt; 0</term>
/// <definition>The font mapper transforms this value into device units and matches it against the cell height of the available fonts.</definition>
/// </item>
/// <item>
/// <term>0</term>
/// <definition></definition> The font mapper uses a default height value when it searches for a match.
/// </item>
/// <item>
/// <term>&lt; 0</term>
/// <definition>The font mapper transforms this value into device units and matches its absolute value against the character height of the available fonts.</definition>
/// </item>
/// </list>
/// <para>For all height comparisons, the font mapper looks for the largest font that does not exceed the requested size.</para>
/// <para>This mapping occurs when the font is used for the first time.</para>
/// <para>For the MM_TEXT mapping mode, you can use the following formula to specify a height for a font with a specified point size:</para>
/// </summary>
public int lfHeight;
/// <summary>
/// The average width, in logical units, of characters in the font. If lfWidth is zero, the aspect ratio of the device is matched against the
/// digitization aspect ratio of the available fonts to find the closest match, determined by the absolute value of the difference.
/// </summary>
public int lfWidth;
/// <summary>
/// The angle, in tenths of degrees, between the escapement vector and the x-axis of the device. The escapement vector is parallel to the base line
/// of a row of text.
/// <para>
/// When the graphics mode is set to GM_ADVANCED, you can specify the escapement angle of the string independently of the orientation angle of the
/// string's characters.
/// </para>
/// <para>
/// When the graphics mode is set to GM_COMPATIBLE, lfEscapement specifies both the escapement and orientation. You should set lfEscapement and
/// lfOrientation to the same value.
/// </para>
/// </summary>
public int lfEscapement;
/// <summary>The angle, in tenths of degrees, between each character's base line and the x-axis of the device.</summary>
public int lfOrientation;
/// <summary>
/// The weight of the font in the range 0 through 1000. For example, 400 is normal and 700 is bold. If this value is zero, a default weight is used.
/// </summary>
public int lfWeight;
/// <summary>An italic font if set to TRUE.</summary>
public byte lfItalic;
/// <summary>An underlined font if set to TRUE.</summary>
public byte lfUnderline;
/// <summary>A strikeout font if set to TRUE.</summary>
public byte lfStrikeOut;
/// <summary>The character set.</summary>
public LogFontCharSet lfCharSet;
/// <summary>
/// The output precision. The output precision defines how closely the output must match the requested font's height, width, character orientation,
/// escapement, pitch, and font type.
/// </summary>
public LogFontOutputPrecision lfOutPrecision;
/// <summary>The clipping precision. The clipping precision defines how to clip characters that are partially outside the clipping region.</summary>
public LogFontClippingPrecision lfClipPrecision;
/// <summary>
/// The output quality. The output quality defines how carefully the graphics device interface (GDI) must attempt to match the logical-font
/// attributes to those of an actual physical font.
/// </summary>
public LogFontOutputQuality lfQuality;
/// <summary>The pitch and family of the font.</summary>
public byte lfPitchAndFamily;
/// <summary>
/// A null-terminated string that specifies the typeface name of the font. The length of this string must not exceed 32 TCHAR values, including the
/// terminating NULL. The EnumFontFamiliesEx function can be used to enumerate the typeface names of all currently available fonts. If lfFaceName is
/// an empty string, GDI uses the first font that matches the other specified attributes.
/// </summary>
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)]
public string lfFaceName;
public bool Italic
{
get { return lfItalic == 1; }
set { lfItalic = System.Convert.ToByte(value); }
}
public bool Underline
{
get { return lfUnderline == 1; }
set { lfUnderline = System.Convert.ToByte(value); }
}
public bool StrikeOut
{
get { return lfStrikeOut == 1; }
set { lfStrikeOut = System.Convert.ToByte(value); }
}
public LogFontPitch Pitch
{
get { return (LogFontPitch)(lfPitchAndFamily & 0x0F); }
set { lfPitchAndFamily = (byte)((lfPitchAndFamily & 0xF0) | (byte)value); }
}
public LogFontFontFamily FontFamily
{
get { return (LogFontFontFamily)(lfPitchAndFamily & 0xF0); }
set { lfPitchAndFamily = (byte)((lfPitchAndFamily & 0x0F) | (byte)value); }
}
public static LOGFONT FromFont(Font font)
{
if (font == null)
throw new System.ArgumentNullException(nameof(font));
var lf = default(LOGFONT);
font.ToLogFont(lf);
return lf;
}
public Font ToFont()
{
try
{
return Font.FromLogFont(this);
}
catch
{
return new Font(lfFaceName, lfHeight, FontStyle.Regular, GraphicsUnit.Display);
}
}
public override string ToString() => $"lfHeight={lfHeight}, lfWidth={lfWidth}, lfEscapement={lfEscapement}, lfOrientation={lfOrientation}, lfWeight={lfWeight}, lfItalic={lfItalic}, lfUnderline={lfUnderline}, lfStrikeOut={lfStrikeOut}, lfCharSet={lfCharSet}, lfOutPrecision={lfOutPrecision}, lfClipPrecision={lfClipPrecision}, lfQuality={lfQuality}, lfPitchAndFamily={lfPitchAndFamily}, lfFaceName={lfFaceName}";
}
}
}

Wyświetl plik

@ -0,0 +1,165 @@
using System.Runtime.InteropServices;
namespace Vanara.Interop
{
internal static partial class NativeMethods
{
[StructLayout(LayoutKind.Sequential)]
public struct RECT
{
public int Left, Top, Right, Bottom;
public RECT(int left, int top, int right, int bottom)
{
Left = left;
Top = top;
Right = right;
Bottom = bottom;
}
public RECT(System.Drawing.Rectangle r)
: this(r.Left, r.Top, r.Right, r.Bottom)
{
}
public int X
{
get { return Left; }
set { Right -= (Left - value); Left = value; }
}
public int Y
{
get { return Top; }
set { Bottom -= (Top - value); Top = value; }
}
public int Height
{
get { return Bottom - Top; }
set { Bottom = value + Top; }
}
public int Width
{
get { return Right - Left; }
set { Right = value + Left; }
}
public System.Drawing.Point Location
{
get { return new System.Drawing.Point(Left, Top); }
set { X = value.X; Y = value.Y; }
}
public System.Drawing.Size Size
{
get { return new System.Drawing.Size(Width, Height); }
set { Width = value.Width; Height = value.Height; }
}
public static implicit operator System.Drawing.Rectangle(RECT r) => new System.Drawing.Rectangle(r.Left, r.Top, r.Width, r.Height);
public static implicit operator RECT(System.Drawing.Rectangle r) => new RECT(r);
public static bool operator ==(RECT r1, RECT r2) => r1.Equals(r2);
public static bool operator !=(RECT r1, RECT r2) => !r1.Equals(r2);
public bool Equals(RECT r) => r.Left == Left && r.Top == Top && r.Right == Right && r.Bottom == Bottom;
public override bool Equals(object obj)
{
if (obj is RECT)
return Equals((RECT)obj);
else if (obj is System.Drawing.Rectangle)
return Equals(new RECT((System.Drawing.Rectangle)obj));
return false;
}
public override int GetHashCode() => ((System.Drawing.Rectangle)this).GetHashCode();
public override string ToString() => $"{{Left={Left},Top={Top},Right={Right},Bottom={Bottom}}}";
}
[StructLayout(LayoutKind.Sequential)]
public class PRECT
{
public int Left, Top, Right, Bottom;
public PRECT(int left, int top, int right, int bottom)
{
Left = left;
Top = top;
Right = right;
Bottom = bottom;
}
public PRECT(System.Drawing.Rectangle r)
: this(r.Left, r.Top, r.Right, r.Bottom)
{
}
public int X
{
get { return Left; }
set { Right -= (Left - value); Left = value; }
}
public int Y
{
get { return Top; }
set { Bottom -= (Top - value); Top = value; }
}
public int Height
{
get { return Bottom - Top; }
set { Bottom = value + Top; }
}
public int Width
{
get { return Right - Left; }
set { Right = value + Left; }
}
public System.Drawing.Point Location
{
get { return new System.Drawing.Point(Left, Top); }
set { X = value.X; Y = value.Y; }
}
public System.Drawing.Size Size
{
get { return new System.Drawing.Size(Width, Height); }
set { Width = value.Width; Height = value.Height; }
}
public static implicit operator System.Drawing.Rectangle(PRECT r) => new System.Drawing.Rectangle(r.Left, r.Top, r.Width, r.Height);
public static implicit operator PRECT(System.Drawing.Rectangle? r) => r.HasValue ? new PRECT(r.Value) : null;
public static implicit operator PRECT(System.Drawing.Rectangle r) => new PRECT(r);
public static bool operator ==(PRECT r1, PRECT r2) => r1.Equals(r2);
public static bool operator !=(PRECT r1, PRECT r2) => !r1.Equals(r2);
public bool Equals(PRECT r) => r.Left == Left && r.Top == Top && r.Right == Right && r.Bottom == Bottom;
public override bool Equals(object obj)
{
if (obj is PRECT)
return Equals((PRECT)obj);
else if (obj is System.Drawing.Rectangle)
return Equals(new PRECT((System.Drawing.Rectangle)obj));
return false;
}
public override int GetHashCode() => ((System.Drawing.Rectangle)this).GetHashCode();
public override string ToString() => $"{{Left={Left},Top={Top},Right={Right},Bottom={Bottom}}}";
}
}
}

Wyświetl plik

@ -0,0 +1,286 @@
using System;
using System.Runtime.InteropServices;
using System.Security;
using System.Text;
namespace Vanara.Interop
{
[System.Security.SuppressUnmanagedCodeSecurity]
internal static partial class NativeMethods
{
internal const string SHELL32 = "shell32.dll";
[Flags]
public enum KF_FLAG : uint
{
ALIAS_ONLY = 0x80000000,
CREATE = 0x8000,
DEFAULT = 0,
DEFAULT_PATH = 0x400,
DONT_UNEXPAND = 0x2000,
DONT_VERIFY = 0x4000,
INIT = 0x800,
NO_ALIAS = 0x1000,
NOT_PARENT_RELATIVE = 0x200,
SIMPLE_IDLIST = 0x100
}
public enum SHARD
{
APPIDINFO = 4,
APPIDINFOIDLIST = 5,
APPIDINFOLINK = 7,
LINK = 6,
PATHA = 2,
PATHW = 3,
PIDL = 1,
SHELLITEM = 8
}
[Flags]
public enum ShellExecuteMaskFlags : uint
{
SEE_MASK_DEFAULT = 0x00000000,
SEE_MASK_CLASSNAME = 0x00000001,
SEE_MASK_CLASSKEY = 0x00000003,
SEE_MASK_IDLIST = 0x00000004,
SEE_MASK_INVOKEIDLIST = 0x0000000c, // Note SEE_MASK_INVOKEIDLIST(0xC) implies SEE_MASK_IDLIST(0x04)
SEE_MASK_HOTKEY = 0x00000020,
SEE_MASK_NOCLOSEPROCESS = 0x00000040,
SEE_MASK_CONNECTNETDRV = 0x00000080,
SEE_MASK_NOASYNC = 0x00000100,
SEE_MASK_FLAG_DDEWAIT = SEE_MASK_NOASYNC,
SEE_MASK_DOENVSUBST = 0x00000200,
SEE_MASK_FLAG_NO_UI = 0x00000400,
SEE_MASK_UNICODE = 0x00004000,
SEE_MASK_NO_CONSOLE = 0x00008000,
SEE_MASK_ASYNCOK = 0x00100000,
SEE_MASK_HMONITOR = 0x00200000,
SEE_MASK_NOZONECHECKS = 0x00800000,
SEE_MASK_NOQUERYCLASSSTORE = 0x01000000,
SEE_MASK_WAITFORINPUTIDLE = 0x02000000,
SEE_MASK_FLAG_LOG_USAGE = 0x04000000,
}
[Flags]
public enum SHGFI : int
{
/// <summary>get icon</summary>
Icon = 0x000000100,
/// <summary>get display name</summary>
DisplayName = 0x000000200,
/// <summary>get type name</summary>
TypeName = 0x000000400,
/// <summary>get attributes</summary>
Attributes = 0x000000800,
/// <summary>get icon location</summary>
IconLocation = 0x000001000,
/// <summary>return executable type</summary>
ExeType = 0x000002000,
/// <summary>get system icon index</summary>
SysIconIndex = 0x000004000,
/// <summary>put a link overlay on icon</summary>
LinkOverlay = 0x000008000,
/// <summary>show icon in selected state</summary>
Selected = 0x000010000,
/// <summary>get only specified attributes</summary>
Attr_Specified = 0x000020000,
/// <summary>get large icon</summary>
LargeIcon = 0x000000000,
/// <summary>get small icon</summary>
SmallIcon = 0x000000001,
/// <summary>get open icon</summary>
OpenIcon = 0x000000002,
/// <summary>get shell size icon</summary>
ShellIconSize = 0x000000004,
/// <summary>pszPath is a PIDL</summary>
PIDL = 0x000000008,
/// <summary>use passed dwFileAttribute</summary>
UseFileAttributes = 0x000000010,
/// <summary>apply the appropriate overlays</summary>
AddOverlays = 0x000000020,
/// <summary>Get the index of the overlay in the upper 8 bits of the iIcon</summary>
OverlayIndex = 0x000000040,
}
public enum ShowCommands : int
{
SW_HIDE = 0,
SW_SHOWNORMAL = 1,
SW_NORMAL = 1,
SW_SHOWMINIMIZED = 2,
SW_SHOWMAXIMIZED = 3,
SW_MAXIMIZE = 3,
SW_SHOWNOACTIVATE = 4,
SW_SHOW = 5,
SW_MINIMIZE = 6,
SW_SHOWMINNOACTIVE = 7,
SW_SHOWNA = 8,
SW_RESTORE = 9,
SW_SHOWDEFAULT = 10,
SW_FORCEMINIMIZE = 11,
SW_MAX = 11
}
[DllImport(SHELL32, CharSet = CharSet.Auto)]
public extern static int ExtractIconEx([MarshalAs(UnmanagedType.LPTStr)] string lpszFile, int nIconIndex, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 4)] IntPtr[] phIconLarge, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 4)] IntPtr[] phIconSmall, int nIcons);
/// <summary> Retrieves the User Model AppID that has been explicitly set for the current process via
/// SetCurrentProcessExplicitAppUserModelID </summary> <param name="AppID">
[DllImport(SHELL32)]
public static extern HRESULT GetCurrentProcessExplicitAppUserModelID([MarshalAs(UnmanagedType.LPWStr)] out string AppID);
/// <summary> Sets the User Model AppID for the current process, enabling Windows to retrieve this ID </summary>
/// <param name="AppID">
[DllImport(SHELL32, PreserveSig = false)]
public static extern void SetCurrentProcessExplicitAppUserModelID([MarshalAs(UnmanagedType.LPWStr)] string AppID);
// This overload is required. There's a cast in the Shell code that causes the wrong vtbl to be used if we let
// the marshaller convert the parameter to an IUnknown.
///<securitynote>
/// Critical - elevates via a SUC.
///</securitynote>
[DllImport(SHELL32, EntryPoint = "SHAddToRecentDocs")]
[SecurityCritical, SuppressUnmanagedCodeSecurity]
public static extern void SHAddToRecentDocs(SHARD uFlags, IShellLinkW pv);
///<securitynote>
/// Critical - elevates via a SUC.
///</securitynote>
[DllImport(SHELL32, EntryPoint = "SHAddToRecentDocs")]
[SecurityCritical, SuppressUnmanagedCodeSecurity]
public static extern void SHAddToRecentDocs(SHARD uFlags, [MarshalAs(UnmanagedType.LPWStr)] string pv);
// Vista only
///<securitynote>
/// Critical - elevates via a SUC.
///</securitynote>
[DllImport(SHELL32, CharSet = CharSet.Unicode, SetLastError = true, PreserveSig = false)]
[SecurityCritical, SuppressUnmanagedCodeSecurity]
public static extern void SHCreateItemFromParsingName([MarshalAs(UnmanagedType.LPWStr)] string pszPath, [MarshalAs(UnmanagedType.Interface)] System.Runtime.InteropServices.ComTypes.IBindCtx pbc, [In, MarshalAs(UnmanagedType.LPStruct)] Guid riid, [MarshalAs(UnmanagedType.Interface)] out IShellItem ppv);
// Vista only
///<securitynote>
/// Critical - elevates via a SUC.
///</securitynote>
[DllImport(SHELL32, CharSet = CharSet.Unicode, SetLastError = true, PreserveSig = false)]
[SecurityCritical, SuppressUnmanagedCodeSecurity]
public static extern void SHCreateItemFromParsingName([MarshalAs(UnmanagedType.LPWStr)] string pszPath, [MarshalAs(UnmanagedType.Interface)] System.Runtime.InteropServices.ComTypes.IBindCtx pbc, [In, MarshalAs(UnmanagedType.LPStruct)] Guid riid, [MarshalAs(UnmanagedType.Interface)] out IShellItem2 ppv);
[DllImport(SHELL32, CharSet = CharSet.Auto)]
public static extern bool ShellExecuteEx(ref SHELLEXECUTEINFO lpExecInfo);
[DllImport(SHELL32, CharSet = CharSet.Auto, SetLastError = false)]
public static extern int SHGetFileInfo(string pszPath, System.IO.FileAttributes dwFileAttributes, ref SHFILEINFO psfi, uint cbFileInfo, SHGFI uFlags);
[DllImport(SHELL32, CharSet = CharSet.Auto, SetLastError = false)]
public static extern int SHGetFileInfo(IntPtr itemIdList, System.IO.FileAttributes dwFileAttributes, ref SHFILEINFO psfi, uint cbFileInfo, SHGFI uFlags);
// Vista only. Also inconsistently documented on MSDN. It was available in some versions of the SDK, and it
// mentioned on several pages, but isn't specifically documented.
///<securitynote>
/// Critical - elevates via a SUC.
///</securitynote>
[DllImport(SHELL32)]
[SecurityCritical, SuppressUnmanagedCodeSecurity]
public static extern HRESULT SHGetFolderPathEx([In] ref Guid rfid, KF_FLAG dwFlags, [In, Optional] IntPtr hToken, [Out, MarshalAs(UnmanagedType.LPWStr)] StringBuilder pszPath, uint cchPath);
[DllImport(SHELL32, CharSet = CharSet.Unicode, PreserveSig = false, SetLastError = true)]
public static extern void SHGetIDListFromObject(IntPtr iUnknown, out IntPtr ppidl);
// Note that the BROWSEINFO object's pszDisplayName only gives you the name of the folder. To get the actual
// folderToSelect, you need to parse the returned PIDL
[DllImport(SHELL32, CharSet = CharSet.Unicode)]
public static extern uint SHGetPathFromIDList(IntPtr pidl, [MarshalAs(UnmanagedType.LPWStr)] StringBuilder pszPath);
[DllImport(SHELL32, CharSet = CharSet.Unicode, SetLastError = false)]
public static extern int SHGetSpecialFolderLocation(IntPtr hwndOwner, int nFolder, out IntPtr ppidl);
[DllImport(SHELL32, SetLastError = true)]
public static extern int SHOpenFolderAndSelectItems(IntPtr pidlFolder, uint cidl, [In, MarshalAs(UnmanagedType.LPArray)] IntPtr[] apidl, uint dwFlags);
[DllImport(SHELL32, CharSet = CharSet.Unicode, SetLastError = false)]
public static extern int SHParseDisplayName([MarshalAs(UnmanagedType.LPWStr)] string pszName, IntPtr pbc, out IntPtr ppidl, uint sfgaoIn, out uint psfgaoOut);
[StructLayout(LayoutKind.Sequential)]
public struct ITEMIDLIST
{
/// <summary>A list of item identifiers.</summary>
[MarshalAs(UnmanagedType.Struct)]
public SHITEMID mkid;
}
[StructLayout(LayoutKind.Sequential)]
public struct SHELLEXECUTEINFO
{
public int cbSize;
public ShellExecuteMaskFlags fMask;
public IntPtr hwnd;
[MarshalAs(UnmanagedType.LPTStr)]
public string lpVerb;
[MarshalAs(UnmanagedType.LPTStr)]
public string lpFile;
[MarshalAs(UnmanagedType.LPTStr)]
public string lpParameters;
[MarshalAs(UnmanagedType.LPTStr)]
public string lpDirectory;
public ShowCommands nShow;
public IntPtr hInstApp;
public IntPtr lpIDList;
[MarshalAs(UnmanagedType.LPTStr)]
public string lpClass;
public IntPtr hkeyClass;
public uint dwHotKey;
public IntPtr hIcon;
public IntPtr hProcess;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
public struct SHFILEINFO
{
public IntPtr hIcon;
public int iIcon;
public int dwAttributes;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 260)]
public string szDisplayName;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 80)]
public string szTypeName;
}
[StructLayout(LayoutKind.Sequential)]
public struct SHITEMID
{
/// <summary>The size of identifier, in bytes, including <see cref="cb"/> itself.</summary>
public ushort cb;
/// <summary>A variable-length item identifier.</summary>
public byte[] abID;
}
}
}

Wyświetl plik

@ -0,0 +1,26 @@
using System.Drawing;
using System.Runtime.InteropServices;
namespace Vanara.Interop
{
internal static partial class NativeMethods
{
[StructLayout(LayoutKind.Sequential)]
public struct SIZE
{
public int width;
public int height;
public SIZE(int w, int h)
{
width = w; height = h;
}
public Size ToSize() => this;
public static implicit operator Size(SIZE s) => new Size(s.width, s.height);
public static implicit operator SIZE(Size s) => new SIZE(s.Width, s.Height);
}
}
}

Wyświetl plik

@ -0,0 +1,101 @@
using System;
using System.Drawing;
using System.Runtime.InteropServices;
namespace Vanara.Interop
{
internal static partial class NativeMethods
{
/// <summary>
/// A SafeHandle to track DC handles.
/// </summary>
public class SafeDCHandle : SafeHandle
{
/// <summary>
/// A null handle.
/// </summary>
public static readonly SafeDCHandle Null = new SafeDCHandle(IntPtr.Zero);
private readonly IDeviceContext idc;
/// <summary>
/// Initializes a new instance of the <see cref="SafeDCHandle"/> class.
/// </summary>
/// <param name="hDC">The handle to the DC.</param>
/// <param name="ownsHandle">
/// <see langword="true" /> to have the native handle released when this safe handle is disposed or finalized;
/// <see langword="false" /> otherwise.
/// </param>
public SafeDCHandle(IntPtr hDC, bool ownsHandle = true)
: base(IntPtr.Zero, ownsHandle)
{
SetHandle(hDC);
}
/// <summary>
/// Initializes a new instance of the <see cref="SafeDCHandle"/> class.
/// </summary>
/// <param name="dc">An <see cref="IDeviceContext"/> instance.</param>
public SafeDCHandle(IDeviceContext dc)
: base(IntPtr.Zero, true)
{
if (dc == null)
{
throw new ArgumentNullException(nameof(dc));
}
idc = dc;
SetHandle(dc.GetHdc());
}
/// <inheritdoc />
public override bool IsInvalid => handle == IntPtr.Zero;
public static SafeDCHandle ScreenCompatibleDCHandle => new SafeDCHandle(CreateCompatibleDC(IntPtr.Zero));
/// <summary>
/// Performs an implicit conversion from <see cref="Graphics"/> to <see cref="SafeDCHandle"/>.
/// </summary>
/// <param name="graphics">The <see cref="Graphics"/> instance.</param>
/// <returns>
/// The result of the conversion.
/// </returns>
public static implicit operator SafeDCHandle(Graphics graphics) => new SafeDCHandle(graphics);
public SafeDCHandle GetCompatibleDCHandle() => new SafeDCHandle(CreateCompatibleDC(handle));
/// <inheritdoc />
protected override bool ReleaseHandle()
{
if (idc != null)
{
idc.ReleaseHdc();
return true;
}
return DeleteDC(handle);
}
}
public class SafeDCObjectHandle : SafeHandle
{
private readonly SafeDCHandle hDC;
private readonly IntPtr hOld;
public SafeDCObjectHandle(SafeDCHandle hdc, IntPtr hObj): base(IntPtr.Zero, true)
{
if (hdc == null || hdc.IsInvalid) return;
hDC = hdc;
hOld = SelectObject(hdc, hObj);
SetHandle(hObj);
}
public override bool IsInvalid => handle == IntPtr.Zero;
protected override bool ReleaseHandle()
{
SelectObject(hDC, hOld);
return DeleteObject(handle);
}
}
}
}

Wyświetl plik

@ -0,0 +1,205 @@
using System.Collections.Generic;
using System.Diagnostics;
namespace System.Runtime.InteropServices
{
internal class SafeHGlobalHandle : SafeHandle
{
/// <summary>
/// Maintains reference to other SafeHGlobalHandle objects, the pointer
/// to which are referred to by this object. This is to ensure that such
/// objects being referred to wouldn't be unreferenced until this object
/// is active.
/// </summary>
List<SafeHGlobalHandle> references;
public SafeHGlobalHandle() : this(IntPtr.Zero, 0, false) { }
public SafeHGlobalHandle(IntPtr handle, int size, bool ownsHandle = true) :
base(IntPtr.Zero, ownsHandle)
{
if (handle != IntPtr.Zero)
SetHandle(handle);
Size = size;
}
public SafeHGlobalHandle(int size) : this()
{
if (size < 0)
throw new ArgumentOutOfRangeException(nameof(size), "The value of this argument must be non-negative");
System.Runtime.CompilerServices.RuntimeHelpers.PrepareConstrainedRegions();
SetHandle(Marshal.AllocHGlobal(size));
Size = size;
}
public SafeHGlobalHandle(object value) : this(Marshal.SizeOf(value))
{
Marshal.StructureToPtr(value, handle, false);
}
/// <summary>
/// Allocates from unmanaged memory to represent an array of pointers
/// and marshals the unmanaged pointers (IntPtr) to the native array
/// equivalent.
/// </summary>
/// <param name="values">Array of unmanaged pointers</param>
/// <returns>SafeHGlobalHandle object to an native (unmanaged) array of pointers</returns>
public SafeHGlobalHandle(IntPtr[] values) : this(IntPtr.Size * values.Length)
{
Marshal.Copy(values, 0, handle, values.Length);
}
/// <summary>
/// Allocates from unmanaged memory to represent a Unicode string (WSTR)
/// and marshal this to a native PWSTR.
/// </summary>
/// <param name="s">String</param>
/// <returns>SafeHGlobalHandle object to an native (unmanaged) Unicode string</returns>
public SafeHGlobalHandle(string s) : this(s == null ? IntPtr.Zero : Marshal.StringToHGlobalUni(s), (s?.Length + 1) * 2 ?? 0)
{
}
/*
/// <summary>
/// Initializes a new instance of the <see cref="SafeHGlobalHandle"/> class.
/// </summary>
/// <param name="s">The secure string.</param>
public SafeHGlobalHandle(Security.SecureString s) :
base(IntPtr.Zero, p => { Marshal.ZeroFreeGlobalAllocUnicode(p); return true; }, true)
{
if (s != null)
{
s.MakeReadOnly();
SetHandle(Marshal.SecureStringToGlobalAllocUnicode(s));
Size = s.Length;
}
}
*/
/// <summary>
/// Allocates from unmanaged memory sufficient memory to hold an object of type T.
/// </summary>
/// <typeparam name="T">Native type</typeparam>
/// <returns>SafeHGlobalHandle object to an native (unmanaged) memory block the size of T.</returns>
public static SafeHGlobalHandle AllocHGlobal<T>() => new SafeHGlobalHandle(Marshal.SizeOf(typeof(T)));
/// <summary>
/// Allocates from unmanaged memory to represent an array of structures
/// and marshals the structure elements to the native array of
/// structures. ONLY structures with attribute StructLayout of
/// LayoutKind.Sequential are supported.
/// </summary>
/// <typeparam name="T">Native structure type</typeparam>
/// <param name="values">Collection of structure objects</param>
/// <returns>SafeHGlobalHandle object to an native (unmanaged) array of structures</returns>
public static SafeHGlobalHandle AllocHGlobal<T>(ICollection<T> values) where T : struct
{
Debug.Assert(typeof(T).StructLayoutAttribute?.Value == LayoutKind.Sequential);
return AllocHGlobal(0, values, values.Count);
}
/// <summary>
/// Allocates from unmanaged memory to represent a structure with a
/// variable length array at the end and marshal these structure
/// elements. It is the callers responsibility to marshal what precedes
/// the trailing array into the unmanaged memory. ONLY structures with
/// attribute StructLayout of LayoutKind.Sequential are supported.
/// </summary>
/// <typeparam name="T">Type of the trailing array of structures</typeparam>
/// <param name="prefixBytes">Number of bytes preceding the trailing array of structures</param>
/// <param name="values">Collection of structure objects</param>
/// <param name="count">Number of items in <paramref name="values"/>.</param>
/// <returns>SafeHGlobalHandle object to an native (unmanaged) structure with a trail array of structures</returns>
public static SafeHGlobalHandle AllocHGlobal<T>(int prefixBytes, IEnumerable<T> values, int count) where T : struct
{
Debug.Assert(typeof(T).StructLayoutAttribute?.Value == LayoutKind.Sequential);
var result = new SafeHGlobalHandle(prefixBytes + Marshal.SizeOf(typeof(T)) * count);
var ptr = new IntPtr(result.handle.ToInt32() + prefixBytes);
foreach (var value in values)
{
Marshal.StructureToPtr(value, ptr, false);
ptr = new IntPtr(ptr.ToInt32() + Marshal.SizeOf(typeof(T)));
}
return result;
}
/// <summary>
/// Allocates from unmanaged memory to hold a copy of a structure.
/// </summary>
/// <typeparam name="T">Type of the structure.</typeparam>
/// <param name="obj">The object.</param>
/// <returns>SafeHGlobalHandle object to an native (unmanaged) structure</returns>
public static SafeHGlobalHandle AllocHGlobalStruct<T>(T obj) where T : struct
{
Debug.Assert(typeof(T).StructLayoutAttribute?.Value == LayoutKind.Sequential);
var result = new SafeHGlobalHandle(Marshal.SizeOf(typeof(T)));
Marshal.StructureToPtr(obj, result.handle, false);
return result;
}
/// <summary>
/// Gets the size of the allocated memory block.
/// </summary>
/// <value>
/// The sizeof the allocated memory block.
/// </value>
public int Size { get; }
/// <summary>
/// Allows to assign IntPtr to SafeHGlobalHandle
/// </summary>
public static implicit operator SafeHGlobalHandle(IntPtr ptr) => new SafeHGlobalHandle(ptr, 0, true);
/// <summary>
/// Allows to use SafeHGlobalHandle as IntPtr
/// </summary>
public static implicit operator IntPtr(SafeHGlobalHandle h) => h.DangerousGetHandle();
/// <summary>
/// Adds reference to other SafeHGlobalHandle objects, the pointer to
/// which are referred to by this object. This is to ensure that such
/// objects being referred to wouldn't be unreferenced until this object
/// is active.
///
/// For e.g. when this object is an array of pointers to other objects
/// </summary>
/// <param name="children">Collection of SafeHGlobalHandle objects referred to by this object.</param>
public void AddSubReference(IEnumerable<SafeHGlobalHandle> children)
{
if (references == null)
references = new List<SafeHGlobalHandle>();
references.AddRange(children);
}
public T ToStructure<T>() where T : struct
{
if (IsInvalid)
return default(T);
if (Size < Marshal.SizeOf(typeof(T)))
throw new InsufficientMemoryException("Requested structure is larger than the memory allocated.");
return handle.ToStructure<T>();
}
public T[] ToArray<T>(int count, int prefixBytes = 0) where T : struct
{
if (IsInvalid)
return null;
if (Size < Marshal.SizeOf(typeof(T)) * count + prefixBytes)
throw new InsufficientMemoryException("Requested array is larger than the memory allocated.");
Debug.Assert(typeof(T).StructLayoutAttribute?.Value == LayoutKind.Sequential);
return handle.ToArray<T>(count, prefixBytes);
}
protected override bool ReleaseHandle()
{
if (!IsInvalid)
Marshal.FreeHGlobal(handle);
return true;
}
public override bool IsInvalid => handle == IntPtr.Zero;
}
}

Wyświetl plik

@ -0,0 +1,193 @@
// Requires ShlObjIdl.cs
using System;
using System.Drawing;
using System.Runtime.InteropServices;
using System.Windows.Forms;
namespace Vanara.Interop
{
[System.Security.SuppressUnmanagedCodeSecurity]
internal static partial class NativeMethods
{
public static class TaskbarList
{
static readonly Finalizer finalizer = new Finalizer();
static ITaskbarList2 taskbar2;
static ITaskbarList4 taskbar4;
static TaskbarList()
{
var tb = new CTaskbarList();
taskbar2 = (ITaskbarList2)tb;
try { taskbar4 = (ITaskbarList4)tb; } catch { taskbar4 = null; }
taskbar2?.HrInit();
}
sealed class Finalizer
{
~Finalizer()
{
if (taskbar2 != null)
Marshal.ReleaseComObject(taskbar2);
if (taskbar4 != null)
Marshal.ReleaseComObject(taskbar4);
}
}
public static uint TaskbarButtonCreatedWinMsgId => RegisterWindowMessage("TaskbarButtonCreated");
public static void ActivateTaskbarItem(IWin32Window parent)
{
if (parent == null)
throw new ArgumentNullException(nameof(parent));
taskbar2?.ActivateTab(parent.Handle);
}
public static void MarkFullscreenWindow(IWin32Window parent, bool fullscreen)
{
if (parent == null)
throw new ArgumentNullException(nameof(parent));
taskbar2?.MarkFullscreenWindow(parent.Handle, fullscreen);
}
public static void SetActiveAlt(IWin32Window parent)
{
if (parent == null)
throw new ArgumentNullException(nameof(parent));
taskbar2?.SetActiveAlt(parent.Handle);
}
// Thumbnail Toolbars ============================================
public static void ThumbBarAddButtons(IWin32Window parent, THUMBBUTTON[] buttons)
{
Validate7OrLater();
if (parent == null)
throw new ArgumentNullException(nameof(parent));
if (buttons == null)
throw new ArgumentNullException(nameof(buttons));
taskbar4?.ThumbBarAddButtons(parent.Handle, (uint)buttons.Length, buttons);
}
public static void ThumbBarSetImageList(IWin32Window parent, ImageList imageList)
{
Validate7OrLater();
if (parent == null)
throw new ArgumentNullException(nameof(parent));
if (imageList == null)
throw new ArgumentNullException(nameof(imageList));
taskbar4?.ThumbBarSetImageList(parent.Handle, imageList.Handle);
}
public static void ThumbBarUpdateButtons(IWin32Window parent, THUMBBUTTON[] buttons)
{
Validate7OrLater();
if (parent == null)
throw new ArgumentNullException(nameof(parent));
if (buttons == null)
throw new ArgumentNullException(nameof(buttons));
taskbar4?.ThumbBarUpdateButtons(parent.Handle, (uint)buttons.Length, buttons);
}
// Overlays ============================================
public static void SetOverlayIcon(IWin32Window parent, Icon icon, string description)
{
Validate7OrLater();
if (parent == null)
throw new ArgumentNullException(nameof(parent));
taskbar4?.SetOverlayIcon(parent.Handle, icon == null ? IntPtr.Zero : icon.Handle, description);
}
// Progress Bars ============================================
public static void SetProgressState(IWin32Window parent, TBPF status)
{
Validate7OrLater();
if (parent == null)
throw new ArgumentNullException(nameof(parent));
taskbar4?.SetProgressState(parent.Handle, status);
}
public static void SetProgressValue(IWin32Window parent, ulong completed, ulong total)
{
Validate7OrLater();
if (parent == null)
throw new ArgumentNullException(nameof(parent));
taskbar4?.SetProgressValue(parent.Handle, completed, total);
}
// Thumbnails ============================================
public static void RegisterTab(IWin32Window parent, IWin32Window childWindow)
{
Validate7OrLater();
if (childWindow == null)
throw new ArgumentNullException(nameof(childWindow));
if (parent == null)
throw new ArgumentNullException(nameof(parent));
taskbar4?.RegisterTab(childWindow.Handle, parent.Handle);
}
public static void SetTabActive(IWin32Window parent, IWin32Window childWindow)
{
Validate7OrLater();
if (childWindow == null)
throw new ArgumentNullException(nameof(childWindow));
if (parent == null)
throw new ArgumentNullException(nameof(parent));
taskbar4?.SetTabActive(childWindow.Handle, parent.Handle, 0);
}
public static void SetTabOrder(IWin32Window childWindow, IWin32Window insertBeforeChildWindow = null)
{
Validate7OrLater();
if (childWindow == null)
throw new ArgumentNullException(nameof(childWindow));
taskbar4?.SetTabOrder(childWindow.Handle, insertBeforeChildWindow == null ? IntPtr.Zero : insertBeforeChildWindow.Handle);
}
public static void SetTabProperties(IWin32Window childWindow, STPF properties)
{
Validate7OrLater();
if (childWindow == null)
throw new ArgumentNullException(nameof(childWindow));
taskbar4?.SetTabProperties(childWindow.Handle, properties);
}
public static void UnregisterTab(IWin32Window childWindow)
{
Validate7OrLater();
if (childWindow == null)
throw new ArgumentNullException(nameof(childWindow));
taskbar4?.UnregisterTab(childWindow.Handle);
}
public static void SetThumbnailClip(IWin32Window parent, Rectangle windowClipRect)
{
Validate7OrLater();
if (parent == null)
throw new ArgumentNullException(nameof(parent));
RECT cr = windowClipRect;
taskbar4?.SetThumbnailClip(parent.Handle, ref cr);
}
public static void SetThumbnailTooltip(IWin32Window parent, string tip)
{
Validate7OrLater();
if (parent == null)
throw new ArgumentNullException(nameof(parent));
taskbar4?.SetThumbnailTooltip(parent.Handle, tip);
}
static readonly Version Win7Ver = new Version(6, 1);
private static void Validate7OrLater()
{
if (Environment.OSVersion.Version < Win7Ver)
throw new InvalidOperationException("This method is only available on Windows 7 and later.");
}
}
}
}

Wyświetl plik

@ -0,0 +1,344 @@
using System;
using System.Diagnostics.CodeAnalysis;
using System.Runtime.InteropServices;
namespace Vanara.Interop
{
internal static partial class NativeMethods
{
internal const string USER32 = "user32.dll";
[Flags]
public enum LoadImageOptions : uint
{
DEFAULTCOLOR = 0x00000000,
MONOCHROME = 0x00000001,
COLOR = 0x00000002,
COPYRETURNORG = 0x00000004,
COPYDELETEORG = 0x00000008,
LOADFROMFILE = 0x00000010,
LOADTRANSPARENT = 0x00000020,
DEFAULTSIZE = 0x00000040,
VGACOLOR = 0x00000080,
LOADMAP3DCOLORS = 0x00001000,
CREATEDIBSECTION = 0x00002000,
COPYFROMRESOURCE = 0x00004000,
SHARED = 0x00008000
}
public enum LoadImageType : uint
{
/// <summary>Loads a bitmap.</summary>
BITMAP = 0,
/// <summary>Loads an icon.</summary>
ICON = 1,
/// <summary>Loads a cursor.</summary>
CURSOR = 2,
/// <summary>Loads an enhanced metafile.</summary>
IMAGE_ENHMETAFILE = 3
}
/// <summary>Window sizing and positioning flags.</summary>
[Flags]
public enum SetWindowPosFlags : uint
{
/// <summary>
/// If the calling thread and the thread that owns the window are attached to different input queues, the
/// system posts the request to the thread that owns the window. This prevents the calling thread from
/// blocking its execution while other threads process the request.
/// </summary>
/// <remarks>SWP_ASYNCWINDOWPOS</remarks>
AsynchronousWindowPosition = 0x4000,
/// <summary>Prevents generation of the WM_SYNCPAINT message.</summary>
/// <remarks>SWP_DEFERERASE</remarks>
DeferErase = 0x2000,
/// <summary>Draws a frame (defined in the window's class description) around the window.</summary>
/// <remarks>SWP_DRAWFRAME</remarks>
DrawFrame = 0x0020,
/// <summary>
/// Applies new frame styles set using the SetWindowLong function. Sends a WM_NCCALCSIZE message to the
/// window, even if the window's size is not being changed. If this flag is not specified, WM_NCCALCSIZE is
/// sent only when the window's size is being changed.
/// </summary>
/// <remarks>SWP_FRAMECHANGED</remarks>
FrameChanged = 0x0020,
/// <summary>Hides the window.</summary>
/// <remarks>SWP_HIDEWINDOW</remarks>
HideWindow = 0x0080,
/// <summary>
/// Does not activate the window. If this flag is not set, the window is activated and moved to the top of
/// either the topmost or non-topmost group (depending on the setting of the hWndInsertAfter parameter).
/// </summary>
/// <remarks>SWP_NOACTIVATE</remarks>
DoNotActivate = 0x0010,
/// <summary>
/// Discards the entire contents of the client area. If this flag is not specified, the valid contents of the
/// client area are saved and copied back into the client area after the window is sized or repositioned.
/// </summary>
/// <remarks>SWP_NOCOPYBITS</remarks>
DoNotCopyBits = 0x0100,
/// <summary>Retains the current position (ignores X and Y parameters).</summary>
/// <remarks>SWP_NOMOVE</remarks>
IgnoreMove = 0x0002,
/// <summary>Does not change the owner window's position in the Z order.</summary>
/// <remarks>SWP_NOOWNERZORDER</remarks>
DoNotChangeOwnerZOrder = 0x0200,
/// <summary>
/// Does not redraw changes. If this flag is set, no repainting of any kind occurs. This applies to the
/// client area, the nonclient area (including the title bar and scroll bars), and any part of the parent
/// window uncovered as a result of the window being moved. When this flag is set, the application must
/// explicitly invalidate or redraw any parts of the window and parent window that need redrawing.
/// </summary>
/// <remarks>SWP_NOREDRAW</remarks>
DoNotRedraw = 0x0008,
/// <summary>Same as the SWP_NOOWNERZORDER flag.</summary>
/// <remarks>SWP_NOREPOSITION</remarks>
DoNotReposition = 0x0200,
/// <summary>Prevents the window from receiving the WM_WINDOWPOSCHANGING message.</summary>
/// <remarks>SWP_NOSENDCHANGING</remarks>
DoNotSendChangingEvent = 0x0400,
/// <summary>Retains the current size (ignores the cx and cy parameters).</summary>
/// <remarks>SWP_NOSIZE</remarks>
IgnoreResize = 0x0001,
/// <summary>Retains the current Z order (ignores the hWndInsertAfter parameter).</summary>
/// <remarks>SWP_NOZORDER</remarks>
IgnoreZOrder = 0x0004,
/// <summary>Displays the window.</summary>
/// <remarks>SWP_SHOWWINDOW</remarks>
ShowWindow = 0x0040,
}
/// <summary>Flags used for <see cref="NativeMethods.GetWindowLong"/> and <see cref="NativeMethods.SetWindowLong"/> methods to retrieve information about a window.</summary>
[Flags]
public enum WindowLongFlags : int
{
/// <summary>The extended window styles</summary>
/// <remarks>GWL_EXSTYLE</remarks>
ExtendedWindowStyles = -20,
/// <summary>The application instance handle</summary>
/// <remarks>GWL_HINSTANCE</remarks>
InstanceHandle = -6,
/// <summary>The parent window handle</summary>
/// <remarks>GWL_HWNDPARENT</remarks>
ParentWindowHandle = -8,
/// <summary>The window identifier</summary>
/// <remarks>GWL_ID</remarks>
WindowIdentifier = -12,
/// <summary>The window styles</summary>
/// <remarks>GWL_STYLE</remarks>
WindowStyles = -16,
/// <summary>The window user data</summary>
/// <remarks>GWL_USERDATA</remarks>
WindowUserData = -21,
/// <summary>The window procedure address or handle</summary>
/// <remarks>GWL_WNDPROC</remarks>
WindowProcedure = -4,
/// <summary>The dialog user data</summary>
/// <remarks>DWLP_USER</remarks>
DialogUserData = 0x8,
/// <summary>The dialog procedure message result</summary>
/// <remarks>DWLP_MSGRESULT</remarks>
DialogMessageResult = 0x0,
/// <summary>The dialog procedure address or handle</summary>
/// <remarks>DWLP_DLGPROC</remarks>
DialogProcedure = 0x4
}
[DllImport(USER32, CharSet = CharSet.Auto, ExactSpelling = true)]
[System.Security.SecurityCritical]
public static extern IntPtr ChildWindowFromPointEx(IntPtr hwndParent, ref System.Drawing.Point pt, System.Windows.Forms.GetChildAtPointSkip uFlags);
[DllImport(USER32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
[System.Security.SecurityCritical]
public static extern bool DestroyIcon(IntPtr hIcon);
[DllImport(USER32, CharSet = CharSet.Unicode)]
public static extern int DrawText(IntPtr hDC, string lpString, int nCount, ref RECT lpRect, uint uFormat);
[DllImport(USER32, ExactSpelling = true)]
[System.Security.SecurityCritical]
public static extern IntPtr GetActiveWindow();
[DllImport(USER32, CharSet = CharSet.Auto, ExactSpelling = true, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
[System.Security.SecurityCritical]
public static extern bool GetClientRect(IntPtr hWnd, [In, Out] ref NativeMethods.RECT rect);
public static IntPtr GetWindowLong(IntPtr hWnd, int nIndex)
{
IntPtr ret = IntPtr.Zero;
if (IntPtr.Size == 4)
ret = (IntPtr)GetWindowLong32(hWnd, nIndex);
else
ret = GetWindowLongPtr(hWnd, nIndex);
if (ret == IntPtr.Zero)
throw new System.ComponentModel.Win32Exception();
return ret;
}
[DllImport(USER32, EntryPoint = "GetWindowLong", SetLastError = true)]
[SuppressMessage("Microsoft.Portability", "CA1901:PInvokeDeclarationsShouldBePortable", MessageId = "return", Justification = "This declaration is not used on 64-bit Windows.")]
[SuppressMessage("Microsoft.Portability", "CA1901:PInvokeDeclarationsShouldBePortable", MessageId = "2", Justification = "This declaration is not used on 64-bit Windows.")]
[System.Security.SecurityCritical]
public static extern int GetWindowLong32(IntPtr hWnd, int nIndex);
[DllImport(USER32, EntryPoint = "GetWindowLongPtr", SetLastError = true)]
[SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist", Justification = "Entry point does exist on 64-bit Windows.")]
[System.Security.SecurityCritical]
public static extern IntPtr GetWindowLongPtr(IntPtr hWnd, int nIndex);
[DllImport(USER32, ExactSpelling = true, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
[System.Security.SecurityCritical]
public static extern bool GetWindowRect(IntPtr hWnd, out RECT lpRect);
[DllImport(USER32, ExactSpelling = true)]
[return: MarshalAs(UnmanagedType.Bool)]
[System.Security.SecurityCritical]
public static extern bool InvalidateRect(IntPtr hWnd, [In] ref NativeMethods.RECT rect, [MarshalAs(UnmanagedType.Bool)] bool bErase);
[DllImport(USER32, ExactSpelling = true)]
[return: MarshalAs(UnmanagedType.Bool)]
[System.Security.SecurityCritical]
public static extern bool InvalidateRect(IntPtr hWnd, IntPtr rect, [MarshalAs(UnmanagedType.Bool)] bool bErase);
[DllImport(USER32, ExactSpelling = true, SetLastError = true, CharSet = CharSet.Auto)]
[System.Security.SecurityCritical]
public static extern IntPtr LoadImage(IntPtr hinst, string lpszName, LoadImageType uType, int cxDesired, int cyDesired, LoadImageOptions fuLoad);
[DllImport(USER32, ExactSpelling = true, SetLastError = true, CharSet = CharSet.Auto)]
[System.Security.SecurityCritical]
public static extern IntPtr LoadImage(IntPtr hinst, [MarshalAs(UnmanagedType.SysInt)] int uID, LoadImageType uType, int cxDesired, int cyDesired, LoadImageOptions fuLoad);
[DllImport(USER32, ExactSpelling = true, CharSet = CharSet.Auto)]
[System.Security.SecurityCritical]
public static extern int LoadString(IntPtr hInstance, uint uID, System.Text.StringBuilder lpBuffer, int nBufferMax);
[DllImport(USER32, SetLastError = true, CharSet = CharSet.Auto)]
[System.Security.SecurityCritical]
public static extern uint RegisterWindowMessage(string lpString);
[DllImport(USER32, CharSet = CharSet.Auto, ExactSpelling = true)]
[return: MarshalAs(UnmanagedType.Bool)]
[System.Security.SecurityCritical]
public static extern bool ScreenToClient(IntPtr hWnd, [In, Out] ref System.Drawing.Point lpPoint);
[DllImport(USER32, CharSet = CharSet.Unicode, SetLastError = false)]
[System.Security.SecurityCritical]
public static extern IntPtr SendMessage(IntPtr hWnd, uint msg, IntPtr wParam, IntPtr lParam);
public static IntPtr SendMessage(IntPtr hWnd, uint msg, int wParam = 0, int lParam = 0) => SendMessage(hWnd, msg, (IntPtr)wParam, (IntPtr)lParam);
public static IntPtr SendMessage(IntPtr hWnd, uint msg, int wParam, string lParam) => SendMessage(hWnd, msg, (IntPtr)wParam, lParam);
[DllImport(USER32, SetLastError = false)]
[System.Security.SecurityCritical]
public static extern IntPtr SendMessage(IntPtr hWnd, uint msg, IntPtr wParam, ref RECT rect);
[DllImport(USER32, SetLastError = false)]
[System.Security.SecurityCritical]
public static extern IntPtr SendMessage(IntPtr hWnd, uint msg, IntPtr wParam, [In, MarshalAs(UnmanagedType.LPWStr)] string lParam);
[DllImport(USER32, CharSet = CharSet.Auto, SetLastError = false)]
[System.Security.SecurityCritical]
public static extern IntPtr SendMessage(IntPtr hWnd, uint msg, ref int wParam, [In, Out] System.Text.StringBuilder lParam);
public static IntPtr SetWindowLong(IntPtr hWnd, Int32 nIndex, IntPtr dwNewLong)
{
IntPtr ret = IntPtr.Zero;
if (IntPtr.Size == 4)
ret = SetWindowLongPtr32(hWnd, nIndex, dwNewLong);
else
ret = SetWindowLongPtr64(hWnd, nIndex, dwNewLong);
if (ret == IntPtr.Zero)
throw new System.ComponentModel.Win32Exception();
return ret;
}
[DllImport(USER32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
[System.Security.SecurityCritical]
public static extern bool SetWindowPos(IntPtr hWnd, IntPtr hWndInsertAfter, int X, int Y, int cx, int cy, SetWindowPosFlags uFlags);
[DllImport(USER32, CharSet = CharSet.Unicode)]
[return: MarshalAs(UnmanagedType.Bool)]
[System.Security.SecurityCritical]
public static extern bool SetWindowText(IntPtr hWnd, [MarshalAs(UnmanagedType.LPWStr)] string lpString);
[DllImport(USER32, SetLastError = true, EntryPoint = "SetWindowLong")]
[SuppressMessage("Microsoft.Portability", "CA1901:PInvokeDeclarationsShouldBePortable", MessageId = "return", Justification = "This declaration is not used on 64-bit Windows.")]
[SuppressMessage("Microsoft.Portability", "CA1901:PInvokeDeclarationsShouldBePortable", MessageId = "2", Justification = "This declaration is not used on 64-bit Windows.")]
private static extern IntPtr SetWindowLongPtr32(IntPtr hWnd, Int32 nIndex, IntPtr dwNewLong);
[DllImport(USER32, SetLastError = true, EntryPoint = "SetWindowLongPtr")]
[SuppressMessage("Microsoft.Interoperability", "CA1400:PInvokeEntryPointsShouldExist", Justification = "Entry point does exist on 64-bit Windows.")]
private static extern IntPtr SetWindowLongPtr64(IntPtr hWnd, Int32 nIndex, IntPtr dwNewLong);
[StructLayout(LayoutKind.Sequential)]
public struct NMHDR
{
public IntPtr hwndFrom;
public IntPtr idFrom;
public int code;
}
[StructLayout(LayoutKind.Sequential)]
public struct WINDOWPOS
{
public IntPtr hwnd;
public IntPtr hwndInsertAfter;
public int x;
public int y;
public int cx;
public int cy;
public int flags;
}
/// <summary>Special window handles</summary>
public static class SpecialWindowHandles
{
/// <summary>
/// Places the window at the bottom of the Z order. If the hWnd parameter identifies a topmost window, the
/// window loses its topmost status and is placed at the bottom of all other windows.
/// </summary>
/// <remarks>HWND_BOTTOM</remarks>
public static IntPtr HwndBottom = new IntPtr(1);
/// <summary>
/// Places the window above all non-topmost windows (that is, behind all topmost windows). This flag has no
/// effect if the window is already a non-topmost window.
/// </summary>
/// <remarks>HWND_NOTOPMOST</remarks>
public static IntPtr HwndNoTopMost = new IntPtr(-2);
/// <summary>Places the window at the top of the Z order.</summary>
/// <remarks>HWND_TOP</remarks>
public static IntPtr HwndTop = new IntPtr(0);
/// <summary>
/// Places the window above all non-topmost windows. The window maintains its topmost position even when it
/// is deactivated.
/// </summary>
/// <remarks>HWND_TOPMOST</remarks>
public static IntPtr HwndTopMost = new IntPtr(-1);
}
}
}

Wyświetl plik

@ -0,0 +1,602 @@
// Requires Gdi\RECT.cs
using System;
using System.Drawing;
using System.Runtime.InteropServices;
using System.Windows.Forms;
using System.Windows.Forms.VisualStyles;
namespace Vanara.Interop
{
internal static partial class NativeMethods
{
private const string UXTHEME = "uxtheme.dll";
public class SafeThemeHandle : SafeHandle
{
public SafeThemeHandle(IntPtr hTheme, bool ownsHandle = true) : base(IntPtr.Zero, ownsHandle) { SetHandle(hTheme); }
protected override bool ReleaseHandle() => CloseThemeData(handle) == 0;
public override bool IsInvalid => handle == IntPtr.Zero;
public static implicit operator SafeThemeHandle(VisualStyleRenderer r) => new SafeThemeHandle(r.Handle, false);
}
[UnmanagedFunctionPointer(CallingConvention.Winapi, CharSet = CharSet.Unicode)]
public delegate int DrawThemeTextCallback(SafeDCHandle hdc, string text, int textLen, ref RECT rc, int flags, IntPtr lParam);
[Flags]
public enum DrawThemeParentBackgroundFlags
{
None = 0,
/// <summary>If set, hdc is assumed to be a window DC, not a client DC.</summary>
/// <remarks>DTPB_WINDOWDC</remarks>
WindowDC = 1,
/// <summary>If set, this function sends a WM_CTLCOLORSTATIC message to the parent and uses the brush if one is provided. Otherwise, it uses COLOR_BTNFACE.</summary>
/// <remarks>DTPB_USECTLCOLORSTATIC</remarks>
UseCtlColorStaticMsg = 2,
/// <summary>If set, this function returns S_OK without sending a WM_CTLCOLORSTATIC message if the parent actually painted on WM_ERASEBKGND.</summary>
/// <remarks>DTPB_USEERASEBKGND</remarks>
UseEraseBkgndMsg = 4
}
public enum DrawThemeTextSystemFonts
{
Caption = 801,
SmallCaption = 802,
Menu = 803,
Status = 804,
MessageBox = 805,
IconTitle = 806
}
public enum IntegerListProperty
{
TransitionDuration = 6000
}
public enum OpenThemeDataOptions
{
None = 0,
/// <summary>Forces drawn images from this theme to stretch to fit the rectangles specified by drawing functions.</summary>
/// <remarks>OTD_FORCE_RECT_SIZING</remarks>
ForceRectSizing = 1,
/// <summary>Allows theme elements to be drawn in the non-client area of the window.</summary>
/// <remarks>OTD_NONCLIENT</remarks>
NonClient = 2
}
public enum ThemePropertyOrigin
{
/// <summary>Property was found in the state section.</summary>
/// <remarks>PO_STATE</remarks>
State = 0,
/// <summary>Property was found in the part section.</summary>
/// <remarks>PO_PART</remarks>
Part = 1,
/// <summary>Property was found in the class section.</summary>
/// <remarks>PO_CLASS</remarks>
Class = 2,
/// <summary>Property was found in the list of global variables.</summary>
/// <remarks>PO_GLOBAL</remarks>
Global = 3,
/// <summary>Property was not found.</summary>
/// <remarks>PO_NOTFOUND</remarks>
NotFound = 4
}
public enum TextShadowType
{
/// <summary>No shadow will be drawn.</summary>
/// <remarks>TST_NONE</remarks>
None = 0,
/// <summary>The shadow will be drawn to appear detailed underneath text.</summary>
/// <remarks>TST_SINGLE</remarks>
Single = 1,
/// <summary>The shadow will be drawn to appear blurred underneath text.</summary>
/// <remarks>TST_CONTINUOUS</remarks>
Continuous = 2
}
public enum ThemeSize
{
/// <summary>Receives the minimum size of a visual style part.</summary>
/// <remarks>TS_MIN</remarks>
Min,
/// <summary>Receives the size of the visual style part that will best fit the available space.</summary>
/// <remarks>TS_TRUE</remarks>
True,
/// <summary>Receives the size that the theme manager uses to draw a part.</summary>
/// <remarks>TS_DRAW</remarks>
Draw
}
[Flags]
public enum WindowThemeNonClientAttributes : int
{
/// <summary>Do Not Draw The Caption (Text)</summary>
NoDrawCaption = 0x00000001,
/// <summary>Do Not Draw the Icon</summary>
NoDrawIcon = 0x00000002,
/// <summary>Do Not Show the System Menu</summary>
NoSysMenu = 0x00000004,
/// <summary>Do Not Mirror the Question mark Symbol</summary>
NoMirrorHelp = 0x00000008
}
[Flags]
private enum DrawThemeTextOptionsMasks
{
TextColor = 1,
BorderColor = 2,
ShadowColor = 4,
ShadowType = 8,
ShadowOffset = 16,
BorderSize = 32,
FontProp = 64,
ColorProp = 128,
StateId = 256,
CalcRect = 512,
ApplyOverlay = 1024,
GlowSize = 2048,
Callback = 4096,
Composited = 8192
}
private enum WindowThemeAttributeType
{
NonClient = 1,
}
[DllImport(UXTHEME, ExactSpelling = true)]
public static extern int CloseThemeData(IntPtr hTheme);
[DllImport(UXTHEME, ExactSpelling = true)]
[System.Security.SecurityCritical]
public static extern int DrawThemeBackground(SafeThemeHandle hTheme, SafeDCHandle hdc, int iPartId, int iStateId, ref RECT pRect, PRECT pClipRect);
[DllImport(UXTHEME, ExactSpelling = true)]
[System.Security.SecurityCritical]
public static extern int DrawThemeBackgroundEx(SafeThemeHandle hTheme, SafeDCHandle hdc, int iPartId, int iStateId, ref RECT pRect, DrawThemeBackgroundOptions opts);
[DllImport(UXTHEME, ExactSpelling = true)]
[System.Security.SecurityCritical]
public static extern int DrawThemeIcon(SafeThemeHandle hTheme, SafeDCHandle hdc, int iPartId, int iStateId, ref RECT pRect, IntPtr himl, int iImageIndex);
[DllImport(UXTHEME, ExactSpelling = true)]
[System.Security.SecurityCritical]
public static extern int DrawThemeParentBackground(IntPtr hwnd, SafeDCHandle hdc, PRECT pRect);
[DllImport(UXTHEME, ExactSpelling = true)]
[System.Security.SecurityCritical]
public static extern int DrawThemeParentBackgroundEx(IntPtr hwnd, SafeDCHandle hdc, DrawThemeParentBackgroundFlags dwFlags, PRECT pRect);
[DllImport(UXTHEME, ExactSpelling = true, CharSet = CharSet.Unicode)]
public static extern int DrawThemeText(SafeThemeHandle hTheme, SafeDCHandle hdc, int iPartId, int iStateId, string text, int textLength, TextFormatFlags textFlags, int textFlags2, ref RECT pRect);
[DllImport(UXTHEME, ExactSpelling = true, CharSet = CharSet.Unicode)]
[System.Security.SecurityCritical]
public static extern int DrawThemeTextEx(SafeThemeHandle hTheme, SafeDCHandle hdc, int iPartId, int iStateId, string text, int iCharCount, TextFormatFlags dwFlags, ref RECT pRect, ref DrawThemeTextOptions pOptions);
[DllImport(UXTHEME, ExactSpelling = true)]
public static extern int GetThemeBackgroundContentRect(SafeThemeHandle hTheme, SafeDCHandle hdc, int iPartId, int iStateId, ref RECT pBoundingRect, out RECT pContentRect);
[DllImport(UXTHEME, ExactSpelling = true)]
public static extern int GetThemeBitmap(SafeThemeHandle hTheme, SafeDCHandle hdc, int iPartId, int iStateId, int iPropId, int dwFlags, out IntPtr phBitmap);
[DllImport(UXTHEME, ExactSpelling = true)]
public static extern int GetThemeBool(SafeThemeHandle hTheme, int iPartId, int iStateId, int iPropId, [MarshalAs(UnmanagedType.Bool)] out bool pfVal);
[DllImport(UXTHEME, ExactSpelling = true)]
public static extern int GetThemeColor(SafeThemeHandle hTheme, int iPartId, int iStateId, int iPropId, out int pColor);
[DllImport(UXTHEME, ExactSpelling = true)]
public static extern int GetThemeEnumValue(SafeThemeHandle hTheme, int iPartId, int iStateId, int iPropId, out int piVal);
[DllImport(UXTHEME, ExactSpelling = true, CharSet = CharSet.Unicode)]
public static extern int GetThemeFilename(SafeThemeHandle hTheme, int iPartId, int iStateId, int iPropId, ref System.Text.StringBuilder pszBuff, int buffLength);
[DllImport(UXTHEME, ExactSpelling = true)]
public static extern int GetThemeInt(SafeThemeHandle hTheme, int iPartId, int iStateId, int iPropId, out int piVal);
public static int[] GetThemeIntList(SafeThemeHandle hTheme, int partId, int stateId, int propId)
{
if (Environment.OSVersion.Version.Major < 6)
{
INTLIST_OLD l;
if (0 != GetThemeIntListPreVista(hTheme, partId, stateId, propId, out l))
return null;
var outlist = new int[l.iValueCount];
Array.Copy(l.iValues, outlist, l.iValueCount);
return outlist;
}
else
{
INTLIST l;
if (0 != GetThemeIntList(hTheme, partId, stateId, propId, out l))
return null;
var outlist = new int[l.iValueCount];
Array.Copy(l.iValues, outlist, l.iValueCount);
return outlist;
}
}
[DllImport(UXTHEME, ExactSpelling = true)]
[System.Security.SecurityCritical]
public static extern int GetThemeMargins(SafeThemeHandle hTheme, SafeDCHandle hdc, int iPartId, int iStateId, int iPropId, IntPtr prc, out RECT pMargins);
[DllImport(UXTHEME, ExactSpelling = true)]
public static extern int GetThemeMetric(SafeThemeHandle hTheme, SafeDCHandle hdc, int iPartId, int iStateId, int iPropId, out int piVal);
[DllImport(UXTHEME, ExactSpelling = true)]
public static extern int GetThemePartSize(SafeThemeHandle hTheme, SafeDCHandle hdc, int part, int state, PRECT pRect, ThemeSize eSize, out Size size);
[DllImport(UXTHEME, ExactSpelling = true)]
public static extern int GetThemePosition(SafeThemeHandle hTheme, int iPartId, int iStateId, int iPropId, out Point piVal);
[DllImport(UXTHEME, ExactSpelling = true)]
public static extern int GetThemePropertyOrigin(SafeThemeHandle hTheme, int iPartId, int iStateId, int iPropId, out ThemePropertyOrigin pOrigin);
[DllImport(UXTHEME, ExactSpelling = true)]
public static extern int GetThemeRect(SafeThemeHandle hTheme, int iPartId, int iStateId, int iPropId, out RECT pRect);
[DllImport(UXTHEME, ExactSpelling = true)]
public static extern int GetThemeStream(SafeThemeHandle hTheme, int iPartId, int iStateId, int iPropId, [MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U1, SizeParamIndex = 5)] out byte[] pvStream, out int cbStream, IntPtr hInst);
[DllImport(UXTHEME, ExactSpelling = true, CharSet = CharSet.Unicode)]
public static extern int GetThemeString(SafeThemeHandle hTheme, int iPartId, int iStateId, int iPropId, ref System.Text.StringBuilder themeString, int themeStringLength);
[DllImport(UXTHEME, ExactSpelling = true)]
public static extern int GetThemeSysInt(SafeThemeHandle hTheme, int iIntID, out int piVal);
[DllImport(UXTHEME, ExactSpelling = true, CharSet = CharSet.Unicode)]
public static extern int GetThemeTextExtent(SafeThemeHandle hTheme, SafeDCHandle hdc, int iPartId, int iStateId, string text, int textLength, TextFormatFlags textFlags, ref RECT boundingRect, out RECT extentRect);
[DllImport(UXTHEME, ExactSpelling = true)]
[System.Security.SecurityCritical]
public static extern int GetThemeTransitionDuration(SafeThemeHandle hTheme, int iPartId, int iStateIdFrom, int iStateIdTo, int iPropId, out int pdwDuration);
[DllImport(UXTHEME, ExactSpelling = true)]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool IsThemeBackgroundPartiallyTransparent(SafeThemeHandle hTheme, int iPartId, int iStateId);
[DllImport(UXTHEME, ExactSpelling = true)]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool IsThemePartDefined(SafeThemeHandle hTheme, int iPartId, int iStateId);
[DllImport(UXTHEME, ExactSpelling = true, CharSet = CharSet.Unicode)]
public static extern IntPtr OpenThemeData(IntPtr hWnd, string classList);
[DllImport(UXTHEME, ExactSpelling = true, CharSet = CharSet.Unicode)]
public static extern IntPtr OpenThemeDataEx(IntPtr hWnd, string classList, OpenThemeDataOptions dwFlags);
[DllImport(UXTHEME, ExactSpelling = true, CharSet = CharSet.Unicode)]
[System.Security.SecurityCritical]
public static extern int SetWindowTheme(IntPtr hWnd, string pszSubAppName, string pszSubIdList);
public static int SetWindowThemeAttribute(IWin32Window wnd, WindowThemeNonClientAttributes ncAttrs, int ncAttrMasks = int.MaxValue)
{
var opt = new WTA_OPTIONS {Flags = ncAttrs, Mask = ncAttrMasks == int.MaxValue ? (int)ncAttrs : ncAttrMasks};
return SetWindowThemeAttribute(wnd?.Handle ?? IntPtr.Zero, WindowThemeAttributeType.NonClient, ref opt, Marshal.SizeOf(opt));
}
[DllImport(UXTHEME, ExactSpelling = true)]
private static extern int GetThemeIntList(SafeThemeHandle hTheme, int iPartId, int iStateId, int iPropId, out INTLIST pIntList);
[DllImport(UXTHEME, ExactSpelling = true, EntryPoint = "GetThemeIntList")]
private static extern int GetThemeIntListPreVista(SafeThemeHandle hTheme, int iPartId, int iStateId, int iPropId, out INTLIST_OLD pIntList);
[DllImport(UXTHEME, ExactSpelling = true)]
[System.Security.SecurityCritical]
private static extern int SetWindowThemeAttribute(IntPtr hWnd, WindowThemeAttributeType wtype, ref WTA_OPTIONS attributes, int size);
/// <summary>
/// Defines the options for the <see cref="DrawThemeTextEx"/> function.
/// </summary>
[StructLayout(LayoutKind.Sequential)]
public struct DrawThemeTextOptions
{
private int dwSize;
private DrawThemeTextOptionsMasks dwMasks;
private int crText;
private int crBorder;
private int crShadow;
private TextShadowType iTextShadowType;
private Point ptShadowOffset;
private int iBorderSize;
private int iFontPropId;
private int iColorPropId;
private int iStateId;
[MarshalAs(UnmanagedType.Bool)]
private bool fApplyOverlay;
private int iGlowSize;
[MarshalAs(UnmanagedType.FunctionPtr)]
private DrawThemeTextCallback pfnDrawTextCallback;
private IntPtr lParam;
/// <summary>Initializes a new instance of the <see cref="DrawThemeTextOptions"/> struct.</summary>
/// <param name="init">This value must be specified to initialize.</param>
public DrawThemeTextOptions(bool init) : this()
{
dwSize = Marshal.SizeOf(typeof(DrawThemeTextOptions));
}
/// <summary>Gets or sets a value that specifies an alternate color property to use when drawing text.</summary>
/// <value>The alternate color of the text.</value>
public Color AlternateColor
{
get { return ColorTranslator.FromWin32(iColorPropId); }
set
{
iColorPropId = ColorTranslator.ToWin32(value);
dwMasks |= DrawThemeTextOptionsMasks.ColorProp;
}
}
/// <summary>Gets or sets an alternate font property to use when drawing text.</summary>
/// <value>The alternate font.</value>
public DrawThemeTextSystemFonts AlternateFont
{
get { return (DrawThemeTextSystemFonts)iFontPropId; }
set
{
iFontPropId = (int)value;
dwMasks |= DrawThemeTextOptionsMasks.FontProp;
}
}
/// <summary>
/// Gets or sets a value indicating whether to draw text with antialiased alpha. Use of this flag requires a
/// top-down DIB section. This flag works only if the HDC passed to function DrawThemeTextEx has a top-down
/// DIB section currently selected in it. For more information, see Device-Independent Bitmaps.
/// </summary>
/// <value><c>true</c> if antialiased alpha; otherwise, <c>false</c>.</value>
public bool AntiAliasedAlpha
{
get { return (dwMasks & DrawThemeTextOptionsMasks.Composited) == DrawThemeTextOptionsMasks.Composited; }
set { SetFlag(DrawThemeTextOptionsMasks.Composited, value); }
}
/// <summary>
/// Gets or sets a value indicating whether text will be drawn on top of the shadow and outline effects
/// (<c>true</c>) or if just the shadow and outline effects will be drawn (<c>false</c>).
/// </summary>
/// <value><c>true</c> if drawn on top; otherwise, <c>false</c>.</value>
public bool ApplyOverlay
{
get { return fApplyOverlay; }
set
{
fApplyOverlay = value;
dwMasks |= DrawThemeTextOptionsMasks.ApplyOverlay;
}
}
/// <summary>Gets or sets the color of the outline that will be drawn around the text.</summary>
/// <value>The color of the border.</value>
public Color BorderColor
{
get { return ColorTranslator.FromWin32(crBorder); }
set
{
crBorder = ColorTranslator.ToWin32(value);
dwMasks |= DrawThemeTextOptionsMasks.BorderColor;
}
}
/// <summary>Gets or sets the radius of the outline that will be drawn around the text.</summary>
/// <value>The size of the border.</value>
public int BorderSize
{
get { return iBorderSize; }
set
{
iBorderSize = value;
dwMasks |= DrawThemeTextOptionsMasks.BorderSize;
}
}
/// <summary>Gets or sets the callback function.</summary>
/// <value>The callback function.</value>
public DrawThemeTextCallback Callback
{
get { return pfnDrawTextCallback; }
set
{
pfnDrawTextCallback = value;
dwMasks |= DrawThemeTextOptionsMasks.Callback;
}
}
/// <summary>Gets or sets the size of a glow that will be drawn on the background prior to any text being drawn.</summary>
/// <value>The size of the glow.</value>
public int GlowSize
{
get { return iGlowSize; }
set
{
iGlowSize = value;
dwMasks |= DrawThemeTextOptionsMasks.GlowSize;
}
}
/// <summary>Gets or sets the parameter for callback back function specified by <see cref="Callback"/>.</summary>
/// <value>The parameter.</value>
public IntPtr LParam
{
get { return lParam; }
set { lParam = value; }
}
/// <summary>
/// Gets or sets a value indicating whether the pRect parameter of the <see cref="DrawThemeTextEx"/> function
/// that uses this structure will be used as both an in and an out parameter. After the function returns, the
/// pRect parameter will contain the rectangle that corresponds to the region calculated to be drawn.
/// </summary>
/// <value><c>true</c> if returning the calculated rectangle; otherwise, <c>false</c>.</value>
public bool ReturnCalculatedRectangle
{
get { return (dwMasks & DrawThemeTextOptionsMasks.CalcRect) == DrawThemeTextOptionsMasks.CalcRect; }
set { SetFlag(DrawThemeTextOptionsMasks.CalcRect, value); }
}
/// <summary>Gets or sets the color of the shadow drawn behind the text.</summary>
/// <value>The color of the shadow.</value>
public Color ShadowColor
{
get { return ColorTranslator.FromWin32(crShadow); }
set
{
crShadow = ColorTranslator.ToWin32(value);
dwMasks |= DrawThemeTextOptionsMasks.ShadowColor;
}
}
/// <summary>Gets or sets the amount of offset, in logical coordinates, between the shadow and the text.</summary>
/// <value>The shadow offset.</value>
public Point ShadowOffset
{
get { return new Point(ptShadowOffset.X, ptShadowOffset.Y); }
set
{
ptShadowOffset = value;
dwMasks |= DrawThemeTextOptionsMasks.ShadowOffset;
}
}
/// <summary>Gets or sets the type of the shadow that will be drawn behind the text.</summary>
/// <value>The type of the shadow.</value>
public TextShadowType ShadowType
{
get { return iTextShadowType; }
set
{
iTextShadowType = value;
dwMasks |= DrawThemeTextOptionsMasks.ShadowType;
}
}
/// <summary>Gets or sets the color of the text that will be drawn.</summary>
/// <value>The color of the text.</value>
public Color TextColor
{
get { return ColorTranslator.FromWin32(crText); }
set
{
crText = ColorTranslator.ToWin32(value);
dwMasks |= DrawThemeTextOptionsMasks.TextColor;
}
}
/// <summary>Gets an instance with default values set.</summary>
public static DrawThemeTextOptions Default => new DrawThemeTextOptions(true);
private void SetFlag(DrawThemeTextOptionsMasks f, bool value) { if (value) dwMasks |= f; else dwMasks &= ~f; }
}
/// <summary>
/// The Options of What Attributes to Add/Remove
/// </summary>
[StructLayout(LayoutKind.Sequential)]
private struct WTA_OPTIONS
{
public WindowThemeNonClientAttributes Flags;
public int Mask;
}
[StructLayout(LayoutKind.Sequential)]
private struct INTLIST
{
public int iValueCount;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 402)]
public int[] iValues;
}
[StructLayout(LayoutKind.Sequential)]
private struct INTLIST_OLD
{
public int iValueCount;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 10)]
public int[] iValues;
}
/// <summary>
/// Defines the options for the DrawThemeBackgroundEx function.
/// </summary>
[StructLayout(LayoutKind.Sequential)]
public class DrawThemeBackgroundOptions
{
private int dwSize;
private DrawThemeBackgroundFlags dwFlags;
private RECT rcClip;
[Flags]
private enum DrawThemeBackgroundFlags
{
None = 0,
/// <summary>The ClipRectangle value is defined.</summary>
ClipRect = 1,
/// <summary>Deprecated. Draw transparent and alpha images as solid.</summary>
DrawSolid = 2,
/// <summary>Do not draw the border of the part (currently this value is only supported for bgtype=borderfill).</summary>
OmitBorder = 4,
/// <summary>Do not draw the content area of the part (currently this value is only supported for bgtype=borderfill).</summary>
OmitContent = 8,
/// <summary>Deprecated.</summary>
ComputingRegion = 16,
/// <summary>Assume the hdc is mirrored and flip images as appropriate (currently this value is only supported for bgtype=imagefile).</summary>
HasMirroredDC = 32,
/// <summary>Do not mirror the output; even in right-to-left (RTL) layout.</summary>
DoNotMirror = 64
}
/// <summary>
/// Initializes a new instance of the <see cref="DrawThemeBackgroundOptions"/> class.
/// </summary>
/// <param name="clipRect">The rectangle to which drawing is clipped.</param>
public DrawThemeBackgroundOptions(Rectangle? clipRect)
{
dwSize = Marshal.SizeOf(this);
ClipRectangle = clipRect;
}
/// <summary>Gets or sets the bounding rectangle of the clip region.</summary>
/// <value>The clip rectangle.</value>
public Rectangle? ClipRectangle
{
get
{
Rectangle r = rcClip;
return r.IsEmpty ? (Rectangle?)null : r;
}
set
{
rcClip = value ?? default(RECT);
SetFlag(DrawThemeBackgroundFlags.ClipRect, value.HasValue);
}
}
/// <summary>Gets or sets a value indicating whether omit drawing the border.</summary>
/// <value><c>true</c> if omit border; otherwise, <c>false</c>.</value>
public bool OmitBorder { get { return GetFlag(DrawThemeBackgroundFlags.OmitBorder); } set { SetFlag(DrawThemeBackgroundFlags.OmitBorder, value); } }
/// <summary>Gets or sets a value indicating whether omit drawing the content area of the part.</summary>
/// <value><c>true</c> if omit content area of the part; otherwise, <c>false</c>.</value>
public bool OmitContent { get { return GetFlag(DrawThemeBackgroundFlags.OmitContent); } set { SetFlag(DrawThemeBackgroundFlags.OmitContent, value); } }
/// <summary>Gets or sets a value indicating the hdc is mirrored and flip images as appropriate.</summary>
/// <value><c>true</c> if mirrored; otherwise, <c>false</c>.</value>
public bool HasMirroredDC { get { return GetFlag(DrawThemeBackgroundFlags.HasMirroredDC); } set { SetFlag(DrawThemeBackgroundFlags.HasMirroredDC, value); } }
/// <summary>Gets or sets a value indicating whether to mirror the output; even in right-to-left (RTL) layout.</summary>
/// <value><c>true</c> if not mirroring; otherwise, <c>false</c>.</value>
public bool DoNotMirror { get { return GetFlag(DrawThemeBackgroundFlags.DoNotMirror); } set { SetFlag(DrawThemeBackgroundFlags.DoNotMirror, value); } }
/// <summary>Performs an implicit conversion from <see cref="Rectangle"/> to <see cref="DrawThemeBackgroundOptions"/>.</summary>
/// <param name="clipRectangle">The clipping rectangle.</param>
/// <returns>The result of the conversion.</returns>
public static implicit operator DrawThemeBackgroundOptions(Rectangle clipRectangle) => new DrawThemeBackgroundOptions(clipRectangle);
private bool GetFlag(DrawThemeBackgroundFlags f) => (dwFlags & f) == f;
private void SetFlag(DrawThemeBackgroundFlags f, bool value) { if (value) dwFlags |= f; else dwFlags &= ~f; }
}
}
}

Wyświetl plik

@ -0,0 +1,16 @@
// Requires UXTHEME\UXTHEME.cs
// Requires Gdi\LOGFONT.cs
using System;
using System.Runtime.InteropServices;
namespace Vanara.Interop
{
internal static partial class NativeMethods
{
[DllImport(UXTHEME, ExactSpelling = true, CharSet = CharSet.Unicode)]
public static extern int GetThemeFont(SafeThemeHandle hTheme, SafeDCHandle hdc, int iPartId, int iStateId, int iPropId, out LOGFONT pFont);
[DllImport(UXTHEME, ExactSpelling = true, CharSet = CharSet.Unicode)]
public static extern int GetThemeSysFont(SafeThemeHandle hTheme, int iFontId, out LOGFONT pFont);
}
}

Wyświetl plik

@ -0,0 +1,42 @@
using System.Drawing;
using Vanara.Interop;
namespace System.Windows.Forms.VisualStyles
{
internal static partial class VisualStyleRendererExtension
{
public static Padding GetMargins2(this VisualStyleRenderer rnd, IDeviceContext dc = null, MarginProperty prop = MarginProperty.ContentMargins)
{
NativeMethods.RECT rc;
using (var hdc = new NativeMethods.SafeDCHandle(dc))
NativeMethods.GetThemeMargins(rnd, hdc, rnd.Part, rnd.State, (int)prop, IntPtr.Zero, out rc);
return new Padding(rc.Left, rc.Top, rc.Right, rc.Bottom);
}
public static int GetTransitionDuration(this VisualStyleRenderer rnd, int toState, int fromState = 0)
{
int dwDuration;
NativeMethods.GetThemeTransitionDuration(rnd, rnd.Part, fromState == 0 ? rnd.State : fromState, toState, (int)NativeMethods.IntegerListProperty.TransitionDuration, out dwDuration);
return dwDuration;
}
/// <summary>
/// Sets the state of the <see cref="VisualStyleRenderer"/>.
/// </summary>
/// <param name="rnd">The <see cref="VisualStyleRenderer"/> instance.</param>
/// <param name="state">The state.</param>
public static void SetState(this VisualStyleRenderer rnd, int state) { rnd.SetParameters(rnd.Class, rnd.Part, state); }
/// <summary>
/// Sets attributes to control how visual styles are applied to a specified window.
/// </summary>
/// <param name="window">The window.</param>
/// <param name="attr">The attributes to apply or disable.</param>
/// <param name="enable">if set to <c>true</c> enable the attribute, otherwise disable it.</param>
public static void SetWindowThemeAttribute(this IWin32Window window, NativeMethods.WindowThemeNonClientAttributes attr, bool enable = true)
{
try { NativeMethods.SetWindowThemeAttribute(window, attr, enable ? (int)attr : 0); }
catch (EntryPointNotFoundException) { }
}
}
}

Wyświetl plik

@ -0,0 +1,263 @@
using System.CodeDom;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Drawing.Imaging;
using Vanara.Interop;
using static Vanara.Interop.NativeMethods;
namespace System.Windows.Forms.VisualStyles
{
internal static partial class VisualStyleRendererExtension
{
private static readonly Dictionary<long, Bitmap> bmpCache = new Dictionary<long, Bitmap>();
private delegate void DrawWrapperMethod(SafeDCHandle hdc);
/// <summary>
/// Draws the background image of the current visual style element within the specified bounding rectangle and optionally clipped to the specified clipping rectangle.
/// </summary>
/// <param name="rnd">The <see cref="VisualStyleRenderer"/> instance.</param>
/// <param name="dc">The <see cref="IDeviceContext"/> used to draw the background image.</param>
/// <param name="bounds">A <see cref="Rectangle"/> in which the background image is drawn.</param>
/// <param name="clipRectangle">A <see cref="Rectangle"/> that defines a clipping rectangle for the drawing operation.</param>
/// <param name="rightToLeft">If set to <c>true</c> flip the image for right to left layout.</param>
public static void DrawBackground(this VisualStyleRenderer rnd, Graphics dc, Rectangle bounds, Rectangle? clipRectangle = null, bool rightToLeft = false)
{
/*var h = rnd.GetHashCode();
Bitmap bmp;
if (!bmpCache.TryGetValue(h, out bmp))
bmpCache.Add(h, bmp = GraphicsExtension.GetTransparentBitmap(GetBackgroundBitmap(rnd, Color.White), GetBackgroundBitmap(rnd, Color.Black)));
if (rightToLeft)
bmp.RotateFlip(RotateFlipType.RotateNoneFlipX);
if (clipRectangle != null) dc.SetClip(clipRectangle.Value);
using (var attr = new ImageAttributes())
{
dc.CompositingMode = CompositingMode.SourceOver;
dc.CompositingQuality = CompositingQuality.HighQuality;
dc.InterpolationMode = InterpolationMode.HighQualityBicubic;
dc.PixelOffsetMode = PixelOffsetMode.HighQuality;
attr.SetWrapMode(WrapMode.TileFlipXY);
dc.DrawImage(bmp, bounds, 0, 0, bmp.Width, bmp.Height, GraphicsUnit.Pixel, attr);
}*/
rnd.DrawBackground(dc, bounds, clipRectangle ?? bounds);
}
/// <summary>
/// Draws the background image of the current visual style element onto a glass background within the specified bounding rectangle and optionally clipped to the specified clipping rectangle.
/// </summary>
/// <param name="rnd">The <see cref="VisualStyleRenderer"/> instance.</param>
/// <param name="dc">The <see cref="IDeviceContext"/> used to draw the background image.</param>
/// <param name="bounds">A <see cref="Rectangle"/> in which the background image is drawn.</param>
/// <param name="clipRectangle">A <see cref="Rectangle"/> that defines a clipping rectangle for the drawing operation.</param>
/// <param name="rightToLeft">If set to <c>true</c> flip the image for right to left layout.</param>
public static void DrawGlassBackground(this VisualStyleRenderer rnd, IDeviceContext dc, Rectangle bounds, Rectangle? clipRectangle = null, bool rightToLeft = false)
{
DrawWrapper(dc, bounds,
memoryHdc =>
{
var rBounds = new RECT(bounds);
//var opts = new DrawThemeBackgroundOptions(clipRectangle);
// Draw background
var oldLayout = DCLayout.GDI_ERROR;
if (rightToLeft)
if ((oldLayout = SetLayout(memoryHdc, DCLayout.LAYOUT_RTL)) == DCLayout.GDI_ERROR)
throw new NotSupportedException("Unable to change graphics layout to RTL.");
DrawThemeBackground(rnd, memoryHdc, rnd.Part, rnd.State, ref rBounds, clipRectangle);
if (oldLayout != DCLayout.GDI_ERROR)
SetLayout(memoryHdc, oldLayout);
}
);
}
/// <summary>
/// Draws the image from the specified <paramref name="imageList"/> within the specified bounds on a glass background.
/// </summary>
/// <param name="rnd">The <see cref="VisualStyleRenderer"/> instance.</param>
/// <param name="g">The <see cref="Graphics"/> used to draw the image.</param>
/// <param name="bounds">A <see cref="Rectangle"/> in which the image is drawn.</param>
/// <param name="imageList">An <see cref="ImageList"/> that contains the <see cref="Image"/> to draw.</param>
/// <param name="imageIndex">The index of the <see cref="Image"/> within <paramref name="imageList"/> to draw.</param>
public static void DrawGlassImage(this VisualStyleRenderer rnd, Graphics g, Rectangle bounds, ImageList imageList, int imageIndex)
{
DrawWrapper(g, bounds,
memoryHdc =>
{
var rBounds = new RECT(bounds);
DrawThemeIcon(rnd, memoryHdc, rnd.Part, rnd.State, ref rBounds, imageList.Handle, imageIndex);
}
);
}
/// <summary>
/// Draws the specified image within the specified bounds on a glass background.
/// </summary>
/// <param name="rnd">The <see cref="VisualStyleRenderer" /> instance.</param>
/// <param name="g">The <see cref="Graphics" /> used to draw the image.</param>
/// <param name="bounds">A <see cref="Rectangle" /> in which the image is drawn.</param>
/// <param name="image">An <see cref="ImageList" /> that contains the <see cref="Image" /> to draw.</param>
/// <param name="disabled">if set to <c>true</c> draws the image in a disabled state using the <see cref="ControlPaint.DrawImageDisabled"/> method.</param>
public static void DrawGlassImage(this VisualStyleRenderer rnd, Graphics g, Rectangle bounds, Image image, bool disabled = false)
{
DrawWrapper(g, bounds,
memoryHdc =>
{
using (var mg = Graphics.FromHdc(memoryHdc.DangerousGetHandle()))
{
if (disabled)
ControlPaint.DrawImageDisabled(mg, image, bounds.X, bounds.Y, Color.Transparent);
else
mg.DrawImage(image, bounds);
}
}
);
}
/// <summary>
/// Draws glowing text in the specified bounding rectangle with the option of overriding text color and applying other text formatting.
/// </summary>
/// <param name="rnd">The <see cref="VisualStyleRenderer" /> instance.</param>
/// <param name="dc">The <see cref="IDeviceContext" /> used to draw the text.</param>
/// <param name="bounds">A <see cref="Rectangle" /> in which the text is drawn.</param>
/// <param name="text">The text to draw.</param>
/// <param name="font">Optional font override.</param>
/// <param name="color">Optionally, the color to draw text in overriding the default color for the theme.</param>
/// <param name="flags">A bitwise combination of the <see cref="TextFormatFlags" /> values.</param>
/// <param name="glowSize">The size of the glow.</param>
public static void DrawGlowingText(this VisualStyleRenderer rnd, IDeviceContext dc, Rectangle bounds, string text, Font font, Color? color, TextFormatFlags flags = TextFormatFlags.Default, int glowSize = 10)
{
DrawWrapper(dc, bounds,
memoryHdc =>
{
// Create and select font
using (var fontHandle = new SafeDCObjectHandle(memoryHdc, font?.ToHfont() ?? IntPtr.Zero))
{
// Draw glowing text
var dttOpts = new DrawThemeTextOptions(true) {GlowSize = glowSize, AntiAliasedAlpha = true};
if (color != null) dttOpts.TextColor = color.Value;
var textBounds = new RECT(4, 0, bounds.Right - bounds.Left, bounds.Bottom - bounds.Top);
DrawThemeTextEx(rnd, memoryHdc, rnd.Part, rnd.State, text, text.Length, flags, ref textBounds, ref dttOpts);
}
}
);
}
/// <summary>
/// Draws text in the specified bounding rectangle with the option of applying other text formatting.
/// </summary>
/// <param name="rnd">The <see cref="VisualStyleRenderer" /> instance.</param>
/// <param name="dc">The <see cref="IDeviceContext" /> used to draw the text.</param>
/// <param name="bounds">A <see cref="Rectangle" /> in which the text is drawn.</param>
/// <param name="text">The text to draw.</param>
/// <param name="flags">A bitwise combination of the <see cref="TextFormatFlags"/> values.</param>
/// <param name="options">The <see cref="DrawThemeTextOptions"/> .</param>
public static void DrawText(this VisualStyleRenderer rnd, IDeviceContext dc, ref Rectangle bounds, string text, TextFormatFlags flags, ref DrawThemeTextOptions options)
{
var rc = new RECT(bounds);
using (var hdc = new SafeDCHandle(dc))
DrawThemeTextEx(rnd, hdc, rnd.Part, rnd.State, text, text.Length, flags, ref rc, ref options);
bounds = rc;
}
/// <summary>
/// Gets the background image of the current visual style element within the specified background color. If <paramref name="states"/> is set, the resulting image will contain each of the state images side by side.
/// </summary>
/// <param name="rnd">The <see cref="VisualStyleRenderer"/> instance.</param>
/// <param name="clr">The background color. This color cannot have an alpha channel.</param>
/// <param name="states">The optional list of states to render side by side.</param>
/// <returns>The background image.</returns>
public static Bitmap GetBackgroundBitmap(this VisualStyleRenderer rnd, Color clr, int[] states = null)
{
const int wh = 200;
if (rnd == null) throw new ArgumentNullException(nameof(rnd));
rnd.SetParameters(rnd.Class, rnd.Part, 0);
if (states == null) states = new[] { rnd.State };
var i = states.Length;
// Get image size
Size imgSz;
using (var sg = Graphics.FromHwnd(IntPtr.Zero))
imgSz = rnd.GetPartSize(sg, new Rectangle(0, 0, wh, wh), ThemeSizeType.Draw);
if (imgSz.Width == 0 || imgSz.Height == 0)
imgSz = new Size(rnd.GetInteger(IntegerProperty.Width), rnd.GetInteger(IntegerProperty.Height));
var bounds = new Rectangle(0, 0, imgSz.Width * i, imgSz.Height);
// Draw each background linearly down the bitmap
using (var memoryHdc = SafeDCHandle.ScreenCompatibleDCHandle)
{
// Create a device-independent bitmap and select it into our DC
var info = new BITMAPINFO(bounds.Width, -bounds.Height);
IntPtr ppv;
using (new SafeDCObjectHandle(memoryHdc, CreateDIBSection(SafeDCHandle.Null, ref info, DIBColorMode.DIB_RGB_COLORS, out ppv, IntPtr.Zero, 0)))
{
using (var memoryGraphics = Graphics.FromHdc(memoryHdc.DangerousGetHandle()))
{
// Setup graphics
memoryGraphics.CompositingMode = CompositingMode.SourceOver;
memoryGraphics.CompositingQuality = CompositingQuality.HighQuality;
memoryGraphics.SmoothingMode = SmoothingMode.HighQuality;
memoryGraphics.Clear(clr);
// Draw each background linearly down the bitmap
var rect = new Rectangle(0, 0, imgSz.Width, imgSz.Height);
foreach (var state in states)
{
rnd.SetParameters(rnd.Class, rnd.Part, state);
rnd.DrawBackground(memoryGraphics, rect);
rect.X += imgSz.Width;
}
}
// Copy DIB to Bitmap
var bmp = new Bitmap(bounds.Width, bounds.Height, PixelFormat.Format32bppArgb);
using (var primaryHdc = new SafeDCHandle(Graphics.FromImage(bmp)))
BitBlt(primaryHdc, bounds.Left, bounds.Top, bounds.Width, bounds.Height, memoryHdc, 0, 0, RasterOperationMode.SRCCOPY);
return bmp;
}
}
}
/// <summary>
/// Returns the value of the specified font property for the current visual style element.
/// </summary>
/// <param name="rnd">The <see cref="VisualStyleRenderer" /> instance.</param>
/// <param name="dc">The <see cref="IDeviceContext" /> used to draw the text.</param>
/// <returns>A <see cref="Font"/> that contains the value of the property specified by the prop parameter for the current visual style element.</returns>
public static Font GetFont2(this VisualStyleRenderer rnd, IDeviceContext dc = null)
{
using (var hdc = new SafeDCHandle(dc))
{
LOGFONT f;
var hres = GetThemeFont(rnd, hdc, rnd.Part, rnd.State, 210, out f);
if (hres != 0)
throw new System.ComponentModel.Win32Exception(hres);
return f.ToFont();
}
}
private static void DrawWrapper(IDeviceContext dc, Rectangle bounds, DrawWrapperMethod func)
{
using (var sdc = new SafeDCHandle(dc))
{
// Create a memory DC so we can work off screen
using (var memoryHdc = sdc.GetCompatibleDCHandle())
{
// Create a device-independent bitmap and select it into our DC
var info = new BITMAPINFO(bounds.Width, -bounds.Height);
IntPtr pBits;
using (new SafeDCObjectHandle(memoryHdc, CreateDIBSection(sdc, ref info, 0, out pBits, IntPtr.Zero, 0)))
{
// Call method
func(memoryHdc);
// Copy to foreground
BitBlt(sdc, bounds.Left, bounds.Top, bounds.Width, bounds.Height, memoryHdc, 0, 0, RasterOperationMode.SRCCOPY);
}
}
}
}
private static long GetHashCode(this VisualStyleRenderer r) => (long)r.Class.GetHashCode() << 32 | ((uint)r.Part << 16 | (ushort)r.State);
}
}

Wyświetl plik

@ -0,0 +1,28 @@
using System;
using System.Runtime.InteropServices;
using FILETIME = System.Runtime.InteropServices.ComTypes.FILETIME;
namespace Vanara.Interop
{
internal static partial class NativeMethods
{
[Serializable, StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto), BestFitMapping(false)]
public class WIN32_FIND_DATA
{
public System.IO.FileAttributes dwFileAttributes;
public FILETIME ftCreationTime;
public FILETIME ftLastAccessTime;
public FILETIME ftLastWriteTime;
public int nFileSizeHigh;
public int nFileSizeLow;
public int dwReserved0;
public int dwReserved1;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 260)]
public string cFileName;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 14)]
public string cAlternateFileName;
}
}
}

Wyświetl plik

@ -0,0 +1,39 @@
using System;
using System.Reflection;
using System.Resources;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("AeroWizard")]
[assembly: AssemblyDescription("Library for easy creation of custom and Aero Wizards. Aero Wizard strictly follows Microsoft guidelines and uses Visual Styles to get visual theming.")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("CodePlex Community")]
[assembly: AssemblyProduct("AeroWizard")]
[assembly: AssemblyCopyright("Copyright © 2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: CLSCompliant(true)]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("949bb556-287f-4184-99f2-f46321235322")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.1.8.0")]
[assembly: AssemblyFileVersion("2.1.8.0")]
[assembly: NeutralResourcesLanguageAttribute("en-US")]

Wyświetl plik

@ -0,0 +1,183 @@
//------------------------------------------------------------------------------
// <auto-generated>
// Dieser Code wurde von einem Tool generiert.
// Laufzeitversion:4.0.30319.42000
//
// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
// der Code erneut generiert wird.
// </auto-generated>
//------------------------------------------------------------------------------
namespace AeroWizard.Properties {
using System;
/// <summary>
/// Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw.
/// </summary>
// Diese Klasse wurde von der StronglyTypedResourceBuilder automatisch generiert
// -Klasse über ein Tool wie ResGen oder Visual Studio automatisch generiert.
// Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen
// mit der /str-Option erneut aus, oder Sie erstellen Ihr VS-Projekt neu.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("AeroWizard.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle
/// Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
/// <summary>
/// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap BackBtnStrip {
get {
object obj = ResourceManager.GetObject("BackBtnStrip", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap BackBtnStrip2 {
get {
object obj = ResourceManager.GetObject("BackBtnStrip2", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die Returns to a previous page ähnelt.
/// </summary>
internal static string WizardBackButtonToolTip {
get {
return ResourceManager.GetString("WizardBackButtonToolTip", resourceCulture);
}
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die &amp;Back ähnelt.
/// </summary>
internal static string WizardBackText {
get {
return ResourceManager.GetString("WizardBackText", resourceCulture);
}
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die &amp;Cancel ähnelt.
/// </summary>
internal static string WizardCancelText {
get {
return ResourceManager.GetString("WizardCancelText", resourceCulture);
}
}
/// <summary>
/// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Icon ähnlich wie (Symbol).
/// </summary>
internal static System.Drawing.Icon WizardControlIcon {
get {
object obj = ResourceManager.GetObject("WizardControlIcon", resourceCulture);
return ((System.Drawing.Icon)(obj));
}
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die &amp;Finish ähnelt.
/// </summary>
internal static string WizardFinishText {
get {
return ResourceManager.GetString("WizardFinishText", resourceCulture);
}
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die Page Title ähnelt.
/// </summary>
internal static string WizardHeader {
get {
return ResourceManager.GetString("WizardHeader", resourceCulture);
}
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die &amp;Help ähnelt.
/// </summary>
internal static string WizardHelpText {
get {
return ResourceManager.GetString("WizardHelpText", resourceCulture);
}
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die &amp;Next ähnelt.
/// </summary>
internal static string WizardNextText {
get {
return ResourceManager.GetString("WizardNextText", resourceCulture);
}
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die No wizard pages have been added. ähnelt.
/// </summary>
internal static string WizardNoPagesNotice {
get {
return ResourceManager.GetString("WizardNoPagesNotice", resourceCulture);
}
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die Help ähnelt.
/// </summary>
internal static string WizardPageDefaultHelpText {
get {
return ResourceManager.GetString("WizardPageDefaultHelpText", resourceCulture);
}
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die Wizard Title ähnelt.
/// </summary>
internal static string WizardTitle {
get {
return ResourceManager.GetString("WizardTitle", resourceCulture);
}
}
}
}

Wyświetl plik

@ -0,0 +1,150 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="WizardPageDefaultHelpText" xml:space="preserve">
<value>Hilfe</value>
</data>
<data name="WizardBackText" xml:space="preserve">
<value>&amp;Zurück</value>
</data>
<data name="WizardCancelText" xml:space="preserve">
<value>&amp;Abbrechen</value>
</data>
<data name="WizardFinishText" xml:space="preserve">
<value>&amp;Fertig stellen</value>
</data>
<data name="WizardHeader" xml:space="preserve">
<value>Seitentitel</value>
</data>
<data name="WizardHelpText" xml:space="preserve">
<value>&amp;Hilfe</value>
</data>
<data name="WizardNextText" xml:space="preserve">
<value>&amp;Weiter</value>
</data>
<data name="WizardTitle" xml:space="preserve">
<value>Assistententitel</value>
</data>
<data name="WizardBackButtonToolTip" xml:space="preserve">
<value>Kehrt zurück zur vorherigen Seite!</value>
</data>
<data name="WizardNoPagesNotice" xml:space="preserve">
<value>Keine Assistentenseiten hinzugekommen!</value>
</data>
</root>

Wyświetl plik

@ -0,0 +1,150 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="WizardCancelText" xml:space="preserve">
<value>&amp;Cancelar</value>
</data>
<data name="WizardBackButtonToolTip" xml:space="preserve">
<value>Vuelve a la página anterior</value>
</data>
<data name="WizardBackText" xml:space="preserve">
<value>&amp;Atrás</value>
</data>
<data name="WizardFinishText" xml:space="preserve">
<value>&amp;Finalizar</value>
</data>
<data name="WizardHeader" xml:space="preserve">
<value>Título de la página</value>
</data>
<data name="WizardHelpText" xml:space="preserve">
<value>A&amp;yuda</value>
</data>
<data name="WizardNextText" xml:space="preserve">
<value>&amp;Siguiente</value>
</data>
<data name="WizardNoPagesNotice" xml:space="preserve">
<value>Se han añadido ninguna página del asistente.</value>
</data>
<data name="WizardTitle" xml:space="preserve">
<value>Título del asistente</value>
</data>
<data name="WizardPageDefaultHelpText" xml:space="preserve">
<value>Ayuda</value>
</data>
</root>

Wyświetl plik

@ -0,0 +1,150 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="WizardBackButtonToolTip" xml:space="preserve">
<value>Retourne à une page précédente</value>
</data>
<data name="WizardBackText" xml:space="preserve">
<value>&amp;Précédent</value>
</data>
<data name="WizardCancelText" xml:space="preserve">
<value>&amp;Annuler</value>
</data>
<data name="WizardFinishText" xml:space="preserve">
<value>&amp;Terminer</value>
</data>
<data name="WizardHeader" xml:space="preserve">
<value>Titre de la page</value>
</data>
<data name="WizardHelpText" xml:space="preserve">
<value>&amp;Aide</value>
</data>
<data name="WizardNextText" xml:space="preserve">
<value>&amp;Suivant</value>
</data>
<data name="WizardNoPagesNotice" xml:space="preserve">
<value>Pas de pages de l'assistant ont été ajoutés.</value>
</data>
<data name="WizardTitle" xml:space="preserve">
<value>Assistant Titre</value>
</data>
<data name="WizardPageDefaultHelpText" xml:space="preserve">
<value>Aide</value>
</data>
</root>

Wyświetl plik

@ -0,0 +1,160 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="BackBtnStrip" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\resources\backbtnstrip.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="BackBtnStrip2" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\BackBtnStrip2.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="WizardBackButtonToolTip" xml:space="preserve">
<value>Returns to a previous page</value>
</data>
<data name="WizardBackText" xml:space="preserve">
<value>&amp;Back</value>
</data>
<data name="WizardCancelText" xml:space="preserve">
<value>&amp;Cancel</value>
</data>
<data name="WizardControlIcon" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\WizardHat.ico;System.Drawing.Icon, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="WizardFinishText" xml:space="preserve">
<value>&amp;Finish</value>
</data>
<data name="WizardHeader" xml:space="preserve">
<value>Page Title</value>
</data>
<data name="WizardHelpText" xml:space="preserve">
<value>&amp;Help</value>
</data>
<data name="WizardNextText" xml:space="preserve">
<value>&amp;Next</value>
</data>
<data name="WizardNoPagesNotice" xml:space="preserve">
<value>No wizard pages have been added.</value>
</data>
<data name="WizardTitle" xml:space="preserve">
<value>Wizard Title</value>
</data>
<data name="WizardPageDefaultHelpText" xml:space="preserve">
<value>Help</value>
</data>
</root>

Plik binarny nie jest wyświetlany.

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 7.0 KiB

Plik binarny nie jest wyświetlany.

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 1.3 KiB

Plik binarny nie jest wyświetlany.

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 22 KiB

Wyświetl plik

@ -0,0 +1,271 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
namespace AeroWizard
{
/// <summary>
/// Shows a list of all the pages in the WizardControl
/// </summary>
[ProvideProperty("StepText", typeof(WizardPage))]
[ProvideProperty("StepTextIndentLevel", typeof(WizardPage))]
internal class StepList : ScrollableControl, IExtenderProvider
{
private const TextFormatFlags defBulletTextFormat = TextFormatFlags.SingleLine | TextFormatFlags.VerticalCenter | TextFormatFlags.NoPadding;
private const TextFormatFlags defStringTextFormat = TextFormatFlags.EndEllipsis | TextFormatFlags.SingleLine | TextFormatFlags.VerticalCenter;
private System.Drawing.Font boldFont;
private int bulletWidth;
private int defItemHeight;
private Dictionary<WizardPage, int> indentLevels = new Dictionary<WizardPage, int>();
private WizardControl myParent;
private System.Drawing.Font ptrFont;
private Dictionary<WizardPage, string> stepTexts = new Dictionary<WizardPage, string>();
/// <summary>
/// Initializes a new instance of the <see cref="StepList"/> class.
/// </summary>
public StepList()
{
}
/// <summary>
/// Occurs when a visual aspect of an owner-drawn StepList changes.
/// </summary>
[Category("Appearance")]
public event EventHandler<DrawStepListItemEventArgs> DrawItem;
/// <summary>
/// Occurs when an owner-drawn StepList is created and the sizes of the list items are determined.
/// </summary>
[Category("Appearance")]
public event EventHandler<MeasureStepListItemEventArgs> MeasureItem;
/// <summary>
/// Gets or sets a value indicating whether the StepList is drawn by the operating system or by code that you provide.
/// </summary>
/// <value>
/// <c>true</c> if the StepList is drawn by code that you provide; otherwise, <c>false</c>.
/// </value>
[DefaultValue(false), Category("Appearance"), Description("Indicates if controls is drawn by owner.")]
public bool OwnerDraw { get; set; }
/// <summary>
/// Gets the default size of the control.
/// </summary>
/// <returns>The default <see cref="T:System.Drawing.Size" /> of the control.</returns>
protected override Size DefaultSize => new Size(150, 200);
/// <summary>
/// Gets the step text.
/// </summary>
/// <param name="page">The page.</param>
/// <returns>Step text for the specified wizard page.</returns>
[DefaultValue((string)null), Category("Appearance"), Description("Alternate text to provide to the StepList. Default value comes the Text property of the WizardPage.")]
public string GetStepText(WizardPage page)
{
string value;
if (stepTexts.TryGetValue(page, out value))
return value;
return page.Text;
}
/// <summary>
/// Gets the step text indent level.
/// </summary>
/// <param name="page">The page.</param>
/// <returns>Step text indent level for the specified wizard page.</returns>
[DefaultValue(0), Category("Appearance"), Description("Indentation level for text provided to the StepList.")]
public int GetStepTextIndentLevel(WizardPage page)
{
int value;
if (indentLevels.TryGetValue(page, out value))
return value;
return 0;
}
bool IExtenderProvider.CanExtend(object extendee) => (extendee is WizardPage);
/// <summary>
/// Sets the step text.
/// </summary>
/// <param name="page">The page.</param>
/// <param name="value">The value.</param>
public void SetStepText(WizardPage page, string value)
{
if (string.IsNullOrEmpty(value) || value == page.Text)
stepTexts.Remove(page);
else
stepTexts[page] = value;
Refresh();
}
/// <summary>
/// Sets the step text indent level.
/// </summary>
/// <param name="page">The page.</param>
/// <param name="value">The indent level.</param>
public void SetStepTextIndentLevel(WizardPage page, int value)
{
if (value < 0) value = 0;
if (value == 0)
indentLevels.Remove(page);
else
indentLevels[page] = value;
Refresh();
}
/// <summary>
/// Raises the <see cref="E:DrawItem"/> event.
/// </summary>
/// <param name="e">The <see cref="DrawStepListItemEventArgs"/> instance containing the event data.</param>
protected virtual void OnDrawItem(DrawStepListItemEventArgs e)
{
var h = DrawItem;
if (h != null)
h(this, e);
}
/// <summary>
/// Raises the <see cref="E:FontChanged"/> event.
/// </summary>
/// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
protected override void OnFontChanged(EventArgs e)
{
base.OnFontChanged(e);
using (Graphics g = CreateGraphics())
{
defItemHeight = (int)Math.Ceiling(TextRenderer.MeasureText(g, "Wg", Font).Height * 1.2);
ptrFont = new Font("Marlett", Font.Size);
boldFont = new Font(Font, FontStyle.Bold);
bulletWidth = TextRenderer.MeasureText(g, "4", ptrFont, new Size(0, defItemHeight), defBulletTextFormat).Width;
}
}
/// <summary>
/// Raises the <see cref="E:MeasureItem"/> event.
/// </summary>
/// <param name="e">The <see cref="MeasureStepListItemEventArgs"/> instance containing the event data.</param>
protected virtual void OnMeasureItem(MeasureStepListItemEventArgs e)
{
var h = MeasureItem;
if (h != null)
h(this, e);
}
/// <summary>
/// Raises the <see cref="E:System.Windows.Forms.Control.Paint" /> event.
/// </summary>
/// <param name="e">A <see cref="T:System.Windows.Forms.PaintEventArgs" /> that contains the event data.</param>
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
if (myParent == null) return;
int y = Padding.Top;
WizardPageCollection pages = myParent.Pages;
bool hit = false;
for (int i = 0; i < pages.Count; i++)
{
var curPage = pages[i];
if (!curPage.Suppress)
{
Size itemSize = new Size(Width - Padding.Horizontal, defItemHeight);
if (OwnerDraw)
{
var meArg = new MeasureStepListItemEventArgs(e.Graphics, Font, curPage, new Size(Width, defItemHeight));
OnMeasureItem(meArg);
itemSize = meArg.ItemSize;
}
if (y + itemSize.Height > (Height - Padding.Bottom))
break;
bool isSelected = myParent.SelectedPage == curPage;
if (isSelected) hit = true;
var eArg = new DrawStepListItemEventArgs(e.Graphics, Font, new Rectangle(new Point(Padding.Left, y), itemSize), curPage, isSelected, hit);
if (OwnerDraw)
OnDrawItem(eArg);
else
DefaultDrawItem(eArg);
y += itemSize.Height;
}
}
}
/// <summary>
/// Raises the <see cref="E:System.Windows.Forms.Control.ParentChanged" /> event.
/// </summary>
/// <param name="e">An <see cref="T:System.EventArgs" /> that contains the event data.</param>
protected override void OnParentChanged(EventArgs e)
{
base.OnParentChanged(e);
SetupControl(this.GetParent<WizardControl>());
}
private static void Split(Rectangle rect, int xPos, out Rectangle r1, out Rectangle r2)
{
r1 = r2 = rect;
r1.Width = r2.X = xPos;
r2.Width = r2.Width - xPos;
}
private void DefaultDrawItem(DrawStepListItemEventArgs e)
{
Color fc = ForeColor, bc = BackColor;
int level = GetStepTextIndentLevel(e.Item);
bool isRTL = RightToLeft == System.Windows.Forms.RightToLeft.Yes;
var tffrtl = isRTL ? TextFormatFlags.Right : 0;
Rectangle rect, prect;
if (isRTL)
{
Split(e.Bounds, Width - bulletWidth, out rect, out prect);
prect.X = e.Bounds.Width - (bulletWidth * (level + 1));
rect.Width = Width - (bulletWidth * (level + 1));
}
else
{
Split(e.Bounds, bulletWidth, out prect, out rect);
prect.X = bulletWidth * level;
rect.X = bulletWidth * (level + 1);
}
if (!e.Completed)
fc = SystemColors.GrayText;
using (Brush br = new SolidBrush(bc))
e.Graphics.FillRectangle(br, Rectangle.Union(rect, prect));
TextRenderer.DrawText(e.Graphics, e.Completed ? (isRTL ? "3" : "4") : "a", ptrFont, prect, fc, defBulletTextFormat | tffrtl);
TextRenderer.DrawText(e.Graphics, GetStepText(e.Item), e.Selected ? boldFont : Font, rect, fc, defStringTextFormat | tffrtl);
}
private void pages_Changed(object sender, EventedList<WizardPage>.ListChangedEventArgs<WizardPage> e)
{
Refresh();
}
private void ResetStepText(WizardPage page)
{
SetStepText(page, null);
}
private void SetupControl(WizardControl p)
{
if (myParent != null)
{
WizardPageCollection pages = myParent.Pages;
pages.ItemAdded -= pages_Changed;
pages.ItemChanged -= pages_Changed;
pages.ItemDeleted -= pages_Changed;
}
myParent = p;
if (myParent != null)
{
WizardPageCollection pages = myParent.Pages;
pages.ItemAdded += pages_Changed;
pages.ItemChanged += pages_Changed;
pages.ItemDeleted += pages_Changed;
}
Refresh();
}
private bool ShouldSerializeStepText(WizardPage page) => (GetStepText(page) != page.Text);
}
}

Plik binarny nie jest wyświetlany.

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 822 B

Wyświetl plik

@ -0,0 +1,305 @@
using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
namespace AeroWizard
{
/// <summary>
/// Wizard control that shows a step summary on the left of the wizard page area.
/// </summary>
[ProvideProperty("StepText", typeof(WizardPage))]
[ProvideProperty("StepTextIndentLevel", typeof(WizardPage))]
[ToolboxItem(true), ToolboxBitmap(typeof(StepWizardControl), "StepWizardControl.bmp")]
public class StepWizardControl : WizardControl, IExtenderProvider
{
private StepList list;
private Splitter splitter;
/// <summary>
/// Initializes a new instance of the <see cref="StepWizardControl"/> class.
/// </summary>
public StepWizardControl()
{
var ds = RightToLeft == System.Windows.Forms.RightToLeft.Yes ? DockStyle.Right : DockStyle.Left;
pageContainer.Controls.Add(splitter = new Splitter() { Dock = ds, BorderStyle = BorderStyle.FixedSingle, Width = 1, Name = "splitter" });
pageContainer.Controls.Add(list = new StepList() { Dock = ds, Name = "stepList" });
list.DrawItem += list_DrawItem;
list.MeasureItem += list_MeasureItem;
Pages.Reset += Pages_Reset;
}
/// <summary>
/// Occurs when a visual aspect of an owner-drawn StepList changes.
/// </summary>
[Category("Appearance")]
public event EventHandler<DrawStepListItemEventArgs> DrawStepListItem;
/// <summary>
/// Occurs when an owner-drawn StepList is created and the sizes of the list items are determined.
/// </summary>
[Category("Appearance")]
public event EventHandler<MeasureStepListItemEventArgs> MeasureStepListItem;
/// <summary>
/// Gets or sets a value indicating whether the StepWizardControl step list is drawn by the operating system or by code that you provide.
/// </summary>
/// <value>
/// <c>true</c> if the StepWizardControl step list is drawn by code that you provide; otherwise, <c>false</c>.
/// </value>
[DefaultValue(false), Category("Appearance"), Description("Indicates if step list items are drawn by owner.")]
public bool OwnerDrawStepList
{
get { return list.OwnerDraw; }
set { list.OwnerDraw = value; }
}
/// <summary>
/// Gets or sets the StepList font.
/// </summary>
/// <value>
/// The StepList font.
/// </value>
[Category("Appearance"), Description("Font for drawing StepList.")]
public Font StepListFont
{
get { return list.Font; }
set { list.Font = value; }
}
/// <summary>
/// Gets or sets the width of the step list.
/// </summary>
/// <value>
/// The width of the step list.
/// </value>
[DefaultValue(150), Category("Appearance"), Description("Determines width of step list on left.")]
public int StepListWidth
{
get { return list.Width; }
set { list.Width = value; }
}
/// <summary>
/// Gets the step text.
/// </summary>
/// <param name="page">The page.</param>
/// <returns>Step text for the specified wizard page.</returns>
[DefaultValue((string)null), Category("Appearance"), Description("Alternate text to provide to the StepList. Default value comes the Text property of the WizardPage.")]
public string GetStepText(WizardPage page) => list.GetStepText(page);
/// <summary>
/// Gets the step text indent level.
/// </summary>
/// <param name="page">The page.</param>
/// <returns>Step text indent level for the specified wizard page.</returns>
[DefaultValue(0), Category("Appearance"), Description("Indentation level for text provided to the StepList.")]
public int GetStepTextIndentLevel(WizardPage page) => list.GetStepTextIndentLevel(page);
/// <summary>
/// Specifies whether this object can provide its extender properties to the specified object.
/// </summary>
/// <param name="extendee">The <see cref="T:System.Object" /> to receive the extender properties.</param>
/// <returns>
/// true if this object can provide extender properties to the specified object; otherwise, false.
/// </returns>
bool IExtenderProvider.CanExtend(object extendee) => (extendee is WizardPage);
/// <summary>
/// Sets the step text.
/// </summary>
/// <param name="page">The page.</param>
/// <param name="value">The value.</param>
public void SetStepText(WizardPage page, string value)
{
list.SetStepText(page, value);
}
/// <summary>
/// Sets the step text indent level.
/// </summary>
/// <param name="page">The page.</param>
/// <param name="value">The indent level.</param>
public void SetStepTextIndentLevel(WizardPage page, int value)
{
list.SetStepTextIndentLevel(page, value);
}
/// <summary>
/// Raises the <see cref="E:AeroWizard.StepWizardControl.DrawStepListItem" /> event.
/// </summary>
/// <param name="e">The <see cref="DrawStepListItemEventArgs"/> instance containing the event data.</param>
protected virtual void OnDrawStepListItem(DrawStepListItemEventArgs e)
{
var h = DrawStepListItem;
if (h != null)
h(this, e);
}
/// <summary>
/// Raises the <see cref="E:AeroWizard.StepWizardControl.MeasureStepListItem" /> event.
/// </summary>
/// <param name="e">The <see cref="MeasureStepListItemEventArgs"/> instance containing the event data.</param>
protected virtual void OnMeasureStepListItem(MeasureStepListItemEventArgs e)
{
var h = MeasureStepListItem;
if (h != null)
h(this, e);
}
/// <summary>
/// Raises the <see cref="E:System.Windows.Forms.Control.RightToLeftChanged" /> event.
/// </summary>
/// <param name="e">An <see cref="T:System.EventArgs" /> that contains the event data.</param>
protected override void OnRightToLeftChanged(System.EventArgs e)
{
base.OnRightToLeftChanged(e);
var ds = RightToLeft == System.Windows.Forms.RightToLeft.Yes ? DockStyle.Right : DockStyle.Left;
if (pageContainer.Controls.Count > 1)
{
pageContainer.Controls["splitter"].Dock = ds;
pageContainer.Controls["stepList"].Dock = ds;
}
}
private void list_DrawItem(object sender, DrawStepListItemEventArgs e)
{
OnDrawStepListItem(e);
}
private void list_MeasureItem(object sender, MeasureStepListItemEventArgs e)
{
OnMeasureStepListItem(e);
}
void Pages_Reset(object sender, System.Collections.Generic.EventedList<WizardPage>.ListChangedEventArgs<WizardPage> e)
{
pageContainer.Controls.Add(splitter);
pageContainer.Controls.Add(list);
}
private void ResetStepListFont()
{
list.Font = Font;
}
private void ResetStepText(WizardPage page)
{
SetStepText(page, null);
}
private bool ShouldSerializeStepListFont() => Font != list.Font;
private bool ShouldSerializeStepText(WizardPage page) => (GetStepText(page) != page.Text);
}
/// <summary>
/// Provides data for the <see cref="E:AeroWizard.StepWizardControl.DrawStepListItem"/> event.
/// </summary>
public class DrawStepListItemEventArgs : EventArgs
{
internal DrawStepListItemEventArgs(Graphics graphics, Font font, Rectangle itemRect, WizardPage page, bool isSelected, bool isCompleted)
{
Graphics = graphics;
Font = font;
Bounds = itemRect;
Item = page;
Selected = isSelected;
Completed = isCompleted;
}
/// <summary>
/// Gets the size and location of the item to draw.
/// </summary>
/// <value>
/// A rectangle that represents the bounds of the item to draw.
/// </value>
public Rectangle Bounds { get; }
/// <summary>
/// Gets a value indicating whether this step has already been completed.
/// </summary>
/// <value>
/// <c>true</c> if completed; otherwise, <c>false</c>.
/// </value>
public bool Completed { get; }
/// <summary>
/// Gets the <see cref="Font"/> used to draw the item.
/// </summary>
/// <value>
/// The <see cref="Font"/> used to draw the item.
/// </value>
public Font Font { get; }
/// <summary>
/// Gets the <see cref="Graphics"/> used to draw the item.
/// </summary>
/// <value>
/// The <see cref="Graphics"/> used to draw the item.
/// </value>
public Graphics Graphics { get; }
/// <summary>
/// Gets the <see cref="WizardPage"/> to which this item refers.
/// </summary>
/// <value>
/// The <see cref="WizardPage"/> to which this item refers.
/// </value>
public WizardPage Item { get; }
/// <summary>
/// Gets a value indicating whether this item is the one currently selected.
/// </summary>
/// <value>
/// <c>true</c> if selected; otherwise, <c>false</c>.
/// </value>
public bool Selected { get; }
}
/// <summary>
/// Provides data for the <see cref="E:AeroWizard.StepWizardControl.MeasureStepListItem"/> event.
/// </summary>
public class MeasureStepListItemEventArgs : EventArgs
{
internal MeasureStepListItemEventArgs(Graphics graphics, Font font, WizardPage page, Size itemSize)
{
Graphics = graphics;
Font = font;
Item = page;
ItemSize = itemSize;
}
/// <summary>
/// Gets the <see cref="Font"/> used to draw the item.
/// </summary>
/// <value>
/// The <see cref="Font"/> used to draw the item.
/// </value>
public Font Font { get; }
/// <summary>
/// Gets the <see cref="Graphics"/> used to draw the item.
/// </summary>
/// <value>
/// The <see cref="Graphics"/> used to draw the item.
/// </value>
public Graphics Graphics { get; }
/// <summary>
/// Gets the <see cref="WizardPage"/> to which this item refers.
/// </summary>
/// <value>
/// The <see cref="WizardPage"/> to which this item refers.
/// </value>
public WizardPage Item { get; }
/// <summary>
/// Gets or sets the size of the item.
/// </summary>
/// <value>
/// The size of the item.
/// </value>
public Size ItemSize { get; set; }
}
}

Wyświetl plik

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

Wyświetl plik

@ -0,0 +1,71 @@
using AeroWizard;
namespace TestWizard
{
partial class AeroWizardTemplate
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.wizardControl1 = new AeroWizard.WizardControl();
this.wizardPage1 = new AeroWizard.WizardPage();
((System.ComponentModel.ISupportInitialize)(this.wizardControl1)).BeginInit();
this.SuspendLayout();
//
// wizardControl1
//
this.wizardControl1.Location = new System.Drawing.Point(0, 0);
this.wizardControl1.Name = "wizardControl1";
this.wizardControl1.Pages.Add(this.wizardPage1);
this.wizardControl1.Size = new System.Drawing.Size(574, 415);
this.wizardControl1.TabIndex = 0;
//
// wizardPage1
//
this.wizardPage1.Name = "wizardPage1";
this.wizardPage1.Size = new System.Drawing.Size(527, 260);
this.wizardPage1.TabIndex = 0;
this.wizardPage1.Text = "Page Title";
//
// AeroWizardTemplate
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(574, 415);
this.Controls.Add(this.wizardControl1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.Name = "AeroWizardTemplate";
((System.ComponentModel.ISupportInitialize)(this.wizardControl1)).EndInit();
this.ResumeLayout(false);
}
#endregion
private AeroWizard.WizardControl wizardControl1;
private AeroWizard.WizardPage wizardPage1;
}
}

Wyświetl plik

@ -0,0 +1,12 @@
using System.Windows.Forms;
namespace TestWizard
{
public partial class AeroWizardTemplate : Form
{
public AeroWizardTemplate()
{
InitializeComponent();
}
}
}

Wyświetl plik

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

Wyświetl plik

@ -0,0 +1,132 @@
using AeroWizard;
namespace TestWizard
{
partial class CustomWizardTemplate
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.backBtn = new System.Windows.Forms.Button();
this.cancelBtn = new System.Windows.Forms.Button();
this.nextBtn = new System.Windows.Forms.Button();
this.wizardPageContainer1 = new AeroWizard.WizardPageContainer();
this.wizardPage1 = new AeroWizard.WizardPage();
this.headingControl = new System.Windows.Forms.Label();
((System.ComponentModel.ISupportInitialize)(this.wizardPageContainer1)).BeginInit();
this.wizardPageContainer1.SuspendLayout();
this.SuspendLayout();
//
// backBtn
//
this.backBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.backBtn.Location = new System.Drawing.Point(93, 204);
this.backBtn.Name = "backBtn";
this.backBtn.Size = new System.Drawing.Size(75, 23);
this.backBtn.TabIndex = 1;
this.backBtn.Text = "&Back";
//
// cancelBtn
//
this.cancelBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.cancelBtn.Location = new System.Drawing.Point(255, 204);
this.cancelBtn.Name = "cancelBtn";
this.cancelBtn.Size = new System.Drawing.Size(75, 23);
this.cancelBtn.TabIndex = 1;
this.cancelBtn.Text = "&Cancel";
//
// nextBtn
//
this.nextBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.nextBtn.Location = new System.Drawing.Point(174, 204);
this.nextBtn.Name = "nextBtn";
this.nextBtn.Size = new System.Drawing.Size(75, 23);
this.nextBtn.TabIndex = 1;
this.nextBtn.Text = "&Next";
//
// wizardPageContainer1
//
this.wizardPageContainer1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.wizardPageContainer1.BackButton = this.backBtn;
this.wizardPageContainer1.CancelButton = this.cancelBtn;
this.wizardPageContainer1.Controls.Add(this.wizardPage1);
this.wizardPageContainer1.Location = new System.Drawing.Point(12, 25);
this.wizardPageContainer1.Name = "wizardPageContainer1";
this.wizardPageContainer1.NextButton = this.nextBtn;
this.wizardPageContainer1.Pages.Add(this.wizardPage1);
this.wizardPageContainer1.Size = new System.Drawing.Size(318, 173);
this.wizardPageContainer1.TabIndex = 2;
this.wizardPageContainer1.Cancelling += new System.ComponentModel.CancelEventHandler(this.wizardPageContainer1_Cancelling);
this.wizardPageContainer1.Finished += new System.EventHandler(this.wizardPageContainer1_Finished);
this.wizardPageContainer1.SelectedPageChanged += new System.EventHandler(this.wizardPageContainer1_SelectedPageChanged);
//
// wizardPage1
//
this.wizardPage1.Name = "wizardPage1";
this.wizardPage1.Size = new System.Drawing.Size(318, 173);
this.wizardPage1.TabIndex = 0;
this.wizardPage1.Text = "Page 1";
//
// headingControl
//
this.headingControl.AutoSize = true;
this.headingControl.Location = new System.Drawing.Point(9, 9);
this.headingControl.Name = "headingControl";
this.headingControl.Size = new System.Drawing.Size(59, 13);
this.headingControl.TabIndex = 3;
this.headingControl.Text = "<Heading>";
//
// CustomWizardTemplate
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(342, 239);
this.Controls.Add(this.headingControl);
this.Controls.Add(this.wizardPageContainer1);
this.Controls.Add(this.cancelBtn);
this.Controls.Add(this.nextBtn);
this.Controls.Add(this.backBtn);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.Name = "CustomWizardTemplate";
((System.ComponentModel.ISupportInitialize)(this.wizardPageContainer1)).EndInit();
this.wizardPageContainer1.ResumeLayout(false);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Button backBtn;
private System.Windows.Forms.Button cancelBtn;
private System.Windows.Forms.Button nextBtn;
private AeroWizard.WizardPageContainer wizardPageContainer1;
private AeroWizard.WizardPage wizardPage1;
private System.Windows.Forms.Label headingControl;
}
}

Wyświetl plik

@ -0,0 +1,28 @@
using System;
using System.Windows.Forms;
namespace TestWizard
{
public partial class CustomWizardTemplate : Form
{
public CustomWizardTemplate()
{
InitializeComponent();
}
private void wizardPageContainer1_Cancelling(object sender, System.ComponentModel.CancelEventArgs e)
{
Close();
}
private void wizardPageContainer1_Finished(object sender, EventArgs e)
{
Close();
}
private void wizardPageContainer1_SelectedPageChanged(object sender, EventArgs e)
{
headingControl.Text = wizardPageContainer1.SelectedPage.Text;
}
}
}

Wyświetl plik

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

Wyświetl plik

@ -0,0 +1,201 @@
namespace TestWizard
{
partial class Main
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.appRenderVS = new System.Windows.Forms.CheckBox();
this.compEnabledCheck = new System.Windows.Forms.CheckBox();
this.vsEnabledByUser = new System.Windows.Forms.CheckBox();
this.vsOnOS = new System.Windows.Forms.CheckBox();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.customBtn = new System.Windows.Forms.Button();
this.stepBtn = new System.Windows.Forms.Button();
this.wizBtn = new System.Windows.Forms.Button();
this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
this.oldButton = new System.Windows.Forms.Button();
this.groupBox1.SuspendLayout();
this.groupBox2.SuspendLayout();
this.SuspendLayout();
//
// appRenderVS
//
this.appRenderVS.AutoCheck = false;
this.appRenderVS.AutoSize = true;
this.appRenderVS.Location = new System.Drawing.Point(6, 42);
this.appRenderVS.Name = "appRenderVS";
this.appRenderVS.Size = new System.Drawing.Size(94, 17);
this.appRenderVS.TabIndex = 0;
this.appRenderVS.Text = "AppRenderVS";
this.toolTip1.SetToolTip(this.appRenderVS, "Indicates if Visual Styles are enabled for this application.");
this.appRenderVS.UseVisualStyleBackColor = true;
//
// compEnabledCheck
//
this.compEnabledCheck.AutoSize = true;
this.compEnabledCheck.Location = new System.Drawing.Point(6, 19);
this.compEnabledCheck.Name = "compEnabledCheck";
this.compEnabledCheck.Size = new System.Drawing.Size(125, 17);
this.compEnabledCheck.TabIndex = 0;
this.compEnabledCheck.Text = "Composition Enabled";
this.toolTip1.SetToolTip(this.compEnabledCheck, "Indicates if Desktop Window Composition (Aero) is enabled. For Windows Vista and " +
"Windows 7, this setting is user configurable.");
this.compEnabledCheck.UseVisualStyleBackColor = true;
this.compEnabledCheck.CheckedChanged += new System.EventHandler(this.compEnabledCheck_CheckedChanged);
//
// vsEnabledByUser
//
this.vsEnabledByUser.AutoCheck = false;
this.vsEnabledByUser.AutoSize = true;
this.vsEnabledByUser.Location = new System.Drawing.Point(149, 19);
this.vsEnabledByUser.Name = "vsEnabledByUser";
this.vsEnabledByUser.Size = new System.Drawing.Size(113, 17);
this.vsEnabledByUser.TabIndex = 0;
this.vsEnabledByUser.Text = "VSEnabledByUser";
this.toolTip1.SetToolTip(this.vsEnabledByUser, "Indicates if Visual Styles are enabled by the user.");
this.vsEnabledByUser.UseVisualStyleBackColor = true;
//
// vsOnOS
//
this.vsOnOS.AutoCheck = false;
this.vsOnOS.AutoSize = true;
this.vsOnOS.Location = new System.Drawing.Point(149, 42);
this.vsOnOS.Name = "vsOnOS";
this.vsOnOS.Size = new System.Drawing.Size(67, 17);
this.vsOnOS.TabIndex = 0;
this.vsOnOS.Text = "VSonOS";
this.toolTip1.SetToolTip(this.vsOnOS, "Indicates if Visual Styles are enabled by the Operating System.");
this.vsOnOS.UseVisualStyleBackColor = true;
//
// groupBox1
//
this.groupBox1.Controls.Add(this.compEnabledCheck);
this.groupBox1.Controls.Add(this.appRenderVS);
this.groupBox1.Controls.Add(this.vsOnOS);
this.groupBox1.Controls.Add(this.vsEnabledByUser);
this.groupBox1.Location = new System.Drawing.Point(12, 12);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(268, 67);
this.groupBox1.TabIndex = 2;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "Environment";
//
// groupBox2
//
this.groupBox2.Controls.Add(this.oldButton);
this.groupBox2.Controls.Add(this.customBtn);
this.groupBox2.Controls.Add(this.stepBtn);
this.groupBox2.Controls.Add(this.wizBtn);
this.groupBox2.Location = new System.Drawing.Point(12, 86);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(268, 82);
this.groupBox2.TabIndex = 3;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "Wizard";
//
// customBtn
//
this.customBtn.Location = new System.Drawing.Point(7, 49);
this.customBtn.Name = "customBtn";
this.customBtn.Size = new System.Drawing.Size(107, 23);
this.customBtn.TabIndex = 0;
this.customBtn.Text = "Custom Wizard";
this.toolTip1.SetToolTip(this.customBtn, "Launches a custom wizard.");
this.customBtn.UseVisualStyleBackColor = true;
this.customBtn.Click += new System.EventHandler(this.customBtn_Click);
//
// stepBtn
//
this.stepBtn.Location = new System.Drawing.Point(149, 20);
this.stepBtn.Name = "stepBtn";
this.stepBtn.Size = new System.Drawing.Size(107, 23);
this.stepBtn.TabIndex = 0;
this.stepBtn.Text = "Step Wizard";
this.toolTip1.SetToolTip(this.stepBtn, "Lauches a modification of the Aero Wizard that includes a checked step list on th" +
"e left.");
this.stepBtn.UseVisualStyleBackColor = true;
this.stepBtn.Click += new System.EventHandler(this.stepBtn_Click);
//
// wizBtn
//
this.wizBtn.Location = new System.Drawing.Point(7, 20);
this.wizBtn.Name = "wizBtn";
this.wizBtn.Size = new System.Drawing.Size(107, 23);
this.wizBtn.TabIndex = 0;
this.wizBtn.Text = "Aero Wizard";
this.toolTip1.SetToolTip(this.wizBtn, "Launches a wizard using the Aero Wizard styling defined for Operating Systems aft" +
"er Windows Vista.");
this.wizBtn.UseVisualStyleBackColor = true;
this.wizBtn.Click += new System.EventHandler(this.wizBtn_Click);
//
// oldButton
//
this.oldButton.Location = new System.Drawing.Point(149, 49);
this.oldButton.Name = "oldButton";
this.oldButton.Size = new System.Drawing.Size(107, 23);
this.oldButton.TabIndex = 0;
this.oldButton.Text = "Old Wizard";
this.oldButton.UseVisualStyleBackColor = true;
this.oldButton.Click += new System.EventHandler(this.oldButton_Click);
//
// Main
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(292, 180);
this.Controls.Add(this.groupBox2);
this.Controls.Add(this.groupBox1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.Name = "Main";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Wizard Test";
this.Load += new System.EventHandler(this.Main_Load);
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.groupBox2.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.CheckBox appRenderVS;
private System.Windows.Forms.CheckBox compEnabledCheck;
private System.Windows.Forms.CheckBox vsEnabledByUser;
private System.Windows.Forms.CheckBox vsOnOS;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.Button customBtn;
private System.Windows.Forms.Button stepBtn;
private System.Windows.Forms.Button wizBtn;
private System.Windows.Forms.ToolTip toolTip1;
private System.Windows.Forms.Button oldButton;
}
}

Wyświetl plik

@ -0,0 +1,61 @@
using System;
using System.Windows.Forms;
using Vanara.Interop.DesktopWindowManager;
namespace TestWizard
{
public partial class Main : Form
{
public Main()
{
InitializeComponent();
}
private void Main_Load(object sender, EventArgs e)
{
compEnabledCheck.AutoCheck = Environment.OSVersion.Version < new Version(6, 2) && Environment.OSVersion.Version >= new Version(6, 0);
UpdateChecks();
DesktopWindowManager.CompositionChanged += DesktopWindowManager_CompositionChanged;
//new MyWizard().ShowDialog(this);
//Close();
}
private void DesktopWindowManager_CompositionChanged(object sender, EventArgs e)
{
UpdateChecks();
}
private void UpdateChecks()
{
appRenderVS.Checked = Application.RenderWithVisualStyles;
compEnabledCheck.Checked = DesktopWindowManager.CompositionEnabled;
vsEnabledByUser.Checked = System.Windows.Forms.VisualStyles.VisualStyleInformation.IsEnabledByUser;
vsOnOS.Checked = System.Windows.Forms.VisualStyles.VisualStyleInformation.IsSupportedByOS;
}
private void wizBtn_Click(object sender, EventArgs e)
{
new MyWizard().ShowDialog(this);
}
private void stepBtn_Click(object sender, EventArgs e)
{
new MyStepWizard().ShowDialog(this);
}
private void customBtn_Click(object sender, EventArgs e)
{
new TestWizBase().ShowDialog(this);
}
private void compEnabledCheck_CheckedChanged(object sender, EventArgs e)
{
DesktopWindowManager.CompositionEnabled = compEnabledCheck.Checked;
}
private void oldButton_Click(object sender, EventArgs e)
{
new OldStyleWizard().ShowDialog(this);
}
}
}

Wyświetl plik

@ -0,0 +1,123 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>

Wyświetl plik

@ -0,0 +1,103 @@
using AeroWizard;
namespace TestWizard
{
partial class MyStepWizard
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.wizardControl1 = new AeroWizard.StepWizardControl();
this.wizardPage1 = new AeroWizard.WizardPage();
this.wizardPage3 = new AeroWizard.WizardPage();
this.wizardPage4 = new AeroWizard.WizardPage();
this.wizardPage5 = new AeroWizard.WizardPage();
((System.ComponentModel.ISupportInitialize)(this.wizardControl1)).BeginInit();
this.SuspendLayout();
//
// wizardControl1
//
this.wizardControl1.ClassicStyle = AeroWizard.WizardClassicStyle.Automatic;
this.wizardControl1.Location = new System.Drawing.Point(0, 0);
this.wizardControl1.Name = "wizardControl1";
this.wizardControl1.Pages.Add(this.wizardPage1);
this.wizardControl1.Pages.Add(this.wizardPage3);
this.wizardControl1.Pages.Add(this.wizardPage4);
this.wizardControl1.Pages.Add(this.wizardPage5);
this.wizardControl1.Size = new System.Drawing.Size(768, 482);
this.wizardControl1.StepListFont = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.World);
this.wizardControl1.TabIndex = 0;
//
// wizardPage1
//
this.wizardPage1.Name = "wizardPage1";
this.wizardPage1.Size = new System.Drawing.Size(570, 330);
this.wizardPage1.TabIndex = 0;
this.wizardPage1.Text = "Page 1";
//
// wizardPage3
//
this.wizardPage3.Name = "wizardPage3";
this.wizardPage3.Size = new System.Drawing.Size(570, 329);
this.wizardPage3.TabIndex = 2;
this.wizardPage3.Text = "Page 3";
//
// wizardPage4
//
this.wizardPage4.Name = "wizardPage4";
this.wizardPage4.Size = new System.Drawing.Size(570, 329);
this.wizardPage4.TabIndex = 3;
this.wizardPage4.Text = "Page 4";
//
// wizardPage5
//
this.wizardPage5.Name = "wizardPage5";
this.wizardPage5.Size = new System.Drawing.Size(571, 327);
this.wizardPage5.TabIndex = 4;
this.wizardPage5.Text = "Page 5";
//
// MyStepWizard
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(768, 482);
this.Controls.Add(this.wizardControl1);
this.Name = "MyStepWizard";
this.Text = "MyStepWizard";
((System.ComponentModel.ISupportInitialize)(this.wizardControl1)).EndInit();
this.ResumeLayout(false);
}
#endregion
private AeroWizard.StepWizardControl wizardControl1;
private AeroWizard.WizardPage wizardPage1;
private AeroWizard.WizardPage wizardPage3;
private AeroWizard.WizardPage wizardPage4;
private AeroWizard.WizardPage wizardPage5;
}
}

Wyświetl plik

@ -0,0 +1,27 @@
using AeroWizard;
using System.Windows.Forms;
namespace TestWizard
{
public partial class MyStepWizard : Form
{
System.Drawing.Font myFont = new System.Drawing.Font("Impact", 20);
public MyStepWizard()
{
InitializeComponent();
}
private void wizardControl1_DrawStepListItem(object sender, AeroWizard.DrawStepListItemEventArgs e)
{
string pre = e.Selected ? "> " : e.Completed ? "- " : "+ ";
TextRenderer.DrawText(e.Graphics, pre + wizardControl1.GetStepText(e.Item), myFont, e.Bounds, ForeColor);
}
private void wizardControl1_MeasureStepListItem(object sender, AeroWizard.MeasureStepListItemEventArgs e)
{
e.ItemSize = new System.Drawing.Size(e.ItemSize.Width, (int)(TextRenderer.MeasureText("Wg", myFont).Height * 1.2));
}
}
}

Wyświetl plik

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

Wyświetl plik

@ -0,0 +1,249 @@
using AeroWizard;
namespace TestWizard
{
partial class MyWizard
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.wizardControl1 = new AeroWizard.WizardControl();
this.introPage = new AeroWizard.WizardPage();
this.button2 = new System.Windows.Forms.Button();
this.button1 = new System.Windows.Forms.Button();
this.suppressedPage = new AeroWizard.WizardPage();
this.label2 = new System.Windows.Forms.Label();
this.questionPage = new AeroWizard.WizardPage();
this.checkBox2 = new System.Windows.Forms.CheckBox();
this.middlePage = new AeroWizard.WizardPage();
this.checkBox1 = new System.Windows.Forms.CheckBox();
this.linkLabel1 = new System.Windows.Forms.LinkLabel();
this.endPage = new AeroWizard.WizardPage();
this.label1 = new System.Windows.Forms.Label();
this.progressBar1 = new System.Windows.Forms.ProgressBar();
((System.ComponentModel.ISupportInitialize)(this.wizardControl1)).BeginInit();
this.introPage.SuspendLayout();
this.suppressedPage.SuspendLayout();
this.questionPage.SuspendLayout();
this.middlePage.SuspendLayout();
this.endPage.SuspendLayout();
this.SuspendLayout();
//
// wizardControl1
//
this.wizardControl1.ClassicStyle = AeroWizard.WizardClassicStyle.Automatic;
this.wizardControl1.Location = new System.Drawing.Point(0, 0);
this.wizardControl1.Name = "wizardControl1";
this.wizardControl1.Pages.Add(this.introPage);
this.wizardControl1.Pages.Add(this.suppressedPage);
this.wizardControl1.Pages.Add(this.questionPage);
this.wizardControl1.Pages.Add(this.middlePage);
this.wizardControl1.Pages.Add(this.endPage);
this.wizardControl1.ShowProgressInTaskbarIcon = true;
this.wizardControl1.Size = new System.Drawing.Size(574, 415);
this.wizardControl1.TabIndex = 0;
this.wizardControl1.Title = "Modify System";
//
// introPage
//
this.introPage.AllowNext = false;
this.introPage.Controls.Add(this.button2);
this.introPage.Controls.Add(this.button1);
this.introPage.HelpText = "Do you hate this?";
this.introPage.Name = "introPage";
this.introPage.Size = new System.Drawing.Size(527, 263);
this.introPage.TabIndex = 0;
this.introPage.Text = "Choose an activity";
this.introPage.HelpClicked += new System.EventHandler(this.introPage_HelpClicked);
this.introPage.Initialize += new System.EventHandler<AeroWizard.WizardPageInitEventArgs>(this.introPage_Initialize);
//
// button2
//
this.button2.Location = new System.Drawing.Point(3, 32);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(227, 23);
this.button2.TabIndex = 1;
this.button2.Text = "Trash everything";
this.button2.UseVisualStyleBackColor = true;
this.button2.Click += new System.EventHandler(this.commandLink2_Click);
//
// button1
//
this.button1.Location = new System.Drawing.Point(3, 3);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(227, 23);
this.button1.TabIndex = 0;
this.button1.Text = "Cleanup system";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.commandLink1_Click);
//
// suppressedPage
//
this.suppressedPage.Controls.Add(this.label2);
this.suppressedPage.Name = "suppressedPage";
this.suppressedPage.Size = new System.Drawing.Size(527, 263);
this.suppressedPage.Suppress = true;
this.suppressedPage.TabIndex = 3;
this.suppressedPage.Text = "Suppressed";
//
// label2
//
this.label2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(188, 113);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(139, 15);
this.label2.TabIndex = 0;
this.label2.Text = "You should never see me";
//
// questionPage
//
this.questionPage.AllowNext = false;
this.questionPage.Controls.Add(this.checkBox2);
this.questionPage.Name = "questionPage";
this.questionPage.Size = new System.Drawing.Size(552, 258);
this.questionPage.TabIndex = 4;
this.questionPage.Text = "Are you sure?";
//
// checkBox2
//
this.checkBox2.AutoSize = true;
this.checkBox2.Location = new System.Drawing.Point(3, 0);
this.checkBox2.Name = "checkBox2";
this.checkBox2.Size = new System.Drawing.Size(44, 19);
this.checkBox2.TabIndex = 0;
this.checkBox2.Text = "Yes";
this.checkBox2.UseVisualStyleBackColor = true;
this.checkBox2.CheckedChanged += new System.EventHandler(this.checkBox2_CheckedChanged);
//
// middlePage
//
this.middlePage.Controls.Add(this.checkBox1);
this.middlePage.Controls.Add(this.linkLabel1);
this.middlePage.IsFinishPage = true;
this.middlePage.Name = "middlePage";
this.middlePage.ShowCancel = false;
this.middlePage.ShowNext = false;
this.middlePage.Size = new System.Drawing.Size(552, 258);
this.middlePage.TabIndex = 1;
this.middlePage.Text = "Launch System Cleanup";
this.middlePage.Initialize += new System.EventHandler<AeroWizard.WizardPageInitEventArgs>(this.middlePage_Initialize);
//
// checkBox1
//
this.checkBox1.AutoSize = true;
this.checkBox1.Location = new System.Drawing.Point(3, 31);
this.checkBox1.Name = "checkBox1";
this.checkBox1.Size = new System.Drawing.Size(233, 19);
this.checkBox1.TabIndex = 1;
this.checkBox1.Text = "Desktop Window Composition Enabled";
this.checkBox1.UseVisualStyleBackColor = true;
this.checkBox1.CheckedChanged += new System.EventHandler(this.checkBox1_CheckedChanged);
//
// linkLabel1
//
this.linkLabel1.AutoSize = true;
this.linkLabel1.Location = new System.Drawing.Point(0, 0);
this.linkLabel1.Name = "linkLabel1";
this.linkLabel1.Size = new System.Drawing.Size(116, 15);
this.linkLabel1.TabIndex = 0;
this.linkLabel1.TabStop = true;
this.linkLabel1.Text = "Launch SysClean.exe";
//
// endPage
//
this.endPage.Controls.Add(this.label1);
this.endPage.Controls.Add(this.progressBar1);
this.endPage.Name = "endPage";
this.endPage.Size = new System.Drawing.Size(527, 259);
this.endPage.TabIndex = 2;
this.endPage.Text = "Bad Choice";
this.endPage.Initialize += new System.EventHandler<AeroWizard.WizardPageInitEventArgs>(this.endPage_Initialize);
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(0, 0);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(185, 15);
this.label1.TabIndex = 1;
this.label1.Text = "Hosing your system. Please wait...";
//
// progressBar1
//
this.progressBar1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.progressBar1.Location = new System.Drawing.Point(3, 28);
this.progressBar1.Name = "progressBar1";
this.progressBar1.Size = new System.Drawing.Size(370, 23);
this.progressBar1.Style = System.Windows.Forms.ProgressBarStyle.Marquee;
this.progressBar1.TabIndex = 0;
//
// MyWizard
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(574, 415);
this.Controls.Add(this.wizardControl1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.MaximizeBox = false;
this.Name = "MyWizard";
this.RightToLeftLayout = true;
((System.ComponentModel.ISupportInitialize)(this.wizardControl1)).EndInit();
this.introPage.ResumeLayout(false);
this.introPage.PerformLayout();
this.suppressedPage.ResumeLayout(false);
this.suppressedPage.PerformLayout();
this.questionPage.ResumeLayout(false);
this.questionPage.PerformLayout();
this.middlePage.ResumeLayout(false);
this.middlePage.PerformLayout();
this.endPage.ResumeLayout(false);
this.endPage.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private AeroWizard.WizardControl wizardControl1;
private AeroWizard.WizardPage introPage;
private AeroWizard.WizardPage middlePage;
private AeroWizard.WizardPage endPage;
private System.Windows.Forms.LinkLabel linkLabel1;
private System.Windows.Forms.ProgressBar progressBar1;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.CheckBox checkBox1;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.Button button1;
private AeroWizard.WizardPage suppressedPage;
private System.Windows.Forms.Label label2;
private AeroWizard.WizardPage questionPage;
private System.Windows.Forms.CheckBox checkBox2;
}
}

Wyświetl plik

@ -0,0 +1,146 @@
using Vanara.Interop.DesktopWindowManager;
using AeroWizard;
using System.Windows.Forms;
namespace TestWizard
{
public partial class MyWizard : Form
{
private readonly Button extraBtn;
private readonly System.Text.StringBuilder events = new System.Text.StringBuilder(1024);
public MyWizard()
{
InitializeComponent();
//this.wizardControl1.TitleIcon = null;
foreach (var i in wizardControl1.Pages)
i.Commit += new System.EventHandler<AeroWizard.WizardPageConfirmEventArgs>(i_Commit);
wizardControl1.Finished += new System.EventHandler(wizardControl1_Finished);
extraBtn = new Button { Text = "Events", AutoSize = true, AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink, Anchor = AnchorStyles.Top | AnchorStyles.Right, Margin = Padding.Empty };
wizardControl1.AddCommandControl(extraBtn);
extraBtn.Click += extraBtn_Click;
SystemColorsChanged += MyWizard_SystemColorsChanged;
StyleChanged += MyWizard_StyleChanged;
if (System.Environment.OSVersion.Version.Major >= 6)
{
DesktopWindowManager.ColorizationColorChanged += DesktopWindowManager_ColorizationColorChanged;
DesktopWindowManager.CompositionChanged += DesktopWindowManager_CompositionChanged;
}
Microsoft.Win32.SystemEvents.DisplaySettingsChanged += SystemEvents_DisplaySettingsChanged;
}
void MyWizard_StyleChanged(object sender, System.EventArgs e)
{
bool ncre = false, clk = false; Padding cbb = Padding.Empty, efb = Padding.Empty;
try
{
ncre = this.GetWindowAttribute<bool>(DesktopWindowManager.GetWindowAttr.NonClientRenderingEnabled);
efb = this.GetWindowAttribute<Padding>(DesktopWindowManager.GetWindowAttr.ExtendedFrameBounds);
cbb = this.GetWindowAttribute<Padding>(DesktopWindowManager.GetWindowAttr.CaptionButtonBounds);
clk = System.Environment.OSVersion.Version.Minor >= 2 && this.GetWindowAttribute<bool>(DesktopWindowManager.GetWindowAttr.Cloaked);
}
catch { }
events.AppendFormat("{0:s}: Style (NCRend:{1}, Clk:{2}, CapBtn:{3}, ExtFrm:{4}\n", System.DateTime.Now, ncre, clk, cbb, efb);
}
void MyWizard_SystemColorsChanged(object sender, System.EventArgs e)
{
bool ncre = this.GetWindowAttribute<bool>(DesktopWindowManager.GetWindowAttr.NonClientRenderingEnabled);
bool clk = System.Environment.OSVersion.Version.Minor >= 2 && this.GetWindowAttribute<bool>(DesktopWindowManager.GetWindowAttr.Cloaked);
Padding cbb = this.GetWindowAttribute<Padding>(DesktopWindowManager.GetWindowAttr.CaptionButtonBounds);
Padding efb = this.GetWindowAttribute<Padding>(DesktopWindowManager.GetWindowAttr.ExtendedFrameBounds);
events.AppendFormat("{0:s}: System colors (NCRend:{1}, Clk:{2}, CapBtn:{3}, ExtFrm:{4}\n", System.DateTime.Now, ncre, clk, cbb, efb);
}
protected override void OnClosing(System.ComponentModel.CancelEventArgs e)
{
base.OnClosing(e);
if (System.Environment.OSVersion.Version.Major >= 6)
{
DesktopWindowManager.ColorizationColorChanged -= DesktopWindowManager_ColorizationColorChanged;
DesktopWindowManager.CompositionChanged -= DesktopWindowManager_CompositionChanged;
}
Microsoft.Win32.SystemEvents.DisplaySettingsChanged -= SystemEvents_DisplaySettingsChanged;
}
void extraBtn_Click(object sender, System.EventArgs e)
{
MessageBox.Show(events.ToString());
}
void SystemEvents_DisplaySettingsChanged(object sender, System.EventArgs e)
{
events.AppendFormat("{0:s}: Display settings\n", System.DateTime.Now);
}
void DesktopWindowManager_CompositionChanged(object sender, System.EventArgs e)
{
events.AppendFormat("{0:s}: Composition ({1})\n", System.DateTime.Now, DesktopWindowManager.IsCompositionEnabled() ? "On" : "Off");
}
void DesktopWindowManager_ColorizationColorChanged(object sender, System.EventArgs e)
{
events.AppendFormat("{0:s}: Colorization color (0x{1:x})\n", System.DateTime.Now, DesktopWindowManager.CompositionColor.ToArgb());
}
void wizardControl1_Finished(object sender, System.EventArgs e)
{
System.Diagnostics.Debug.WriteLine("--> Wizard finished.");
}
void i_Commit(object sender, AeroWizard.WizardPageConfirmEventArgs e)
{
System.Diagnostics.Debug.WriteLine($"--> Page {e.Page.Name} committed.");
}
private void commandLink1_Click(object sender, System.EventArgs e)
{
wizardControl1.NextPage();
}
private void commandLink2_Click(object sender, System.EventArgs e)
{
wizardControl1.NextPage(endPage);
}
private void checkBox1_CheckedChanged(object sender, System.EventArgs e)
{
if (!initMiddle)
DesktopWindowManager.EnableComposition(checkBox1.Checked);
}
private bool initMiddle = false;
private void middlePage_Initialize(object sender, AeroWizard.WizardPageInitEventArgs e)
{
initMiddle = true;
if (!System.IO.File.Exists(System.IO.Path.Combine(System.Environment.GetFolderPath(System.Environment.SpecialFolder.System), "dwmapi.dll")))
checkBox1.Enabled = false;
else
checkBox1.Checked = DesktopWindowManager.IsCompositionEnabled();
wizardControl1.FinishButtonText = "Finish";
initMiddle = false;
}
private void checkBox2_CheckedChanged(object sender, System.EventArgs e)
{
wizardControl1.SelectedPage.AllowNext = checkBox2.Checked;
wizardControl1.SelectedPage.AllowBack = !checkBox2.Checked;
}
private void endPage_Initialize(object sender, AeroWizard.WizardPageInitEventArgs e)
{
wizardControl1.FinishButtonText = "Sorry, but you are hosed.";
}
private void introPage_HelpClicked(object sender, System.EventArgs e)
{
MessageBox.Show("Clicked help");
}
private void introPage_Initialize(object sender, AeroWizard.WizardPageInitEventArgs e)
{
//MessageBox.Show("Page initialized");
}
}
}

Wyświetl plik

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

Wyświetl plik

@ -0,0 +1,68 @@
// Requires USER32.cs
using Microsoft.Win32;
using System.ComponentModel;
using System.Drawing;
namespace System.Windows.Forms
{
/// <summary>
/// Implements a CommandLink button that can be used in WinForms user interfaces.
/// </summary>
[System.Drawing.ToolboxBitmap(typeof(Button))]
public class CommandLink : VistaButtonBase
{
private string note = null;
/// <summary>
/// Initializes a new instance of the <see cref="CommandLink"/> class.
/// </summary>
public CommandLink()
{
}
/// <summary>
/// Gets or sets the note text for the button.
/// </summary>
/// <value>
/// The note text.
/// </value>
[Category("Appearance"), Browsable(true), DefaultValue((string)null)]
public string Note
{
get { return note; }
set
{
const uint BCM_SETNOTE = 0x1609;
note = value;
NativeMethods.SendMessage(Handle, BCM_SETNOTE, IntPtr.Zero, note);
Invalidate();
}
}
/// <summary>
/// Gets a System.Windows.Forms.CreateParams on the base class when creating a window.
/// </summary>
/// <value>
/// The create parameters.
/// </value>
protected override CreateParams CreateParams
{
get
{
const int BS_COMMANDLINK = 0xE;
var cp = base.CreateParams;
if (IsPlatformSupported)
cp.Style |= BS_COMMANDLINK;
return cp;
}
}
/// <summary>
/// Gets the default size.
/// </summary>
/// <value>
/// The default size.
/// </value>
protected override Drawing.Size DefaultSize => new Drawing.Size(135, 60);
}
}

Wyświetl plik

@ -0,0 +1,85 @@
using System.Runtime.InteropServices;
namespace Microsoft.Win32
{
internal static partial class NativeMethods
{
[StructLayout(LayoutKind.Sequential)]
public struct RECT
{
public int Left, Top, Right, Bottom;
public RECT(int left, int top, int right, int bottom)
{
Left = left;
Top = top;
Right = right;
Bottom = bottom;
}
public RECT(System.Drawing.Rectangle r)
: this(r.Left, r.Top, r.Right, r.Bottom)
{
}
public int X
{
get { return Left; }
set { Right -= (Left - value); Left = value; }
}
public int Y
{
get { return Top; }
set { Bottom -= (Top - value); Top = value; }
}
public int Height
{
get { return Bottom - Top; }
set { Bottom = value + Top; }
}
public int Width
{
get { return Right - Left; }
set { Right = value + Left; }
}
public System.Drawing.Point Location
{
get { return new System.Drawing.Point(Left, Top); }
set { X = value.X; Y = value.Y; }
}
public System.Drawing.Size Size
{
get { return new System.Drawing.Size(Width, Height); }
set { Width = value.Width; Height = value.Height; }
}
public static implicit operator System.Drawing.Rectangle(RECT r) => new System.Drawing.Rectangle(r.Left, r.Top, r.Width, r.Height);
public static implicit operator RECT(System.Drawing.Rectangle r) => new RECT(r);
public static bool operator ==(RECT r1, RECT r2) => r1.Equals(r2);
public static bool operator !=(RECT r1, RECT r2) => !r1.Equals(r2);
public bool Equals(RECT r) => r.Left == Left && r.Top == Top && r.Right == Right && r.Bottom == Bottom;
public override bool Equals(object obj)
{
if (obj is RECT)
return Equals((RECT)obj);
else if (obj is System.Drawing.Rectangle)
return Equals(new RECT((System.Drawing.Rectangle)obj));
return false;
}
public override int GetHashCode() => ((System.Drawing.Rectangle)this).GetHashCode();
public override string ToString() => $"{{Left={Left},Top={Top},Right={Right},Bottom={Bottom}}}";
}
}
}

Wyświetl plik

@ -0,0 +1,198 @@
using System;
using System.Runtime.InteropServices;
namespace Microsoft.Win32
{
internal static partial class NativeMethods
{
internal const string USER32 = "user32.dll";
[DllImport(USER32, CharSet = CharSet.Unicode, ExactSpelling = true)]
public static extern IntPtr GetActiveWindow();
[DllImport(USER32, CharSet = CharSet.Unicode, ExactSpelling = true)]
public static extern IntPtr ChildWindowFromPointEx(IntPtr hwndParent, System.Drawing.Point pt, System.Windows.Forms.GetChildAtPointSkip uFlags);
[DllImport(USER32, CharSet = CharSet.Auto, ExactSpelling = true)]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool GetClientRect(IntPtr hWnd, [In, Out] ref NativeMethods.RECT rect);
public static IntPtr GetWindowLong(IntPtr hWnd, int nIndex)
{
if (IntPtr.Size == 4)
return GetWindowLong32(hWnd, nIndex);
return GetWindowLongPtr64(hWnd, nIndex);
}
[DllImport(USER32, EntryPoint = "GetWindowLong", CharSet = CharSet.Auto)]
public static extern IntPtr GetWindowLong32(IntPtr hWnd, int nIndex);
[DllImport(USER32, EntryPoint = "GetWindowLongPtr", CharSet = CharSet.Auto)]
public static extern IntPtr GetWindowLongPtr64(IntPtr hWnd, int nIndex);
[DllImport(USER32, ExactSpelling = true, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool GetWindowRect(IntPtr hWnd, out RECT lpRect);
[DllImport(USER32, ExactSpelling = true)]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool InvalidateRect(IntPtr hWnd, [In] ref NativeMethods.RECT rect, [MarshalAs(UnmanagedType.Bool)] bool bErase);
[DllImport(USER32, ExactSpelling = true)]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool InvalidateRect(IntPtr hWnd, IntPtr rect, [MarshalAs(UnmanagedType.Bool)] bool bErase);
[DllImport(USER32, ExactSpelling = true, CharSet = CharSet.Auto)]
public static extern int LoadString(IntPtr hInstance, int uID, out IntPtr lpBuffer, int nBufferMax);
[DllImport(USER32, CharSet = CharSet.Auto, ExactSpelling = true)]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool ScreenToClient(IntPtr hWnd, [In, Out] ref System.Drawing.Point lpPoint);
[DllImport(USER32, CharSet = CharSet.Unicode, SetLastError = false)]
public static extern IntPtr SendMessage(IntPtr hWnd, uint Msg, IntPtr wParam, IntPtr lParam);
[DllImport(USER32, CharSet = CharSet.Unicode, SetLastError = false)]
public static extern IntPtr SendMessage(IntPtr hWnd, uint Msg, int wParam, IntPtr lParam);
[DllImport(USER32, CharSet = CharSet.Unicode, SetLastError = false)]
public static extern IntPtr SendMessage(IntPtr hWnd, uint Msg, int wParam, int lParam);
public static IntPtr SendMessage(IntPtr hWnd, uint Msg, int wParam = 0) => SendMessage(hWnd, Msg, wParam, 0);
[DllImport(USER32, CharSet = CharSet.Unicode, SetLastError = false)]
public static extern IntPtr SendMessage(IntPtr hWnd, uint Msg, IntPtr wParam, ref RECT rect);
[DllImport(USER32, CharSet = CharSet.Unicode, SetLastError = false)]
public static extern IntPtr SendMessage(IntPtr hWnd, uint Msg, IntPtr wParam, [In, MarshalAs(UnmanagedType.LPWStr)] string lParam);
[DllImport(USER32, CharSet = CharSet.Unicode, SetLastError = false)]
public static extern IntPtr SendMessage(IntPtr hWnd, uint Msg, ref int wParam, [In, Out, MarshalAs(UnmanagedType.LPWStr)] System.Text.StringBuilder lParam);
public static IntPtr SetWindowLong(IntPtr hWnd, int nIndex, IntPtr dwNewLong)
{
if (IntPtr.Size == 4)
return SetWindowLongPtr32(hWnd, nIndex, dwNewLong);
return SetWindowLongPtr64(hWnd, nIndex, dwNewLong);
}
[DllImport(USER32, EntryPoint = "SetWindowLong", CharSet = CharSet.Auto)]
private static extern IntPtr SetWindowLongPtr32(IntPtr hWnd, int nIndex, IntPtr dwNewLong);
[DllImport(USER32, EntryPoint = "SetWindowLongPtr", CharSet = CharSet.Auto)]
private static extern IntPtr SetWindowLongPtr64(IntPtr hWnd, int nIndex, IntPtr dwNewLong);
/// <summary>
/// Special window handles
/// </summary>
public static class SpecialWindowHandles
{
/// <summary>Places the window at the top of the Z order.</summary>
/// <remarks>HWND_TOP</remarks>
public static IntPtr HwndTop = new IntPtr(0);
/// <summary>Places the window at the bottom of the Z order. If the hWnd parameter identifies a topmost window, the window loses its topmost status and is placed at the bottom of all other windows.</summary>
/// <remarks>HWND_BOTTOM</remarks>
public static IntPtr HwndBottom = new IntPtr(1);
/// <summary>Places the window above all non-topmost windows. The window maintains its topmost position even when it is deactivated.</summary>
/// <remarks>HWND_TOPMOST</remarks>
public static IntPtr HwndTopMost = new IntPtr(-1);
/// <summary>Places the window above all non-topmost windows (that is, behind all topmost windows). This flag has no effect if the window is already a non-topmost window.</summary>
/// <remarks>HWND_NOTOPMOST</remarks>
public static IntPtr HwndNoTopMost = new IntPtr(-2);
}
/// <summary>
/// Window sizing and positioning flags.
/// </summary>
[Flags]
public enum SetWindowPosFlags : uint
{
/// <summary>If the calling thread and the thread that owns the window are attached to different input queues,
/// the system posts the request to the thread that owns the window. This prevents the calling thread from
/// blocking its execution while other threads process the request.</summary>
/// <remarks>SWP_ASYNCWINDOWPOS</remarks>
AsynchronousWindowPosition = 0x4000,
/// <summary>Prevents generation of the WM_SYNCPAINT message.</summary>
/// <remarks>SWP_DEFERERASE</remarks>
DeferErase = 0x2000,
/// <summary>Draws a frame (defined in the window's class description) around the window.</summary>
/// <remarks>SWP_DRAWFRAME</remarks>
DrawFrame = 0x0020,
/// <summary>Applies new frame styles set using the SetWindowLong function. Sends a WM_NCCALCSIZE message to
/// the window, even if the window's size is not being changed. If this flag is not specified, WM_NCCALCSIZE
/// is sent only when the window's size is being changed.</summary>
/// <remarks>SWP_FRAMECHANGED</remarks>
FrameChanged = 0x0020,
/// <summary>Hides the window.</summary>
/// <remarks>SWP_HIDEWINDOW</remarks>
HideWindow = 0x0080,
/// <summary>Does not activate the window. If this flag is not set, the window is activated and moved to the
/// top of either the topmost or non-topmost group (depending on the setting of the hWndInsertAfter
/// parameter).</summary>
/// <remarks>SWP_NOACTIVATE</remarks>
DoNotActivate = 0x0010,
/// <summary>Discards the entire contents of the client area. If this flag is not specified, the valid
/// contents of the client area are saved and copied back into the client area after the window is sized or
/// repositioned.</summary>
/// <remarks>SWP_NOCOPYBITS</remarks>
DoNotCopyBits = 0x0100,
/// <summary>Retains the current position (ignores X and Y parameters).</summary>
/// <remarks>SWP_NOMOVE</remarks>
IgnoreMove = 0x0002,
/// <summary>Does not change the owner window's position in the Z order.</summary>
/// <remarks>SWP_NOOWNERZORDER</remarks>
DoNotChangeOwnerZOrder = 0x0200,
/// <summary>Does not redraw changes. If this flag is set, no repainting of any kind occurs. This applies to
/// the client area, the nonclient area (including the title bar and scroll bars), and any part of the parent
/// window uncovered as a result of the window being moved. When this flag is set, the application must
/// explicitly invalidate or redraw any parts of the window and parent window that need redrawing.</summary>
/// <remarks>SWP_NOREDRAW</remarks>
DoNotRedraw = 0x0008,
/// <summary>Same as the SWP_NOOWNERZORDER flag.</summary>
/// <remarks>SWP_NOREPOSITION</remarks>
DoNotReposition = 0x0200,
/// <summary>Prevents the window from receiving the WM_WINDOWPOSCHANGING message.</summary>
/// <remarks>SWP_NOSENDCHANGING</remarks>
DoNotSendChangingEvent = 0x0400,
/// <summary>Retains the current size (ignores the cx and cy parameters).</summary>
/// <remarks>SWP_NOSIZE</remarks>
IgnoreResize = 0x0001,
/// <summary>Retains the current Z order (ignores the hWndInsertAfter parameter).</summary>
/// <remarks>SWP_NOZORDER</remarks>
IgnoreZOrder = 0x0004,
/// <summary>Displays the window.</summary>
/// <remarks>SWP_SHOWWINDOW</remarks>
ShowWindow = 0x0040,
}
[DllImport(USER32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool SetWindowPos(IntPtr hWnd, IntPtr hWndInsertAfter, int X, int Y, int cx, int cy, SetWindowPosFlags uFlags);
[DllImport(USER32, CharSet = CharSet.Unicode)]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool SetWindowText(IntPtr hWnd, [MarshalAs(UnmanagedType.LPWStr)] string lpString);
[StructLayout(LayoutKind.Sequential)]
public struct WINDOWPOS
{
public IntPtr hwnd;
public IntPtr hwndInsertAfter;
public int x;
public int y;
public int cx;
public int cy;
public int flags;
}
[StructLayout(LayoutKind.Sequential)]
public struct NMHDR
{
public IntPtr hwndFrom;
public IntPtr idFrom;
public int code;
public override string ToString() => $"hwndFrom:{hwndFrom}; idFrom:{idFrom}; code:{code}";
}
}
}

Wyświetl plik

@ -0,0 +1,136 @@
// Requires USER32.cs
using Microsoft.Win32;
using System.ComponentModel;
using System.Drawing;
namespace System.Windows.Forms
{
/// <summary>
/// Implements a CommandLink button that can be used in WinForms user interfaces.
/// </summary>
[System.Drawing.ToolboxBitmap(typeof(Button))]
public abstract class VistaButtonBase : Button
{
private Icon icon;
private bool showShield = false;
/// <summary>
/// Initializes a new instance of the <see cref="CommandLink"/> class.
/// </summary>
public VistaButtonBase()
{
base.FlatStyle = Forms.FlatStyle.System;
}
/// <summary>
/// Gets or sets the flat style.
/// </summary>
/// <value>
/// The flat style.
/// </value>
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never), DefaultValue(typeof(Forms.FlatStyle), "System")]
public new Forms.FlatStyle FlatStyle
{
get { return base.FlatStyle; }
set { base.FlatStyle = value; }
}
/// <summary>
/// Gets or sets the icon that is displayed on a button control.
/// </summary>
[Description("Gets or sets the icon that is displayed on a button control."), Category("Appearance"), DefaultValue(null)]
public Icon Icon
{
get { return icon; }
set
{
icon = value;
if (value != null)
Image = null;
ShowShield = false;
SetImage();
}
}
/// <summary>
/// Gets or sets the image that is displayed on a button control.
/// </summary>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, ControlEvidence" />
/// <IPermission class="System.Diagnostics.PerformanceCounterPermission, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
/// </PermissionSet>
[Description("Gets or sets the image that is displayed on a button control."), Category("Appearance"), DefaultValue(null)]
public new Image Image
{
get { return base.Image; }
set
{
base.Image = value;
if (value != null)
Icon = null;
ShowShield = false;
SetImage();
}
}
/// <summary>
/// Gets or sets a value indicating whether to display an elevated shield icon.
/// </summary>
/// <value>
/// <c>true</c> if showing shield icon; otherwise, <c>false</c>.
/// </value>
[Description("Gets or sets whether if the control should use an elevated shield icon."), Category("Appearance"), DefaultValue(false)]
public bool ShowShield
{
get { return showShield; }
set
{
if (showShield != value && IsHandleCreated)
{
showShield = value;
SetShield(value);
}
}
}
internal static bool IsPlatformSupported => Environment.OSVersion.Version.Major >= 6;
/// <summary>
/// Raises the <see cref="E:System.Windows.Forms.Control.HandleCreated" /> event.
/// </summary>
/// <param name="e">An <see cref="T:System.EventArgs" /> that contains the event data.</param>
protected override void OnHandleCreated(EventArgs e)
{
base.OnHandleCreated(e);
SetShield(showShield);
SetImage();
}
/// <summary>
/// Refreshes the image displayed on the button
/// </summary>
private void SetImage()
{
if (IsHandleCreated)
{
IntPtr iconhandle = IntPtr.Zero;
if (Image != null)
iconhandle = new Bitmap(Image).GetHicon();
else if (icon != null)
iconhandle = Icon.Handle;
const int BM_SETIMAGE = 0xF7;
NativeMethods.SendMessage(Handle, BM_SETIMAGE, 1, iconhandle);
}
}
private void SetShield(bool value)
{
const uint BCM_SETSHIELD = 0x160C; //Elevated button
NativeMethods.SendMessage(Handle, BCM_SETSHIELD, IntPtr.Zero, value ? new IntPtr(1) : IntPtr.Zero);
Invalidate();
}
}
}

Wyświetl plik

@ -0,0 +1,279 @@
using AeroWizard;
namespace TestWizard
{
partial class OldStyleWizard
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.headerPanel = new System.Windows.Forms.Panel();
this.headerImage = new System.Windows.Forms.PictureBox();
this.subHeaderLabel = new System.Windows.Forms.Label();
this.headerLabel = new System.Windows.Forms.Label();
this.topDivider = new System.Windows.Forms.Label();
this.bottomDivider = new System.Windows.Forms.Label();
this.commandPanel = new System.Windows.Forms.Panel();
this.backButton = new System.Windows.Forms.Button();
this.nextButton = new System.Windows.Forms.Button();
this.cancelButton = new System.Windows.Forms.Button();
this.wizardPageContainer1 = new AeroWizard.WizardPageContainer();
this.wizardPage2 = new AeroWizard.WizardPage();
this.wizardPage3 = new AeroWizard.WizardPage();
this.wizardPage1 = new AeroWizard.WizardPage();
this.startEndPicture = new System.Windows.Forms.PictureBox();
this.label1 = new System.Windows.Forms.Label();
this.headerPanel.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.headerImage)).BeginInit();
this.commandPanel.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.wizardPageContainer1)).BeginInit();
this.wizardPageContainer1.SuspendLayout();
this.wizardPage1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.startEndPicture)).BeginInit();
this.SuspendLayout();
//
// headerPanel
//
this.headerPanel.BackColor = System.Drawing.SystemColors.Window;
this.headerPanel.Controls.Add(this.headerImage);
this.headerPanel.Controls.Add(this.subHeaderLabel);
this.headerPanel.Controls.Add(this.headerLabel);
this.headerPanel.Dock = System.Windows.Forms.DockStyle.Top;
this.headerPanel.Location = new System.Drawing.Point(0, 0);
this.headerPanel.Name = "headerPanel";
this.headerPanel.Size = new System.Drawing.Size(480, 57);
this.headerPanel.TabIndex = 2;
//
// headerImage
//
this.headerImage.Image = global::TestWizard.Properties.Resources.WizardHat_48;
this.headerImage.Location = new System.Drawing.Point(426, 4);
this.headerImage.Name = "headerImage";
this.headerImage.Size = new System.Drawing.Size(49, 49);
this.headerImage.TabIndex = 1;
this.headerImage.TabStop = false;
//
// subHeaderLabel
//
this.subHeaderLabel.AutoSize = true;
this.subHeaderLabel.Location = new System.Drawing.Point(12, 31);
this.subHeaderLabel.Name = "subHeaderLabel";
this.subHeaderLabel.Size = new System.Drawing.Size(74, 13);
this.subHeaderLabel.TabIndex = 0;
this.subHeaderLabel.Text = "<Sub-header>";
//
// headerLabel
//
this.headerLabel.AutoSize = true;
this.headerLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.headerLabel.Location = new System.Drawing.Point(12, 11);
this.headerLabel.Name = "headerLabel";
this.headerLabel.Size = new System.Drawing.Size(62, 13);
this.headerLabel.TabIndex = 0;
this.headerLabel.Text = "<Header>";
//
// topDivider
//
this.topDivider.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.topDivider.Dock = System.Windows.Forms.DockStyle.Top;
this.topDivider.Location = new System.Drawing.Point(0, 57);
this.topDivider.Name = "topDivider";
this.topDivider.Size = new System.Drawing.Size(480, 2);
this.topDivider.TabIndex = 3;
//
// bottomDivider
//
this.bottomDivider.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.bottomDivider.Dock = System.Windows.Forms.DockStyle.Bottom;
this.bottomDivider.Enabled = false;
this.bottomDivider.Location = new System.Drawing.Point(0, 313);
this.bottomDivider.Name = "bottomDivider";
this.bottomDivider.Size = new System.Drawing.Size(480, 2);
this.bottomDivider.TabIndex = 4;
//
// commandPanel
//
this.commandPanel.Controls.Add(this.backButton);
this.commandPanel.Controls.Add(this.nextButton);
this.commandPanel.Controls.Add(this.cancelButton);
this.commandPanel.Dock = System.Windows.Forms.DockStyle.Bottom;
this.commandPanel.Location = new System.Drawing.Point(0, 315);
this.commandPanel.Name = "commandPanel";
this.commandPanel.Size = new System.Drawing.Size(480, 40);
this.commandPanel.TabIndex = 5;
//
// backButton
//
this.backButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.backButton.Location = new System.Drawing.Point(171, 9);
this.backButton.Name = "backButton";
this.backButton.Size = new System.Drawing.Size(97, 23);
this.backButton.TabIndex = 2;
this.backButton.Tag = AeroWizard.WizardCommandButtonState.Disabled;
this.backButton.Text = "< Back";
this.backButton.UseVisualStyleBackColor = true;
//
// nextButton
//
this.nextButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.nextButton.Location = new System.Drawing.Point(270, 9);
this.nextButton.Name = "nextButton";
this.nextButton.Size = new System.Drawing.Size(97, 23);
this.nextButton.TabIndex = 3;
this.nextButton.Tag = AeroWizard.WizardCommandButtonState.Enabled;
this.nextButton.Text = "Next >";
this.nextButton.UseVisualStyleBackColor = true;
//
// cancelButton
//
this.cancelButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.cancelButton.Location = new System.Drawing.Point(373, 9);
this.cancelButton.Name = "cancelButton";
this.cancelButton.Size = new System.Drawing.Size(97, 23);
this.cancelButton.TabIndex = 4;
this.cancelButton.Tag = AeroWizard.WizardCommandButtonState.Disabled;
this.cancelButton.Text = "Cancel";
this.cancelButton.UseVisualStyleBackColor = true;
//
// wizardPageContainer1
//
this.wizardPageContainer1.BackButton = this.backButton;
this.wizardPageContainer1.BackButtonText = "< Back";
this.wizardPageContainer1.CancelButton = this.cancelButton;
this.wizardPageContainer1.CancelButtonText = "Cancel";
this.wizardPageContainer1.Controls.Add(this.wizardPage1);
this.wizardPageContainer1.Controls.Add(this.wizardPage2);
this.wizardPageContainer1.Controls.Add(this.wizardPage3);
this.wizardPageContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
this.wizardPageContainer1.Location = new System.Drawing.Point(164, 59);
this.wizardPageContainer1.Name = "wizardPageContainer1";
this.wizardPageContainer1.NextButton = this.nextButton;
this.wizardPageContainer1.Pages.Add(this.wizardPage1);
this.wizardPageContainer1.Pages.Add(this.wizardPage2);
this.wizardPageContainer1.Pages.Add(this.wizardPage3);
this.wizardPageContainer1.Size = new System.Drawing.Size(316, 254);
this.wizardPageContainer1.TabIndex = 0;
this.wizardPageContainer1.Finished += new System.EventHandler(this.wizardPageContainer1_Finished);
this.wizardPageContainer1.SelectedPageChanged += new System.EventHandler(this.wizardPageContainer1_SelectedPageChanged);
//
// wizardPage2
//
this.wizardPage2.Name = "wizardPage2";
this.wizardPage2.Size = new System.Drawing.Size(316, 254);
this.wizardPage2.TabIndex = 1;
this.wizardPage2.Tag = "";
this.wizardPage2.Text = "Page 2 - Middle|This is the middle page";
this.wizardPage2.Initialize += new System.EventHandler<AeroWizard.WizardPageInitEventArgs>(this.wizardPage2_Initialize);
//
// wizardPage3
//
this.wizardPage3.Name = "wizardPage3";
this.wizardPage3.Size = new System.Drawing.Size(316, 254);
this.wizardPage3.TabIndex = 2;
this.wizardPage3.Tag = "";
this.wizardPage3.Text = "Task Completed|You\'re all done!";
//
// wizardPage1
//
this.wizardPage1.Controls.Add(this.label1);
this.wizardPage1.Name = "wizardPage1";
this.wizardPage1.Size = new System.Drawing.Size(316, 254);
this.wizardPage1.TabIndex = 0;
this.wizardPage1.Text = "Welcom";
this.wizardPage1.Initialize += new System.EventHandler<AeroWizard.WizardPageInitEventArgs>(this.wizardPage1_Initialize);
//
// startEndPicture
//
this.startEndPicture.BackColor = System.Drawing.Color.Navy;
this.startEndPicture.BackgroundImage = global::TestWizard.Properties.Resources.WizardHat_48;
this.startEndPicture.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
this.startEndPicture.Dock = System.Windows.Forms.DockStyle.Left;
this.startEndPicture.Location = new System.Drawing.Point(0, 59);
this.startEndPicture.Name = "startEndPicture";
this.startEndPicture.Size = new System.Drawing.Size(164, 254);
this.startEndPicture.TabIndex = 6;
this.startEndPicture.TabStop = false;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(20, 17);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(95, 13);
this.label1.TabIndex = 0;
this.label1.Text = "<Introductory text>";
//
// OldStyleWizard
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.cancelButton;
this.ClientSize = new System.Drawing.Size(480, 355);
this.Controls.Add(this.wizardPageContainer1);
this.Controls.Add(this.startEndPicture);
this.Controls.Add(this.bottomDivider);
this.Controls.Add(this.commandPanel);
this.Controls.Add(this.topDivider);
this.Controls.Add(this.headerPanel);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "OldStyleWizard";
this.Text = "OldStyleWizard";
this.headerPanel.ResumeLayout(false);
this.headerPanel.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.headerImage)).EndInit();
this.commandPanel.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.wizardPageContainer1)).EndInit();
this.wizardPageContainer1.ResumeLayout(false);
this.wizardPage1.ResumeLayout(false);
this.wizardPage1.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.startEndPicture)).EndInit();
this.ResumeLayout(false);
}
#endregion
private AeroWizard.WizardPageContainer wizardPageContainer1;
private System.Windows.Forms.Panel headerPanel;
private System.Windows.Forms.Label topDivider;
private System.Windows.Forms.Label bottomDivider;
private System.Windows.Forms.Button backButton;
private System.Windows.Forms.Button cancelButton;
private AeroWizard.WizardPage wizardPage3;
private AeroWizard.WizardPage wizardPage2;
private AeroWizard.WizardPage wizardPage1;
private System.Windows.Forms.Button nextButton;
private System.Windows.Forms.Panel commandPanel;
private System.Windows.Forms.Label subHeaderLabel;
private System.Windows.Forms.Label headerLabel;
private System.Windows.Forms.PictureBox startEndPicture;
private System.Windows.Forms.PictureBox headerImage;
private System.Windows.Forms.Label label1;
}
}

Wyświetl plik

@ -0,0 +1,41 @@
using System;
using System.Windows.Forms;
using AeroWizard;
namespace TestWizard
{
public partial class OldStyleWizard : Form
{
public OldStyleWizard()
{
InitializeComponent();
}
private void wizardPageContainer1_Finished(object sender, EventArgs e)
{
Close();
}
private void wizardPageContainer1_SelectedPageChanged(object sender, EventArgs e)
{
string[] headers = new string[] { "" };
if (wizardPageContainer1.SelectedPage.Text != null)
headers = wizardPageContainer1.SelectedPage.Text.Split('|');
headerLabel.Text = headers[0];
if (headers.Length == 2)
subHeaderLabel.Text = headers[1];
}
private void wizardPage1_Initialize(object sender, AeroWizard.WizardPageInitEventArgs e)
{
headerPanel.Visible = topDivider.Visible = false;
startEndPicture.Visible = true;
}
private void wizardPage2_Initialize(object sender, AeroWizard.WizardPageInitEventArgs e)
{
headerPanel.Visible = topDivider.Visible = true;
startEndPicture.Visible = false;
}
}
}

Wyświetl plik

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

Wyświetl plik

@ -0,0 +1,19 @@
using System;
using System.Windows.Forms;
namespace TestWizard
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Main());
}
}
}

Wyświetl plik

@ -0,0 +1,35 @@
using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("TestWizard")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("CodePlex Community")]
[assembly: AssemblyProduct("TestWizard")]
[assembly: AssemblyCopyright("Copyright © 2013")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("1d4f4e11-cf96-43fa-afbf-07fba4c1bbe2")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyFileVersion("1.0.0.0")]

Wyświetl plik

@ -0,0 +1,73 @@
//------------------------------------------------------------------------------
// <auto-generated>
// Dieser Code wurde von einem Tool generiert.
// Laufzeitversion:4.0.30319.42000
//
// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
// der Code erneut generiert wird.
// </auto-generated>
//------------------------------------------------------------------------------
namespace TestWizard.Properties {
using System;
/// <summary>
/// Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw.
/// </summary>
// Diese Klasse wurde von der StronglyTypedResourceBuilder automatisch generiert
// -Klasse über ein Tool wie ResGen oder Visual Studio automatisch generiert.
// Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen
// mit der /str-Option erneut aus, oder Sie erstellen Ihr VS-Projekt neu.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("TestWizard.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle
/// Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
/// <summary>
/// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap WizardHat_48 {
get {
object obj = ResourceManager.GetObject("WizardHat_48", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
}
}

Wyświetl plik

@ -0,0 +1,124 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="WizardHat_48" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\WizardHat-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>

Wyświetl plik

@ -0,0 +1,26 @@
//------------------------------------------------------------------------------
// <auto-generated>
// Dieser Code wurde von einem Tool generiert.
// Laufzeitversion:4.0.30319.42000
//
// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
// der Code erneut generiert wird.
// </auto-generated>
//------------------------------------------------------------------------------
namespace TestWizard.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default {
get {
return defaultInstance;
}
}
}
}

Wyświetl plik

@ -0,0 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>

Plik binarny nie jest wyświetlany.

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 2.8 KiB

Wyświetl plik

@ -0,0 +1,285 @@
using AeroWizard;
namespace TestWizard
{
partial class TestWizBase
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(TestWizBase));
this.backBtn = new System.Windows.Forms.Button();
this.cancelBtn = new System.Windows.Forms.Button();
this.nextBtn = new System.Windows.Forms.Button();
this.wizardPageContainer1 = new AeroWizard.WizardPageContainer();
this.wizardPage1 = new AeroWizard.WizardPage();
this.label1 = new System.Windows.Forms.Label();
this.wizardPage2 = new AeroWizard.WizardPage();
this.checkBox1 = new System.Windows.Forms.CheckBox();
this.wizardPage3 = new AeroWizard.WizardPage();
this.label5 = new System.Windows.Forms.Label();
this.textBox1 = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.button1 = new System.Windows.Forms.Button();
((System.ComponentModel.ISupportInitialize)(this.wizardPageContainer1)).BeginInit();
this.wizardPageContainer1.SuspendLayout();
this.wizardPage1.SuspendLayout();
this.wizardPage2.SuspendLayout();
this.wizardPage3.SuspendLayout();
this.SuspendLayout();
//
// backBtn
//
this.backBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.backBtn.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
this.backBtn.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Silver;
this.backBtn.FlatAppearance.MouseOverBackColor = System.Drawing.Color.DarkGray;
this.backBtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.backBtn.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
this.backBtn.Location = new System.Drawing.Point(141, 434);
this.backBtn.Name = "backBtn";
this.backBtn.Size = new System.Drawing.Size(75, 23);
this.backBtn.TabIndex = 1;
this.backBtn.Tag = AeroWizard.WizardCommandButtonState.Disabled;
this.backBtn.Text = "&Back";
this.backBtn.UseVisualStyleBackColor = false;
//
// cancelBtn
//
this.cancelBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.cancelBtn.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
this.cancelBtn.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Silver;
this.cancelBtn.FlatAppearance.MouseOverBackColor = System.Drawing.Color.DarkGray;
this.cancelBtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.cancelBtn.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
this.cancelBtn.Location = new System.Drawing.Point(303, 434);
this.cancelBtn.Name = "cancelBtn";
this.cancelBtn.Size = new System.Drawing.Size(75, 23);
this.cancelBtn.TabIndex = 1;
this.cancelBtn.Tag = AeroWizard.WizardCommandButtonState.Disabled;
this.cancelBtn.Text = "&Cancel";
this.cancelBtn.UseVisualStyleBackColor = false;
this.cancelBtn.Click += new System.EventHandler(this.button1_Click);
//
// nextBtn
//
this.nextBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.nextBtn.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
this.nextBtn.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Silver;
this.nextBtn.FlatAppearance.MouseOverBackColor = System.Drawing.Color.DarkGray;
this.nextBtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.nextBtn.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
this.nextBtn.Location = new System.Drawing.Point(222, 434);
this.nextBtn.Name = "nextBtn";
this.nextBtn.Size = new System.Drawing.Size(75, 23);
this.nextBtn.TabIndex = 1;
this.nextBtn.Tag = AeroWizard.WizardCommandButtonState.Enabled;
this.nextBtn.Text = "&Next";
this.nextBtn.UseVisualStyleBackColor = false;
//
// wizardPageContainer1
//
this.wizardPageContainer1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.wizardPageContainer1.BackButton = this.backBtn;
this.wizardPageContainer1.CancelButton = this.cancelBtn;
this.wizardPageContainer1.Controls.Add(this.wizardPage1);
this.wizardPageContainer1.Controls.Add(this.wizardPage2);
this.wizardPageContainer1.Controls.Add(this.wizardPage3);
this.wizardPageContainer1.Location = new System.Drawing.Point(12, 93);
this.wizardPageContainer1.Name = "wizardPageContainer1";
this.wizardPageContainer1.NextButton = this.nextBtn;
this.wizardPageContainer1.Pages.Add(this.wizardPage1);
this.wizardPageContainer1.Pages.Add(this.wizardPage2);
this.wizardPageContainer1.Pages.Add(this.wizardPage3);
this.wizardPageContainer1.ShowProgressInTaskbarIcon = true;
this.wizardPageContainer1.Size = new System.Drawing.Size(366, 335);
this.wizardPageContainer1.TabIndex = 2;
this.wizardPageContainer1.Finished += new System.EventHandler(this.wizardPageContainer1_Finished);
this.wizardPageContainer1.SelectedPageChanged += new System.EventHandler(this.wizardPageContainer1_SelectedPageChanged);
//
// wizardPage1
//
this.wizardPage1.Controls.Add(this.label1);
this.wizardPage1.Name = "wizardPage1";
this.wizardPage1.Size = new System.Drawing.Size(366, 335);
this.wizardPage1.TabIndex = 0;
this.wizardPage1.Text = "Page 1";
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(3, 9);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(280, 13);
this.label1.TabIndex = 0;
this.label1.Text = "This is another wizard form that is totally customized.";
//
// wizardPage2
//
this.wizardPage2.AllowNext = false;
this.wizardPage2.Controls.Add(this.checkBox1);
this.wizardPage2.Name = "wizardPage2";
this.wizardPage2.Size = new System.Drawing.Size(366, 335);
this.wizardPage2.TabIndex = 1;
this.wizardPage2.Text = "Page 2";
//
// checkBox1
//
this.checkBox1.AutoSize = true;
this.checkBox1.Location = new System.Drawing.Point(4, 12);
this.checkBox1.Name = "checkBox1";
this.checkBox1.Size = new System.Drawing.Size(144, 17);
this.checkBox1.TabIndex = 0;
this.checkBox1.Text = "Click here to proceed...";
this.checkBox1.UseVisualStyleBackColor = true;
this.checkBox1.CheckedChanged += new System.EventHandler(this.checkBox1_CheckedChanged);
//
// wizardPage3
//
this.wizardPage3.Controls.Add(this.label5);
this.wizardPage3.Controls.Add(this.textBox1);
this.wizardPage3.Name = "wizardPage3";
this.wizardPage3.Size = new System.Drawing.Size(366, 335);
this.wizardPage3.TabIndex = 2;
this.wizardPage3.Text = "Page 3";
//
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(4, 6);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(64, 13);
this.label5.TabIndex = 1;
this.label5.Text = "Your name:";
//
// textBox1
//
this.textBox1.Location = new System.Drawing.Point(74, 3);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(247, 22);
this.textBox1.TabIndex = 0;
//
// label2
//
this.label2.AutoSize = true;
this.label2.Font = new System.Drawing.Font("Segoe UI", 15.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label2.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
this.label2.Location = new System.Drawing.Point(57, 15);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(189, 30);
this.label2.TabIndex = 3;
this.label2.Text = "My Cooler Wizard";
//
// label3
//
this.label3.Image = ((System.Drawing.Image)(resources.GetObject("label3.Image")));
this.label3.ImageAlign = System.Drawing.ContentAlignment.TopLeft;
this.label3.Location = new System.Drawing.Point(9, 4);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(52, 55);
this.label3.TabIndex = 4;
//
// label4
//
this.label4.AutoSize = true;
this.label4.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label4.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
this.label4.Location = new System.Drawing.Point(12, 69);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(97, 21);
this.label4.TabIndex = 3;
this.label4.Text = "<Heading>";
//
// button1
//
this.button1.BackColor = System.Drawing.Color.Crimson;
this.button1.FlatAppearance.BorderSize = 0;
this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.button1.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.button1.ForeColor = System.Drawing.Color.White;
this.button1.Location = new System.Drawing.Point(358, 0);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(27, 23);
this.button1.TabIndex = 5;
this.button1.Text = "X";
this.button1.UseVisualStyleBackColor = false;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// TestWizBase
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.DimGray;
this.ClientSize = new System.Drawing.Size(390, 469);
this.Controls.Add(this.button1);
this.Controls.Add(this.label3);
this.Controls.Add(this.label4);
this.Controls.Add(this.label2);
this.Controls.Add(this.wizardPageContainer1);
this.Controls.Add(this.cancelBtn);
this.Controls.Add(this.nextBtn);
this.Controls.Add(this.backBtn);
this.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.Name = "TestWizBase";
this.Text = "TestWizBase";
((System.ComponentModel.ISupportInitialize)(this.wizardPageContainer1)).EndInit();
this.wizardPageContainer1.ResumeLayout(false);
this.wizardPage1.ResumeLayout(false);
this.wizardPage1.PerformLayout();
this.wizardPage2.ResumeLayout(false);
this.wizardPage2.PerformLayout();
this.wizardPage3.ResumeLayout(false);
this.wizardPage3.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Button backBtn;
private System.Windows.Forms.Button cancelBtn;
private System.Windows.Forms.Button nextBtn;
private AeroWizard.WizardPageContainer wizardPageContainer1;
private AeroWizard.WizardPage wizardPage3;
private AeroWizard.WizardPage wizardPage2;
private System.Windows.Forms.CheckBox checkBox1;
private AeroWizard.WizardPage wizardPage1;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.Button button1;
}
}

Wyświetl plik

@ -0,0 +1,33 @@
using System;
using System.Windows.Forms;
namespace TestWizard
{
public partial class TestWizBase : Form
{
public TestWizBase()
{
InitializeComponent();
}
private void wizardPageContainer1_Finished(object sender, EventArgs e)
{
Close();
}
private void checkBox1_CheckedChanged(object sender, EventArgs e)
{
wizardPage2.AllowNext = checkBox1.Checked;
}
private void wizardPageContainer1_SelectedPageChanged(object sender, EventArgs e)
{
label4.Text = wizardPageContainer1.SelectedPage.Text;
}
private void button1_Click(object sender, EventArgs e)
{
Close();
}
}
}

Wyświetl plik

@ -0,0 +1,172 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="label3.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAqESURBVGhD7Zn5U9NnHsdBA+FKuAmGHIQkhBAg4Uog
HIFcHAkJgmBFQFAoXhQELQpWFEVKPahitfZCqx1tdcZuO9aeS7fbnc7s7tTu7NF2pzPsMTvT6Xbq7F/w
3s/zTUBgj+56NPzQz8wzgeT7zfd5Pc/neb8/z5OgH+PHCGzo/a/fF6NBwatBr1O+f1dGzFBjnWKv/y30
QbxwhCjKEbQqhF0f7Xs7sOFNFUXi1kQJ7Jqo74OY5YkN4KsqsEqYwq7d5Hs7sNFnyUjCa8MWfHy6Er2l
Mf8JYtMqQTIiM6wIT68AT5zLrrvh+yjwcbvOkIKrQ+W4cdCMWm3kcojooFW8O5GaSmRV2AnChpA0C/xr
YUUEy+XbVq0I/Z4MHN+SDVfmknSaCRFpoSh145PzCuzqLYK6xIbgiHh2jdd3SeCDg8iTxeIxN4PIgVsn
YB2cC+YLkW004eYTifjqYjK+e0+FpFwHVifnLJ+pgAcHkUsQO10anOjKQaNeCIHMAHHZI9jd58Ln5xPw
6aV0rN1Q7k+j4DnfrSsnOAiDNBbba9JxoluPLosEWd4erOvfjfaWUoRr7OBrqhGqqUEwP5rNwv/qIT9Y
+CFisK1ajeMEsdOlhblrFBJLC8IYQEYNB7AqVsEAVpSpzccMk83MNBl6nATRRRC1GkhM7iUAPKmJAdz2
3bJygnPcMI0DiQVu6AtMeNShwrEuA3qsMoizzDg2mMkBhKirELQ6lEHIfbeujJjliXQQ6l3QrH0MpX1T
MFps6LL5IA7Xi/DhZKIPIL0awVEiBtDnuzXwYWGyGa51QlTSDNP2Y6g79ias+56DzajEZqsSTxHEIU8y
pgbUqPRUzMvpinHluRBpIY2+G2rPDtgPXMLa0+/CNXkDxqYudJQL0VmRhkmCGKsX4+qTGiiNZgIIZhBs
8Qc0NgWHxSA8ywWRuQmFjx5F3fE30fDMB6iduI6Ktq14a78AndYYbLIQxBYDhmqlSFYbERQSwQAC7spz
ITIjhAY3cuo3Y/dTe9Ew/T4aCaD68FUM9FZjfKsSOlMhKvLEaC9XYGKzAXvdMiTGCBlAQF15lI1+RLYb
ScXrcGivHe/NVKLx7CwaznwAx+hlKGu6Eal1kISSiSmtUCkUaCtV4GinAQe9EmjjueIuICU2y907sco8
OKtMeHyrCZ8/m4A/XUnB2IWTBPA+bCMzkNs7EJHBAGqouaiUqIBUkoqNJakY79DjUL0U2oTAQPQFh8dA
V1KBd4Yi8ekxAb6gmufPV1Pw91tp+OajPOycHOZcOJwBaGupuXwyqrBAKlOhxZyKI5v0GGuQBwRiLlRe
BIHBg4ZmO24fF+KL5xPxl9ck+PYdJV6+1o+ygTNYQ7IaRgCKInJiP0Ao+UBIWiVBqLGhWI6xdj2OrEud
h/hB1gSnPBE5HiQUNWLvtlJ8diIaX76QhL9ek+LLmyZ4n74Fc+9JJJkaOIBPnxVj3y4TbGutPgByY56i
AsnJUjQWSnGoTY/xZgVMKbyHCsGs/wY/TgZ+ajEEuR6kVnfhhf2FOHRqBF3nXsMrl7vx3fsqeE7ehLFn
AvH5HrzcG4c/nIvH12+mIjG3agEgROUAL6UQgjAeGgqkONiag6PrlXAouDLjgUOM8qPXQGRcj8T8daT7
bsSbGqFv28/pfeMzP8W6cx9ybeTieXLiN5DXeQixBhcSsm34eDIee3YUIM9uWwqgqARtPSHg81CfL8GB
jTmY2KCCI+3BQszEqksgreihRdkNga4GUQYvZI5OlA2e5dJlHUnnPACTUebC+tZhROcw9amC3Wlaugb8
ACFpdgRRGULPuM0gvHkS7N+QjYkWNRxKDoKVG/fl1lMJOhvktu2QVW5FSlkn1TwOxNHo57SOoGb8Gue6
853nAGg2ao5eh655NwRZVdTxavAz3RxAqbMM8TnU8XkApR2rxQUIChXcoWfNMghPbgpGHsnCkxvT4VTy
OThq9wRhEYhpY+7sRap9BweRkLuWG30p6XvZ4DPc6LMRZx0ff/bgAkDV2FVo6nsRpXNSx2kW/AAHdmTj
xYPapQDSYvDk5bThT+DSRhjGu8NOPPY1Z+GYXQpzEndYcE8SOyu3bEZaVR8UDh9EdLYLsYUN0K3fg+oj
r2LD6Z+gb+oUxqafwJcko0PPnfW78CWoXD2IzGQA5AF+gMsH0jivmB6lzc62IuTbqDKVFHMgDMI/E14G
0aEV4ZNIPvLDuRO9/3sLKhdKMqCuHYCyup8gHuMghFnVkFjbYe47Be/ULXSevoJfPMHHZ1PR+OqCCL+6
Vobu86/COvwSUp2diKASm59Zi8xiC57vl+D3Z+Mxd3kNvn4jFf/4mQYHhooIoAihKqdvNlKoyKOBo6ZP
XxV8p8R3fHlP+wZLUqYF6a5BqGp2LUDEkapomwYpRa5wI81S5vpkEX53Jg5zr4jxzVvkwj/PQ/PoJKSV
rdwegZ/pwnRXEn55JAK/nY7ljln+dkOGj2YyfZ0mAL6S1Mm/qIOj1tzTiC8PS3x6CTTuPVAvghCbW5Df
Nc7pPMv9/qdP4dcTUVwdxFz4jWttqD/1Dsp2TXPHKmEZDIDSh5rObMFvpmLwxxd9hvftu0qkGSmF5GUI
lRWDT+uCQfDE+Qzgvjf9FnlxHTLqHke6ezelkh+CZsHQcRgeSh82+o+fHMf2My+h9dxNvH1lLS68OoD6
p9/mXFhEFWoYSeg8AFsDrOR4/bCM1KgU27qNaGsv5lQoPKMWYSSv8xD0fJZG9xVyUaYJGZ4haJZBZDTs
g2XoJRrpdxcUaL71PH/d78JPIsFYTwDUKd1dgJPb5YjLXiSjlDIhKfm0VtxLIOj59w0QxI+Kmc3vmFgG
McBBaBuHYdo5DRftfZdA0N9sR5a/eQxx+XUIYx6gq1sAWG5kPBr9SI2T1KqOIFwI1/gg6PH3D0BhSSvz
Qte4/y6Eax6iH2r3IHLaD6Ny+CLqTtzkFrXPhV8nFx5BDC34MOYB/w6AqQ6NfJTGDmF2PaKyvAsQfN+5
0QM7+Lph3DIGrXevH2LPXQhOmfqgrhuEvv0ISgfPw37wCqwjF2mGBiCkMiKMeQClUCjrPKUIG/VQRRki
FCWIyaknyEYqNxogYBA6DwfBi5YwgAd29BgdGim8bSTlWZgJUiYmr8s9gjm2yjVADryHSo42CKnkiEi3
cS1S44Ag3YqYrFokFLYgvuARxOWtR2xuEwch9EMIyfjomQ/8uIWDyKrfjtzW8SUQiz1C4djpKzms28gD
WOH3KFLKuyAu3Uwbm04kmzchqagNiaaNiyCaOYhofSN91oIokYw58UM5amFfOiXWl6J42xQyG0b+xSPS
nH4I2w7IFiC6F0F0kLT6IYxLIZIKGqjzctb5h35qbQmNEMxpnBtRtHUKWU0HFuRVWd23AMFVrwzCX4LP
QyRzEO0LECpaP2vynGAzTN/9gx65s+pwVl5UjdwNe2DqOQFD6xEyOgZBhd8CxNa7EGVbsIYglG5aJ95d
kJFRRiWmsB87AnKsMh9sm8mKrdkYWfodBqSsbIKmdgvyaEOTy9rGYSgsTZCbPWAp6O80222tmN/KFgcD
slBjozq6qLHOsvcfygL9MQITQUH/BJc6GSQWKR47AAAAAElFTkSuQmCC
</value>
</data>
</root>

Wyświetl plik

@ -0,0 +1,216 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{EAA3C12F-D499-476C-9500-524EAEE3373A}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>TestWizard</RootNamespace>
<AssemblyName>TestWizard</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<SccProjectName>
</SccProjectName>
<SccLocalPath>
</SccLocalPath>
<SccAuxPath>
</SccAuxPath>
<SccProvider>
</SccProvider>
<FileUpgradeFlags>
</FileUpgradeFlags>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
<OldToolsVersion>3.5</OldToolsVersion>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
<TargetFrameworkProfile>
</TargetFrameworkProfile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Design" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="AeroWizardTemplate.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="AeroWizardTemplate.Designer.cs">
<DependentUpon>AeroWizardTemplate.cs</DependentUpon>
</Compile>
<Compile Include="Main.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Main.Designer.cs">
<DependentUpon>Main.cs</DependentUpon>
</Compile>
<Compile Include="MyStepWizard.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="MyStepWizard.Designer.cs">
<DependentUpon>MyStepWizard.cs</DependentUpon>
</Compile>
<Compile Include="MyWizard.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="MyWizard.Designer.cs">
<DependentUpon>MyWizard.cs</DependentUpon>
</Compile>
<Compile Include="Native\CommandLink.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Native\RECT.cs" />
<Compile Include="Native\USER32.cs" />
<Compile Include="Native\VistaButtonBase.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="OldStyleWizard.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="OldStyleWizard.Designer.cs">
<DependentUpon>OldStyleWizard.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="CustomWizardTemplate.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="CustomWizardTemplate.Designer.cs">
<DependentUpon>CustomWizardTemplate.cs</DependentUpon>
</Compile>
<Compile Include="Win10Wiz.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Win10Wiz.Designer.cs">
<DependentUpon>Win10Wiz.cs</DependentUpon>
</Compile>
<Compile Include="TestWizBase.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="TestWizBase.Designer.cs">
<DependentUpon>TestWizBase.cs</DependentUpon>
</Compile>
<EmbeddedResource Include="AeroWizardTemplate.resx">
<DependentUpon>AeroWizardTemplate.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Main.resx">
<DependentUpon>Main.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="MyStepWizard.resx">
<DependentUpon>MyStepWizard.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="MyWizard.resx">
<DependentUpon>MyWizard.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="OldStyleWizard.resx">
<DependentUpon>OldStyleWizard.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime>
</Compile>
<EmbeddedResource Include="CustomWizardTemplate.resx">
<DependentUpon>CustomWizardTemplate.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Win10Wiz.resx">
<DependentUpon>Win10Wiz.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="TestWizBase.resx">
<DependentUpon>TestWizBase.cs</DependentUpon>
</EmbeddedResource>
<None Include="app.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
<Visible>False</Visible>
<ProductName>Windows Installer 3.1</ProductName>
<Install>true</Install>
</BootstrapperPackage>
</ItemGroup>
<ItemGroup>
<None Include="Resources\WizardHat-48.png" />
</ItemGroup>
<ItemGroup>
<WCFMetadata Include="Service References\" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\AeroWizard.csproj">
<Project>{199c12c4-3eef-4d08-bac3-f2a62bcf969c}</Project>
<Name>AeroWizard</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

Wyświetl plik

@ -0,0 +1,316 @@
using AeroWizard;
namespace TestWizard
{
partial class Win10Wiz
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.backBtn = new System.Windows.Forms.Button();
this.cancelBtn = new System.Windows.Forms.Button();
this.nextBtn = new System.Windows.Forms.Button();
this.wizardPageContainer1 = new AeroWizard.WizardPageContainer();
this.wizardPage2 = new AeroWizard.WizardPage();
this.checkBox1 = new System.Windows.Forms.CheckBox();
this.wizardPage3 = new AeroWizard.WizardPage();
this.label5 = new System.Windows.Forms.Label();
this.textBox1 = new System.Windows.Forms.TextBox();
this.label4 = new System.Windows.Forms.Label();
this.button1 = new System.Windows.Forms.Button();
this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components);
this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripMenuItem2 = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripMenuItem3 = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripMenuItem4 = new System.Windows.Forms.ToolStripMenuItem();
((System.ComponentModel.ISupportInitialize)(this.wizardPageContainer1)).BeginInit();
this.wizardPageContainer1.SuspendLayout();
this.wizardPage2.SuspendLayout();
this.wizardPage3.SuspendLayout();
this.flowLayoutPanel1.SuspendLayout();
this.contextMenuStrip1.SuspendLayout();
this.SuspendLayout();
//
// backBtn
//
this.backBtn.FlatAppearance.BorderSize = 0;
this.backBtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.backBtn.Font = new System.Drawing.Font("Segoe UI Symbol", 15.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.backBtn.ForeColor = System.Drawing.Color.White;
this.backBtn.Location = new System.Drawing.Point(3, 3);
this.backBtn.Name = "backBtn";
this.backBtn.Size = new System.Drawing.Size(47, 43);
this.backBtn.TabIndex = 1;
this.backBtn.Tag = AeroWizard.WizardCommandButtonState.Disabled;
this.backBtn.Text = "º";
this.backBtn.TextAlign = System.Drawing.ContentAlignment.TopLeft;
this.backBtn.UseVisualStyleBackColor = false;
//
// cancelBtn
//
this.cancelBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.cancelBtn.AutoSize = true;
this.cancelBtn.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.cancelBtn.FlatAppearance.BorderColor = System.Drawing.Color.White;
this.cancelBtn.FlatAppearance.BorderSize = 2;
this.cancelBtn.FlatAppearance.MouseDownBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(116)))), ((int)(((byte)(188)))));
this.cancelBtn.FlatAppearance.MouseOverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(31)))), ((int)(((byte)(57)))), ((int)(((byte)(92)))));
this.cancelBtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.cancelBtn.Font = new System.Drawing.Font("Segoe UI Semibold", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cancelBtn.ForeColor = System.Drawing.Color.White;
this.cancelBtn.Location = new System.Drawing.Point(661, 496);
this.cancelBtn.MinimumSize = new System.Drawing.Size(90, 0);
this.cancelBtn.Name = "cancelBtn";
this.cancelBtn.Size = new System.Drawing.Size(90, 34);
this.cancelBtn.TabIndex = 1;
this.cancelBtn.Tag = AeroWizard.WizardCommandButtonState.Disabled;
this.cancelBtn.Text = "&Cancel";
this.cancelBtn.UseVisualStyleBackColor = false;
this.cancelBtn.Click += new System.EventHandler(this.button1_Click);
//
// nextBtn
//
this.nextBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.nextBtn.AutoSize = true;
this.nextBtn.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.nextBtn.FlatAppearance.BorderColor = System.Drawing.Color.White;
this.nextBtn.FlatAppearance.BorderSize = 2;
this.nextBtn.FlatAppearance.MouseDownBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(116)))), ((int)(((byte)(188)))));
this.nextBtn.FlatAppearance.MouseOverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(31)))), ((int)(((byte)(57)))), ((int)(((byte)(92)))));
this.nextBtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.nextBtn.Font = new System.Drawing.Font("Segoe UI Semibold", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.nextBtn.ForeColor = System.Drawing.Color.White;
this.nextBtn.Location = new System.Drawing.Point(556, 496);
this.nextBtn.MinimumSize = new System.Drawing.Size(90, 0);
this.nextBtn.Name = "nextBtn";
this.nextBtn.Size = new System.Drawing.Size(90, 34);
this.nextBtn.TabIndex = 1;
this.nextBtn.Tag = AeroWizard.WizardCommandButtonState.Enabled;
this.nextBtn.Text = "&Next";
this.nextBtn.UseVisualStyleBackColor = false;
//
// wizardPageContainer1
//
this.wizardPageContainer1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.wizardPageContainer1.BackButton = this.backBtn;
this.wizardPageContainer1.BackButtonText = "º";
this.wizardPageContainer1.CancelButton = this.cancelBtn;
this.wizardPageContainer1.Controls.Add(this.wizardPage2);
this.wizardPageContainer1.Controls.Add(this.wizardPage3);
this.wizardPageContainer1.Location = new System.Drawing.Point(12, 93);
this.wizardPageContainer1.Name = "wizardPageContainer1";
this.wizardPageContainer1.NextButton = this.nextBtn;
this.wizardPageContainer1.Pages.Add(this.wizardPage2);
this.wizardPageContainer1.Pages.Add(this.wizardPage3);
this.wizardPageContainer1.ShowProgressInTaskbarIcon = true;
this.wizardPageContainer1.Size = new System.Drawing.Size(739, 399);
this.wizardPageContainer1.TabIndex = 2;
this.wizardPageContainer1.Finished += new System.EventHandler(this.wizardPageContainer1_Finished);
this.wizardPageContainer1.SelectedPageChanged += new System.EventHandler(this.wizardPageContainer1_SelectedPageChanged);
//
// wizardPage2
//
this.wizardPage2.AllowNext = false;
this.wizardPage2.Controls.Add(this.checkBox1);
this.wizardPage2.Name = "wizardPage2";
this.wizardPage2.Size = new System.Drawing.Size(739, 399);
this.wizardPage2.TabIndex = 1;
this.wizardPage2.Text = "Page 2";
//
// checkBox1
//
this.checkBox1.AutoSize = true;
this.checkBox1.Location = new System.Drawing.Point(4, 12);
this.checkBox1.Name = "checkBox1";
this.checkBox1.Size = new System.Drawing.Size(144, 17);
this.checkBox1.TabIndex = 0;
this.checkBox1.Text = "Click here to proceed...";
this.checkBox1.UseVisualStyleBackColor = true;
this.checkBox1.CheckedChanged += new System.EventHandler(this.checkBox1_CheckedChanged);
//
// wizardPage3
//
this.wizardPage3.Controls.Add(this.label5);
this.wizardPage3.Controls.Add(this.textBox1);
this.wizardPage3.Name = "wizardPage3";
this.wizardPage3.Size = new System.Drawing.Size(366, 335);
this.wizardPage3.TabIndex = 2;
this.wizardPage3.Text = "Page 3";
//
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(4, 6);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(64, 13);
this.label5.TabIndex = 1;
this.label5.Text = "Your name:";
//
// textBox1
//
this.textBox1.Location = new System.Drawing.Point(74, 3);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(247, 22);
this.textBox1.TabIndex = 0;
//
// label4
//
this.label4.AutoSize = true;
this.label4.Font = new System.Drawing.Font("Segoe UI", 20.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label4.ForeColor = System.Drawing.Color.White;
this.label4.Location = new System.Drawing.Point(56, 0);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(154, 37);
this.label4.TabIndex = 3;
this.label4.Text = "<Heading>";
//
// button1
//
this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.button1.BackColor = System.Drawing.Color.Crimson;
this.button1.FlatAppearance.BorderSize = 0;
this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.button1.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.button1.ForeColor = System.Drawing.Color.White;
this.button1.Location = new System.Drawing.Point(736, -1);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(27, 23);
this.button1.TabIndex = 5;
this.button1.Text = "X";
this.button1.UseVisualStyleBackColor = false;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// flowLayoutPanel1
//
this.flowLayoutPanel1.AutoSize = true;
this.flowLayoutPanel1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.flowLayoutPanel1.Controls.Add(this.backBtn);
this.flowLayoutPanel1.Controls.Add(this.label4);
this.flowLayoutPanel1.Location = new System.Drawing.Point(13, 13);
this.flowLayoutPanel1.Name = "flowLayoutPanel1";
this.flowLayoutPanel1.Size = new System.Drawing.Size(213, 49);
this.flowLayoutPanel1.TabIndex = 6;
//
// contextMenuStrip1
//
this.contextMenuStrip1.Font = new System.Drawing.Font("Webdings", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(2)));
this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.toolStripMenuItem1,
this.toolStripMenuItem2,
this.toolStripMenuItem3,
this.toolStripMenuItem4});
this.contextMenuStrip1.LayoutStyle = System.Windows.Forms.ToolStripLayoutStyle.Table;
this.contextMenuStrip1.Name = "contextMenuStrip1";
this.contextMenuStrip1.ShowImageMargin = false;
this.contextMenuStrip1.Size = new System.Drawing.Size(69, 100);
//
// toolStripMenuItem1
//
this.toolStripMenuItem1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
this.toolStripMenuItem1.Name = "toolStripMenuItem1";
this.toolStripMenuItem1.Size = new System.Drawing.Size(68, 24);
this.toolStripMenuItem1.Text = "9";
this.toolStripMenuItem1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// toolStripMenuItem2
//
this.toolStripMenuItem2.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
this.toolStripMenuItem2.Name = "toolStripMenuItem2";
this.toolStripMenuItem2.Size = new System.Drawing.Size(68, 24);
this.toolStripMenuItem2.Text = "3";
this.toolStripMenuItem2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// toolStripMenuItem3
//
this.toolStripMenuItem3.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
this.toolStripMenuItem3.Name = "toolStripMenuItem3";
this.toolStripMenuItem3.Size = new System.Drawing.Size(68, 24);
this.toolStripMenuItem3.Text = "4";
this.toolStripMenuItem3.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// toolStripMenuItem4
//
this.toolStripMenuItem4.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
this.toolStripMenuItem4.Name = "toolStripMenuItem4";
this.toolStripMenuItem4.Size = new System.Drawing.Size(68, 24);
this.toolStripMenuItem4.Text = ":";
this.toolStripMenuItem4.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// Win10Wiz
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(44)))), ((int)(((byte)(81)))), ((int)(((byte)(131)))));
this.ClientSize = new System.Drawing.Size(763, 542);
this.Controls.Add(this.flowLayoutPanel1);
this.Controls.Add(this.button1);
this.Controls.Add(this.wizardPageContainer1);
this.Controls.Add(this.cancelBtn);
this.Controls.Add(this.nextBtn);
this.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.ForeColor = System.Drawing.Color.White;
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.Name = "Win10Wiz";
this.Text = "TestWizBase";
((System.ComponentModel.ISupportInitialize)(this.wizardPageContainer1)).EndInit();
this.wizardPageContainer1.ResumeLayout(false);
this.wizardPage2.ResumeLayout(false);
this.wizardPage2.PerformLayout();
this.wizardPage3.ResumeLayout(false);
this.wizardPage3.PerformLayout();
this.flowLayoutPanel1.ResumeLayout(false);
this.flowLayoutPanel1.PerformLayout();
this.contextMenuStrip1.ResumeLayout(false);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Button backBtn;
private System.Windows.Forms.Button cancelBtn;
private System.Windows.Forms.Button nextBtn;
private AeroWizard.WizardPageContainer wizardPageContainer1;
private AeroWizard.WizardPage wizardPage3;
private AeroWizard.WizardPage wizardPage2;
private System.Windows.Forms.CheckBox checkBox1;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1;
private System.Windows.Forms.ContextMenuStrip contextMenuStrip1;
private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem1;
private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem2;
private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem3;
private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem4;
}
}

Some files were not shown because too many files have changed in this diff Show More