本文整理汇总了C#中System.IsStartElement方法的典型用法代码示例。如果您正苦于以下问题:C# System.IsStartElement方法的具体用法?C# System.IsStartElement怎么用?C# System.IsStartElement使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System
的用法示例。
在下文中一共展示了System.IsStartElement方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CanRead
public override bool CanRead(System.Xml.XmlReader reader)
{
if (reader == null)
throw new ArgumentNullException("reader");
return reader.IsStartElement("RDF", this.RdfNamespaceUri);
}
示例2: ReadCommand
/// <summary>
/// Lê comando.
/// </summary>
/// <param name="p_reader">Objeto XML.</param>
private void ReadCommand(System.Xml.XmlReader p_reader)
{
System.Xml.XmlReader v_item;
this.v_cmd = new Spartacus.Database.Command();
while (p_reader.Read())
{
if (p_reader.IsStartElement())
{
switch (p_reader.Name)
{
case "sql":
this.v_cmd.v_text = p_reader.ReadString();
break;
case "parameter":
v_item = p_reader.ReadSubtree();
this.ReadParameter(v_item);
v_item.Close();
break;
default:
break;
}
}
}
}
示例3: FromXml
public bool FromXml(ref System.Xml.XmlReader xr)
{
bool results = false;
try
{
while (xr.Read())
{
if (xr.IsStartElement())
{
if (!xr.IsEmptyElement)
{
switch (xr.Name)
{
case "Bvin":
xr.Read();
Bvin = xr.ReadString();
break;
case "ControlName":
xr.Read();
ControlName = xr.ReadString();
break;
case "SortOrder":
xr.Read();
SortOrder = int.Parse(xr.ReadString());
break;
case "ColumnId":
xr.Read();
ColumnId = xr.ReadString();
break;
case "SerializedSettings":
xr.Read();
string json = xr.ReadString();
this.BaseSettings = MerchantTribe.Web.Json.ObjectFromJson<ContentBlockSettings>(json);
break;
case "Lists":
xr.Read();
string jsonlist = xr.ReadString();
this.Lists = MerchantTribe.Web.Json.ObjectFromJson<ContentBlockSettingList>(jsonlist);
break;
}
}
}
}
results = true;
}
catch (XmlException XmlEx)
{
EventLog.LogEvent(XmlEx);
results = false;
}
return results;
}
示例4: ReadXml
public override void ReadXml(System.Xml.XmlReader reader)
{
reader.ReadStartElement();
while (reader.IsStartElement())
{
reader.Read();
}
reader.Read();
}
示例5: ReadXml
public void ReadXml(System.Xml.XmlReader reader)
{
while (!reader.IsStartElement("BlockCache") && !reader.EOF)
reader.Read();
if (reader.EOF)
return;
if (reader.IsEmptyElement && reader.Name == "BlockCache")
{
reader.ReadStartElement("BlockCache");
BlockCache = new SerializableDictionary<IPAddr, BlockedIP>();
}
else
{
reader.ReadStartElement("BlockCache");
BlockCache = (SerializableDictionary<IPAddr, BlockedIP>)new XmlSerializer(typeof(SerializableDictionary<IPAddr, BlockedIP>)).Deserialize(reader);
reader.ReadEndElement();
}
while (!reader.IsStartElement("dos_threshold") && !reader.EOF)
reader.Read();
if (reader.EOF)
return;
reader.ReadStartElement("dos_threshold");
dos_threshold = (int)new XmlSerializer(typeof(int)).Deserialize(reader);
reader.ReadEndElement();
while (!reader.IsStartElement("Save") && !reader.EOF)
reader.Read();
if (reader.EOF)
return;
reader.ReadStartElement("Save");
Save = (bool)new XmlSerializer(typeof(bool)).Deserialize(reader);
reader.ReadEndElement();
}
示例6: HandleEponymousNode
private void HandleEponymousNode(System.Xml.XmlReader reader)
{
if (reader.IsStartElement() && !reader.IsEmptyElement)
{
HandleStartNode(reader);
}
else
{
AddCompletedObject(m_dataObject);
IsFinished = true;
m_dataObject = null;
}
}
示例7: UnpersistBag
public override void UnpersistBag(IParamBag target, System.Xml.XmlReader reader)
{
// Assumes reader has started the read of elements which contain actual param values
IExtractKthCoreParamBag bag = (IExtractKthCoreParamBag)target;
if (reader.Name == "K")
{
bag.K = UnpersistK(reader);
}
if (reader.IsStartElement() && !reader.IsEmptyElement)
{
reader.Read();
}
}
示例8: HandleNode
public override void HandleNode(System.Xml.XmlReader reader)
{
if (reader.LocalName == "majorFont" ||
reader.LocalName == "minorFont")
{
HandleEponymousNode(reader);
return;
}
if (string.IsNullOrEmpty(reader.LocalName) || !reader.IsStartElement())
{
return;
}
HandleNamedNode(reader);
}
示例9: HandleNode
public override void HandleNode(System.Xml.XmlReader reader)
{
if (reader.IsEmptyElement)
{
return;
}
if (!Context.IsWordMLPrefix(reader.Prefix))
return;
if (reader.IsStartElement())
{
HandleStartNode(reader);
return;
}
return;
}
示例10: ReadXml
public virtual void ReadXml(System.Xml.XmlReader reader)
{
reader.ReadStartElement();
while (reader.IsStartElement())
{
if (reader.Name == "Name")
{
Name = reader.ReadElementContentAsString();
}
else
{
reader.Read();
}
}
reader.ReadEndElement();
}
示例11: UnpersistBag
public override void UnpersistBag(IParamBag target, System.Xml.XmlReader reader)
{
// Assumes reader has started the read of elements which contain actual param values
IExportNetworkParamBag bag = (IExportNetworkParamBag)target;
bool loopAgain = false;
int ctr = 0;
do
{
if (reader.Name == bag.FileName_ParamName)
{
bag.FileName = UnpersistFileName(reader);
ctr++;
loopAgain = true;
}
else if (reader.Name == bag.ExportNodeAttributes_ParamName)
{
bag.ExportNodeAttributes = UnpersistExportNodeAttributes(reader);
ctr++;
loopAgain = true;
}
else if (reader.Name == bag.ExportEdgeAttributes_ParamName)
{
bag.ExportEdgeAttributes = UnpersistExportEdgeAttributes(reader);
ctr++;
loopAgain = true;
}
else if (reader.Name == bag.FileType_ParamName)
{
bag.FileType = UnpersistFileType(reader);
ctr++;
loopAgain = true;
}
else
loopAgain = false;
} while (loopAgain && (ctr < (bag.Count + 1))); // get out after each
if (reader.IsStartElement() && !reader.IsEmptyElement)
{
reader.Read();
}
}
示例12: UnpersistMgr
public void UnpersistMgr(IParamMgr target, System.Xml.XmlReader reader)
{
// Assumes reader has started the read of element "ParamMgr"
if (reader.Name == "ParamMgr" && !reader.IsEmptyElement)
{
reader.ReadStartElement("ParamMgr");
IExportNetworkParamMgr mgr = (IExportNetworkParamMgr)target;
using (ExportNetworkParamBagUnpersister unpersiter = new ExportNetworkParamBagUnpersister())
{
unpersiter.UnpersistBag(mgr.Bag, reader);
}
if (reader.IsStartElement() && !reader.IsEmptyElement)
{
reader.Read();
}
}
}
示例13: ReadXml
public override void ReadXml(System.Xml.XmlReader reader)
{
reader.ReadStartElement();
while (reader.IsStartElement())
{
if (reader.Name == "Name")
{
Name = reader.ReadElementContentAsString();
}
else if (reader.Name == "RealPath")
{
RealPath = reader.ReadElementContentAsString();
}
else
{
reader.Read();
}
}
reader.ReadEndElement();
}
示例14: Read
public void Read(out string id, out Domain domain, out string attribName, out Type attribType, out object defaultVal, System.Xml.XmlReader reader)
{
id = null;
domain = Domain.all;
attribName = null;
attribType = null;
defaultVal = null;
reader.MoveToAttribute("id");
id = reader["id"];
reader.MoveToAttribute("for");
domain = (Domain)Enum.Parse(typeof(Domain), reader["for"]);
reader.MoveToAttribute("attr.name");
attribName = reader["attr.name"];
reader.MoveToAttribute("attr.type");
attribType = GraphMLConvert.ToType(reader["attr.type"]);
reader.MoveToElement();
// if there is a default value element, read it and convet
if (reader.ReadToDescendant("default"))
{
string defaultValStr = null;
ReadDefault(out defaultValStr, reader);
defaultVal = ConvertDefaultValStr(defaultValStr, attribType);
if (!reader.IsStartElement() && reader.Name=="default")
reader.Read(); // read the end tag element of default
}
else
{
// default value is system default
defaultVal = GetDefault( attribType);
}
}
示例15: SerializationException
/// <summary>
/// Deserialize from XML
/// </summary>
/// <param name="reader"> XML reader</param>
void IXmlSerializable.ReadXml(System.Xml.XmlReader reader)
{
ChessBoard.MovePosS movePos;
bool bIsEmpty;
m_listMovePos.Clear();
if (reader.MoveToContent() != XmlNodeType.Element || reader.LocalName != "MoveList") {
throw new SerializationException("Unknown format");
} else {
bIsEmpty = reader.IsEmptyElement;
m_iPosInList = Int32.Parse(reader.GetAttribute("PositionInList"));
if (bIsEmpty) {
reader.Read();
} else {
if (reader.ReadToDescendant("Move")) {
while (reader.IsStartElement()) {
movePos = new ChessBoard.MovePosS();
movePos.OriginalPiece = (ChessBoard.PieceE)Enum.Parse(typeof(ChessBoard.SerPieceE), reader.GetAttribute("OriginalPiece"));
movePos.StartPos = (byte)Int32.Parse(reader.GetAttribute("StartingPosition"));
movePos.EndPos = (byte)Int32.Parse(reader.GetAttribute("EndingPosition"));
movePos.Type = (ChessBoard.MoveTypeE)Enum.Parse(typeof(ChessBoard.MoveTypeE), reader.GetAttribute("MoveType"));
m_listMovePos.Add(movePos);
reader.ReadStartElement("Move");
}
}
reader.ReadEndElement();
}
}
}