Exemple #1
0
 public NuGenMethodSpec(uint token, NuGenTokenBase parent, IntPtr signature, uint signatureLength, NuGenAssembly assembly)
 {
     Token           = token;
     Parent          = parent;
     Signature       = signature;
     SignatureLength = signatureLength;
 }
		public NuGenMethodSpec(uint token, NuGenTokenBase parent, IntPtr signature, uint signatureLength, NuGenAssembly	assembly)
		{
			Token = token;
			Parent = parent;
			Signature = signature;
			SignatureLength = signatureLength;
		}
Exemple #3
0
        protected override void CreateText(Dictionary <uint, NuGenTokenBase> allTokens)
        {
            base.CreateText(allTokens);

            if (Constraints != null)
            {
                TextBuilder.Length = 0;
                TextBuilder.Append("(");

                for (int index = 0; index < Constraints.Count; index++)
                {
                    NuGenTokenBase constraint = allTokens[Constraints[index]];
                    TextBuilder.Append(constraint.Name);

                    if (index < Constraints.Count - 1)
                    {
                        TextBuilder.Append(", ");
                    }
                }

                TextBuilder.Append(") ");
                TextBuilder.Append(Name);
                Text = TextBuilder.ToString();
            }
            else
            {
                Text = Name;
            }
        }
		public NuGenCustomAttribute(NuGenIMetaDataImport2 import, uint token, NuGenTokenBase owner, uint type, IntPtr blob, uint blobLength)
		{
			Token = token;
			Owner = owner;
			Type = type;
			Blob = blob;
			BlobLength = blobLength;
		}
Exemple #5
0
 public NuGenCustomAttribute(NuGenIMetaDataImport2 import, uint token, NuGenTokenBase owner, uint type, IntPtr blob, uint blobLength)
 {
     Token      = token;
     Owner      = owner;
     Type       = type;
     Blob       = blob;
     BlobLength = blobLength;
 }
Exemple #6
0
        public NuGenGenericParameter(NuGenIMetaDataImport2 import, uint token, string name, uint sequence, uint attributes, NuGenTokenBase owner, uint kind)
        {
            Token      = token;
            Name       = name;
            Sequence   = sequence;
            Attributes = (CorGenericParamAttr)attributes;
            Owner      = owner;
            Kind       = kind;

            EnumConstraints(import);
        }
		private static TreeNode SearchTokenNode(TreeNode parentNode, NuGenTokenBase parentTokenObject, string subNodeText, string nodeText)
		{
			TreeNode result = SearchNodes(parentNode, parentTokenObject);

			if (subNodeText != null && result != null)
			{
				result.Expand();
				result = FindNodeByName(result.Nodes, subNodeText);
			}

			if (result != null)
			{
				result.Expand();
				result = FindNodeByName(result.Nodes, nodeText);
			}

			return result;
		}
		public NuGenFoundItemEventArgs(NuGenAssembly assembly, NuGenTokenBase foundTokenObject)
		{
			Assembly = assembly;
			FoundTokenObject = foundTokenObject;
		}
		private static TreeNode SearchNodes(TreeNode parentNode, NuGenTokenBase tokenObject)
		{
			TreeNode result = null;

			if (parentNode != null)
			{
				switch (tokenObject.ItemType)
				{
					case SearchOptions.Assembly:
						NuGenAssembly assembly = (NuGenAssembly)tokenObject;
						parentNode.Expand();
						result = FindNodeByName(parentNode.Nodes, assembly.FileName);
						break;

					case SearchOptions.AssemblyReference:
						NuGenAssemblyReference assemblyReference = (NuGenAssemblyReference)tokenObject;

						result = SearchTokenNode(parentNode, assemblyReference.Assembly, " References", assemblyReference.Name);
						break;

					case SearchOptions.FieldDefintion:
						NuGenFieldDefinition fieldDefinition = (NuGenFieldDefinition)tokenObject;

						result = SearchTokenNode(parentNode, fieldDefinition.BaseTypeDefinition, "Fields", fieldDefinition.Name);
						break;

					case SearchOptions.File:
						NuGenFile file = (NuGenFile)tokenObject;

						result = SearchTokenNode(parentNode, file.Assembly, " Files", file.Name);
						break;

					case SearchOptions.ManifestResource:
						NuGenManifestResource manifestResource = (NuGenManifestResource)tokenObject;

						result = SearchTokenNode(parentNode, manifestResource.Assembly, " Manifest Resources", manifestResource.Name);
						break;

					case SearchOptions.MethodDefinition:
						NuGenMethodDefinition methodDefinition = (NuGenMethodDefinition)tokenObject;

						if (methodDefinition.OwnerProperty == null)
						{
							result = SearchTokenNode(parentNode, methodDefinition.BaseTypeDefinition, "Methods", methodDefinition.DisplayName);
						}
						else
						{
							result = SearchNodes(parentNode, methodDefinition.OwnerProperty);
							result.Expand();
							result = FindNodeByName(result.Nodes, methodDefinition.DisplayName);
						}
						break;

					case SearchOptions.ModuleReference:
						NuGenModuleReference moduleReference = (NuGenModuleReference)tokenObject;

						result = SearchTokenNode(parentNode, moduleReference.Assembly, " Module References", moduleReference.Name);
						break;

					case SearchOptions.ModuleScope:
						NuGenModuleScope moduleScope = (NuGenModuleScope)tokenObject;

						result = SearchTokenNode(parentNode, moduleScope.Assembly, null, moduleScope.Name);
						break;

					case SearchOptions.Property:
						NuGenProperty property = (NuGenProperty)tokenObject;

						result = SearchTokenNode(parentNode, property.BaseTypeDefinition, "Properties", property.Name);
						break;

					case SearchOptions.TypeDefinition:
						NuGenTypeDefinition typeDefinition = (NuGenTypeDefinition)tokenObject;
						string typeNamespace = typeDefinition.Namespace;

						if (typeNamespace.Length == 0)
						{
							typeNamespace = NuGenConstants.DefaultNamespaceName;
						}

						result = SearchTokenNode(parentNode, typeDefinition.ModuleScope, typeNamespace, typeDefinition.FullName);
						break;
				}
			}

			return result;
		}
		public static TreeNode LocateNode(TreeNode startingNode, NuGenTokenBase tokenObject)
		{
			return SearchNodes(startingNode, tokenObject);
		}
		public void LocateTokenNode(NuGenTokenBase tokenObject)
		{
			ProjectElements.SelectedNode = NuGenTreeViewSearcher.LocateNode(ProjectElements.Nodes[0], tokenObject);			
		}
		public NuGenGenericParameter(NuGenIMetaDataImport2 import, uint token, string name, uint sequence, uint attributes, NuGenTokenBase owner, uint kind)
		{
			Token = token;
			Name = name;
			Sequence = sequence;
			Attributes = (CorGenericParamAttr)attributes;
			Owner = owner;
			Kind = kind;

			EnumConstraints(import);
		}