当前位置: 首页>>代码示例>>C#>>正文


C# Element.GetElement方法代码示例

本文整理汇总了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);
            }
        }
开发者ID:tweakch,项目名称:TweakToolkit,代码行数:23,代码来源:FieldSearchEventHandler.cs

示例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)));
                    }
                }
            }
        }
开发者ID:tweakch,项目名称:TweakToolkit,代码行数:36,代码来源:SecurityData.cs

示例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);
 }
开发者ID:heimanhon,项目名称:researchwork,代码行数:21,代码来源:Core.cs

示例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);
   }
 }
开发者ID:heimanhon,项目名称:researchwork,代码行数:18,代码来源:Core.cs

示例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);
   }
 }
开发者ID:heimanhon,项目名称:researchwork,代码行数:21,代码来源:Core.cs


注:本文中的Element.GetElement方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。