hilowcard游戏的代码片段

hilowcard游戏的代码片段

本文介绍了hilowcard游戏的代码片段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我开始遇到问题的地方...

This is where I start having my problems...

public Card()
{
  int width = DefaultWidth;
  int height = DefaultHeight;
  mode = (int)CardMode.RankCollated;
  NativeMethods.cdtInit(ref width, ref height);
}
#region Implementation: IDisposable & Finaliser
/// <summary>
/// Instance finaliser for the class for unmanaged resources.
/// </summary>
~Card ()
{
  Dispose(false);
}
/// <summary>
/// Called by caller's when the instance is finished with.
/// </summary>
public void Dispose()
{
  Dispose(true);
  GC.SuppressFinalize(this);
}
/// <summary>
/// Internal dispose function which release managed and unmanaged resources.
/// </summary>
/// <param name="disposing">true iff managed and unmanaged are being disposed of else unmanaged only.</param>
private void Dispose( bool disposing )
{
  // Check to see if Dispose has already been called.
  if(!this.disposed)
  {
    // Call the appropriate methods to clean up
    // unmanaged resources here.
    // If disposing is false,  only the following code is executed.
    if( this.graphicsSurface != null && this.graphicsDC != IntPtr.Zero)
    {
      this.graphicsSurface.ReleaseHdc( this.graphicsDC );
      this.graphicsDC = IntPtr.Zero;
    }
    NativeMethods.cdtTerm();
    // If disposing equals true, dispose all managed
    // and unmanaged resources.
    if(disposing)
    {
      // Dispose managed resources.
      if( graphicsSurface != null )
      {
        graphicsSurface.Dispose();
      }
    }
  }
  this.disposed = true;
}
#endregion

推荐答案



这篇关于hilowcard游戏的代码片段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-15 14:13