本文整理汇总了C#中System.Xml.XmlNode.GetValue方法的典型用法代码示例。如果您正苦于以下问题:C# XmlNode.GetValue方法的具体用法?C# XmlNode.GetValue怎么用?C# XmlNode.GetValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Xml.XmlNode
的用法示例。
在下文中一共展示了XmlNode.GetValue方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Balance
public Balance(XmlNode ledgerNode, XmlNode avaliableNode)
{
string tempLedgerBalance = ledgerNode.GetValue("BALAMT");
if (!String.IsNullOrEmpty(tempLedgerBalance))
{
LedgerBalance = Convert.ToDecimal(tempLedgerBalance);
}
else
{
throw new OFXParseException("Ledger balance has not been set");
}
string tempAvaliableBalance = avaliableNode.GetValue("BALAMT");
if (!String.IsNullOrEmpty(tempAvaliableBalance))
{
AvaliableBalance = Convert.ToDecimal(tempAvaliableBalance);
}
else
{
throw new OFXParseException("Avaliable balance has not been set");
}
LedgerBalanceDate = ledgerNode.GetValue("DTASOF").ToDate();
AvaliableBalanceDate = avaliableNode.GetValue("DTASOF").ToDate();
}
示例2: Rectangle
public Rectangle(XmlNode node)
{
Left = new VerticalSlice(node.GetValue("left"));
Right = new VerticalSlice(node.GetValue("right"));
Top = new HorizontalSlice(node.GetValue("top"));
Bottom = new HorizontalSlice(node.GetValue("bottom"));
}
示例3: SignOn
public SignOn(XmlNode node)
{
StatusCode = Convert.ToInt32(node.GetValue("//CODE"));
StatusSeverity = node.GetValue("//SEVERITY");
DTServer = node.GetValue("//DTSERVER").ToDate();
Language = node.GetValue("//LANGUAGE");
IntuBid = node.GetValue("//INTU.BID");
}
示例4: SignOn
public SignOn(XmlNode node)
{
StatusCode = Convert.ToInt32(node.GetValue("STATUS/CODE"));
StatusSeverity = node.GetValue("STATUS/SEVERITY");
DTServer = Convert.ToInt64(node.GetValue("DTSERVER"));
Language = node.GetValue("LANGUAGE");
IntuBid = node.GetValue("INTU.BID");
}
示例5: Balance
public Balance(XmlNode ledgerNode, XmlNode avaliableNode)
{
var tempLedgerBalance = ledgerNode.GetValue("BALAMT");
if (!String.IsNullOrEmpty(tempLedgerBalance))
{
// ***** Forced Invariant Culture.
// If you don't force it, it will use the computer's default (defined in windows control panel, regional settings)
// So, if the number format of the computer in use it's different from OFX standard (i suppose the english/invariant),
// the next line of could crash or (worse) the number would be wrongly interpreted.
// For example, my computer has a brazilian regional setting, with "." as thousand separator and "," as
// decimal separator, so the value "10.99" (ten 'dollars' (or whatever currency) and ninetynine cents) would be interpreted as "1099"
// (one thousand and ninetynine dollars - the "." would be ignored)
LedgerBalance = Convert.ToDecimal(tempLedgerBalance, CultureInfo.InvariantCulture);
}
else
{
throw new OFXParseException("Ledger balance has not been set");
}
// ***** OFX files from my bank don't have the 'avaliableNode' node, so i manage a null situation
if (avaliableNode == null)
{
AvaliableBalance = 0;
// ***** this member veriable should be a nullable DateTime, declared as:
// public DateTime? LedgerBalanceDate { get; set; }
// and next line could be:
// AvaliableBalanceDate = null;
AvaliableBalanceDate = new DateTime();
}
else
{
var tempAvaliableBalance = avaliableNode.GetValue("BALAMT");
if (!String.IsNullOrEmpty(tempAvaliableBalance))
{
// ***** Forced Invariant Culture. (same commment as above)
AvaliableBalance = Convert.ToDecimal(tempAvaliableBalance, CultureInfo.InvariantCulture);
}
else
{
throw new OFXParseException("Avaliable balance has not been set");
}
AvaliableBalanceDate = avaliableNode.GetValue("DTASOF").ToDate();
}
LedgerBalanceDate = ledgerNode.GetValue("DTASOF").ToDate();
}
示例6: Account
public Account(XmlNode node, AccountType type)
{
AccountType = type;
AccountID = node.GetValue("//ACCTID");
AccountKey = node.GetValue("//ACCTKEY");
switch (AccountType)
{
case AccountType.BANK:
InitializeBank(node);
break;
case AccountType.AP:
InitializeAP(node);
break;
case AccountType.AR:
InitializeAR(node);
break;
default:
break;
}
}
示例7: LoadFromNode
protected static Slice LoadFromNode(XmlNode node, Slice slice)
{
slice.Position = node.GetValue("position");
slice.Index = node.GetValue("index");
slice.Begin = new HorizontalSlice(node.GetValue("begin"));
slice.End = new HorizontalSlice(node.GetValue("end"));
slice.Changed = false;
return slice;
}
示例8: InitializeBank
/// <summary>
/// Initializes information specific to bank
/// </summary>
private void InitializeBank(XmlNode node)
{
BankID = node.GetValue("//BANKID");
BranchID = node.GetValue("//BRANCHID");
//Get Bank Account Type from XML
string bankAccountType = node.GetValue("//ACCTTYPE");
//Check that it has been set
if (String.IsNullOrEmpty(bankAccountType))
throw new OFXParseException("Bank Account type unknown");
//Set bank account enum
_BankAccountType = bankAccountType.GetBankAccountType();
}
示例9: Transaction
public Transaction(XmlNode node, string currency)
{
TransType = GetTransactionType(node.GetValue("//TRNTYPE"));
Date = node.GetValue("//DTPOSTED").ToDate();
TransactionInitializationDate = node.GetValue("//DTUSER").ToDate();
FundAvaliabilityDate = node.GetValue("//DTAVAIL").ToDate();
try
{
Amount = Convert.ToDecimal(node.GetValue("//TRNAMT"), CultureInfo.InvariantCulture);
}
catch (Exception ex)
{
throw new OFXParseException("Transaction Amount unknown", ex);
}
try
{
TransactionID = node.GetValue("//FITID");
}
catch (Exception ex)
{
throw new OFXParseException("Transaction ID unknown", ex);
}
IncorrectTransactionID = node.GetValue("//CORRECTFITID");
//If Transaction Correction Action exists, populate
var tempCorrectionAction = node.GetValue("//CORRECTACTION");
TransactionCorrectionAction = !String.IsNullOrEmpty(tempCorrectionAction)
? GetTransactionCorrectionType(tempCorrectionAction)
: TransactionCorrectionType.NA;
ServerTransactionID = node.GetValue("//SRVRTID");
CheckNum = node.GetValue("//CHECKNUM");
ReferenceNumber = node.GetValue("//REFNUM");
Sic = node.GetValue("//SIC");
PayeeID = node.GetValue("//PAYEEID");
Name = node.GetValue("//NAME");
Memo = node.GetValue("//MEMO");
//If differenct currency to CURDEF, populate currency
if (NodeExists(node, "//CURRENCY"))
Currency = node.GetValue("//CURRENCY");
else if (NodeExists(node, "//ORIGCURRENCY"))
Currency = node.GetValue("//ORIGCURRENCY");
//If currency not different, set to CURDEF
else
Currency = currency;
//If senders bank/credit card details avaliable, add
if (NodeExists(node, "//BANKACCTTO"))
TransactionSenderAccount = new Account(node.SelectSingleNode("//BANKACCTTO"), AccountType.BANK);
else if (NodeExists(node, "//CCACCTTO"))
TransactionSenderAccount = new Account(node.SelectSingleNode("//CCACCTTO"), AccountType.CC);
}