Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
ennerperez committed May 29, 2016
2 parents d7c791c + c844806 commit 5544042
Show file tree
Hide file tree
Showing 19 changed files with 140 additions and 117 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ publish/
# NuGet v3's project.json files produces more ignoreable files
*.nuget.props
*.nuget.targets
.nuget/NuGet.exe

# Microsoft Azure Build Output
csx/
Expand Down Expand Up @@ -234,5 +235,4 @@ _Pvt_Extensions

# FAKE - F# Make
.fake/

*.ai
/.editoricon.ai
6 changes: 6 additions & 0 deletions .nuget/NuGet.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<solution>
<add key="disableSourceControlIntegration" value="true" />
</solution>
</configuration>
47 changes: 35 additions & 12 deletions .nuget/NuGet.targets
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
***********************************************************************************************
<Import Project="$(SolutionDir).nuget\NuGet.targets" Condition="Exists('$(SolutionDir).nuget\NuGet.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('$(SolutionDir).nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir).nuget\NuGet.targets'))" />
</Target>
***********************************************************************************************
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">$(MSBuildProjectDirectory)\..\</SolutionDir>
Expand All @@ -13,7 +24,11 @@
<RequireRestoreConsent Condition=" '$(RequireRestoreConsent)' != 'false' ">true</RequireRestoreConsent>

<!-- Download NuGet.exe if it does not already exist -->
<DownloadNuGetExe Condition=" '$(DownloadNuGetExe)' == '' ">false</DownloadNuGetExe>
<DownloadNuGetExe Condition=" '$(DownloadNuGetExe)' == '' ">true</DownloadNuGetExe>

<!-- Exclude files in BuildPackage command -->
<ExcludeFiles Condition="'$(BuildPackage)' "></ExcludeFiles>

</PropertyGroup>

<ItemGroup Condition=" '$(PackageSources)' == '' ">
Expand All @@ -36,22 +51,29 @@
</PropertyGroup>

<PropertyGroup>
<PackagesProjectConfig Condition=" '$(OS)' == 'Windows_NT'">$(MSBuildProjectDirectory)\packages.$(MSBuildProjectName.Replace(' ', '_')).config</PackagesProjectConfig>
<PackagesProjectConfig Condition=" '$(OS)' != 'Windows_NT'">$(MSBuildProjectDirectory)\packages.$(MSBuildProjectName).config</PackagesProjectConfig>
<PackagesProjectConfig>packages.$(MSBuildProjectName.Replace(' ', '_')).config</PackagesProjectConfig>
</PropertyGroup>

<PropertyGroup>
<PackagesConfig Condition="Exists('$(MSBuildProjectDirectory)\packages.config')">$(MSBuildProjectDirectory)\packages.config</PackagesConfig>
<PackagesConfig Condition="Exists('$(PackagesProjectConfig)')">$(PackagesProjectConfig)</PackagesConfig>
</PropertyGroup>
<Choose>
<When Condition="Exists('$(PackagesProjectConfig)')">
<PropertyGroup>
<PackagesConfig>$(PackagesProjectConfig)</PackagesConfig>
</PropertyGroup>
</When>
<When Condition="Exists('packages.config')">
<PropertyGroup>
<PackagesConfig>packages.config</PackagesConfig>
</PropertyGroup>
</When>
</Choose>

<PropertyGroup>
<!-- NuGet command -->
<NuGetExePath Condition=" '$(NuGetExePath)' == '' ">$(NuGetToolsPath)\NuGet.exe</NuGetExePath>
<PackageSources Condition=" $(PackageSources) == '' ">@(PackageSource)</PackageSources>

<NuGetCommand Condition=" '$(OS)' == 'Windows_NT'">"$(NuGetExePath)"</NuGetCommand>
<NuGetCommand Condition=" '$(OS)' != 'Windows_NT' ">mono --runtime=v4.0.30319 "$(NuGetExePath)"</NuGetCommand>
<NuGetCommand Condition=" '$(OS)' != 'Windows_NT' ">mono --runtime=v4.0.30319 $(NuGetExePath)</NuGetCommand>

<PackageOutputDir Condition="$(PackageOutputDir) == ''">$(TargetDir.Trim('\\'))</PackageOutputDir>

Expand All @@ -63,7 +85,8 @@

<!-- Commands -->
<RestoreCommand>$(NuGetCommand) install "$(PackagesConfig)" -source "$(PackageSources)" $(NonInteractiveSwitch) $(RequireConsentSwitch) -solutionDir $(PaddedSolutionDir)</RestoreCommand>
<BuildCommand>$(NuGetCommand) pack "$(ProjectPath)" -Properties "Configuration=$(Configuration);Platform=$(Platform)" $(NonInteractiveSwitch) -OutputDirectory "$(PackageOutputDir)"</BuildCommand>
<ExcludeArgs Condition="'$(ExcludeFiles)' != ''">-Exclude $(ExcludeFiles)</ExcludeArgs>
<BuildCommand>$(NuGetCommand) pack "$(ProjectPath)" $(ExcludeArgs) -Properties "Configuration=$(Configuration);Platform=$(Platform)" $(NonInteractiveSwitch) -OutputDirectory "$(PackageOutputDir)"</BuildCommand>

<!-- We need to ensure packages are restored prior to assembly resolve -->
<BuildDependsOn Condition="$(RestorePackages) == 'true'">
Expand All @@ -78,7 +101,7 @@
</BuildDependsOn>
</PropertyGroup>

<Target Name="CheckPrerequisites">
<Target Name="CheckPrerequisites" Condition=" '$(OS)' == 'Windows_NT'">
<!-- Raise an error if we're unable to locate nuget.exe -->
<Error Condition="'$(DownloadNuGetExe)' != 'true' AND !Exists('$(NuGetExePath)')" Text="Unable to locate '$(NuGetExePath)'" />
<!--
Expand All @@ -102,9 +125,9 @@
Condition="'$(OS)' == 'Windows_NT' And Exists('$(PackagesConfig)')" />
</Target>

<Target Name="BuildPackage" DependsOnTargets="CheckPrerequisites" Condition="Exists('$(ProjectDir)Package.nuspec') AND $(ConfigurationName) == 'Release'">
<Target Name="BuildPackage" DependsOnTargets="CheckPrerequisites" Condition="Exists('$(ProjectDir)Package.nuspec') AND $(ConfigurationName) == 'Release' ">
<Exec Command="$(BuildCommand)"
Condition=" '$(OS)' != 'Windows_NT' " />
Condition=" '$(OS)' != 'Windows_NT' " />

<Exec Command="$(BuildCommand)"
LogStandardErrorAsError="true"
Expand Down
15 changes: 11 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,36 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## [1.0.14] - 2016-04-26
## [1.0.15] - [2016-05-28]
### Fixed
- Generics extensions

## [1.0.14] - [2016-04-26]
### Changed
- NETFX40 Base migrated

### Fixed
- Build bug

## [1.0.12] - 2016-04-22
### Added
- Windows Forms Extensions

## [1.0.12] - [2016-04-22]
### Changed
- FontAwesome 4.6.1

### Removed
- Sample project

## [1.0.1] - 2016-04-04
## [1.0.1] - [2016-04-04]
### Changed
- Following [SemVer](http://semver.org) properly with AppVeyor.
- Solution build process

### Added
- AppVeyor integration

## [1.0.0] - 2016-03-02
## [1.0.0] - [2016-03-02]
### Added
- Fonts resources loader
- Custom font loader
Expand Down
12 changes: 6 additions & 6 deletions Pictograms.Forms/Extensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,34 +14,34 @@ public static class Extensions

public static void SetImage<T>(this Control @this, object type, int size = 0, Color? color = null, Brush brush = null) where T : Pictogram
{
var instance = Activator.CreateInstance<T>();
T instance = (T)Activator.CreateInstance(typeof(T), true);
SetImage(@this, instance, type, size, color, brush);
}
public static void SetText<T>(this Control @this, object type, float size = 0) where T : Pictogram
{
var instance = Activator.CreateInstance<T>();
T instance = (T)Activator.CreateInstance(typeof(T), true);
SetText(@this, instance, type, size);
}

public static void SetImage<T>(this Component @this, object type, int size = 0, Color? color = null, Brush brush = null) where T : Pictogram
{
var instance = Activator.CreateInstance<T>();
T instance = (T)Activator.CreateInstance(typeof(T), true);
SetImage(@this, instance, type, size, color, brush);
}
public static void SetText<T>(this Component @this, object type, float size = 0) where T : Pictogram
{
var instance = Activator.CreateInstance<T>();
T instance = (T)Activator.CreateInstance(typeof(T), true);
SetText(@this, instance, type, size);
}

public static void SetIcon<T>(this NotifyIcon @this, object type, int size = 0, Color? color = null, Brush brush = null) where T : Pictogram
{
var instance = Activator.CreateInstance<T>();
T instance = (T)Activator.CreateInstance(typeof(T), true);
SetIcon(@this, instance, type, size, color, brush);
}
public static void SetIcon<T>(this ImageList @this, object type, int size = 0, Color? color = null, Brush brush = null) where T : Pictogram
{
var instance = Activator.CreateInstance<T>();
T instance = (T)Activator.CreateInstance(typeof(T), true);
SetIcon(@this, instance, type, size, color, brush);
}

Expand Down
2 changes: 1 addition & 1 deletion Pictograms.Forms/Package.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<iconUrl>https://raw.githubusercontent.com/ennerperez/pictograms/master/.editoricon.png</iconUrl>
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<description>Introducing fonts based pictograms for .NET Windows Forms projects</description>
<summary />
<summary>$description$</summary>
<releaseNotes />
<copyright>$copyright$</copyright>
<language>en</language>
Expand Down
4 changes: 2 additions & 2 deletions Pictograms.Forms/Pictograms.Forms.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@
</None>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\.nuget\NuGet.targets" Condition="Exists('..\.nuget\NuGet.targets')" />
<Import Project="$(SolutionDir).nuget\NuGet.targets" Condition="Exists('$(SolutionDir).nuget\NuGet.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\.nuget\NuGet.targets'))" />
<Error Condition="!Exists('$(SolutionDir).nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir).nuget\NuGet.targets'))" />
</Target>
<!-- 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.
Expand Down
35 changes: 8 additions & 27 deletions Pictograms.Forms/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,42 +4,23 @@
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// La información general de un ensamblado se controla mediante el siguiente
// conjunto de atributos. Cambie estos valores de atributo para modificar la información
// asociada con un ensamblado.

[assembly: AssemblyTitle("Pictograms Forms")]
[assembly: AssemblyDescription("Fonts based pictograms for .NET (WinForms)")]
#if DEBUG
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyConfiguration("DEBUG")]
#else
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyConfiguration("RELEASE")]
#endif
[assembly: AssemblyCompany("Enner Pérez")]
[assembly: AssemblyProduct("Pictograms Forms")]
[assembly: AssemblyCopyright("© Enner Pérez. All rights reserved.")]
[assembly: AssemblyTrademark("© Enner Pérez")]

// Si establece ComVisible en false, los tipos de este ensamblado no estarán visibles
// para los componentes COM. Si necesita obtener acceso a un tipo de este ensamblado desde
// COM, establezca el atributo ComVisible en true en este tipo.
[assembly: AssemblyCopyright("Copyright © Enner Pérez")]
[assembly: AssemblyTrademark("Pictograms Forms")]

[assembly: ComVisible(true)]

// El siguiente GUID sirve como id. de typelib si este proyecto se expone a COM.
[assembly: Guid("45872aa9-7722-49b4-864d-b03f11ab5b3f")]
[assembly: Guid("45872AA9-7722-49B4-864D-B03F11AB5B3F")]

// La información de versión de un ensamblado consta de los cuatro valores siguientes:
//
// Versión principal
// Versión secundaria
// Número de compilación
// Revisión
//
// Puede especificar todos los valores o usar los valores predeterminados de número de compilación y de revisión
// mediante el carácter '*', como se muestra a continuación:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: NeutralResourcesLanguage("en")]

[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0")]
//[assembly: AssemblyInformationalVersion("1.0.0-master")]
2 changes: 1 addition & 1 deletion Pictograms/Package.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<iconUrl>https://raw.githubusercontent.com/ennerperez/pictograms/master/.editoricon.png</iconUrl>
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<description>Introducing fonts based pictograms for .NET solutions</description>
<summary />
<summary>$description$</summary>
<releaseNotes />
<copyright>$copyright$</copyright>
<language>en</language>
Expand Down
7 changes: 7 additions & 0 deletions Pictograms/Pictogram.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ namespace System.Drawing
public class Pictogram : IDisposable
{

internal static Pictogram instance;

public static T GetInstance<T>() where T: Pictogram
{
return (T)instance;
}

public Pictogram()
{
}
Expand Down
14 changes: 3 additions & 11 deletions Pictograms/Pictograms.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,6 @@
<Service Include="{94E38DFF-614B-4cbd-B67C-F211BB35CE8B}" />
</ItemGroup>
<ItemGroup>
<None Include="..\CHANGELOG.md">
<Link>CHANGELOG.md</Link>
</None>
<None Include="..\LICENSE">
<Link>LICENSE</Link>
</None>
<None Include="..\README.md">
<Link>README.md</Link>
</None>
<None Include="Fonts\fontawesome-webfont.ttf" />
<None Include="Fonts\foundation-icons.ttf" />
<None Include="Fonts\linearicons-free.ttf" />
Expand All @@ -73,15 +64,16 @@
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\.nuget\NuGet.targets" Condition="Exists('..\.nuget\NuGet.targets')" />
<Import Project="$(SolutionDir).nuget\NuGet.targets" Condition="Exists('$(SolutionDir).nuget\NuGet.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\.nuget\NuGet.targets'))" />
<Error Condition="!Exists('$(SolutionDir).nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir).nuget\NuGet.targets'))" />
</Target>
<!-- 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.
Expand Down
8 changes: 5 additions & 3 deletions Pictograms/Pictograms/FontAwesome.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ public class FontAwesome : Pictogram

#region Singleton

private static FontAwesome instance;

/// <summary>
/// Initializes the <see cref="Icon" /> class by loading the font from resources upon first use.
/// </summary>
Expand All @@ -31,12 +29,16 @@ public static FontAwesome Instance
{
if (instance == null)
instance = new FontAwesome();
return instance;
return (FontAwesome)instance;
}
}

#endregion

public FontAwesome(bool @default) : this()
{
}

#region Statics

public static Image GetImage(IconType type, int size, Brush brush)
Expand Down
8 changes: 5 additions & 3 deletions Pictograms/Pictograms/Foundation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ public class Foundation : Pictogram

#region Singleton

private static Foundation instance;

/// <summary>
/// Initializes the <see cref="Icon" /> class by loading the font from resources upon first use.
/// </summary>
Expand All @@ -30,12 +28,16 @@ public static Foundation Instance
{
if (instance == null)
instance = new Foundation();
return instance;
return (Foundation)instance;
}
}

#endregion

public Foundation(bool @default) : this()
{
}

#region Statics

public static Image GetImage(IconType type, int size, Brush brush)
Expand Down
Loading

0 comments on commit 5544042

Please sign in to comment.