本文整理汇总了C#中System.Xml.XmlElement.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# XmlElement.ToString方法的具体用法?C# XmlElement.ToString怎么用?C# XmlElement.ToString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Xml.XmlElement
的用法示例。
在下文中一共展示了XmlElement.ToString方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetAttributeWithInheritanceOrFail
public static string GetAttributeWithInheritanceOrFail(XmlElement e, string name)
{
string v = GetAttributeWithInheritance(e, name);
if (null == v)
{
throw new ParserException(e.ToString() + " missing \"" + name
+ "\" attribute");
}
return v;
}
示例2: GetFirstChildOrFail
public static XmlElement GetFirstChildOrFail(XmlElement e)
{
XmlElement kid = GetFirstChildElement(e);
if (null == kid)
{
throw new ParserException(e.ToString()
+ " does not contain a child element");
}
return kid;
}
示例3: GetChildByTagOrFail
public static XmlElement GetChildByTagOrFail(XmlElement e, string name)
{
XmlElement kid = GetChildByTagName(e, name);
if (null == kid)
{
throw new ParserException(e.ToString() + " missing \"" + name
+ "\" child element");
}
return kid;
}
示例4: GetNonBlankTextOrFail
public static string GetNonBlankTextOrFail(XmlElement e)
{
string v = GetText(e);
if (null != v)
v = v.Trim();
if (null == v || 0 == v.Length)
{
throw new ParserException(e.ToString() + " has no text");
}
return v;
}
示例5: LoadAssembly
private void LoadAssembly(XmlElement el, string currentDirectory)
{
if (el.Name == "Assembly" && el.HasAttribute("Path"))
{
string path = el.GetAttribute("Path");
FileInfo fInfo = new FileInfo(Path.Combine(currentDirectory, path));
if (!fInfo.Exists)
fInfo = new FileInfo(path);
if (fInfo.Exists)
{
try
{
Assembly loadedAssembly = Assembly.LoadFrom(fInfo.FullName);
bool wasBehaviorAssembly = false;
foreach (Type type in loadedAssembly.DefinedTypes)
{
if (type.BaseType != null && type.BaseType.FullName == "Hansoft.Jean.Behavior.AbstractBehavior")
{
behaviorTypes.Add(type);
wasBehaviorAssembly = true;
}
}
if (!wasBehaviorAssembly)
{
extensionAssemblies.Add(path);
}
}
catch (Exception e)
{
logger.Exception("Error in configuration file JeanSettings.xml when loading assembly " + fInfo.FullName + ".", e);
}
}
else
logger.Error("Error in configuration file JeanSettings.xml. Could not find assembly file: " + path);
}
else
logger.Error("Error in configuration file JeanSettings.xml. Malformed configuration of assemblies: " + el.ToString());
}
示例6: XmlResult
public XmlResult(XmlElement xmlElement)
{
Content = xmlElement.ToString();
ContentEncoding = Encoding.UTF8;
ContentType = "text/xml";
}
示例7: Write
protected void Write(XmlElement data)
{
ProtocolLog.WriteIf(XmppLog, "Outgoing: " + data.ToString());
lock(_write_lock) {
_jc.Write(data);
}
}
示例8: HandleAuthError
/// <summary>Crap, we were denied access, all we can do is notify the user.
/// Maybe they can change the user parameters and restart the process.</summary>
protected void HandleAuthError(object sender, XmlElement rp)
{
ProtocolLog.WriteIf(ProtocolLog.Exceptions, rp.ToString());
}