Пример #1
0
        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);
        }
Пример #2
0
        public async System.Threading.Tasks.Task UpdateProcess(EngineNS.Profiler.ELogTag tag, string info, double progressChange)
        {
            await EngineNS.CEngine.Instance.EventPoster.Post(() =>
            {
                var tb = new TextBlock()
                {
                    Text         = info,
                    Foreground   = Brushes.White,
                    FontSize     = 10,
                    LineHeight   = 10,
                    TextTrimming = TextTrimming.CharacterEllipsis,
                };
                switch (tag)
                {
                case EngineNS.Profiler.ELogTag.Error:
                    Foreground = Brushes.Red;
                    break;

                case EngineNS.Profiler.ELogTag.Warning:
                    Foreground = Brushes.Yellow;
                    break;

                case EngineNS.Profiler.ELogTag.Fatal:
                    Foreground = Brushes.Orange;
                    break;

                default:
                    break;
                }
                StackPanel_Infos.Children.Add(tb);

                var count = 10;
                if (StackPanel_Infos.Children.Count > count)
                {
                    StackPanel_Infos.Children.RemoveAt(0);
                }

                int invisibleCount = StackPanel_Infos.Children.Count / 2;
                for (int i = 0; i < invisibleCount + 1; i++)
                {
                    var tx     = StackPanel_Infos.Children[i] as TextBlock;
                    tx.Opacity = (i + 0.2) / invisibleCount;
                }

                //TextBlock_Info.Text = info;
                return(true);
            }, EngineNS.Thread.Async.EAsyncTarget.Main);
        }
Пример #3
0
        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;
        }