本文整理匯總了C#中System.Xml.XmlNode.IsNullOrEmpty方法的典型用法代碼示例。如果您正苦於以下問題:C# XmlNode.IsNullOrEmpty方法的具體用法?C# XmlNode.IsNullOrEmpty怎麽用?C# XmlNode.IsNullOrEmpty使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.Xml.XmlNode
的用法示例。
在下文中一共展示了XmlNode.IsNullOrEmpty方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: Create
public object Create(
object parent, object configContext, XmlNode section)
{
if(null == _Config) {
lock(_Lock) {
if(null == _Config) {
_Config = new Config();
if(section.IsNullOrEmpty()) {
return _Config;
}
foreach(XmlNode node in section.ChildNodes) {
if(node.IsNullOrEmpty()) { continue; }
switch(node.Name.ToPascalCasing()) {
case Config.Xml.Kernel:
_Config.KernelSection =
ParsedAsAnys(node);
break;
case Config.Xml.Builtin:
_Config.BuiltinSection =
ParsedAsManys(node);
break;
case Config.Xml.Plugin:
_Config.PluginSection =
ParsedAsManys(node);
break;
case Config.Xml.Application:
_Config.ApplicationSection =
ParsedAsManys(node);
break;
}
}
}
}
}
return _Config;
}
示例2: GetConflicts
private Clients.SCR.Template.Conflict[] GetConflicts(XmlNode[] aXmlNodes)
{
if (aXmlNodes.IsNullOrEmpty())
return null;
List<Clients.SCR.Template.Conflict> aINPs = new List<Clients.SCR.Template.Conflict>();
int nID;
Clients.SCR.Template.Bind eBind;
foreach (XmlNode cXmlNodeConflict in aXmlNodes)
{
nID = cXmlNodeConflict.AttributeGet<int>("id_preset", false);
eBind = cXmlNodeConflict.AttributeGet<Clients.SCR.Template.Bind>("bind", false);
aINPs.Add(new Clients.SCR.Template.Conflict() { nPresetID = nID, eBind = eBind });
}
return aINPs.ToArray();
}
示例3: GetParameters
private Clients.SCR.Template.Parameters[] GetParameters(XmlNode[] aXmlNodes)
{
if (aXmlNodes.IsNullOrEmpty())
return null;
List<Clients.SCR.Template.Parameters> aParams = new List<Clients.SCR.Template.Parameters>();
int nID;
string sText;
bool bIsVisible = true;
bool bIsEnabled = true;
bool bAutostart = true;
Clients.SCR.Template.FirstAction eFirstAction;
foreach (XmlNode cXmlNode in aXmlNodes)
{
nID = cXmlNode.AttributeGet<int>("id_preset", false);
sText = cXmlNode.AttributeValueGet("text", false);
if (!bool.TryParse(cXmlNode.AttributeValueGet("is_visible", false), out bIsVisible))
bIsVisible = true;
if (!bool.TryParse(cXmlNode.AttributeValueGet("is_enabled", false), out bIsEnabled))
bIsEnabled = true;
if (!bool.TryParse(cXmlNode.AttributeValueGet("autostart", false), out bAutostart))
bAutostart = true;
if (!Clients.SCR.Template.FirstAction.TryParse(cXmlNode.AttributeValueGet("first_action", false), true, out eFirstAction))
eFirstAction = Clients.SCR.Template.FirstAction.start;
aParams.Add(new Clients.SCR.Template.Parameters() { nPresetID = nID, sText = sText, bIsEnabled = bIsEnabled, bIsVisible = bIsVisible, bAutostart = bAutostart, eFirstAction = eFirstAction });
}
return aParams.ToArray();
}
示例4: GetOffsets
private Clients.SCR.Template.Offset[] GetOffsets(XmlNode[] aXmlNodes)
{
if (aXmlNodes.IsNullOrEmpty())
return null;
List<Clients.SCR.Template.Offset> aINPs = new List<Clients.SCR.Template.Offset>();
bool bDoOnlyIfLast = false;
foreach (XmlNode cXmlNode in aXmlNodes)
{
if (!bool.TryParse(cXmlNode.AttributeValueGet("do_if_last", false), out bDoOnlyIfLast))
bDoOnlyIfLast = false;
aINPs.Add(new Clients.SCR.Template.Offset()
{
nPresetID = cXmlNode.AttributeGet<int>("id_preset", false),
nOffsetIn = cXmlNode.AttributeGet<int>("in", false),
nOffsetOut = cXmlNode.AttributeGet<int>("out", false),
nDurationSafe = cXmlNode.AttributeGet<int>("safe", false),
bDoOnlyIfLast = bDoOnlyIfLast,
sNextClass = cXmlNode.AttributeValueGet("next_class", false),
sNextType = cXmlNode.AttributeValueGet("next_type", false),
sPreClass = cXmlNode.AttributeValueGet("pre_class", false),
sPreType = cXmlNode.AttributeValueGet("pre_type", false),
sClass = cXmlNode.AttributeValueGet("class", false),
sType = cXmlNode.AttributeValueGet("type", false)
});
}
return aINPs.ToArray();
}