Exemplo n.º 1
0
        private void FindGetThreadNameMethod(uint threadTypeToken, ModuleWrapper module)
        {
            NuGenTypeDefinition threadType = NuGenHelperFunctions.FindObjectByToken(threadTypeToken, module) as NuGenTypeDefinition;

            if (threadType != null)
            {
                NuGenProperty nameProperty = threadType.FindPropertyByName("Name");

                if (nameProperty != null)
                {
                    GetThreadNameMethod = NuGenHelperFunctions.FindObjectByToken(nameProperty.GetterMethodToken, module) as NuGenMethodDefinition;
                }
            }

            HasSearchedForNameMethod = true;
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
 private void ValueDisplayer_PropertyEvaluated(NuGenValueDisplayer sender, NuGenProperty property, NuGenIValueFormatter propertyValueFormatter)
 {
     InvokeDisplayValueFormatter(propertyValueFormatter, sender.ParentNode);
     InvokeStepEvaluationProgress();
     UpdateCancelEvaluation(sender);
 }