public ButtonHoverCellType1(NSImage aImageBkgd, NSImage aImageButtonUp, NSImage aImageButtonDown) { // a non-toggle button iImageBkgdOff = aImageBkgd; iImageButtonOffUp = aImageButtonUp; iImageButtonOffDown = aImageButtonDown; iImageBkgdOff.Retain(); iImageButtonOffUp.Retain(); iImageButtonOffDown.Retain(); }
public ButtonHoverCellType1(NSImage aImageBkgdOff, NSImage aImageButtonOffUp, NSImage aImageButtonOffDown, NSImage aImageBkgdOn, NSImage aImageButtonOnUp, NSImage aImageButtonOnDown) { // a toggle button iImageBkgdOff = aImageBkgdOff; iImageButtonOffUp = aImageButtonOffUp; iImageButtonOffDown = aImageButtonOffDown; iImageBkgdOn = aImageBkgdOn; iImageButtonOnUp = aImageButtonOnUp; iImageButtonOnDown = aImageButtonOnDown; iImageBkgdOff.Retain(); iImageButtonOffUp.Retain(); iImageButtonOffDown.Retain(); iImageBkgdOn.Retain(); iImageButtonOnUp.Retain(); iImageButtonOnDown.Retain(); }
public override NSImage GetScreenshot() { NSImage img = null; try { string sel = "getScreenshot"; if (m_nativeController != null && m_nativeController.RespondsToSelector(sel)) { img = m_nativeController.SendMessage <NSImage>(sel); } } catch (Exception ex) { ApiUtils.Log.Add(new RoyalLogEntry() { Severity = RoyalLogEntry.Severities.Debug, Action = RoyalLogEntry.ACTION_PLUGIN, PluginName = "RDP Plugin (CoRD/rdesktop)", PluginID = "a6330510-982c-11e1-a8b0-0800200c9a66", Message = "Error while getting screenshot", Details = ex.ToString() }); } string propName = "CurrentScreenshot"; if (this.SupportsProperty(propName)) { if (this.GetPropertyValue <NSImage>(propName) != null && img != null) { this.GetPropertyValue <NSImage>(propName).Release(); this.SetPropertyValue(propName, null); } if (img != null) { this.SetPropertyValue(propName, img.Retain <NSImage>()); } } return(img); }
public override NSImage GetScreenshot() { NSAutoreleasePool pool = new NSAutoreleasePool(); try { if (CurrentScreenshot != null) { CurrentScreenshot.Release(); CurrentScreenshot = null; } NSImage img = null; if (m_sessionViewController != null) { img = m_sessionViewController.GetScreenshot(); } if (img != null) { CurrentScreenshot = img.Retain <NSImage>(); } } catch (Exception ex) { ApiUtils.Log.Add(new RoyalLogEntry() { Severity = RoyalLogEntry.Severities.Debug, Action = RoyalLogEntry.ACTION_PLUGIN, PluginName = PLUGIN_NAME, PluginID = PLUGIN_ID, Message = "Error while getting screenshot", Details = ex.ToString() }); } finally { if (pool != null) { pool.Drain(); pool = null; } } return(CurrentScreenshot); }