本文整理汇总了C#中XmlHelper.TryGetInteger方法的典型用法代码示例。如果您正苦于以下问题:C# XmlHelper.TryGetInteger方法的具体用法?C# XmlHelper.TryGetInteger怎么用?C# XmlHelper.TryGetInteger使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XmlHelper
的用法示例。
在下文中一共展示了XmlHelper.TryGetInteger方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetDefinition
public void SetDefinition(System.Xml.XmlElement definition)
{
XmlHelper h = new XmlHelper(definition);
_initialized = false;
//Check Basic Tab
chkBasic.Checked = CheckEnable(h.GetElement("Authentication/Basic"), true);
cbHashProvider.Text = h.GetText("Authentication/Basic/PasswordHashProvider/@DriverClass");
txtGetUserDataQuery.Text = h.GetText("Authentication/Basic/UserInfoStorage/DBSchema/GetUserDataQuery");
txtGetUserRoleQuery.Text = h.GetText("Authentication/Basic/UserInfoStorage/DBSchema/GetUserRolesQuery");
//Check Session Tab
chkSession.Checked = h.TryGetBoolean("Authentication/Session/@Enabled", true);
txtTimeout.Text = h.TryGetInteger("Authentication/Session/@Timeout", 20).ToString();
//Check Passport Tab
chkPassport.Checked = CheckEnable(h.GetElement("Authentication/Passport"), false);
txtIssuer.Text = h.GetText("Authentication/Passport/Issuer/@Name");
txtCertProvider.Text = h.GetText("Authentication/Passport/Issuer/CertificateProvider");
cbALTable.Text = h.GetText("Authentication/Passport/AccountLinking/TableName");
cboMappingField.Text = h.GetText("Authentication/Passport/AccountLinking/MappingField");
cbUserNameField.Text = h.GetText("Authentication/Passport/AccountLinking/UserNameField");
dgExtProp.Rows.Clear();
foreach (XmlElement pe in h.GetElements("Authentication/Passport/AccountLinking/Properties/Property"))
{
int index = dgExtProp.Rows.Add();
DataGridViewRow row = dgExtProp.Rows[index];
row.Cells[colAlias.Name].Value = pe.GetAttribute("Alias");
row.Cells[colDBField.Name].Value = pe.GetAttribute("Field");
}
CheckTabs();
_initialized = true;
}
示例2: Pagination
internal Pagination(XmlElement pageElement)
{
if (pageElement == null)
{
this.AllowPagination = true;
this.MaxPageSize = 0;
return;
}
XmlHelper h = new XmlHelper(pageElement);
this.AllowPagination = h.TryGetBoolean("@Allow", true);
this.MaxPageSize = h.TryGetInteger("MaxPageSize", 0);
}
示例3: ExecuteSQL
//.........这里部分代码省略.........
commands.Add(sql);
}
StringBuilder sb = new StringBuilder();
Envelope env = null;
bool showSelect = false;
bool occurError = false;
long t1 = System.Environment.TickCount;
if (commands.Count > 0)
{
sb.Append("執行 ").Append(commands.Count).Append(" Command\n");
XmlHelper req = new XmlHelper();
foreach (string sql in commands)
{
XmlElement xml = req.AddElement(".", "Command");
XmlCDataSection section = xml.OwnerDocument.CreateCDataSection(sql);
xml.AppendChild(section);
}
try
{
env = MainForm.CurrentProject.SendRequest("UDTService.DML.Command", new Envelope(req));
}
catch (Exception ex)
{
sb.Append("執行 Commands 時發生錯誤.\n").Append(ex.Message).Append("\n");
occurError = true;
}
}
if (lastSQL.StartsWith("select", StringComparison.CurrentCultureIgnoreCase))
{
sb.Append("執行 SQL Query : ").Append(lastSQL).Append("\n");
XmlHelper req = new XmlHelper();
XmlElement xml = req.AddElement("SQL");
XmlCDataSection section = xml.OwnerDocument.CreateCDataSection(lastSQL);
xml.AppendChild(section);
try
{
env = MainForm.CurrentProject.SendRequest("UDTService.DML.Query", new Envelope(req));
}
catch (Exception ex)
{
sb.Append("執行 Query 時發生錯誤.\n").Append(ex.Message).Append("\n");
occurError = true;
}
showSelect = true;
}
long t2 = System.Environment.TickCount;
tsLabel.Text = "執行時間 : " + (t2 - t1) + "ms";
dgResult.Rows.Clear();
dgResult.Columns.Clear();
if (!occurError)
{
XmlHelper rsp = new XmlHelper(env.Body);
if (showSelect)
{
foreach (XmlElement col in rsp.GetElements("Metadata/Column"))
{
dgResult.Columns.Add("col" + col.GetAttribute("Index"), col.GetAttribute("Field"));
}
foreach (XmlElement record in rsp.GetElements("Record"))
{
int rowIndex = dgResult.Rows.Add();
DataGridViewRow row = dgResult.Rows[rowIndex];
XmlHelper h = new XmlHelper(record);
foreach (XmlElement col in h.GetElements("Column"))
{
string columnName = "col" + col.GetAttribute("Index");
string value = col.InnerText;
row.Cells[columnName].Value = value;
}
}
}
else
{
dgResult.Columns.Add("colResult", "Result");
dgResult.Rows.Add();
dgResult.Rows[0].Cells["colResult"].Value = rsp.TryGetInteger("Update", 0);
}
}
txtInfo.Text = sb.ToString();
if (occurError)
{
tabControl1.SelectedTab = tpInfo;
}
else
{
tabControl1.SelectedTab = tpResult;
}
}