コード例 #1
0
        internal override string ToCode(out SnapshotNodeType type)
        {
            string replicationGuideString = string.Empty;
            int    i = 0;

            foreach (uint slot in inputSlots)
            {
                List <int> tmp = new List <int>();
                int        j   = 0;

                foreach (int value in replicationGuides[i])
                {
                    tmp.Add(value);
                    j++;
                }
                replicationGuideString += SnapshotNode.CreateReplicationGuideText(tmp);

                // The delimiter for a group of replication guides is'%'
                // Put all these characters in a definition structure or file
                replicationGuideString += GraphToDSCompiler.Constants.ReplicationGuideDelimiter;
                i++;
            }
            string assemblyPath = graphController.MapAssemblyPath(this.Assembly);

            // only external library need to convert the assembly path
            if (this.Assembly != assemblyPath)
            {
                assemblyPath = GraphUtilities.ConvertAbsoluteToRelative(assemblyPath);
            }

            if (this.MemberType == LibraryItem.MemberType.InstanceMethod || this.MemberType == LibraryItem.MemberType.InstanceProperty)
            {
                type = SnapshotNodeType.Method;
                string tempArgumentTypes = this.ArgumentTypes;
                // there is additional slot[0] with name "this" and type "this"
                // the "this" type need to be converted to proper class name(first part of the qualifiedName)
                //
                if (this.QualifiedName.Contains('.'))
                {
                    string className = this.QualifiedName.Substring(0, this.QualifiedName.IndexOf('.'));
                    tempArgumentTypes = tempArgumentTypes.Replace("this", className);
                }

                return(string.Format("{0};{1};{2};{3};{4}", assemblyPath, this.Caption, tempArgumentTypes, this.Text, replicationGuideString));
            }
            else
            {
                type = SnapshotNodeType.Function;
                return(string.Format("{0};{1};{2};{3};{4}", assemblyPath, this.QualifiedName, this.ArgumentTypes, this.Text, replicationGuideString));
            }
        }
コード例 #2
0
        internal override string ToCode(out GraphToDSCompiler.SnapshotNodeType type)
        {
            string assemblyPath = graphController.MapAssemblyPath(this.Assembly);

            // only external library need to convert the assembly path
            if (this.Assembly != assemblyPath)
            {
                assemblyPath = GraphUtilities.ConvertAbsoluteToRelative(assemblyPath);
            }

            type = GraphToDSCompiler.SnapshotNodeType.Property;
            if (this.MemberType == LibraryItem.MemberType.InstanceProperty)
            {
                return(string.Format("{0};{1};{2}", assemblyPath, this.Caption, this.Text));
            }
            else  //this.MemberType == LibraryItem.MemberType.StaticProperty
            {
                return(string.Format("{0};{1};{2}", assemblyPath, this.QualifiedName, this.Text));
            }
        }