/// <summary> /// This method loads the movie, adds the flashobject to the controls /// controls list and puts a message filter into the Application /// message stack to push all messages sent to the flash object /// also to the owning parent. /// </summary> /// <param name="control">The <see cref="Control"/> this flash object /// should be hosted on.</param> /// <param name="recreateFlash"><strong>True</strong>, /// if this function is called from separate thread to avoid error.</param> /// <param name="graphicsTransform">A <see cref="Matrix"/> with the /// transform of the canvas to display this activeX object.</param> public void InitializeOnControl(Control control, bool recreateFlash, Matrix graphicsTransform) { if (recreateFlash) { if (this.flashControl != null) { this.flashControl.Dispose(); } this.flashControl = new AxFlashControl(); } this.flashControl.Bounds = GetTransformedBounds(graphicsTransform, this.Bounds); if (control.InvokeRequired) { control.Invoke(new AddDelegate(control.Controls.Add), this.flashControl); } else { control.Controls.Add(this.flashControl); } this.flashControl.Visible = true; // Put it in the background control.Controls.SetChildIndex(this.flashControl, control.Controls.Count - 1); this.LoadMovie(); // Initialize controls surface handle this.flashControl.CreateWindowHandle(); }
/// <summary> /// This method initializes member of this class. /// </summary> private void IntializeFields() { this.flashControl = new AxFlashControl(); this.currentTransform = new Matrix(); this.Filepath = string.Empty; this.Filename = string.Empty; this.disposing = false; }
public FlashWrapper(AxFlashControl axFlashControl) { _log = LogManager.GetLogger(GetType()); _axFlashControl = axFlashControl; if (_axFlashControl.IsHandleCreated) { Initialize(_axFlashControl); } else { _log.Debug("Handle is not created for AxFlashControl, wiring HandleCreated event"); _axFlashControl.HandleCreated += AxFlashControlOnHandleCreated; } }
public void Initialize(AxFlashControl axFlashControl) { _axFlashControl.FlashCall += AxShockwaveFlashOnFlashCall; _axFlashControl.PreviewKeyDown += AxShockwaveFlashPreviewKeyDown; _hostForm = _axFlashControl.FindForm(); }
public void Dispose() { if (_axFlashControl != null) { _axFlashControl.HandleCreated -= AxFlashControlOnHandleCreated; _axFlashControl.FlashCall -= AxShockwaveFlashOnFlashCall; _axFlashControl.PreviewKeyDown -= AxShockwaveFlashPreviewKeyDown; _axFlashControl = null; } _hostForm = null; FlashCall = null; UnhandledFlashCallback = null; PreviewKeyDown = null; }