Exemple #1
0
        /// <summary>
        /// Строка пивота
        /// </summary>
        /// <param name="table">пивот</param>
        /// <param name="settings">настройки</param>
        /// <param name="rowValue">значение строки</param>
        /// <param name="parent">родительская строка</param>
        internal TracePivotRow(
            TracePivotTable table
            , TracePivotRowSettings settings
            , string rowValue
            , TracePivotRow parent)
        {
            if (table == null)
            {
                throw new ArgumentNullException("table");
            }
            if (settings == null)
            {
                throw new ArgumentNullException("settings");
            }
            _table    = table;
            _settings = settings;
            _rowValue = rowValue;
            _parent   = parent;

            foreach (var c in table.Columns)
            {
                var column = c.Value;

                var pv = new TracePivotValue();
                pv.Row     = this;
                pv.Column  = column;
                pv.Measure = new TraceEventMeasure(column.Settings.Type, column.Settings.Measure);

                _values.Add(c.Key, pv);
            }
        }
Exemple #2
0
        public void AddEvent(TraceEvent @event)
        {
            if (@event == null)
            {
                throw new ArgumentNullException("event");
            }

            TracePivotRowCollection rows = Rows;

            for (int i = 0; i < RowSettings.Count; i++)
            {
                var setting = RowSettings[i];

                if (setting.Type == RowType.EventName)
                {
                    TracePivotRow row;
                    if (rows.TryGetValue(@event.Name, out row) == false)
                    {
                        row = new TracePivotRow(this, setting, @event.Name, null);
                        rows.Add(row);
                    }

                    foreach (var column in Columns)
                    {
                        if (column.Value.Settings.Filter.Type == FilterType.EventName)
                        {
                            var eventName = column.Value.Settings.Filter.EventName;
                            row[column.Key].Measure.AddRange(@event.ByName(eventName));
                        }
                    }
                }
            }
        }
Exemple #3
0
 /// <summary>
 /// Добавить строку
 /// </summary>
 /// <param name="child"></param>
 public void AddRow(TracePivotRow child)
 {
     if (child == null)
     {
         throw new ArgumentNullException("child");
     }
     _childs.Add(child);
 }