Skip to content

Commit

Permalink
Code updated
Browse files Browse the repository at this point in the history
  • Loading branch information
arthurits committed Jun 18, 2020
1 parent 9e77e97 commit 129787c
Show file tree
Hide file tree
Showing 13 changed files with 112 additions and 126 deletions.
11 changes: 1 addition & 10 deletions Board/Board.cs
Original file line number Diff line number Diff line change
Expand Up @@ -371,8 +371,7 @@ protected override void OnResize(EventArgs e)
_nDiameter = (int)(_nMinDimension * _fNumbersFactor);

var form = FindForm();
if (form == null) return;
if (form.WindowState == FormWindowState.Minimized) return;
if (form == null || form.WindowState == FormWindowState.Minimized) return;

// Update the controls if the board is not shrunk
if (_nMinDimension != 0)
Expand Down Expand Up @@ -433,27 +432,19 @@ private async Task PictureBoxResultUpdate()
//bmpCorrect = DrawSVG(_svgCorrect, this.pctCorrect.Width, this.pctCorrect.Height);
//bmpWrong = DrawSVG(_svgWrong, this.pctWrong.Width, this.pctWrong.Height);

System.Diagnostics.Debug.WriteLine("Mark stamp #1");
await Task.Run(() =>
{
System.Diagnostics.Debug.WriteLine("Mark stamp #2");
rgCorrect = new Region(GetRegionFromTransparentBitmap(bmpCorrect));
rgWrong = new Region(GetRegionFromTransparentBitmap(bmpWrong));
System.Diagnostics.Debug.WriteLine("pctWrong size {0}x{1}", pctWrong.Width, pctWrong.Height);
System.Diagnostics.Debug.WriteLine("bmpWrong size {0}x{1}", bmpWrong.Width, bmpWrong.Height);
System.Diagnostics.Debug.WriteLine("Mark stamp #3");

this.pctCorrect.Image = bmpCorrect;
if (this.pctCorrect.InvokeRequired) this.pctCorrect.Invoke((Action)(() => this.pctCorrect.Region = rgCorrect));
else this.pctCorrect.Region = rgCorrect;
this.pctWrong.Image = bmpWrong;
if (this.pctWrong.InvokeRequired) this.pctWrong.Invoke((Action)(() => this.pctWrong.Region = rgWrong));
else this.pctWrong.Region = rgWrong;

});
System.Diagnostics.Debug.WriteLine("Mark stamp #4");


}

}
Expand Down
1 change: 0 additions & 1 deletion MemoryNumbers/Game.cs
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,6 @@ public class OverEventArgs : EventArgs

#endregion Events

//if (GameOver != null) OnGameOver(new OverEventArgs(_nScore));

public Game()
{
Expand Down
19 changes: 5 additions & 14 deletions MemoryNumbers/MemoryNumbers.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -75,17 +75,11 @@
<Compile Include="clsApplicationSettings.cs" />
<Compile Include="clsTablessTabControl.cs" />
<Compile Include="clsUtilities.cs" />
<Compile Include="Form1.cs">
<Compile Include="frmMain.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Form1.Designer.cs">
<DependentUpon>Form1.cs</DependentUpon>
</Compile>
<Compile Include="Form2.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Form2.Designer.cs">
<DependentUpon>Form2.cs</DependentUpon>
<Compile Include="frmMain.Designer.cs">
<DependentUpon>frmMain.cs</DependentUpon>
</Compile>
<Compile Include="frmAbout.cs">
<SubType>Form</SubType>
Expand All @@ -103,11 +97,8 @@
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Win32.cs" />
<EmbeddedResource Include="Form1.resx">
<DependentUpon>Form1.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Form2.resx">
<DependentUpon>Form2.cs</DependentUpon>
<EmbeddedResource Include="frmMain.resx">
<DependentUpon>frmMain.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="frmAbout.resx">
<DependentUpon>frmAbout.cs</DependentUpon>
Expand Down
2 changes: 1 addition & 1 deletion MemoryNumbers/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
Application.Run(new frmMain());
}
}
}
10 changes: 5 additions & 5 deletions MemoryNumbers/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
// conjunto de atributos. Cambie estos valores de atributo para modificar la información
// asociada con un ensamblado.
[assembly: AssemblyTitle("MemoryNumbers")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyDescription("Short-term memory game")]
[assembly: AssemblyConfiguration("Winddows 10 x64")]
[assembly: AssemblyCompany("Alf Interactive Entertainment Ltd.")]
[assembly: AssemblyProduct("MemoryNumbers")]
[assembly: AssemblyCopyright("Copyright © 2020")]
[assembly: AssemblyCopyright("Copyright © 2020")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

Expand All @@ -32,5 +32,5 @@
// Puede especificar todos los valores o utilizar los números de compilación y de revisión predeterminados
// mediante el carácter '*', como se muestra a continuación:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.1")]
[assembly: AssemblyFileVersion("1.0.0.1")]
[assembly: AssemblyVersion("1.1.0.0")]
[assembly: AssemblyFileVersion("1.1.0.0")]
5 changes: 3 additions & 2 deletions MemoryNumbers/frmAbout.Designer.cs

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

2 changes: 1 addition & 1 deletion MemoryNumbers/frmAbout.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public frmAbout()
InitializeComponent();
// this.Text = String.Format("About {0}", AssemblyTitle);
this.labelProductName.Text = AssemblyProduct;
this.labelVersion.Text = String.Format("Versión {0}", AssemblyVersion);
this.labelVersion.Text = String.Format("Version {0}", AssemblyVersion);
this.labelCopyright.Text = AssemblyCopyright;
this.labelCompanyName.Text = AssemblyCompany;
this.textBoxDescription.Text = AssemblyDescription;
Expand Down

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

19 changes: 7 additions & 12 deletions MemoryNumbers/Form1.cs → MemoryNumbers/frmMain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

namespace MemoryNumbers
{
public partial class Form1 : Form
public partial class frmMain : Form
{
//RoundButton.RoundButton btn = new RoundButton.RoundButton();
Game _game = new Game();
Expand All @@ -25,7 +25,7 @@ public partial class Form1 : Form
private ProgramSettings<string, string> _defaultSettings;
private static readonly string _programSettingsFileName = @"Configuration.xml";

public Form1()
public frmMain()
{
// Set form icon
_path = Path.GetDirectoryName(System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName);
Expand All @@ -39,32 +39,27 @@ public Form1()
InitializeStatusStrip();
InitializeChartStats();

// Initialization extras
splitStats.SplitterWidth = 1; // This is a known bug

//board1.Parent = this;

// Subscribe to events
//countDown1.TimerEnding += new EventHandler<Controls.TimerEndingEventArgs>(OnTimerEnding);
board1.ButtonClick += new EventHandler<Board.ButtonClickEventArgs>(OnButtonClick);
//board1.RightSequence += new EventHandler<Board.SequenceEventArgs>(OnCorrectSequence);
//board1.WrongSequence += new EventHandler<Board.SequenceEventArgs>(OnWrongSequence);

_game.CorrectSequence += new EventHandler<Game.CorrectEventArgs>(OnCorrectSequence);
_game.WrongSequence += new EventHandler<Game.WrongEventArgs>(OnWrongSequence);
_game.GameOver += new EventHandler<Game.OverEventArgs>(OnGameOver);
//_game.CorrectSequence += async (object s, Game.CorrectEventArgs e) => await OnCorrectSequence(s, e);
//_game.WrongSequence += async (object s, Game.WrongEventArgs e) => await OnWrongSequence(s, e);
//_game.GameOver += async (object s, Game.OverEventArgs e) => await OnGameOver(s, e);

// Read the program settings file and apply them
// Read the program settings file
LoadProgramSettings(ref _programSettings);

// Load defalut settings
_defaultSettings = new ProgramSettings<string, string>();
LoadDefaultSettings(_defaultSettings);

// Apply settings
if (_programSettings == null) _programSettings = _defaultSettings;

ApplySettings(_programSettings, _defaultSettings, true);

}

#region Initialization routines
Expand Down
File renamed without changes.
Loading

0 comments on commit 129787c

Please sign in to comment.