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


C# QualifiedName.ToString方法代码示例

本文整理汇总了C#中QualifiedName.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# QualifiedName.ToString方法的具体用法?C# QualifiedName.ToString怎么用?C# QualifiedName.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QualifiedName的用法示例。


在下文中一共展示了QualifiedName.ToString方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetQualifiedAreaName

        /// <summary>
        /// Provides a mechanism to assemble a fully qualified Area name in a hierarchical space.
        /// </summary>
        /// <param name="szAreaName">The name of an Area at the current level, obtained from the string enumerator returned by BrowseOPCAreas with a BrowseFilterType of OPC_AREA</param>
        /// <param name="pszQualifiedAreaName">Where to return the resulting fully qualified area name.</param>
        public void GetQualifiedAreaName(string szAreaName, out string pszQualifiedAreaName)
        {
            pszQualifiedAreaName = String.Empty;

            try
            {
                pszQualifiedAreaName = szAreaName;
                // Make sure the stack is not null
                INode parent = m_browseStack.Peek();
                if (parent == null)
                {
                    throw ComUtils.CreateComException(ResultIds.E_FAIL);
                }

                // And make sure this is avalid Area name at the level
                INode child = FindChildByName(parent.NodeId, szAreaName);
                if (child == null)
                {
                    throw ComUtils.CreateComException(ResultIds.E_INVALIDARG);
                }
                pszQualifiedAreaName = "";
                INode[] stack = m_browseStack.ToArray();
                for (int i = stack.Length - 2; i >= 0; i--)
                {
                    // Translate the server namespace index in browsename to the corresponding client namespace index
                    QualifiedName QName = stack[i].BrowseName;
                    QualifiedName translatedName = new QualifiedName(QName.Name, (ushort)m_server.ServerMappingTable[QName.NamespaceIndex]);
                    if (pszQualifiedAreaName.Length != 0)
                        pszQualifiedAreaName = pszQualifiedAreaName + "/" + translatedName.ToString();
                    else
                        pszQualifiedAreaName = translatedName.ToString();
                }
                //Also translate the areaname
                QualifiedName QualifiedAreaName =  QualifiedName.Parse(szAreaName);
                QualifiedName TranslatedAreaName = new QualifiedName(QualifiedAreaName.Name, (ushort)m_server.ServerMappingTable[QualifiedAreaName.NamespaceIndex]);
                pszQualifiedAreaName = pszQualifiedAreaName + "/" + TranslatedAreaName.ToString();

            }
            catch (COMException e)
            {
                throw ComUtils.CreateComException(e);
            }
            catch (Exception e)
            {
                Utils.Trace(e, "Unexpected error in GetQualifiedAreaName");
                throw ComUtils.CreateComException(e);
            }
        }
开发者ID:yuriik83,项目名称:UA-.NET,代码行数:53,代码来源:ComAeAreaBrowser.cs

示例2: GetMetadataString

 private string GetMetadataString(string componentType,
                                  ComponentName componentName,
                                  QualifiedName property)
 {
     return GetComponentMetadata(componentType, componentName)
         .GetString(property.ToString());
 }
开发者ID:Carbonfrost,项目名称:ff-foundations-runtime,代码行数:7,代码来源:ComponentStore.cs


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