Esempio n. 1
0
        private void OnGUI()
        {
            EditorGUILayout.BeginHorizontal(new GUILayoutOption[0]);
            EditorGUILayout.PrefixLabel(this.m_LabelTargetType, EditorStyles.popup);
            this.m_DeviceListBox = new GUIStyle("box");
            int num = EditorGUILayout.Popup(this.m_SelectedType, this.m_DeploymentTargetTypeNames, new GUILayoutOption[0]);

            if (num != this.m_SelectedType)
            {
                this.m_SelectedType = num;
                this.RefreshDeviceList();
            }
            if (GUILayout.Button(EditorGUIUtility.IconContent("Refresh", "Refresh Target List"), EditorStyles.iconButton, new GUILayoutOption[0]))
            {
                this.RefreshDeviceList();
            }
            EditorGUILayout.EndHorizontal();
            int         index      = 0;
            IEnumerator enumerator = ListViewGUILayout.ListView(this.m_ListView, this.m_DeviceListBox, new GUILayoutOption[0]).GetEnumerator();

            try
            {
                while (enumerator.MoveNext())
                {
                    ListViewElement current = (ListViewElement)enumerator.Current;
                    if ((current.row == this.m_ListView.row) && (Event.current.type == EventType.Repaint))
                    {
                        this.m_DeviceListBox.Draw(current.position, false, false, false, false);
                    }
                    if (ListViewGUILayout.HasMouseUp(current.position) || (this.m_SelectedType == 2))
                    {
                        string str = "";
                        if (this.m_SelectedType == 0)
                        {
                            string pattern = @"Model\:\s\w+-\w+\sDUID\:\s(\w+)";
                            Match  match   = new Regex(pattern, RegexOptions.IgnoreCase).Match(this.m_DeviceList[index]);
                            if (match.Success)
                            {
                                str = match.Groups[1].Value;
                            }
                        }
                        else if (this.m_SelectedType == 1)
                        {
                            str = this.m_DeviceList[index];
                        }
                        PlayerSettings.Tizen.deploymentTarget     = str;
                        PlayerSettings.Tizen.deploymentTargetType = this.m_SelectedType;
                    }
                    GUILayout.Label(this.m_DeviceList[index++], new GUILayoutOption[0]);
                }
            }
            finally
            {
                IDisposable disposable = enumerator as IDisposable;
                if (disposable != null)
                {
                    disposable.Dispose();
                }
            }
        }
        private void OnGUI()
        {
            GUILayout.Label(EditorGUIUtility.TextContent("Choose one or more targets to deploy to."), new GUILayoutOption[0]);
            EditorGUILayout.Space();
            this.RefreshDeviceList();
            GUIStyle    style      = "box";
            int         num        = 0;
            IEnumerator enumerator = ListViewGUILayout.ListView(this.m_ListView, style, new GUILayoutOption[0]).GetEnumerator();

            try
            {
                while (enumerator.MoveNext())
                {
                    ListViewElement current = (ListViewElement)enumerator.Current;
                    if ((current.row == this.m_ListView.row) && (Event.current.type == EventType.Repaint))
                    {
                        style.Draw(current.position, false, false, false, false);
                    }
                    if (ListViewGUILayout.HasMouseUp(current.position))
                    {
                        this.target = (string)this.m_DeviceList[num];
                    }
                    GUILayout.Label((string)this.m_DeviceList[num++], new GUILayoutOption[0]);
                }
            }
            finally
            {
                IDisposable disposable = enumerator as IDisposable;
                if (disposable != null)
                {
                    disposable.Dispose();
                }
            }
            GUILayoutOption[] options = new GUILayoutOption[] { btnWidth };
            if (GUILayout.Button(EditorGUIUtility.TextContent("Add"), options))
            {
                m_STVEditorExt.SetTVDeviceAddressString(this.target.Remove(this.target.IndexOf(" :: ")));
            }
        }