Пример #1
0
        private void dataGridViewPlayers_ColumnDisplayIndexChanged(object sender, DataGridViewColumnEventArgs e)
        {
            if (e.Column.Tag != null && !buildingUI)
            {
                HM.Entities.HattrickManager.Settings.Column column = user.applicationSettingsField.tableColumsListField[Resources.ColumnTables.Players].Find(col => col.columnIDField == Convert.ToUInt16(e.Column.Tag));

                column.displayIndex = Convert.ToInt32(e.Column.DisplayIndex);
            }
        }
        private Dictionary <ColumnTables, List <HMEntities.Settings.Column> > ParseSettingColumnListNode(XmlNode node)
        {
            try {
                Dictionary <ColumnTables, List <HMEntities.Settings.Column> > tableColumns = new Dictionary <ColumnTables, List <HMEntities.Settings.Column> >();

                foreach (XmlNode xmlColumnListNodes in node.ChildNodes)
                {
                    if (xmlColumnListNodes.NodeType != XmlNodeType.Comment && xmlColumnListNodes.ChildNodes != null)
                    {
                        ColumnTables key = (ColumnTables)Convert.ToInt32(xmlColumnListNodes.Attributes[Tags.ColumnTableID].InnerText);
                        List <HMEntities.Settings.Column> columnList = new List <HMEntities.Settings.Column>();

                        foreach (XmlNode xmlColumnNode in xmlColumnListNodes.ChildNodes)
                        {
                            HMEntities.Settings.Column column = new HMEntities.Settings.Column();

                            foreach (XmlNode xmlColumnChildNode in xmlColumnNode.ChildNodes)
                            {
                                switch (xmlColumnChildNode.Name)
                                {
                                case Tags.ColumnID:
                                    column.columnIDField = Convert.ToUInt16(xmlColumnChildNode.InnerText);
                                    break;

                                case Tags.ColumnTitle:
                                    column.titleField = xmlColumnChildNode.InnerText;
                                    break;

                                case Tags.ColumnWidth:
                                    column.widthField = Convert.ToUInt16(xmlColumnChildNode.InnerText);
                                    break;

                                case Tags.ColumnDisplayType:
                                    column.displayTypeField = (ColumnDisplayType)Convert.ToInt32(xmlColumnChildNode.InnerText);
                                    break;

                                case Tags.ColumnAlignment:
                                    column.alignmentField = (ColumnAlignment)Convert.ToInt32(xmlColumnChildNode.InnerText);
                                    break;

                                case Tags.ColumnDisplay:
                                    column.displayColumnField = Convert.ToBoolean(xmlColumnChildNode.InnerText);
                                    break;

                                case Tags.ColumnDisplayIndex:
                                    column.displayIndex = Convert.ToInt32(xmlColumnChildNode.InnerText);
                                    break;

                                case Tags.ColumnSortColumn:
                                    column.sortedColumnField = Convert.ToInt32(xmlColumnChildNode.InnerText);
                                    break;
                                }
                            }

                            columnList.Add(column);
                        }

                        tableColumns.Add(key, columnList);
                    }
                }

                return(tableColumns);
            } catch (Exception ex) {
                throw ex;
            }
        }
        private Dictionary<ColumnTables, List<HMEntities.Settings.Column>> ParseSettingColumnListNode(XmlNode node)
        {
            try {
                Dictionary<ColumnTables, List<HMEntities.Settings.Column>> tableColumns = new Dictionary<ColumnTables, List<HMEntities.Settings.Column>>();

                foreach (XmlNode xmlColumnListNodes in node.ChildNodes) {
                    if (xmlColumnListNodes.NodeType != XmlNodeType.Comment && xmlColumnListNodes.ChildNodes != null) {
                        ColumnTables key = (ColumnTables)Convert.ToInt32(xmlColumnListNodes.Attributes[Tags.ColumnTableID].InnerText);
                        List<HMEntities.Settings.Column> columnList = new List<HMEntities.Settings.Column>();

                        foreach (XmlNode xmlColumnNode in xmlColumnListNodes.ChildNodes) {
                            HMEntities.Settings.Column column = new HMEntities.Settings.Column();

                            foreach (XmlNode xmlColumnChildNode in xmlColumnNode.ChildNodes) {
                                switch (xmlColumnChildNode.Name) {
                                    case Tags.ColumnID:
                                        column.columnIDField = Convert.ToUInt16(xmlColumnChildNode.InnerText);
                                        break;
                                    case Tags.ColumnTitle:
                                        column.titleField = xmlColumnChildNode.InnerText;
                                        break;
                                    case Tags.ColumnWidth:
                                        column.widthField = Convert.ToUInt16(xmlColumnChildNode.InnerText);
                                        break;
                                    case Tags.ColumnDisplayType:
                                        column.displayTypeField = (ColumnDisplayType)Convert.ToInt32(xmlColumnChildNode.InnerText);
                                        break;
                                    case Tags.ColumnAlignment:
                                        column.alignmentField = (ColumnAlignment)Convert.ToInt32(xmlColumnChildNode.InnerText);
                                        break;
                                    case Tags.ColumnDisplay:
                                        column.displayColumnField = Convert.ToBoolean(xmlColumnChildNode.InnerText);
                                        break;
                                    case Tags.ColumnDisplayIndex:
                                        column.displayIndex = Convert.ToInt32(xmlColumnChildNode.InnerText);
                                        break;
                                    case Tags.ColumnSortColumn:
                                        column.sortedColumnField = Convert.ToInt32(xmlColumnChildNode.InnerText);
                                        break;
                                }
                            }

                            columnList.Add(column);
                        }

                        tableColumns.Add(key, columnList);
                    }
                }

                return (tableColumns);
            } catch (Exception ex) {
                throw ex;
            }
        }