private void ProfilerInstrumentationPopupCallback(PopupList.ListElement element)
 {
     if (element == this.m_AllCheckbox)
     {
         element.selected = !element.selected;
         foreach (PopupList.ListElement element2 in this.m_FunctionsListInputData.m_ListElements)
         {
             if (element.selected)
             {
                 ProfilerDriver.BeginInstrumentFunction(element2.text);
             }
             else
             {
                 ProfilerDriver.EndInstrumentFunction(element2.text);
             }
             element2.selected = element.selected;
         }
     }
     else
     {
         element.selected = !element.selected;
         if (element.selected)
         {
             ProfilerDriver.BeginInstrumentFunction(element.text);
         }
         else
         {
             ProfilerDriver.EndInstrumentFunction(element.text);
         }
     }
     this.UpdateAllCheckbox();
 }
Example #2
0
        void ProfilerInstrumentationPopupCallback(PopupList.ListElement element)
        {
            if (element == m_AllCheckbox)
            {
                element.selected = !element.selected;
                foreach (var child in m_FunctionsListInputData.m_ListElements)
                {
                    if (element.selected)
                    {
                        ProfilerDriver.BeginInstrumentFunction(child.text);
                    }
                    else
                    {
                        ProfilerDriver.EndInstrumentFunction(child.text);
                    }
                    child.selected = element.selected;
                }
            }
            else
            {
                element.selected = !element.selected;
                if (element.selected)
                {
                    ProfilerDriver.BeginInstrumentFunction(element.text);
                }
                else
                {
                    ProfilerDriver.EndInstrumentFunction(element.text);
                }
            }

            UpdateAllCheckbox();
        }
 private void SetFunctions(Dictionary <string, int> functions)
 {
     this.m_FunctionsListInputData.m_ListElements.Clear();
     if (functions == null)
     {
         this.m_FunctionsListInputData.NewOrMatchingElement("Querying instrumentable functions...").enabled = false;
     }
     else if (functions.Count == 0)
     {
         this.m_FunctionsListInputData.NewOrMatchingElement("No instrumentable child functions found").enabled = false;
     }
     else
     {
         this.m_FunctionsListInputData.m_MaxCount = Mathf.Clamp(functions.Count + 1, 0, 30);
         if (this.m_ShowAllCheckbox)
         {
             this.m_AllCheckbox = new PopupList.ListElement(" All", false, float.MaxValue);
             this.m_FunctionsListInputData.m_ListElements.Add(this.m_AllCheckbox);
         }
         foreach (KeyValuePair <string, int> pair in functions)
         {
             PopupList.ListElement item = new PopupList.ListElement(pair.Key, pair.Value != 0);
             item.ResetScore();
             this.m_FunctionsListInputData.m_ListElements.Add(item);
         }
         if (this.m_ShowAllCheckbox)
         {
             this.UpdateAllCheckbox();
         }
     }
 }
Example #4
0
        public void UpdateAllCheckbox()
        {
            if (this.m_AllCheckbox == null)
            {
                return;
            }
            bool flag1 = false;
            bool flag2 = true;

            using (List <PopupList.ListElement> .Enumerator enumerator = this.m_FunctionsListInputData.m_ListElements.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    PopupList.ListElement current = enumerator.Current;
                    if (current != this.m_AllCheckbox)
                    {
                        if (current.selected)
                        {
                            flag1 = true;
                        }
                        else
                        {
                            flag2 = false;
                        }
                    }
                }
            }
            this.m_AllCheckbox.selected          = flag2;
            this.m_AllCheckbox.partiallySelected = flag1 && !flag2;
        }
 private void SetFunctions(Dictionary <string, int> functions)
 {
     this.m_FunctionsListInputData.m_ListElements.Clear();
     if (functions == null)
     {
         PopupList.ListElement listElement = this.m_FunctionsListInputData.NewOrMatchingElement("Querying instrumentable functions...");
         listElement.enabled = false;
     }
     else if (functions.Count == 0)
     {
         PopupList.ListElement listElement2 = this.m_FunctionsListInputData.NewOrMatchingElement("No instrumentable child functions found");
         listElement2.enabled = false;
     }
     else
     {
         this.m_FunctionsListInputData.m_MaxCount = Mathf.Clamp(functions.Count + 1, 0, 30);
         if (this.m_ShowAllCheckbox)
         {
             this.m_AllCheckbox = new PopupList.ListElement(" All", false, 3.40282347E+38f);
             this.m_FunctionsListInputData.m_ListElements.Add(this.m_AllCheckbox);
         }
         foreach (KeyValuePair <string, int> current in functions)
         {
             PopupList.ListElement listElement3 = new PopupList.ListElement(current.Key, current.Value != 0);
             listElement3.ResetScore();
             this.m_FunctionsListInputData.m_ListElements.Add(listElement3);
         }
         if (this.m_ShowAllCheckbox)
         {
             this.UpdateAllCheckbox();
         }
     }
 }
Example #6
0
        private void SetFunctions(Dictionary <string, int> functions)
        {
            m_FunctionsListInputData.m_ListElements.Clear();
            if (functions == null)
            {
                // Querying functions
                var element = m_FunctionsListInputData.NewOrMatchingElement("Querying instrumentable functions...");
                element.enabled = false;
            }
            else if (functions.Count == 0)
            {
                var element = m_FunctionsListInputData.NewOrMatchingElement("No instrumentable child functions found");
                element.enabled = false;
            }
            else
            {
                m_FunctionsListInputData.m_MaxCount = Mathf.Clamp(functions.Count + 1, 0, 30);

                if (m_ShowAllCheckbox)
                {
                    m_AllCheckbox = new PopupList.ListElement(" All", false, float.MaxValue);
                    m_FunctionsListInputData.m_ListElements.Add(m_AllCheckbox);
                }

                foreach (var f in functions)
                {
                    var res = new PopupList.ListElement(f.Key, f.Value != 0);
                    res.ResetScore();
                    m_FunctionsListInputData.m_ListElements.Add(res);
                }

                if (m_ShowAllCheckbox)
                {
                    UpdateAllCheckbox();
                }
            }
        }
Example #7
0
 private void SetFunctions(Dictionary <string, int> functions)
 {
     this.m_FunctionsListInputData.m_ListElements.Clear();
     if (functions == null)
     {
         this.m_FunctionsListInputData.NewOrMatchingElement("Querying instrumentable functions...").enabled = false;
     }
     else if (functions.Count == 0)
     {
         this.m_FunctionsListInputData.NewOrMatchingElement("No instrumentable child functions found").enabled = false;
     }
     else
     {
         this.m_FunctionsListInputData.m_MaxCount = Mathf.Clamp(functions.Count + 1, 0, 30);
         if (this.m_ShowAllCheckbox)
         {
             this.m_AllCheckbox = new PopupList.ListElement(" All", false, float.MaxValue);
             this.m_FunctionsListInputData.m_ListElements.Add(this.m_AllCheckbox);
         }
         using (Dictionary <string, int> .Enumerator enumerator = functions.GetEnumerator())
         {
             while (enumerator.MoveNext())
             {
                 KeyValuePair <string, int> current     = enumerator.Current;
                 PopupList.ListElement      listElement = new PopupList.ListElement(current.Key, current.Value != 0);
                 listElement.ResetScore();
                 this.m_FunctionsListInputData.m_ListElements.Add(listElement);
             }
         }
         if (!this.m_ShowAllCheckbox)
         {
             return;
         }
         this.UpdateAllCheckbox();
     }
 }
Example #8
0
 private void ProfilerInstrumentationPopupCallback(PopupList.ListElement element)
 {
     if (element == this.m_AllCheckbox)
     {
         element.selected = !element.selected;
         using (List <PopupList.ListElement> .Enumerator enumerator = this.m_FunctionsListInputData.m_ListElements.GetEnumerator())
         {
             while (enumerator.MoveNext())
             {
                 PopupList.ListElement current = enumerator.Current;
                 if (element.selected)
                 {
                     ProfilerDriver.BeginInstrumentFunction(current.text);
                 }
                 else
                 {
                     ProfilerDriver.EndInstrumentFunction(current.text);
                 }
                 current.selected = element.selected;
             }
         }
     }
     else
     {
         element.selected = !element.selected;
         if (element.selected)
         {
             ProfilerDriver.BeginInstrumentFunction(element.text);
         }
         else
         {
             ProfilerDriver.EndInstrumentFunction(element.text);
         }
     }
     this.UpdateAllCheckbox();
 }