Example #1
0
        public virtual void WriteLines(StringBuilder linesBuffer, ColorCategory colorCategory = ColorCategory.None, int relativeIndentLevel = 1)
        {
            if (!atBeginningOfLine)
            {
                WriteEndLine();
            }

            int indexStartLine = 0;
            int bufLen         = linesBuffer.Length;

            while (indexStartLine < bufLen)
            {
                int indexEol = linesBuffer.IndexOfAny(EolChars, indexStartLine);
                if (indexEol < 0)
                { // No more EOL chars in remainder of linesBuffer
                    indexEol = bufLen;
                }

                // REVIEW: When there are multiple EolChars adjacent to each other (eg CrLfCrLf), nothing is written
                // If the caller wants blank lines, put a single space or tab on each blank line.
                if (indexEol > indexStartLine)
                {
                    WriteLinePrefix(IndentLevel + relativeIndentLevel);
                    WriteText(linesBuffer, indexStartLine, indexEol - indexStartLine, colorCategory);
                    WriteEndLine();
                }
                indexStartLine = indexEol + 1;
            }
        }
    /// <summary>
    /// Applies all the changes done from the inspector to the
    /// UI elements having the ColorType script attached.
    /// </summary>
    public void ApplyChanges()
    {
        foreach (ColorType childColorType in GetComponentsInChildren <ColorType>())
        {
            ColorCategory category = childColorType.category;
            switch (category)
            {
            // Changes to be done only to the text gameObjects.
            case ColorCategory.TextMain:
            case ColorCategory.TextAlternative:
                TextMeshProUGUI textMesh = childColorType.GetComponent <TextMeshProUGUI>();
                if (textMesh != null)
                {
                    textMesh.font  = category == ColorCategory.TextMain ? fontMain : category == ColorCategory.TextAlternative ? fontAlternative : fontDropdown;
                    textMesh.color = colorPairs[category];
                }
                break;

            // Changes to be done to gameObjects with an Image component attached.
            case ColorCategory.PrimayLight:
            case ColorCategory.Primary:
            case ColorCategory.PrimaryDark:
            case ColorCategory.SecondaryLight:
            case ColorCategory.Secondary:
            case ColorCategory.SecondaryDark:
                Image childImage = childColorType.GetComponent <Image>();
                if (childImage != null)
                {
                    childImage.color = colorPairs[category];
                }
                break;
            }
        }
    }
Example #3
0
        protected virtual Color GetColor(ColorCategory c)
        {
            Color backColor;

            switch (c)
            {
            case ColorCategory.Background:
                backColor = this.BackColor;
                if (backColor == Resco.Controls.AdvancedList.AdvancedList.TransparentColor)
                {
                    backColor = this.m_Owner.BackColor;
                }
                return(backColor);

            case ColorCategory.Foreground:
                backColor = this.ForeColor;
                if (backColor == Resco.Controls.AdvancedList.AdvancedList.TransparentColor)
                {
                    backColor = this.m_Owner.ForeColor;
                }
                return(backColor);

            case ColorCategory.BorderFlat:
                return(SystemColors.ControlDark);

            case ColorCategory.BorderHighlight:
                return(SystemColors.ControlLightLight);

            case ColorCategory.BorderShadow:
                return(SystemColors.ControlDarkDark);
            }
            return(Resco.Controls.AdvancedList.AdvancedList.TransparentColor);
        }
 /// <summary> Returns the Color attached to the given category. </summary>
 public                   Color this[ColorCategory category]
 {
     get
     {
         return(elements.First(e => e.category == category).color);
     }
 }
Example #5
0
        /// <summary>
        /// Formats an int field, with zero padding and space padding if specified.
        /// </summary>
        /// <param name="formatWriter">The <see cref="FormatWriter" /> being written to.</param>
        /// <param name="number">The number to format.</param>
        /// <param name="colorCategory">The color category for the output.</param>
        /// <param name="zeroPaddedWidth">
        /// The minimum digit width to write. If <paramref name="number" /> has fewer digits the
        /// output is left-padded with zeros.
        /// </param>
        /// <param name="spacePaddedWidth">
        /// The minimum character width to write. If the written characters are less than this width, the output is right-padded
        /// with spaces.
        /// </param>
        public static void WriteIntField(this FormatWriter formatWriter,
                                         int number,
                                         ColorCategory colorCategory = ColorCategory.Detail,
                                         int zeroPaddedWidth         = 0,
                                         int spacePaddedWidth        = 0)
        {
            Contract.Requires <ArgumentNullException>(formatWriter != null);

            StringBuilder fieldBuffer = formatWriter.FieldBuffer;

            fieldBuffer.Clear();
            if (zeroPaddedWidth > 0)
            {
                fieldBuffer.AppendPadZeroes(number, zeroPaddedWidth);
            }

            int spacesPadding = spacePaddedWidth - fieldBuffer.Length;

            if (spacesPadding > 0)
            {
                fieldBuffer.Append(' ', spacesPadding);
            }

            formatWriter.WriteField(fieldBuffer, colorCategory);
        }
Example #6
0
        /// <summary>
        /// Gets the color for a specific color scheme.
        /// </summary>
        /// <param name="cat">The category</param>
        /// <returns></returns>
        public Color this[ColorCategory cat]
        {
            get
            {
                switch (cat)
                {
                case ColorCategory.BACKGROUND:
                    return(Background);

                case ColorCategory.FOREGROUND:
                    return(Foreground);

                case ColorCategory.ERROR_FG:
                    return(ErrorForeground);

                case ColorCategory.WARNING_FG:
                    return(WarningForeground);

                case ColorCategory.HIGHLIGHT_BG:
                    return(HighlightBackground);

                case ColorCategory.HIGHLIGHT_BG_2:
                    return(Highlight2Background);

                default:
                    throw new ArgumentException("Bad color category " + cat);
                }
            }
        }
Example #7
0
        public override void Format(ref TraceEntry traceEntry, FormatWriter formatWriter)
        {
            ColorCategory color = ColorCategory.None;

            if (formatWriter.IsColorEnabled)
            {
                color = TraceLevelToColorCategory(traceEntry.TraceLevel);
            }

            int entryIndentLevel = formatWriter.IndentLevel + RelativeIndentLevel;

            entryIndentLevel = Math.Min(entryIndentLevel, MaxIndentLevel);

            formatWriter.BeginEntry(entryIndentLevel);

            if (IncludeDate)
            {
                formatWriter.WriteDate(traceEntry.TimestampUtc, ColorCategory.Debug);
            }
            if (IncludeTimestamp)
            {
                formatWriter.WriteTimestamp(traceEntry.TimestampUtc, ColorCategory.Detail);
            }
            formatWriter.WriteField(TraceLevelToLabel(traceEntry.TraceLevel), color, 7);
            formatWriter.WriteAbbreviatedTypeName(traceEntry.TracerName, ColorCategory.Debug, 36);
            formatWriter.WriteField(traceEntry.Message.Trim(), color);
            if (traceEntry.Details != null)
            {
                ColorCategory detailColor = color == ColorCategory.Debug ? ColorCategory.Debug : ColorCategory.Detail;
                formatWriter.WriteLines(traceEntry.Details.ToString(), detailColor, 1);
            }

            formatWriter.EndEntry();
        }
 public override void WriteText(StringBuilder sb, int startIndex, int length, ColorCategory colorCategory)
 {
     if (_textWriter != null)
     {
         _textWriter.BufferedWrite(sb, startIndex, length, _charBuffer);
     }
 }
 protected override void WriteText(string s, ColorCategory colorCategory)
 {
     if (_textWriter != null)
     {
         _textWriter.BufferedWrite(s, _charBuffer);
     }
 }
Example #10
0
        public void BindColorCategories()
        {
            List <string> colorNames = new List <string>();

            colorNames = Enum.GetNames(typeof(ColorCategoryEnums)).Cast <string>().ToList();

            foreach (string colorName in colorNames)
            {
                ColorCategory.Add(new ColorCategories(colorName));
            }
        }
Example #11
0
        public virtual void WriteLine(StringBuilder line, ColorCategory colorCategory = ColorCategory.None, int relativeIndentLevel = 1)
        {
            if (!atBeginningOfLine)
            {
                WriteEndLine();
            }

            WriteLinePrefix(IndentLevel + relativeIndentLevel);
            WriteText(line, 0, line.Length, colorCategory);
            WriteEndLine();
        }
        /// <summary>
        /// Override timestamp formatting to support timestamp + offset
        /// </summary>
        /// <param name="timestamp"></param>
        /// <param name="colorCategory"></param>
        public override void WriteTimestamp(DateTimeOffset timestamp, ColorCategory colorCategory = ColorCategory.Detail)
        {
            if (IncludeTime)
            {
                base.WriteTimestamp(timestamp, colorCategory);
            }

            if (IncludeTimeOffset)
            {
                TimeSpan timeOffset = timestamp.Subtract(StartTimeUtc);
                this.WriteTimeOffset(timeOffset, colorCategory);
            }
        }
Example #13
0
        public virtual void WriteDate(DateTime dateTimeUtc, ColorCategory colorCategory = ColorCategory.Detail)
        {
            DateTime outputDateTime = TimeZoneInfo.ConvertTimeFromUtc(dateTimeUtc, _outputTimeZone);

            // Format date
            _fieldBuffer.Clear();
            _fieldBuffer.AppendPadZeroes(outputDateTime.Year, 4);
            _fieldBuffer.Append('/');
            _fieldBuffer.AppendPadZeroes(outputDateTime.Month, 2);
            _fieldBuffer.Append('/');
            _fieldBuffer.AppendPadZeroes(outputDateTime.Day, 2);

            WriteField(_fieldBuffer, colorCategory);
        }
 private void OnAddCategoryCommandExecute( )
 {
     if (NameCategory is null || ColorCategory is null)
     {
         return;
     }
     // Adding category to the repository
     categoryManager.Add(categoryManager.Create(NameCategory, ColorCategory.ToString()));
     categoryManager.Save();
     //Add category to the list
     Categories.Add(categoryManager.Create(NameCategory, ColorCategory.ToString()));
     NameCategory  = null;
     ColorCategory = null;
 }
Example #15
0
        public virtual void WriteTimestamp(DateTimeOffset timestamp, ColorCategory colorCategory = ColorCategory.Detail)
        {
            DateTimeOffset outputTimestamp = TimeZoneInfo.ConvertTime(timestamp, _outputTimeZone);

            // Format time
            _fieldBuffer.Clear();
            _fieldBuffer.AppendPadZeroes(outputTimestamp.Hour, 2);
            _fieldBuffer.Append(':');
            _fieldBuffer.AppendPadZeroes(outputTimestamp.Minute, 2);
            _fieldBuffer.Append(':');
            _fieldBuffer.AppendPadZeroes(outputTimestamp.Second, 2);
            _fieldBuffer.Append('.');
            _fieldBuffer.AppendPadZeroes(outputTimestamp.Millisecond, 3);

            WriteField(_fieldBuffer, colorCategory);
        }
Example #16
0
            private static void WriteCategory(MemoryStream bytes, ColorCategory category)
            {
                // |------------------------Category---------------------------|--Items...
                // |----------------Category GUID------------------|-Item Count|--
                // ,85,56,a0,75,a8,00,ed,4d,ba,e5,e7,a5,0b,fa,92,9a,2e,00,00,00,--

                WriteGuid(bytes, category.Guid);

                WriteDWord(bytes, (uint)category.Colors.Length);

                foreach (var color in category.Colors)
                {
                    WriteColor(bytes, color);
                }

                return;
        protected override void WriteText(string s, ColorCategory colorCategory)
        {
            var colorResolver = ColorResolver;

            if (colorResolver != null && colorCategory != ColorCategory.None)
            {
                SetConsoleColor(colorResolver.ResolveColor(colorCategory));
            }

            try
            {
                base.WriteText(s, colorCategory);
            }
            catch (Exception excp)
            {
                OnConsoleWriteException(excp);
            }
        }
        public override void WriteText(StringBuilder sb, int startIndex, int length, ColorCategory colorCategory)
        {
            var colorResolver = ColorResolver;

            if (colorResolver != null && colorCategory != ColorCategory.None)
            {
                SetConsoleColor(colorResolver.ResolveColor(colorCategory));
            }

            try
            {
                base.WriteText(sb, startIndex, length, colorCategory);
            }
            catch (Exception excp)
            {
                OnConsoleWriteException(excp);
            }
        }
Example #19
0
        private RasterSymbolizer MakeSnowSymbolizer()
        {
            RasterSymbolizer sym    = new RasterSymbolizer();
            ColorScheme      scheme = new ColorScheme();

            ColorCategory c1 = new ColorCategory(1, 100, Color.LightBlue, Color.LightBlue);

            c1.LegendText = "0 - 100";
            scheme.AddCategory(c1);

            ColorCategory c2 = new ColorCategory(100, 10000, Color.DarkBlue, Color.DarkBlue);

            c2.LegendText = "> 100";
            scheme.AddCategory(c2);

            sym.Scheme = scheme;

            return(sym);
        }
        /// <inheritdoc />
        public override void Format(ref LoggerEntry entry, FormatWriter formatWriter)
        {
            ColorCategory color = ColorCategory.None;

            if (formatWriter.IsColorEnabled)
            {
                color = LogLevelToColorCategory(entry.LogLevel);
            }

            int entryIndentLevel = formatWriter.IndentLevel + RelativeIndentLevel;

            entryIndentLevel = Math.Min(entryIndentLevel, MaxIndentLevel);

            formatWriter.BeginEntry(entryIndentLevel);

            if (IncludeDate)
            {
                formatWriter.WriteDate(entry.TimestampUtc, ColorCategory.Debug);
            }
            if (IncludeTimestamp)
            {
                formatWriter.WriteTimestamp(entry.TimestampUtc, ColorCategory.Detail);
            }

            formatWriter.WriteField(LogLevelToLabel(entry.LogLevel), color, 7);
            formatWriter.WriteAbbreviatedTypeName(entry.CategoryName, ColorCategory.Debug, 36);

            if (IncludeEventId)
            {
                formatWriter.WriteField(entry.EventId.ToString(), color, 6);
            }

            string message = entry.DefaultFormatter(entry.State, null);

            formatWriter.WriteField(message.Trim(), color);
            if (entry.Exception != null)
            {
                ColorCategory detailColor = color == ColorCategory.Debug ? ColorCategory.Debug : ColorCategory.Detail;
                formatWriter.WriteLines(entry.Exception.ToString(), detailColor, 1);
            }

            formatWriter.EndEntry();
        }
Example #21
0
 protected override Color GetColor(ColorCategory c)
 {
     if (c == ColorCategory.Foreground)
     {
         Color transparentColor = Resco.Controls.AdvancedTree.AdvancedTree.TransparentColor;
         if (this.m_bActive)
         {
             transparentColor = this.ActiveColor;
         }
         else if (Links.IsVisited(this.GetLink(base.CurrentData)))
         {
             transparentColor = this.VisitedColor;
         }
         if (!(transparentColor == Resco.Controls.AdvancedTree.AdvancedTree.TransparentColor))
         {
             return(transparentColor);
         }
     }
     return(base.GetColor(c));
 }
Example #22
0
        public virtual void WriteField(StringBuilder buffer, ColorCategory colorCategory = ColorCategory.None, int padWidth = 0)
        {
            Contract.Requires <ArgumentNullException>(buffer != null);

            if (atBeginningOfLine)
            {
                WriteLinePrefix(IndentLevel);
            }
            else
            {
                WriteText(FieldDelimiter, ColorCategory.Markup);
            }

            WriteText(buffer, 0, buffer.Length, colorCategory);
            padWidth -= buffer.Length;

            if (padWidth > 0)
            {
                WriteSpaces(padWidth);
            }
        }
Example #23
0
        public virtual void WriteField(string text, ColorCategory colorCategory = ColorCategory.None, int padWidth = 0)
        {
            if (atBeginningOfLine)
            {
                WriteLinePrefix(IndentLevel);
            }
            else
            {
                WriteText(FieldDelimiter, ColorCategory.Markup);
            }

            if (text != null)
            {
                WriteText(text, colorCategory, true);
                padWidth -= text.Length;
            }

            if (padWidth > 0)
            {
                WriteSpaces(padWidth);
            }
        }
Example #24
0
 /// <summary>
 /// Writes the specified text to the target.
 /// </summary>
 /// <param name="s"></param>
 /// <param name="colorCategory"></param>
 /// <param name="normalizeFieldText">
 /// If <c>true</c>, <paramref name="s" /> should be normalized for display as a field, eg
 /// tabs and line breaks removed.
 /// </param>
 public virtual void WriteText(string s, ColorCategory colorCategory, bool normalizeFieldText = false)
 {
     if (s == null)
     { // Do nothing
     }
     else if (normalizeFieldText && (s.IndexOfAny(s_invalidFieldChars) >= 0))
     {
         _fieldBuffer.Clear();
         _fieldBuffer.Append(s);
         _fieldBuffer.RemoveAll(s_invalidFieldChars);
         _fieldBuffer.TrimSpaces();
         WriteText(_fieldBuffer, 0, _fieldBuffer.Length, colorCategory);
     }
     else
     {
         if (normalizeFieldText)
         {
             s = s.Trim();
         }
         WriteText(s, colorCategory);
     }
 }
Example #25
0
        /// <summary>
        /// Converts a <see cref="ColorCategory" /> value to a <see cref="ConsoleColor" /> value.
        /// </summary>
        /// <param name="colorCategory">A <see cref="ColorCategory" /> value.</param>
        /// <returns>The <see cref="ConsoleColor" /> for <paramref name="colorCategory" />.</returns>
        public ConsoleColor ResolveColor(ColorCategory colorCategory)
        {
            switch (colorCategory)
            {
            case ColorCategory.Detail:
                return(ConsoleColor.Gray);

            case ColorCategory.Info:
                return(ConsoleColor.White);

            case ColorCategory.None:
                return(_initialForegroundColor);

            case ColorCategory.Markup:
                return(ConsoleColor.DarkGray);

            case ColorCategory.Warning:
                return(ConsoleColor.Yellow);

            case ColorCategory.Error:
                return(ConsoleColor.Red);

            case ColorCategory.SevereError:
                return(ConsoleColor.Red);

            case ColorCategory.Debug:
                return(ConsoleColor.DarkGray);

            case ColorCategory.Success:
                return(ConsoleColor.Green);

            case ColorCategory.Important:
                return(ConsoleColor.Cyan);

            default:
                return(_initialForegroundColor);
            }
        }
Example #26
0
        public virtual void WriteField(Action <StringBuilder> formatFieldAction, ColorCategory colorCategory = ColorCategory.None, int padWidth = 0)
        {
            Contract.Requires <ArgumentNullException>(formatFieldAction != null);

            if (atBeginningOfLine)
            {
                WriteLinePrefix(IndentLevel);
            }
            else
            {
                WriteText(FieldDelimiter, ColorCategory.Markup);
            }

            _fieldBuffer.Clear();
            formatFieldAction(_fieldBuffer);
            WriteText(_fieldBuffer, 0, _fieldBuffer.Length, colorCategory);
            padWidth -= _fieldBuffer.Length;

            if (padWidth > 0)
            {
                WriteSpaces(padWidth);
            }
        }
Example #27
0
 protected override Color GetColor(ColorCategory c)
 {
     if (c == ColorCategory.Foreground)
     {
         Color transparentColor = Resco.Controls.AdvancedList.AdvancedList.TransparentColor;
         if (this.m_bActive)
         {
             transparentColor = this.ActiveColor;
         }
         else if (Links.IsVisited(this.GetLink(base.CurrentData)))
         {
             transparentColor = this.VisitedColor;
         }
         if (!(transparentColor == Resco.Controls.AdvancedList.AdvancedList.TransparentColor))
         {
             return transparentColor;
         }
     }
     return base.GetColor(c);
 }
Example #28
0
        /// <summary>
        /// Formats a time offset field
        /// </summary>
        /// <param name="timeOffset"></param>
        /// <param name="colorCategory"></param>
        public static void WriteTimeOffset(this FormatWriter formatWriter, TimeSpan timeOffset, ColorCategory colorCategory, int leftPaddedWidth = 9)
        {
            var buf = formatWriter.FieldBuffer;

            buf.Clear();

            // Handle negative timespans
            if (timeOffset.Ticks < 0)
            {
                buf.Append('-');
                timeOffset = timeOffset.Negate();
            }

            int hours = (int)Math.Floor(timeOffset.TotalHours);

            if (hours > 0)
            {
                buf.Append(hours);
                buf.Append(':');
            }
            int minutes = timeOffset.Minutes;

            if (hours > 0)
            {
                buf.AppendPadZeroes(minutes, 2);
            }
            else
            {
                buf.Append(minutes);
            }
            buf.Append(':');
            buf.AppendPadZeroes(timeOffset.Seconds, 2);
            buf.Append('.');
            buf.AppendPadZeroes(timeOffset.Milliseconds, 3);

            int leftPadSpaces = leftPaddedWidth - buf.Length;

            formatWriter.WriteSpaces(leftPadSpaces);
            formatWriter.WriteField(buf, colorCategory);
        }
Example #29
0
        public static void WriteAbbreviatedTypeName(this FormatWriter formatWriter, string typeName, ColorCategory colorCategory = ColorCategory.Detail, int padWidth = 0)
        {
            Contract.Requires <ArgumentNullException>(formatWriter != null);
            Contract.Requires <ArgumentNullException>(typeName != null);

            // Count the dots
            int countDots = 0;

            for (int i = typeName.IndexOf('.'); i >= 0; i = typeName.IndexOf('.', i + 1))
            {
                countDots++;
            }
            if (countDots == 0)
            {
                formatWriter.WriteField(typeName, colorCategory, padWidth);
                return;
            }

            // Walk the string, abbreviating until just over half the segments are abbreviated
            StringBuilder fieldBuffer          = formatWriter.FieldBuffer;
            int           segmentsToAbbreviate = (countDots >> 1) + 1;

            fieldBuffer.Clear();
            int len = typeName.Length;

            fieldBuffer.Append(typeName[0]); // Always include the first char
            for (int i = 1, segmentsAbbreviated = 0; i < len; ++i)
            {
                char ch = typeName[i];
                if (ch == '.')
                {
                    fieldBuffer.Append(ch);
                    i++;
                    if (++segmentsAbbreviated >= segmentsToAbbreviate)
                    { // No more abbreviating - take the rest straight
                        fieldBuffer.Append(typeName, i, len - i);
                        break;
                    }
                    else
                    { // Keep abbreviating - always include the first char after a '.'
                        if (i < len)
                        {
                            fieldBuffer.Append(typeName[i]);
                        }
                    }
                }
                else if (!ch.AsciiIsLower())
                {
                    fieldBuffer.Append(ch);
                }
                // Else ch is lower case - omit it
            }

            // Add padding if needed
            int spacesPadding = padWidth - fieldBuffer.Length;

            if (spacesPadding > 0)
            {
                fieldBuffer.Append(' ', spacesPadding);
            }

            formatWriter.WriteField(fieldBuffer, colorCategory);
        }
Example #30
0
        /// <inheritdoc />
        public override void Format(ref HttpResponseEntry entry, FormatWriter formatWriter)
        {
            StringBuilder buf = formatWriter.FieldBuffer;

            formatWriter.IndentLevel--;
            formatWriter.BeginEntry(0);

            // RequestNumber
            buf.Clear();
            buf.Append(entry.RequestNumber);
            buf.Append('<');
            formatWriter.WriteField(buf, ColorCategory.Markup, 3);

            formatWriter.WriteTimestamp(entry.RequestCompleted, ColorCategory.Detail);

            // Ttfb
            buf.Clear();
            buf.AppendPadZeroes(entry.Ttfb.Seconds, 2);
            buf.Append('.');
            buf.AppendPadZeroes(entry.Ttfb.Milliseconds, 3);
            buf.Append('s');
            formatWriter.WriteField(buf, ColorCategory.Info);

            // Determine response color from HTTP status code
            ColorCategory responseColorCategory = ColorCategory.None;

            if (formatWriter.IsColorEnabled)
            {
                var statusCode = entry.HttpStatusCode;
                if ((statusCode >= 200) && (statusCode < 300))
                {
                    responseColorCategory = ColorCategory.Success;
                }
                else if ((statusCode >= 300) && (statusCode < 400))
                {
                    responseColorCategory = ColorCategory.Important;
                }
                else if (statusCode >= 500)
                {
                    responseColorCategory = ColorCategory.Error;
                }
                else
                {
                    responseColorCategory = ColorCategory.Warning;
                }
            }

            formatWriter.WriteField(entry.Method, ColorCategory.Info, 3);
            formatWriter.WriteField(entry.Uri, responseColorCategory);
            formatWriter.WriteLine();

            // HTTP status line
            formatWriter.WriteLinePrefix(formatWriter.IndentLevel + 1);
            formatWriter.WriteText("  HTTP/1.1 ", ColorCategory.Detail);
            buf.Clear();
            buf.Append(entry.HttpStatusCode);
            formatWriter.WriteText(buf, 0, buf.Length, responseColorCategory);
            formatWriter.WriteSpaces(1);
            formatWriter.WriteText(entry.HttpReasonPhrase, ColorCategory.Detail);
            formatWriter.WriteLine();

            FormatterHelper.FormatHeaders(formatWriter, entry.ResponseHeaders);

            formatWriter.WriteLine(); // Extra line break for readability
            formatWriter.EndEntry();
        }
Example #31
0
        protected virtual Color GetColor(ColorCategory c)
        {
            Color backColor;
            switch (c)
            {
                case ColorCategory.Background:
                    backColor = this.BackColor;
                    if (backColor == Resco.Controls.AdvancedList.AdvancedList.TransparentColor)
                    {
                        backColor = this.m_Owner.BackColor;
                    }
                    return backColor;

                case ColorCategory.Foreground:
                    backColor = this.ForeColor;
                    if (backColor == Resco.Controls.AdvancedList.AdvancedList.TransparentColor)
                    {
                        backColor = this.m_Owner.ForeColor;
                    }
                    return backColor;

                case ColorCategory.BorderFlat:
                    return SystemColors.ControlDark;

                case ColorCategory.BorderHighlight:
                    return SystemColors.ControlLightLight;

                case ColorCategory.BorderShadow:
                    return SystemColors.ControlDarkDark;
            }
            return Resco.Controls.AdvancedList.AdvancedList.TransparentColor;
        }
 public ColorTheme(string name, Guid guid, ColorCategory category)
 {
     Name     = name;
     Guid     = guid;
     Category = category;
 }