/// <summary> /// DisplayEvent is raised when a bitmap is ready. A copy of the bitmap and /// no. of copies of the page are passed as event variables. A handler can /// pick up these variables /// </summary> /// <param name="page">No. of Copies.</param> private void RaiseBitmapAvailableEvent(int page) { DisplayEvent de = new DisplayEvent { bmp = _bitmap.Clone() as Bitmap, pageNo = page }; OnBitmapReadyHandler(this, de); }
/// <summary> /// if handler for GSDisplay event is implemented, then that event is called. /// </summary> /// <param name="obj">Sender</param> /// <param name="e">DisplayEvent variable</param> public virtual void OnBitmapReadyHandler(object obj, DisplayEvent e) //Same delegate signature as DisplayEventHandler delegate { DisplayCallbackEventHandler?.Invoke(this, e); /* Simplified code is provided above * DisplayEventHandler handler = DisplayCallbackEventHandler; //Attach calling program handle here * if (handler != null) * { * handler(this, e); * } */ }