private Image imageFor(ValueOrigin valueOrigin) { var sourceImage = ApplicationIcons.IconFor(valueOrigin.Source).ToImage(); if (valueOrigin.Method == ValueOriginDeterminationMethods.Undefined) { return(sourceImage); } var methodImage = ApplicationIcons.IconFor(valueOrigin.Method).ToImage(); if (valueOrigin.Source == ValueOriginSources.Undefined) { return(methodImage); } var resultImage = new Bitmap(sourceImage.Width + methodImage.Width + IMAGE_OFFSET, sourceImage.Height); using (var g = Graphics.FromImage(resultImage)) { g.DrawImage(sourceImage, new PointF(0, 0)); g.DrawImage(methodImage, new PointF(sourceImage.Width + IMAGE_OFFSET, 0)); } return(resultImage); }
public ExceptionManager(IDialogCreator dialogCreator, IExceptionView exceptionView, IApplicationConfiguration configuration, IOSPSuiteLogger logger) { _dialogCreator = dialogCreator; _exceptionView = exceptionView; _logger = logger; _productInfo = $"{configuration.ProductNameWithTrademark} {configuration.FullVersion}"; _exceptionView.Initialize($"{_productInfo} - Error", ApplicationIcons.IconFor(configuration), configuration.IssueTrackerUrl, configuration.ProductName); }
private void mapProperties(ParameterIdentificationRunResult runResult) { var icon = ApplicationIcons.IconFor(runResult.Status); _allProperties.Add(new RunPropertyDTO <double>(Captions.ParameterIdentification.TotalError, runResult.TotalError, new DoubleFormatter())); _allProperties.Add(new RunPropertyDTO <int>(Captions.ParameterIdentification.NumberOfEvaluations, runResult.NumberOfEvaluations, new IntFormatter())); _allProperties.Add(new RunPropertyDTO <TimeSpan>(Captions.ParameterIdentification.Duration, runResult.Duration, new TimeSpanFormatter())); _allProperties.Add(new RunPropertyDTO <RunStatus>(Captions.ParameterIdentification.Status, runResult.Status, icon: icon)); if (!string.IsNullOrEmpty(runResult.Message)) { _allProperties.Add(new RunPropertyDTO <string>(Captions.ParameterIdentification.RunMessage, runResult.Message, icon: icon)); } }
public SuperToolTip CreateToolTip(string content, string title = null, ApplicationIcon image = null, IWithIcon withIcon = null) { var imageToUse = image ?? ApplicationIcons.IconFor(withIcon); // Create an object to initialize the SuperToolTip. var superToolTip = CreateToolTip(); var setupArgs = new SuperToolTipSetupArgs(); if (!string.IsNullOrEmpty(title)) { setupArgs.Title.Text = title; } setupArgs.Contents.Text = convertHtml(content); setupArgs.Contents.ImageOptions.SvgImage = imageToUse; setupArgs.Contents.ImageOptions.SvgImageSize = IconSizes.Size16x16; superToolTip.Setup(setupArgs); return(superToolTip); }