public Message(MessageReport report, EngineNS.Profiler.ELogTag type, string category, string message, object[] args) { MessageType = type; Category = category; MessageStr = message; var msgTypeStr = MessageType.ToString(); Icon = (report.TryFindResource(msgTypeStr + "_Image") as Image).Source; var brush = report.TryFindResource(msgTypeStr + "_Brush") as Brush; MessageBrush = brush ?? (report.TryFindResource("Default_Brush") as Brush); }
public FilterButton(MessageReport hostCtrl, EngineNS.Profiler.ELogTag logTag) { InitializeComponent(); mHostCtrl = hostCtrl; mLogTag = logTag; var valName = mLogTag.ToString(); var field = typeof(EngineNS.Profiler.ELogTag).GetField(valName); if (field != null) { ///ResourceLibrary;component/Icon/output_error.png var attrs = field.GetCustomAttributes(typeof(DescriptionAttribute), false); if (attrs.Length > 0) { ShowName = ((DescriptionAttribute)attrs[0]).Description; } } Icon = (hostCtrl.TryFindResource(valName + "_Image") as Image).Source; }