Exemplo n.º 1
0
 private void Instance_DisplayHexaNumbersChanged()
 {
     if (threadsGrid.RowCount != 0)
     {
         for (int i = 0; i < threadsGrid.RowCount; i++)
         {
             GridEXCell idCell = threadsGrid.GetRow(i).Cells[0];
             idCell.Value = NuGenHelperFunctions.FormatNumber(NuGenHelperFunctions.TaggedObjects[(int)idCell.Value]);
         }
     }
 }
Exemplo n.º 2
0
        public string GetFormattedDefaultValue()
        {
            string result = null;

            if (IsReformattableDefaultValue())
            {
                result = NuGenHelperFunctions.FormatNumber(DefaultValueNumber);
            }
            else
            {
                result = DefaultValueAsString;
            }

            return(result);
        }
Exemplo n.º 3
0
 private void AssignNumberValueToCell <T>(GridEXCell cell, T tag)
 {
     NuGenHelperFunctions.TaggedObjects.Add(cell.Value.ToString(), tag);
     cell.Value = NuGenHelperFunctions.FormatNumber(tag);
 }
Exemplo n.º 4
0
 private void FormatNumberInCell(GridEXCell cell)
 {
     cell.Value = NuGenHelperFunctions.FormatNumber(NuGenHelperFunctions.TaggedObjects[cell.Value.ToString()]);
 }
Exemplo n.º 5
0
        private void ShowThreads()
        {
            threadsGrid.BeginGridUpdate();
            threadsGrid.ClearItems();
            List <ThreadWrapper> threads = NuGenDebugEventHandler.Instance.EventObjects.Controller.EnumerateThreads();

            foreach (ThreadWrapper thread in threads)
            {
                EvaluatedThreadName = "<no name>";
                ValueWrapper threadObject       = null;
                ValueWrapper dereferencedObject = null;

                if (!HasSearchedForNameMethod)
                {
                    threadObject = thread.GetObject();

                    if (threadObject != null && !threadObject.IsNull())
                    {
                        dereferencedObject = threadObject.DereferenceValue();

                        if (dereferencedObject != null)
                        {
                            ClassWrapper  threadClass     = dereferencedObject.GetClassInformation();
                            uint          threadTypeToken = threadClass.GetToken();
                            ModuleWrapper module          = threadClass.GetModule();

                            FindGetThreadNameMethod(threadTypeToken, module);
                        }
                    }
                }

                if (HasSearchedForNameMethod)
                {
                    if (GetThreadNameMethod == null)
                    {
                        EvaluatedThreadName = "<definition of the Thread class is not loaded>";
                    }
                    else
                    {
                        if (threadObject == null)
                        {
                            threadObject = thread.GetObject();

                            if (threadObject != null && !threadObject.IsNull())
                            {
                                dereferencedObject = threadObject.DereferenceValue();
                            }
                        }

                        if (dereferencedObject != null)
                        {
                            FrameWrapper threadActiveFrame = thread.GetActiveFrame();

                            if (threadActiveFrame != null)
                            {
                                NuGenFrameRefresher threadActiveFrameRefresher = new NuGenFrameRefresher(thread, threadActiveFrame.ChainIndex, threadActiveFrame.FrameIndex, threadActiveFrame.IsActiveFrame);

                                GetThreadName(thread, threadObject, threadActiveFrameRefresher);
                            }
                        }
                    }
                }

                GridEXRow row = threadsGrid.AddItem();

                uint       threadID = thread.GetID();
                GridEXCell idCell   = row.Cells[0];
                NuGenHelperFunctions.TaggedObjects.Add((int)idCell.Value, threadID);
                idCell.Value       = NuGenHelperFunctions.FormatNumber(threadID);
                row.Cells[1].Value = EvaluatedThreadName;

                AppDomainWrapper appDomain = thread.GetAppDomain();

                if (appDomain != null)
                {
                    row.Cells[2].Value = appDomain.GetName();
                }

                NuGenHelperFunctions.TaggedObjects.Add((String)row.Cells[1].Value + (String)row.Cells[2].Value, thread);
            }

            threadsGrid.EndGridUpdate();
        }