Пример #1
0
 private static void EventHeapShotReceived(string name)
 {
     Debug.Log("Received " + name);
     if (HeapshotWindow.onReceivedHeapshot != null)
     {
         HeapshotWindow.onReceivedHeapshot(name);
     }
 }
Пример #2
0
 private static void EventHeapShotReceived(string name)
 {
     Debug.Log((object)("Received " + name));
     if (HeapshotWindow.onReceivedHeapshot == null)
     {
         return;
     }
     HeapshotWindow.onReceivedHeapshot(name);
 }
Пример #3
0
		private void DoHeapshotObjects(List<HeapshotWindow.HeapshotUIObject> objects, SplitterState splitter, int indent, HeapshotWindow.OnSelect onSelect)
		{
			if (objects == null)
			{
				return;
			}
			Event current = Event.current;
			foreach (HeapshotWindow.HeapshotUIObject current2 in objects)
			{
				Rect position = new Rect(14f * (float)indent, this.guiRect.y, 14f, this.guiRect.height);
				Rect[] array = new Rect[this.titleNames.Length];
				float num = 14f * (float)(indent + 1);
				for (int i = 0; i < array.Length; i++)
				{
					float num2 = (i != 0) ? ((float)splitter.realSizes[i]) : ((float)splitter.realSizes[i] - num);
					array[i] = new Rect(num, this.guiRect.y, num2, this.guiRect.height);
					num += num2;
				}
				if (current.type == EventType.Repaint)
				{
					Rect position2 = new Rect(0f, 16f * (float)this.itemIndex, base.position.width, 16f);
					GUIStyle gUIStyle = ((this.itemIndex & 1) != 0) ? HeapshotWindow.Styles.entryOdd : HeapshotWindow.Styles.entryEven;
					gUIStyle.Draw(position2, GUIContent.none, false, false, this.itemIndex == this.selectedItem, false);
				}
				if (current2.HasChildren)
				{
					GUI.changed = false;
					bool flag = GUI.Toggle(position, current2.IsExpanded, GUIContent.none, HeapshotWindow.Styles.foldout);
					if (GUI.changed)
					{
						if (flag)
						{
							current2.Expand();
						}
						else
						{
							current2.Collapse();
						}
					}
				}
				GUI.changed = false;
				bool flag2 = GUI.Toggle(array[0], this.itemIndex == this.selectedItem, current2.Name, HeapshotWindow.Styles.numberLabel);
				if (!current2.IsDummyObject)
				{
					GUI.Toggle(array[1], this.itemIndex == this.selectedItem, current2.TypeName, HeapshotWindow.Styles.numberLabel);
					GUI.Toggle(array[2], this.itemIndex == this.selectedItem, "0x" + current2.Code.ToString("X"), HeapshotWindow.Styles.numberLabel);
					GUI.Toggle(array[3], this.itemIndex == this.selectedItem, current2.Size.ToString(), HeapshotWindow.Styles.numberLabel);
					GUI.Toggle(array[4], this.itemIndex == this.selectedItem, string.Format("{0} / {1}", current2.ReferenceCount, current2.InverseReferenceCount), HeapshotWindow.Styles.numberLabel);
					if (GUI.changed && flag2 && onSelect != null)
					{
						this.selectedItem = this.itemIndex;
						onSelect(current2);
					}
				}
				this.itemIndex++;
				this.guiRect.y = this.guiRect.y + 16f;
				this.DoHeapshotObjects(current2.Children, splitter, indent + 1, onSelect);
			}
		}
Пример #4
0
		private void OnSelectObject(HeapshotWindow.HeapshotUIObject o)
		{
			this.hsBackTraceObjects.Clear();
			this.hsBackTraceObjects.Add(new HeapshotWindow.HeapshotUIObject(o.Name, o.ObjectInfo, true));
		}
 private void DoHeapshotObjects(List<HeapshotWindow.HeapshotUIObject> objects, SplitterState splitter, int indent, HeapshotWindow.OnSelect onSelect)
 {
   if (objects == null)
     return;
   Event current1 = Event.current;
   using (List<HeapshotWindow.HeapshotUIObject>.Enumerator enumerator = objects.GetEnumerator())
   {
     while (enumerator.MoveNext())
     {
       HeapshotWindow.HeapshotUIObject current2 = enumerator.Current;
       Rect position = new Rect(14f * (float) indent, this.guiRect.y, 14f, this.guiRect.height);
       Rect[] rectArray = new Rect[this.titleNames.Length];
       float x = 14f * (float) (indent + 1);
       for (int index = 0; index < rectArray.Length; ++index)
       {
         float width = index != 0 ? (float) splitter.realSizes[index] : (float) splitter.realSizes[index] - x;
         rectArray[index] = new Rect(x, this.guiRect.y, width, this.guiRect.height);
         x += width;
       }
       if (current1.type == EventType.Repaint)
         ((this.itemIndex & 1) != 0 ? HeapshotWindow.Styles.entryOdd : HeapshotWindow.Styles.entryEven).Draw(new Rect(0.0f, 16f * (float) this.itemIndex, this.position.width, 16f), GUIContent.none, false, false, this.itemIndex == this.selectedItem, false);
       if (current2.HasChildren)
       {
         GUI.changed = false;
         bool flag = GUI.Toggle(position, current2.IsExpanded, GUIContent.none, HeapshotWindow.Styles.foldout);
         if (GUI.changed)
         {
           if (flag)
             current2.Expand();
           else
             current2.Collapse();
         }
       }
       GUI.changed = false;
       bool flag1 = GUI.Toggle(rectArray[0], this.itemIndex == this.selectedItem, current2.Name, HeapshotWindow.Styles.numberLabel);
       if (!current2.IsDummyObject)
       {
         GUI.Toggle(rectArray[1], this.itemIndex == this.selectedItem, current2.TypeName, HeapshotWindow.Styles.numberLabel);
         GUI.Toggle(rectArray[2], this.itemIndex == this.selectedItem, "0x" + current2.Code.ToString("X"), HeapshotWindow.Styles.numberLabel);
         GUI.Toggle(rectArray[3], this.itemIndex == this.selectedItem, current2.Size.ToString(), HeapshotWindow.Styles.numberLabel);
         GUI.Toggle(rectArray[4], this.itemIndex == this.selectedItem, string.Format("{0} / {1}", (object) current2.ReferenceCount, (object) current2.InverseReferenceCount), HeapshotWindow.Styles.numberLabel);
         if (GUI.changed && flag1 && onSelect != null)
         {
           this.selectedItem = this.itemIndex;
           onSelect(current2);
         }
       }
       ++this.itemIndex;
       this.guiRect.y += 16f;
       this.DoHeapshotObjects(current2.Children, splitter, indent + 1, onSelect);
     }
   }
 }