Example #1
0
        /// <summary>
        /// Adds a row importance rule to the table definition
        /// </summary>
        /// <param name="columnName">The column name</param>
        /// <param name="matchValue">The data match value</param>
        /// <param name="compareOperator">The match compare operator</param>
        /// <param name="importanceOnMatch">The importance flag for matches</param>
        public void AddRowImportanceRule
        (
            string columnName,
            object matchValue,
            DataCompareOperator compareOperator,
            DataImportance importanceOnMatch
        )
        {
            var ruleFound = this.RowImportanceRules.Any
                            (
                r => r.ColumnName.Equals(columnName, StringComparison.OrdinalIgnoreCase) &&
                r.MatchValue == matchValue &&
                r.CompareOperator == compareOperator
                            );

            if (ruleFound)
            {
                throw new ArgumentException
                      (
                          "A rule with matching column, value and comparer has been defined."
                      );
            }

            var rule = new TableRowImportanceRule
                       (
                columnName,
                matchValue,
                compareOperator,
                importanceOnMatch
                       );

            this.RowImportanceRules.Add(rule);
        }
Example #2
0
        /// <summary>
        /// Constructs the table row with the cell data
        /// </summary>
        /// <param name="importance">The row importance</param>
        /// <param name="cells">The cells</param>
        public TableRow
        (
            DataImportance importance,
            params TableCell[] cells
        )
        {
            this.Importance = importance;

            PopulateCells(cells);
        }
Example #3
0
File: Log.cs Project: ext0/Phoenix
        public static void addEntryToLog(object sender, String data, DataImportance importance = DataImportance.DEBUG)
        {
            return;

            /*
             * log.Add(new LogMessage
             * {
             *  sender = sender.GetType().Name,
             *  timeOf = DateTime.Now,
             *  importance = importance,
             *  data = data
             * });
             */
        }
Example #4
0
 /// <summary>
 /// Defines the style details for the column
 /// </summary>
 /// <param name="title">The title</param>
 /// <param name="alignment">The text alignment</param>
 /// <param name="importance">The importance</param>
 /// <param name="noWrap">True, if the cell text shouldn't word wrap</param>
 public virtual void DefineStyle
 (
     string title,
     ColumnAlignment alignment,
     DataImportance importance = default,
     bool noWrap = false
 )
 {
     this.Title      = title;
     this.Alignment  = alignment;
     this.Importance = importance;
     this.NoWrap     = noWrap;
     this.HasStyling = true;
 }
Example #5
0
        /// <summary>
        /// Constructs the rule with the rule configuration
        /// </summary>
        /// <param name="columnName">The column name</param>
        /// <param name="matchValue">The data match value</param>
        /// <param name="compareOperator">The match compare operator</param>
        /// <param name="importanceOnMatch">The importance flag for matches</param>
        public TableRowImportanceRule
        (
            string columnName,
            object matchValue,
            DataCompareOperator compareOperator,
            DataImportance importanceOnMatch
        )
        {
            Validate.IsNotEmpty(columnName);

            this.ColumnName        = columnName;
            this.MatchValue        = matchValue;
            this.CompareOperator   = compareOperator;
            this.ImportanceOnMatch = importanceOnMatch;
        }
Example #6
0
        /// <summary>
        /// Constructs the table column with the details
        /// </summary>
        /// <param name="name">The column name</param>
        /// <param name="title">The title</param>
        /// <param name="alignment">The alignment (optional)</param>
        /// <param name="importance">The importance (optional)</param>
        /// <param name="noWrap">Should text be wrapped (optional)</param>
        public TableColumn
        (
            string name,
            string title,
            ColumnAlignment alignment = default,
            DataImportance importance = default,
            bool noWrap = false
        )
        {
            Validate.IsNotEmpty(name);
            Validate.IsNotEmpty(title);

            this.ColumnId   = Guid.NewGuid();
            this.Name       = name;
            this.Title      = title;
            this.Alignment  = alignment;
            this.Importance = importance;
            this.NoWrap     = noWrap;
        }
Example #7
0
        /// <summary>
        /// Applies style configuration to a table column definition
        /// </summary>
        /// <param name="columnName">The column name</param>
        /// <param name="title">The title</param>
        /// <param name="alignment">The text alignment</param>
        /// <param name="importance">The importance</param>
        /// <param name="noWrap">True, if the cell text shouldn't word wrap</param>
        public void StyleColumn
        (
            string columnName,
            string title,
            ColumnAlignment alignment,
            DataImportance importance = default,
            bool noWrap = false
        )
        {
            var column = GetColumn(columnName);

            column.DefineStyle
            (
                title,
                alignment,
                importance,
                noWrap
            );
        }