public static FindSurface GetInstance() { if (instance == null) { instance = new FindSurface(); if (instance.context == IntPtr.Zero) { instance = null; // Failed to Initialized... } } return(instance); }
public static FindSurface GetInstance(ref FS_CONTEXT_CREATION_ERROR err) { if (instance == null) { FS_CONTEXT_CREATION_ERROR ret = FS_CONTEXT_CREATION_ERROR.FS_NO_ERROR; instance = new FindSurface(ref ret); if (ret != FS_CONTEXT_CREATION_ERROR.FS_NO_ERROR || instance.context == IntPtr.Zero) { instance = null; // Failed to Initialized... err = ret; } } else { err = FS_CONTEXT_CREATION_ERROR.FS_NO_ERROR; } return(instance); }