當前位置: 首頁>>代碼示例>>C#>>正文


C# AssociativeNode.ToString方法代碼示例

本文整理匯總了C#中ProtoCore.AST.AssociativeAST.AssociativeNode.ToString方法的典型用法代碼示例。如果您正苦於以下問題:C# AssociativeNode.ToString方法的具體用法?C# AssociativeNode.ToString怎麽用?C# AssociativeNode.ToString使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在ProtoCore.AST.AssociativeAST.AssociativeNode的用法示例。


在下文中一共展示了AssociativeNode.ToString方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: TypedParameter

        /// <summary>
        /// This function creates TypedParameter
        /// </summary>
        /// <param name="parameter">parameter name</param>
        /// <param name="type">parameter type</param>
        /// <param name="defaultValue">parameter default value</param>
        /// <param name="shortArgumentName">short name is used as tooltip</param>
        /// <param name="summary">parameter description</param>
        public TypedParameter(string parameter, ProtoCore.Type type, AssociativeNode defaultValue = null, string shortArgumentName = null, string summary = null)
        {
            if (parameter == null)
                throw new ArgumentNullException("parameter");

            Name = parameter;
            Type = type;
            DefaultValue = defaultValue;

            if (defaultValue != null)
                defaultValueString = defaultValue.ToString();
            else
                defaultValueString = shortArgumentName;

            this.summary = summary;
        }
開發者ID:sh4nnongoh,項目名稱:Dynamo,代碼行數:24,代碼來源:TypedParameter.cs

示例2: RewriteIdentifierListNode

        private AssociativeNode RewriteIdentifierListNode(AssociativeNode identifierList)
        {
            var resolvedName = ResolveClassName(identifierList);

            if (string.IsNullOrEmpty(resolvedName))
                return identifierList;

            var identListNode = identifierList as IdentifierListNode;

            var newIdentList = CoreUtils.CreateNodeFromString(resolvedName);

            // If the original input node matches with the resolved name, simply return 
            // the identifier list constructed from the resolved name
            var symbol = new Symbol(resolvedName);
            if (symbol.Matches(identifierList.ToString()))
                return newIdentList;

            // Remove partialName from identListNode and replace with newIdentList
            AssociativeNode leftNode = identListNode != null ? identListNode.LeftNode : identifierList;
            AssociativeNode rightNode = identListNode != null ? identListNode.RightNode : identifierList;

            var intermediateNodes = new List<AssociativeNode>();
            while (leftNode is IdentifierListNode && !symbol.Matches(leftNode.ToString()))
            {
                intermediateNodes.Insert(0, ((IdentifierListNode)leftNode).RightNode);
                leftNode = ((IdentifierListNode)leftNode).LeftNode;
            }
            intermediateNodes.Insert(0, newIdentList);

            var lNode = CoreUtils.CreateNodeByCombiningIdentifiers(intermediateNodes);

            // The last ident list for the functioncall or identifier rhs
            var lastIdentList = new IdentifierListNode
            {
                LeftNode = lNode,
                RightNode = rightNode,
                Optr = Operator.dot
            };

            return lastIdentList;
        }
開發者ID:sh4nnongoh,項目名稱:Dynamo,代碼行數:41,代碼來源:ElementRewriter.cs


注:本文中的ProtoCore.AST.AssociativeAST.AssociativeNode.ToString方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。