Skip to content

Commit

Permalink
Add Carubbi.Cards.WinForms
Browse files Browse the repository at this point in the history
  • Loading branch information
rcarubbi committed Nov 4, 2018
1 parent b3a7622 commit fc3a3d9
Show file tree
Hide file tree
Showing 9 changed files with 242 additions and 4 deletions.
36 changes: 36 additions & 0 deletions Carubbi.Cards.WinForms/CardBox.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

73 changes: 73 additions & 0 deletions Carubbi.Cards.WinForms/CardBox.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
using Carubbi.Cards;
using System;
using System.Drawing;
using System.Windows.Forms;

namespace Carubbi.Cards.WinForms
{
public partial class CardBox : PictureBox
{
public CardBox()
{
InitializeComponent();
}

protected override void OnPaint(PaintEventArgs pe)
{
base.OnPaint(pe);
if (DesignMode && BackgroundImage == null)
{
BackgroundImage = Resources.Back;
Width = Resources.Back.Width;
Height = Resources.Back.Height;
}
}


private Card _card;

public Card Card
{
get => _card;
set
{
_card = value;
if (_card != null)
{

_card.closed += _card_changed;
_card.opened += _card_changed;
BackgroundImage = _card.Image;
Width = _card.Image.Width;
Height = _card.Image.Height;
BringToFront();

}
else
{
BackgroundImage = null;
BackColor = Color.Transparent;

}
Invalidate();

}
}

private void _card_changed(object sender, EventArgs e)
{
if (_card != null)
{
BackgroundImage = _card.Image;
Width = _card.Image.Width;
Height = _card.Image.Height;
}
else
{
BackgroundImage = null;
}
BringToFront();
Refresh();
}
}
}
62 changes: 62 additions & 0 deletions Carubbi.Cards.WinForms/Carubbi.Cards.WinForms.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<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>
<ProjectGuid>{86F4F039-0057-43F9-AA70-0BDF4BE1FB19}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Carubbi.Cards.WinForms</RootNamespace>
<AssemblyName>Carubbi.Cards.WinForms</AssemblyName>
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
</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="Carubbi.Cards, Version=1.1.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Carubbi.Cards.1.1.0\lib\net461\Carubbi.Cards.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="CardBox.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="CardBox.Designer.cs">
<DependentUpon>CardBox.cs</DependentUpon>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="Carubbi.Cards.WinForms.nuspec" />
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
17 changes: 17 additions & 0 deletions Carubbi.Cards.WinForms/Carubbi.Cards.WinForms.nuspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0"?>
<package >
<metadata>
<id>$id$</id>
<version>$version$</version>
<title>$title$</title>
<authors>Raphael Carubbi Neto</authors>
<owners>Raphael Carubbi Neto</owners>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>WinForms Visual Components do use with Carubbi.Cards</description>
<releaseNotes></releaseNotes>
<copyright>Copyright Carubbi Consultoria e Tecnologia 2018</copyright>
<tags>poker, card game</tags>
</metadata>
</package>


36 changes: 36 additions & 0 deletions Carubbi.Cards.WinForms/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -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("Carubbi.Cards.WinForms")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Carubbi.Cards.WinForms")]
[assembly: AssemblyCopyright("Copyright © 2018")]
[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("86f4f039-0057-43f9-aa70-0bdf4be1fb19")]

// 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")]
4 changes: 4 additions & 0 deletions Carubbi.Cards.WinForms/packages.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Carubbi.Cards" version="1.1.0" targetFramework="net462" />
</packages>
6 changes: 6 additions & 0 deletions Carubbi.Cards.sln
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Carubbi.Truco.UI", "Carubbi
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Carubbi.RobaMonte", "Carubbi.RobaMonte\Carubbi.RobaMonte.csproj", "{9BE2F5C1-32ED-44DA-BDA4-90C82E27BF4D}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Carubbi.Cards.WinForms", "Carubbi.Cards.WinForms\Carubbi.Cards.WinForms.csproj", "{86F4F039-0057-43F9-AA70-0BDF4BE1FB19}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -81,6 +83,10 @@ Global
{9BE2F5C1-32ED-44DA-BDA4-90C82E27BF4D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9BE2F5C1-32ED-44DA-BDA4-90C82E27BF4D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9BE2F5C1-32ED-44DA-BDA4-90C82E27BF4D}.Release|Any CPU.Build.0 = Release|Any CPU
{86F4F039-0057-43F9-AA70-0BDF4BE1FB19}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{86F4F039-0057-43F9-AA70-0BDF4BE1FB19}.Debug|Any CPU.Build.0 = Debug|Any CPU
{86F4F039-0057-43F9-AA70-0BDF4BE1FB19}.Release|Any CPU.ActiveCfg = Release|Any CPU
{86F4F039-0057-43F9-AA70-0BDF4BE1FB19}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
8 changes: 4 additions & 4 deletions Carubbi.SlotCard.UI/Carubbi.SlotCard.UI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="Carubbi.Cards, Version=1.1.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Carubbi.Cards.1.1.0\lib\net461\Carubbi.Cards.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
Expand Down Expand Up @@ -95,6 +98,7 @@
<DesignTime>True</DesignTime>
</Compile>
<None Include="app.config" />
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
Expand All @@ -106,10 +110,6 @@
</Compile>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Carubbi.Cards\Carubbi.Cards.csproj">
<Project>{1491ED5C-868B-4E08-AF44-4F2C4C7AEF7E}</Project>
<Name>Carubbi.Cards</Name>
</ProjectReference>
<ProjectReference Include="..\Carubbi.SlotCard\Carubbi.SlotCard.csproj">
<Project>{FD3F4BE7-0A7F-4AD6-AA94-9CDC593A5F96}</Project>
<Name>Carubbi.SlotCard</Name>
Expand Down
4 changes: 4 additions & 0 deletions Carubbi.SlotCard.UI/packages.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Carubbi.Cards" version="1.1.0" targetFramework="net461" />
</packages>

0 comments on commit fc3a3d9

Please sign in to comment.