本文整理汇总了C#中Element.GetElement方法的典型用法代码示例。如果您正苦于以下问题:C# Element.GetElement方法的具体用法?C# Element.GetElement怎么用?C# Element.GetElement使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Element
的用法示例。
在下文中一共展示了Element.GetElement方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PrintField
private void PrintField(Element field)
{
String fldDesc;
string fldId = field.GetElementAsString(IdElementId);
if (field.HasElement(FieldInfoElementId))
{
Element fldInfo = field.GetElement(FieldInfoElementId);
string fldMnemonic = fldInfo.GetElementAsString(FieldMnemonicElementId);
fldDesc = fldInfo.GetElementAsString(FieldDescElementId);
Console.WriteLine(PadString(fldId, ID_LEN) +
PadString(fldMnemonic, MNEMONIC_LEN) +
PadString(fldDesc, DESC_LEN));
}
else
{
Element fldError = field.GetElement(FieldErrorElementId);
fldDesc = fldError.GetElementAsString(FieldMsgElementId);
Console.WriteLine("\n ERROR: " + fldId + " - " + fldDesc);
}
}
示例2: SecurityData
public SecurityData(ReferenceDataResponse context, Element securityData)
: this(context.GetDescription())
{
_securityData = securityData;
Security = _securityData.GetElementAsString("security");
SequenceNr = _securityData.GetElementAsInt32("sequenceNumber");
if (_securityData.HasElement("securityError"))
{
_securityError = new SecurityError(_securityData.GetElement("securityError"));
}
else
{
if (_securityData.HasElement("fieldData"))
{
Element _fieldDataArray = _securityData.GetElement("fieldData");
for (int i = 0; i < context.Fields.Count; i++)
{
if (_fieldDataArray.HasElement(context.Fields[i]))
{
var field = new FieldData(_fieldDataArray.GetElement(context.Fields[i]));
Fields[field.Name] = field;
}
}
}
if (_securityData.HasElement("fieldExceptions"))
{
Element _fieldExceptionsArray = _securityData.GetElement("fieldExceptions");
for (int i = 0; i < _fieldExceptionsArray.NumValues; i++)
{
FieldExceptions.Add(new FieldException(_fieldExceptionsArray.GetValueAsElement(i)));
}
}
}
}
示例3: processSpanElement
/// <summary>
/// <summary>
/// Process spanUpdate Element
/// </summary>
/// <param name="spanElement"></param>
/// <param name="rowNum"></param>
/// <param name="topic"></param>
private void processSpanElement(Element spanElement, int rowNum, string topic)
{
Element eleStartCol = spanElement.GetElement(STARTCOL);
int startCol = eleStartCol.GetValueAsInt32();
Element eleLength = spanElement.GetElement(LENGTH);
int len = eleLength.GetValueAsInt32();
Element eleText = spanElement.GetElement(TEXT);
string text = eleText.GetValueAsString();
//System.Console.WriteLine("Row : " + rowNum +
// ",Col: " + startCol +
// "(Len: " + len + ")" +
// "\tNew Text: " + text);
LivePage.GetCached(topic, true).DoUpdate(rowNum, startCol, len, text);
}
示例4: processRowElement
/// <summary>
/// Process RowUpdate Event/ rowUpdate Element
/// </summary>
/// <param name="rowElement"></param>
/// <param name="topic"></param>
private void processRowElement(Element rowElement, string topic)
{
Element eleRowNum = rowElement.GetElement(ROWNUM);
int rowNum = eleRowNum.GetValueAsInt32();
Element eleSpanUpdates = rowElement.GetElement(SPANUPDATE);
int numSpanUpdates = eleSpanUpdates.NumValues;
//System.Console.WriteLine("Processing " + numSpanUpdates + " spanUpdate");
for (int i = 0; i < numSpanUpdates; ++i)
{
Element spanUpdate = eleSpanUpdates.GetValueAsElement(i);
processSpanElement(spanUpdate, rowNum, topic);
}
}
示例5: processPageElement
/// <summary>
/// Process PageUpdate Event/PageUpdate Element
/// </summary>
/// <param name="pageElement"></param>
/// <param name="topic"></param>
private void processPageElement(Element pageElement, string topic)
{
Element eleNumRows = pageElement.GetElement(NUMROWS);
int numRows = eleNumRows.GetValueAsInt32();
Element eleNumCols = pageElement.GetElement(NUMCOLS);
int numCols = eleNumCols.GetValueAsInt32();
System.Console.WriteLine("Page Contains " + numRows + " Rows & " + numCols + " Columns");
Element eleRowUpdates = pageElement.GetElement(ROWUPDATE);
int numRowUpdates = eleRowUpdates.NumValues;
System.Console.WriteLine("Processing " + numRowUpdates + " RowUpdates");
for (int i = 0; i < numRowUpdates; ++i)
{
Element rowUpdate = eleRowUpdates.GetValueAsElement(i);
processRowElement(rowUpdate, topic);
}
}