/// ------------------------------------------------------------------------------------
        public void AddRowGroup(string text, int rowCount, string textsLocalizationId)
        {
            var grp = CVChartRowGroup.Create(text, rowCount, this, textsLocalizationId);

            RowHeadersWidth = Math.Max(RowHeadersWidth, grp.PreferredWidth);
            RowGroups.Add(grp);
        }
        //------------------------------------------------------
        //
        //  Public Methods
        //
        //------------------------------------------------------

        #region Public Methods

        /// <summary>
        /// <see cref="IAddChild.AddChild"/>
        /// </summary>
        void IAddChild.AddChild(object value)
        {
            if (value == null)
            {
                throw new ArgumentNullException("value");
            }

            TableRowGroup rowGroup = value as TableRowGroup;

            if (rowGroup != null)
            {
                RowGroups.Add(rowGroup);
                return;
            }

            throw (new ArgumentException(SR.Get(SRID.UnexpectedParameterType, value.GetType(), typeof(TableRowGroup)), "value"));
        }
Beispiel #3
0
        private void UpdateContent()
        {
            RowGroups.Clear();

            if (HeaderRowGroup != null)
            {
                RowGroups.Add(HeaderRowGroup);
            }

            if (ItemsSource != null)
            {
                if (ItemTemplate == null)
                {
                    throw new InvalidOperationException("When ItemsSource is used then the ItemTemplate must not be null.");
                }

                TableRowGroup contentRowGroup = new TableRowGroup();
                foreach (object item in ItemsSource)
                {
                    TableRow       tableRow       = null;
                    ContentElement contentElement = ItemTemplate.LoadContent() as ContentElement;
                    if (contentElement != null)
                    {
                        tableRow = contentElement.Content as TableRow;
                    }

                    if (tableRow == null)
                    {
                        throw new InvalidOperationException("The ItemTemplate must define: DataTemplate > ContentElement > TableRow.");
                    }
                    tableRow.DataContext = item;
                    contentRowGroup.Rows.Add(tableRow);
                }

                if (contentRowGroup.Rows.Any())
                {
                    RowGroups.Add(contentRowGroup);
                }
            }

            if (FooterRowGroup != null)
            {
                RowGroups.Add(FooterRowGroup);
            }
        }
Beispiel #4
0
        public DoDSummaryDisplayOptions(GCDConsoleLib.GCD.UnitGroup dataUnits)
        {
            m_Units      = dataUnits;
            m_nPrecision = 2;

            m_eRowGroups            = RowGroups.ShowAll;
            m_bRowsAreal            = true;
            m_bRowsVolumetric       = true;
            m_bRowsVerticalAverages = true;
            m_bRowsPercentages      = true;

            m_bColsRaw         = true;
            m_bColsThresholded = true;
            m_bColsPMError     = true;
            m_bColsPCError     = true;

            Font = Properties.Settings.Default.ChartFont;

            AutomatedYAxisScale = true;
        }
        public int[] DispatchRowGroupsToClients(string clientSender)
        {
            this.clientSender = clientSender;
            //totalRows = rowsNumber;
            if (totalRows <= 0)
                return null;
            assignedRowsGroups = new Dictionary<string, RowGroups>();
            int clientsNumber = clients.Count;
            int groups = totalRows / clientsNumber;
            int row = 0;
            foreach (string client in clients)
            {
                RowGroups groupForClient = new RowGroups();
                for (int i = 0; i < groups; i++)
                    groupForClient.Add(row++);
                assignedRowsGroups.Add(client, groupForClient);
            }
            while(row < totalRows)
            {
                assignedRowsGroups[clients[0]].Add(row++);
            }

            downloaded = 1; //clientSender has already downloaded its rows
            downloadedRows_m2[clientSender] = totalRows;
            lock(callingClientsLock)
            {
                callingClients = true;
            }
            foreach( int rowIndex in assignedRowsGroups[clientSender].rowGroups)
            {
                sourceMatrix_1[rowIndex].sent = true;
                assignedRowsGroups[clientSender].downloadedRows++;
            }
            return assignedRowsGroups[clientSender].rowGroups.ToArray();
        }
Beispiel #6
0
        private SheetGroups GetSheetGroups(IExcelDataReader reader, SheetConfig config, int sheetNumber)
        {
            var sheetGroups = new SheetGroups()
            {
                SheetNumber = sheetNumber,
                RowGroups   = new List <RowGroups>()
            };

            var rowNumber = 0;
            var header    = new HeaderLocator(config.HeaderIdentifier);

            while (reader.Read())
            {
                rowNumber++;

                if (!header.Found)
                {
                    header.Check(reader);
                    continue;
                }

                var rowGroups = new RowGroups(rowNumber);

                //Check groupings
                int hierarchyOrder = 0;
                foreach (var group in config.Groups)
                {
                    hierarchyOrder++;

                    var groupValue = new GroupValue(group.FieldName, hierarchyOrder);

                    //Check for match
                    var isMatch = true;
                    foreach (var identifier in group.Identifiers)
                    {
                        var value = CommissionImportReader.GetValue(reader, identifier.Column) ?? "";
                        if (Regex.Matches(value, identifier.Value).Count == 0)
                        {
                            isMatch = false;
                        }
                    }

                    if (isMatch)
                    {
                        var value = CommissionImportReader.GetValue(reader, group.Column) ?? "";

                        if (!string.IsNullOrEmpty(group.Formatter))
                        {
                            var match = Regex.Match(value, group.Formatter);
                            if (match.Success)
                            {
                                value = match.Value;
                            }
                        }

                        groupValue.Value       = value;
                        groupValue.IsInherited = false;
                    }

                    rowGroups.GroupValues.Add(groupValue);
                }

                sheetGroups.RowGroups.Add(rowGroups);
            }
            ;

            return(sheetGroups);
        }