当前位置: 首页>>代码示例>>C#>>正文


C# XElement.zAttribValue方法代码示例

本文整理汇总了C#中System.Xml.Linq.XElement.zAttribValue方法的典型用法代码示例。如果您正苦于以下问题:C# XElement.zAttribValue方法的具体用法?C# XElement.zAttribValue怎么用?C# XElement.zAttribValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Xml.Linq.XElement的用法示例。


在下文中一共展示了XElement.zAttribValue方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SetGridColumnEditSecond

        public static void SetGridColumnEditSecond(GridColumn col, XElement xe)
        {
            //if (gbTrace) cTrace.StartNestedLevel("SetGridColumnEditSecond");

            RepositoryItemTextEdit edit = new RepositoryItemTextEdit();
            edit.Name = "PKT_Grid_SecondEdit";
            ((System.ComponentModel.ISupportInitialize)edit).BeginInit();
            col.View.GridControl.RepositoryItems.AddRange(new RepositoryItem[] { edit });
            //edit.AutoHeight = false;

            string sFormat = xe.zAttribValue("Format");
            if (sFormat == "" || sFormat == null) sFormat = "hh:mm:ss";
            SecondEdit secondEdit = new SecondEdit();
            secondEdit.Format = sFormat;

            edit.MaskData.EditMask = secondEdit.EditMask;
            edit.MaskData.MaskType = MaskType.Simple;
            edit.FormatEditValue += new ConvertEditValueEventHandler(secondEdit.FormatEditValue);
            edit.ParseEditValue += new ConvertEditValueEventHandler(secondEdit.ParseEditValue);
            col.ColumnEdit = edit;
            ((System.ComponentModel.ISupportInitialize)edit).EndInit();

            //if (gbTrace) cTrace.StopNestedLevel("SetGridColumnEditSecond");
        }
开发者ID:labeuze,项目名称:source,代码行数:24,代码来源:XtraGrid.cs

示例2: ImageHtml

 public ImageHtml(XElement xe, string urlBase)
 {
     Source = zurl.GetUrl(urlBase, xe.zAttribValue("src"));
     Alt = xe.zAttribValue("alt");
     Title = xe.zAttribValue("title");
     Class = xe.zAttribValue("class");
 }
开发者ID:labeuze,项目名称:source,代码行数:7,代码来源:ImageHtml.cs

示例3: XXNodeLink

 public XXNodeLink(XElement xe)
 {
     if (xe.Name != "a")
         throw new PBException("error creating XXNodeLink with wrong node type \"{0}\"", xe.Name);
     type = XXNodeType.Link;
     link = xe;
     url = xe.zAttribValue("href");
     relAttribute = xe.zAttribValue("rel");
     typeAttribute = xe.zAttribValue("type");
     text = xe.Value;
 }
开发者ID:labeuze,项目名称:source,代码行数:11,代码来源:XXNode.cs

示例4: XXNodeImage

 public XXNodeImage(XElement xe)
 {
     if (xe.Name != "img")
         throw new PBException("error creating XXNodeImage with wrong node type \"{0}\"", xe.Name);
     type = XXNodeType.Image;
     img = xe;
     source = xe.zAttribValue("src");
     alt = xe.zAttribValue("alt");
     title = xe.zAttribValue("title");
     className = xe.zAttribValue("className");
 }
开发者ID:labeuze,项目名称:source,代码行数:11,代码来源:XXNode.cs

示例5: SetGridColumnEditCombo

        public void SetGridColumnEditCombo(GridColumn col, XElement colDefinition)
        {
            //if (gbTrace) cTrace.StartNestedLevel("SetGridColumnEditCombo");

            RepositoryItemComboBox combo = new RepositoryItemComboBox();
            combo.Name = "PKT_Grid_Combo";

            combo.AutoHeight = false;
            string sCmd = colDefinition.zAttribValue("Cmd");
            DataTable dt = null;
            if (sCmd != null) // la combo est rempli à partir d'une requête sql
                //dt = Ado.ExeCmd(gCon, sCmd);
                dt = _ado.ExeCmd(gCon, sCmd);
            else // sinon les valeurs de la combo sont la table fille "value"
                dt = colDefinition.zXmlToDataTable("value");
            for (int i = 0; i < dt.Rows.Count; i++) combo.Items.Add(dt.Rows[i][0]);
            combo.Name = "Combo_" + col.FieldName;
            combo.HotTrackDropDownItems = false;

            string sOption = colDefinition.zAttribValue("Option");
            bool bValueInListOnly;
            GetComboOptions(sOption, out bValueInListOnly);
            if (bValueInListOnly) combo.TextEditStyle = TextEditStyles.DisableTextEditor;

            combo.NullText = "";
            string sNullText = colDefinition.zAttribValue("NullText");
            if (sNullText != null) combo.NullText = sNullText;

            col.View.GridControl.RepositoryItems.AddRange(new RepositoryItem[] { combo });
            col.ColumnEdit = combo;

            //if (gbTrace) cTrace.StopNestedLevel("SetGridColumnEditCombo");
        }
开发者ID:labeuze,项目名称:source,代码行数:33,代码来源:XtraGrid.cs

示例6: CreateEditLookUp

        public static RepositoryItemLookUpEdit CreateEditLookUp(string sFieldName, XElement colDefinition, DataTable dt, bool bReadOnlyDataTable)
        {
            //if (col == null) return;

            //if (gbTrace) cTrace.StartNestedLevel("SetGridColumnEditLookUp2");

            RepositoryItemLookUpEdit look = new RepositoryItemLookUpEdit();
            string sLookUpName = colDefinition.zAttribValue("LookUpName");
            //if (sLookUpName == null) sLookUpName = "PKT_Grid_LookUp_" + col.FieldName;
            if (sLookUpName == null) sLookUpName = "PKT_Grid_LookUp_" + sFieldName;
            look.Name = sLookUpName;
            ((System.ComponentModel.ISupportInitialize)look).BeginInit();
            //view.GridControl.RepositoryItems.AddRange(new RepositoryItem[] { look });
            look.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            //col.ColumnEdit = look;
            look.AutoHeight = false;

            look.NullText = "";
            string sNullText = colDefinition.zAttribValue("NullText");
            if (sNullText != null) look.NullText = sNullText;

            //if (gbTrace) cTrace.StartNestedLevel("SetDataSource");
            look.DataSource = dt;
            look.PopulateColumns();
            if (look.Columns.Count == 0)
                throw new GridException("Error in lookup \"{0}\" no column in data source", sFieldName);
            //if (gbTrace) cTrace.StopNestedLevel("SetDataSource");

            //if (gbTrace) cTrace.StartNestedLevel("SetLookUpGridColumn");
            string sColumn = colDefinition.zAttribValue("Column");
            SetLookUpGridColumn(look, sColumn);
            //if (gbTrace) cTrace.StopNestedLevel("SetLookUpGridColumn");

            //if (gbTrace) cTrace.StartNestedLevel("BestFit");
            look.BestFit();
            //if (gbTrace) cTrace.StopNestedLevel("BestFit");

            //if (gbTrace) cTrace.StartNestedLevel("DisplayMember");
            // définition de look.DisplayMember
            string sDisplay = colDefinition.zAttribValue("Display");
            if (sDisplay != null)
            {
                if (look.Columns[sDisplay] != null)
                    look.DisplayMember = sDisplay;
                else
                    throw new GridException("Error in lookup \"{0}\" no display column, column {0} does'nt exist in data source", sFieldName, sDisplay);
            }
            else
            {
                look.DisplayMember = look.Columns[0].FieldName;
                for (int i = 0; i < look.Columns.Count; i++)
                    if (look.Columns[i].FieldName != sFieldName) { look.DisplayMember = look.Columns[i].FieldName; break; }
            }
            //if (gbTrace) cTrace.StopNestedLevel("DisplayMember");

            if (look.DisplayMember != sFieldName)
            {
                if (look.Columns[sFieldName] != null)
                    look.Columns[sFieldName].Visible = false;
            }

            //if (gbTrace) cTrace.StartNestedLevel("ValueMember");
            // définition de look.ValueMember
            string sValue = colDefinition.zAttribValue("Value");
            if (sValue != null)
            {
                if (look.Columns[sValue] != null)
                    look.ValueMember = sValue;
                else
                    throw new GridException("Error in lookup \"{0}\" no value column, column {0} does'nt exist in data source", sFieldName, sValue);
            }
            else
            {
                if (look.Columns[sFieldName] != null)
                    look.ValueMember = sFieldName;
                else
                    look.ValueMember = look.DisplayMember;
            }
            //if (gbTrace) cTrace.StopNestedLevel("ValueMember");

            //if (gbTrace) cTrace.StartNestedLevel("AddNullRow");
            string sAddNullRow = colDefinition.zAttribValue("AddNullRow");
            if (!bReadOnlyDataTable && sAddNullRow != null && sAddNullRow.ToLower() == "true")
            {
                DataRow dataRow = dt.NewRow();
                if (look.DisplayMember != look.ValueMember) dataRow[look.DisplayMember] = look.NullText;
                dt.Rows.InsertAt(dataRow, 0);
            }
            //if (gbTrace) cTrace.StopNestedLevel("AddNullRow");

            //look.TextEditStyle = TextEditStyles.Standard;
            look.SearchMode = SearchMode.OnlyInPopup;
            ((System.ComponentModel.ISupportInitialize)look).EndInit();

            //if (gbTrace) cTrace.StopNestedLevel("SetGridColumnEditLookUp2");

            return look;
        }
开发者ID:labeuze,项目名称:source,代码行数:98,代码来源:XtraGrid.cs

示例7: SetColumnEditLookUp

        public void SetColumnEditLookUp(GridColumn col, XElement colDefinition)
        {
            //GridView view, IDbConnection con, DataList dataList, 
            //if (gbTrace) cTrace.StartNestedLevel("SetGridColumnEditLookUp");

            string sLookUpName = colDefinition.zAttribValue("LookUpName");
            if (sLookUpName != null && gStaticEditRepositoryList != null && gStaticEditRepositoryList.ContainsKey(sLookUpName))
            {
                //cTrace.Trace("Use LookUp Repository : {0}", sLookUpName);
                RepositoryItem item = gStaticEditRepositoryList[sLookUpName];
                col.ColumnEdit = item;
                goto fin;
            }

            bool bReadOnlyDataTable;
            DataTable dt = null;
            string sTableDef = colDefinition.zAttribValue("TableDef");
            if (sTableDef != null)
            {
                dt = gDataList[sTableDef].DataTable;
                bReadOnlyDataTable = true;
            }
            else
            {
                string sCmd = colDefinition.zAttribValue("Cmd");
                if (sCmd != null) // les valeurs du lookup viennent de la base
                {
                    //if (gbTrace) cTrace.StartNestedLevel("LoadData");
                    //dt = Ado.ExeCmd(gCon, sCmd);
                    dt = _ado.ExeCmd(gCon, sCmd);
                    //if (gbTrace) cTrace.StopNestedLevel("LoadData");
                }
                else // sinon les valeurs du lookup sont la table fille "value"
                {
                    dt = colDefinition.zXmlToDataTable("value");
                    //dt = zdt.ChangeColumnType(dt, col.FieldName, col.ColumnType);
                    dt = dt.zChangeColumnType(col.FieldName, col.ColumnType);
                }
                bReadOnlyDataTable = false;
            }

            RepositoryItemLookUpEdit look = CreateEditLookUp(col.FieldName, colDefinition, dt, bReadOnlyDataTable);
            //view.GridControl.RepositoryItems.AddRange(new RepositoryItem[] { look });
            col.View.GridControl.RepositoryItems.AddRange(new RepositoryItem[] { look });
            col.ColumnEdit = look;

            if (sLookUpName != null && gStaticEditRepositoryList != null)
            {
                //cTrace.Trace("Add LookUp Repository : {0}", sLookUpName);
                gStaticEditRepositoryList.Add(sLookUpName, col.ColumnEdit);
            }

        fin:;
            //if (gbTrace) cTrace.StopNestedLevel("SetGridColumnEditLookUp");
        }
开发者ID:labeuze,项目名称:source,代码行数:55,代码来源:XtraGrid.cs

示例8: SetColumnEdit

 public void SetColumnEdit(GridColumn col, XElement colDefinition)
 {
     if (col == null) return;
     //string sEdit = colDefinition.zAttribValue("Edit");
     //if (sEdit == null || sEdit == "") return;
     // modif le 27/03/2013 column edit Mask par defaut pour pouvoir afficher les valeurs nulles --null--
     string sEdit = colDefinition.zAttribValue("Edit", "Mask");
     switch (sEdit.ToLower())
     {
         case "lookup":
             SetColumnEditLookUp(col, colDefinition);
             break;
         case "combo":
             SetGridColumnEditCombo(col, colDefinition);
             break;
         case "mask":
             SetGridColumnEditMask(col, colDefinition);
             break;
         case "memo":
             SetGridColumnEditMemo(col);
             break;
         case "heuresec":
         case "second":
             SetGridColumnEditSecond(col, colDefinition);
             break;
     }
 }
开发者ID:labeuze,项目名称:source,代码行数:27,代码来源:XtraGrid.cs

示例9: GetGrid

 public XtraGridControlManager GetGrid(XElement xe, GridControl grid, XtraGridControlManager parentGrid)
 {
     if (xe == null) return null;
     string sName = xe.zAttribValue("Name");
     if (sName == null || sName == "") throw new XtraGridException("error creating grid name is not defined");
     if (gGridControls.ContainsKey(sName)) return gGridControls[sName];
     XtraGridControlManager gridManager = new XtraGridControlManager(this, xe, grid, parentGrid);
     gGridControls.Add(sName, gridManager);
     return gridManager;
 }
开发者ID:labeuze,项目名称:source,代码行数:10,代码来源:XtraGrid.cs

示例10: GridSetViewOption

        private void GridSetViewOption(GridView view, XtraGridOption option, XElement definition, DataTable dt)
        {
            //if (gbTrace) cTrace.StartNestedLevel("GridSetViewOption");

            //if (gbTrace) cTrace.StartNestedLevel("Columns_Clear");
            view.Columns.Clear();
            //if (gbTrace) cTrace.StopNestedLevel("Columns_Clear");

            //if (gbTrace) cTrace.StartNestedLevel("PopulateColumns");
            if (dt != null)
                view.PopulateColumns(dt);
            else
                view.PopulateColumns();
            //if (gbTrace) cTrace.StopNestedLevel("PopulateColumns");

            //((System.ComponentModel.ISupportInitialize)(dxGrid)).BeginInit();
            //((System.ComponentModel.ISupportInitialize)(view)).BeginInit();

            //string sName = definition.zAttribValue("def");
            string sName = definition.zAttribValue("Name");
            if (sName != null) view.Name = sName;
            view.Name = sName;

            //if (gbTrace) cTrace.StartNestedLevel("SetGridColumn***");
            string sColumn = definition.zAttribValue("Column");
            XtraGridTools.SetGridColumn(view, sColumn);

            sColumn = definition.zAttribValue("ColumnCaption");
            XtraGridTools.SetGridColumnCaption(view, sColumn);

            sColumn = definition.zAttribValue("Update");
            XtraGridTools.SetGridColumnUpdate(view, sColumn);

            sColumn = definition.zAttribValue("ReadOnly");
            XtraGridTools.SetGridColumnReadOnly(view, sColumn);

            sColumn = definition.zAttribValue("Hide");
            XtraGridTools.SetGridColumnHide(view, sColumn);
            //if (gbTrace) cTrace.StopNestedLevel("SetGridColumn***");

            // Filter
            string sFilter = definition.zAttribValue("Filter");
            XtraGridTools.SetGridFilter(view, sFilter);

            view.OptionsView.ColumnAutoWidth = option.ColumnAutoWidth;
            view.OptionsView.ShowGroupPanel = option.ShowGroupPanel;
            view.OptionsView.ShowIndicator = !option.NoIndicator;
            view.OptionsView.ShowFilterPanel = !option.NoShowFilterPanel;
            view.OptionsView.ShowColumnHeaders = !option.NoShowColumnHeaders;

            view.OptionsCustomization.AllowFilter = !option.NoAllowFilter;
            view.OptionsCustomization.AllowGroup = !option.NoAllowGroup;
            view.OptionsCustomization.AllowRowSizing = !option.NoAllowRowSizing;
            view.OptionsCustomization.AllowSort = !option.NoAllowSort;

            //RowHeight
            XtraGridTools.SetRowHeight(view, definition.zAttribValue("RowHeight"));

            Font font = XtraGridTools.GetFont(definition.zAttribValue("Font"));
            if (font != null)
            {
                view.ViewStylesInfo.Row.Font = font;
                view.ViewStylesInfo.FocusedRow.Font = font;
                view.ViewStylesInfo.FocusedCell.Font = font;
            }

            StyleOptions style;
            if (XtraGridTools.GetStyleOptions(definition.zAttribValue("StyleFocusedRow"), out style))
                view.ViewStylesInfo.FocusedRow.Options = style;
            if (XtraGridTools.GetStyleOptions(definition.zAttribValue("StyleSelectedRow"), out style))
                view.ViewStylesInfo.SelectedRow.Options = style;
            if (XtraGridTools.GetStyleOptions(definition.zAttribValue("StyleHideSelectionRow"), out style))
                view.ViewStylesInfo.HideSelectionRow.Options = style;

            //OptionsDetail
            view.OptionsDetail.EnableMasterViewMode = option.MasterViewMode;
            view.OptionsDetail.AllowZoomDetail = option.AllowZoomDetail;
            view.OptionsDetail.SmartDetailExpand = option.SmartDetailExpand;
            view.OptionsDetail.AllowExpandEmptyDetails = option.AllowExpandEmptyDetails;
            view.OptionsDetail.AutoZoomDetail = option.AutoZoomDetail;
            view.OptionsDetail.EnableDetailToolTip = option.EnableDetailToolTip;
            view.OptionsDetail.ShowDetailTabs = option.ShowDetailTabs;
            view.OptionsDetail.SmartDetailHeight = option.SmartDetailHeight;

            view.OptionsBehavior.Editable = false;

            view.OptionsView.ShowNewItemRow = false;
            if (!option.ReadOnly)
            {
                if (!option.NoUpdate) view.OptionsBehavior.Editable = true;
                if (!option.NoInsert && !option.NoInsertButton) view.OptionsView.ShowNewItemRow = true;
            }

            if (!option.NoMultiSelect) view.OptionsSelection.MultiSelect = true;

            //if (gbTrace) cTrace.StartNestedLevel("GridSetViewOption_2");
            IEnumerable<XElement> colDefinitions = null;
            if (definition != null)
            {
                colDefinitions = definition.Elements("col");
//.........这里部分代码省略.........
开发者ID:labeuze,项目名称:source,代码行数:101,代码来源:XtraGrid.cs

示例11: GridSetOption

        public static void GridSetOption(GridControl dxGrid, XElement xe, DataTable dt, IDbConnection con, DataList dataList)
        {
            string sOption = xe.zAttribValue("Option");
            XtraGridOption option = new XtraGridOption(sOption);
            dxGrid.ForceInitialize();

            //GridSetNavigatorOption(dxGrid, option);
            XtraGridTools.SetNavigatorOption(dxGrid, option);

            GridSetViewOption((GridView)dxGrid.MainView, xe, dt, con, dataList, option);
            dxGrid.Leave += new EventHandler(GridControl_Leave);
        }
开发者ID:labeuze,项目名称:source,代码行数:12,代码来源:cGrid.cs

示例12: XtraGridControlManager

 public XtraGridControlManager(XtraGridFormManager formManager, XElement xe)
 {
     gFormManager = formManager;
     gsName = xe.zAttribValue("Name");
     gGridDefinition = xe;
     Init();
 }
开发者ID:labeuze,项目名称:source,代码行数:7,代码来源:XtraGrid.cs

示例13: sql

        /****************
		<def
			def="b_channel"
			Caption="Channel"
			Cmd="commande sql (select * from b_channel"
			CmdType="StoredProcedure | TableDirect | Text"
			UpdateCmd="update b_channel set shortname = @shortname, longname = @longname where channel_id = @channel_id"
			UpdateCmdType="StoredProcedure | TableDirect | Text"
			Option=""
		>
			<col Name="client_id" Option="ReadOnly, Hide"/>
			<!--<col Name="code" Edit="LookUp" Display="code" Value="code" Cmd="select code, longname channel from b_channel order by isnull(order_no, 9999), longname"/>-->
		</def>
		****************/
        public static void CreateDataSource(IDbConnection con, DataList dataList, XElement xe, out IDbDataAdapter da, out DataTable dt, DataTable dtMaster)
        {
            da = null;
            dt = null;
            bool bDetailDynamic = false;

            if (xe == null) return;

            //if (gbTrace) cTrace.StartNestedLevel("cGrid_CreateDataSource");

            string sOption = xe.zAttribValue("Option");
            XtraGridOption option = new XtraGridOption(sOption);
            bDetailDynamic = option.DetailDynamic;

            string sCmdType, sCmd;
            IDbCommand cmd = null;
            string sTableDef = xe.zAttribValue("TableDef");
            if (sTableDef != null)
            {
                DataContainer data = dataList[sTableDef];
                cmd = data.Command;
                dt = data.DataTable;
                //da = Ado.CreateDataAdapter(cmd);
                da = _ado.CreateDataAdapter(cmd);
            }
            else
            {
                sCmdType = xe.zAttribValue("CmdType", CommandType.Text.ToString());
                sCmd = xe.zAttribValue("Cmd");
                //cmd = Ado.CreateCmd(con, sCmd, Ado.GetCommandType(sCmdType));
                cmd = _ado.CreateCmd(con, sCmd, _ado.GetCommandType(sCmdType));

                if (bDetailDynamic)
                {
                    string sMasterId = xe.zAttribValue("MasterId");
                    AddMasterIdParameter(cmd, dtMaster, sMasterId);
                }

                string sTable = GetTableName(xe);
                dt = new DataTable(sTable);

                //da = Ado.CreateDataAdapter(cmd);
                da = _ado.CreateDataAdapter(cmd);

                //Ado.DataAdapter_FillSchema(da, dt);
                _ado.DataAdapter_FillSchema(da, dt);

                string sPrimaryKey = xe.zAttribValue("PrimaryKey");
                SetPrimaryKey(dt, sPrimaryKey);

                SetDataTableColumnOption(dt, xe);
            }

            //////////////////   Debug pb channel_id
            //if (dt.Columns.Contains("channel_id"))
            //{
            //    cTrace.Trace("PB_Grid.DataContainer.CreateDataTable() : après DataAdapter_FillSchema");
            //    DataColumn col = dt.Columns["channel_id"];
            //    cTrace.Trace("PB_Grid.cGrid.CreateDataSource() : Table {0}, col {1}, AutoIncrementSeed = {2}, AutoIncrementStep = {3}", dt.TableName, col.ColumnName, col.AutoIncrementSeed, col.AutoIncrementStep);

            //    dt.TableNewRow -= new DataTableNewRowEventHandler(Test_TableNewRow_Event);
            //    dt.TableNewRow += new DataTableNewRowEventHandler(Test_TableNewRow_Event);

            //    DataRow row = dt.NewRow();
            //    //col.AutoIncrementSeed = -20;
            //    //cTrace.Trace("PB_Grid.cGrid.CreateDataSource() : Table {0}, col {1}, AutoIncrementSeed = {2}, AutoIncrementStep = {3}", dt.TableName, col.ColumnName, col.AutoIncrementSeed, col.AutoIncrementStep);
            //    //row = dt.NewRow();
            //    //col.AutoIncrementSeed = -1;
            //    //cTrace.Trace("PB_Grid.cGrid.CreateDataSource() : Table {0}, col {1}, AutoIncrementSeed = {2}, AutoIncrementStep = {3}", dt.TableName, col.ColumnName, col.AutoIncrementSeed, col.AutoIncrementStep);
            //    //row = dt.NewRow();
            //}

            sCmdType = xe.zAttribValue("UpdateCmdType", CommandType.Text.ToString());
            sCmd = xe.zAttribValue("UpdateCmd");
            if (sCmd != null)
            {
                //da.UpdateCommand = Ado.CreateCmd(con, sCmd, Ado.GetCommandType(sCmdType), dt);
                da.UpdateCommand = _ado.CreateCmd(con, sCmd, _ado.GetCommandType(sCmdType), dt);
                da.UpdateCommand.UpdatedRowSource = UpdateRowSource.Both;
            }

            bool bInsertCmdDefined = false;
            sCmdType = xe.zAttribValue("InsertCmdType", CommandType.Text.ToString());
            sCmd = xe.zAttribValue("InsertCmd");
            if (sCmd != null)
            {
//.........这里部分代码省略.........
开发者ID:labeuze,项目名称:source,代码行数:101,代码来源:cGrid.cs

示例14: AddDetailDataSource

        public void AddDetailDataSource(IDbConnection con, DataList dataList, IDbDataAdapter da, DataTable dt, XElement xe)
        {
            //string sDataName = Xml.GetAttribValue(xe, "def");
            string sDataName = xe.zAttribValue("def");
            if (sDataName == gsDetailName) return;

            //if (gbTrace) cTrace.StartNestedLevel("cGrid_AddDetailDataSource_2");

            Update();
            int iRow = 0;
            if (gGridMaster != null && gGridMaster.MainView != null) iRow = ((GridView)gGridMaster.MainView).FocusedRowHandle;

            ClearDetailDataSource();
            if (xe == null) return;

            string sOption = xe.zAttribValue("Option");
            XtraGridOption option = gOptionDetail = new XtraGridOption(sOption);
            gdaDetail = da; gdtDetail = dt;
            gbDetailDynamic = option.DetailDynamic;


            gsMasterId = xe.zAttribValue("MasterId");
            gsDetailId = xe.zAttribValue("DetailId", gsMasterId);

            GridSetDataSource(gGridDetail, gdtDetail, xe, con, dataList, option);
            gViewDetail.OptionsView.ShowFilterPanel = false;

            DetailUpdateList();
            gsDetailName = sDataName;
            //LoadDetailParameters();
            if (gGridMaster != null && gGridMaster.MainView != null) ((GridView)gGridMaster.MainView).FocusedRowHandle = iRow;

            //if (gbTrace) cTrace.StopNestedLevel("cGrid_AddDetailDataSource_2");
        }
开发者ID:labeuze,项目名称:source,代码行数:34,代码来源:cGrid.cs

示例15: SetMasterDataSource

        public void SetMasterDataSource(IDbConnection con, DataList dataList, DataTable dt, IDbDataAdapter da, XElement xe)
        {
            //cTrace.StartNestedLevel("cGrid_SetMasterDataSource");

            //string sDataName = Xml.GetAttribValue(xe, "def");
            string sDataName = xe.zAttribValue("def");
            if (sDataName == gsMasterName) return;
            //Update();
            ClearDataSource();
            //gsMasterId = null;
            //gsDetailId = null;
            //gbDetailDynamic = false;
            if (xe == null) return;
            gdaMaster = da;
            gdtMaster = dt;
            XtraGridOption option = gOptionMaster = new XtraGridOption(xe.zAttribValue("Option"));
            GridSetDataSource(gGridMaster, dt, xe, con, dataList, option);
            gdtMaster.RowDeleting += new DataRowChangeEventHandler(DataTableMaster_RowDeleting);
            gsMasterName = sDataName;
            //LoadMasterParameters();

            //cTrace.StopNestedLevel("cGrid_SetMasterDataSource");
        }
开发者ID:labeuze,项目名称:source,代码行数:23,代码来源:cGrid.cs


注:本文中的System.Xml.Linq.XElement.zAttribValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。