Exemplo n.º 1
0
        public void OutputAppend(string text)
        {
            lock (textView1.Buffer)
            {
                textView1.Buffer.Text += text + "\r\n";
            }

            if (string.IsNullOrWhiteSpace(text))
            {
                return;
            }

            outputParser.Parse(text);
            text = text.TrimEnd(new[] { ' ', '\n', '\r', '\t' });

            switch (outputParser.State)
            {
            case OutputState.BuildBegin:
                AddItem(icon_begin_end, text, "");
                break;

            case OutputState.Cleaning:
                AddItem(icon_clean, "Cleaning " + GetRelativePath(outputParser.Filename), "");
                listStore.AppendValues(tmpIter, null, text, "");
                break;

            case OutputState.Skipping:
                AddItem(icon_skip, "Skipping " + GetRelativePath(outputParser.Filename), "");
                listStore.AppendValues(tmpIter, null, text, "");
                break;

            case OutputState.BuildAsset:
                AddItem(icon_processing, "Building " + GetRelativePath(outputParser.Filename), "");
                listStore.AppendValues(tmpIter, null, text, "");
                break;

            case OutputState.BuildError:
                listStore.SetValue(tmpIter, 0, icon_fail);
                listStore.AppendValues(tmpIter, null, outputParser.ErrorMessage, "");
                break;

            case OutputState.BuildErrorContinue:
                listStore.AppendValues(tmpIter, null, outputParser.ErrorMessage, "");
                break;

            case OutputState.BuildEnd:
                AddItem(icon_begin_end, text, "");
                break;

            case OutputState.BuildTime:
                listStore.SetValue(tmpIter, 1, listStore.GetValue(tmpIter, 1).ToString().TrimEnd(new[] { '.', ' ' }) + ", " + text);
                break;
            }
        }
Exemplo n.º 2
0
        public void WriteLine(string line)
        {
            textArea.Append(line + Environment.NewLine, true);

            if (string.IsNullOrEmpty(line))
            {
                return;
            }

            _output.Parse(line);
            line = line.Trim(new[] { ' ', '\n', '\r', '\t' });

            switch (_output.State)
            {
            case OutputState.BuildBegin:
                AddItem(_iconStartEnd, line);
                break;

            case OutputState.Cleaning:
                AddItem(_iconClean, "Cleaning " + PipelineController.Instance.GetRelativePath(_output.Filename));
                AddItem(line);
                break;

            case OutputState.Skipping:
                AddItem(_iconSkip, "Skipping " + PipelineController.Instance.GetRelativePath(_output.Filename));
                AddItem(line);
                break;

            case OutputState.BuildAsset:
                AddItem(_iconProcessing, "Building " + PipelineController.Instance.GetRelativePath(_output.Filename));
                AddItem(line);
                break;

            case OutputState.BuildError:
                _last.Image = _iconFail;
                AddItem(_output.ErrorMessage);
                break;

            case OutputState.BuildErrorContinue:
                AddItem(_output.ErrorMessage);
                break;

            case OutputState.BuildEnd:
                AddItem(_iconStartEnd, line);
                break;

            case OutputState.BuildTime:
                _last.Text = _last.Text.TrimEnd(new[] { '.', ' ' }) + ", " + line;
                treeView.RefreshItem(_last);
                break;
            }
        }
Exemplo n.º 3
0
        public void WriteLine(string line)
        {
            textArea.Append(line + Environment.NewLine, _cmdAutoScroll.Checked);

            if (string.IsNullOrEmpty(line))
            {
                return;
            }

            _output.Parse(line);
            line = line.Trim(new[] { ' ', '\n', '\r', '\t' });

            switch (_output.State)
            {
            case OutputState.BuildBegin:
                _items.Add(new BuildItem {
                    Text = line, Icon = _iconStart
                });
                Count    = -1;
                ReqWidth = 0;
                break;

            case OutputState.Cleaning:
                _items.Add(new BuildItem
                {
                    Text        = "Cleaning " + PipelineController.Instance.GetRelativePath(_output.Filename),
                    Icon        = _iconInformation,
                    Description = line
                });
                break;

            case OutputState.Skipping:
                if (_items[_items.Count - 1].Icon == _iconProcessing)
                {
                    _items[_items.Count - 1].Icon = _iconSucceed;
                }

                _items.Add(new BuildItem
                {
                    Text        = "Skipping " + PipelineController.Instance.GetRelativePath(_output.Filename),
                    Icon        = _iconSkip,
                    Description = _output.Filename
                });
                break;

            case OutputState.BuildAsset:
                if (_items[_items.Count - 1].Icon == _iconProcessing)
                {
                    _items[_items.Count - 1].Icon = _iconSucceed;
                }

                _items.Add(new BuildItem
                {
                    Text        = "Building " + PipelineController.Instance.GetRelativePath(_output.Filename),
                    Icon        = _iconProcessing,
                    Description = _output.Filename
                });
                break;

            case OutputState.BuildError:
                _items[_items.Count - 1].Icon = _iconFail;
                _items[_items.Count - 1].AddDescription(_output.ErrorMessage);
                break;

            case OutputState.BuildErrorContinue:
                _items[_items.Count - 1].AddDescription(_output.ErrorMessage);
                break;

            case OutputState.BuildWarning:
                if (_items[_items.Count - 1].Icon == _iconProcessing)
                {
                    _items[_items.Count - 1].Icon = _iconSucceedWithWarnings;
                }
                _items[_items.Count - 1].AddDescription(_output.ErrorMessage);
                break;

            case OutputState.BuildEnd:
                if (_items[_items.Count - 1].Icon == _iconProcessing)
                {
                    _items[_items.Count - 1].Icon = _iconSucceed;
                }

                _items.Add(new BuildItem
                {
                    Text = line,
                    Icon = line.Contains("0 failed") ? _iconEndSucceed : _iconEndFailed
                });
                break;

            case OutputState.BuildTime:
                var text = _items[_items.Count - 1].Text.TrimEnd(new[] { '.', ' ' }) + ", " + line;
                _items[_items.Count - 1].Text = text;
                Count = _items.Count * 35 - 3;
                break;
            }

            drawable.Invalidate();
        }