/// <summary> /// Main Constructor /// </summary> /// <param name="ACallerForm">A reference to the caller form. Usually use 'this'. It must implement the <see cref="IBoundImageEvaluator"/> interface.</param> /// <param name="AContext">A string that identifies the column context. Can be empty text if the grid only has one column with an image.</param> /// <param name="AImageEnum">One of the available images that can be displayed.</param> public BoundGridImage(IBoundImageEvaluator ACallerForm, AnnotationContextEnum AContext, DisplayImageEnum AImageEnum) { FCallerForm = ACallerForm; FCallerContext = AContext; FDisplayImageEnum = AImageEnum; string path = TAppSettingsManager.GetValue("Resource.Dir", string.Empty, true); if (path.Length > 0) { string filename = string.Empty; try { switch (FDisplayImageEnum) { // At present we only have the Inactive triangle but if there are more images later add them to this switch statement case DisplayImageEnum.Inactive: filename = "RedTriangle.png"; break; } FDisplayImage = System.Drawing.Image.FromFile(Path.Combine(path, filename)); } catch (FileNotFoundException) { TLogging.Log(string.Format("Could not find the file {0} in folder {1}", filename, path)); } catch (Exception ex) { TLogging.Log(string.Format("Error opening resource file {0}: {1}", filename, ex.Message)); } } }
/// <summary> /// Main Constructor /// </summary> /// <param name="ACallerForm">A reference to the caller form. Usually use 'this'. It must implement the <see cref="IBoundImageEvaluator"/> interface.</param> /// <param name="AContext">A string that identifies the column context. Can be empty text if the grid only has one column with an image.</param> /// <param name="AImageEnum">One of the available images that can be displayed.</param> public BoundImageToolTipModel(IBoundImageEvaluator ACallerForm, BoundGridImage.AnnotationContextEnum AContext, BoundGridImage.DisplayImageEnum AImageEnum) { FCallerForm = ACallerForm; FCallerContext = AContext; FImageEnum = AImageEnum; }