public void OnGUI()
            {
                GUILayout.Label("Name", EditorStyles.label, new GUILayoutOption[0]);
                EditorGUI.FocusTextInControl("NewScriptName");
                GUI.SetNextControlName("NewScriptName");
                AddComponentWindow.className = EditorGUILayout.TextField(AddComponentWindow.className, new GUILayoutOption[0]);
                EditorGUILayout.Space();
                AddComponentWindow.Language language = (AddComponentWindow.Language)EditorGUILayout.EnumPopup("Language", AddComponentWindow.s_Lang, new GUILayoutOption[0]);
                if (language != AddComponentWindow.s_Lang)
                {
                    AddComponentWindow.s_Lang = language;
                    EditorPrefs.SetInt("NewScriptLanguage", (int)language);
                }
                EditorGUILayout.Space();
                bool flag = this.CanCreate();

                if (!flag && AddComponentWindow.className != "")
                {
                    GUILayout.Label(this.GetError(), EditorStyles.helpBox, new GUILayoutOption[0]);
                }
                GUILayout.FlexibleSpace();
                using (new EditorGUI.DisabledScope(!flag))
                {
                    if (GUILayout.Button("Create and Add", new GUILayoutOption[0]))
                    {
                        this.Create();
                    }
                }
                EditorGUILayout.Space();
            }
 private void OnEnable()
 {
     AddComponentWindow.s_AddComponentWindow = this;
     AddComponentWindow.s_Lang = (AddComponentWindow.Language)EditorPrefs.GetInt("NewScriptLanguage", 0);
     if (!Enum.IsDefined(typeof(AddComponentWindow.Language), AddComponentWindow.s_Lang))
     {
         EditorPrefs.SetInt("NewScriptLanguage", 0);
         AddComponentWindow.s_Lang = AddComponentWindow.Language.CSharp;
     }
     this.m_Search = EditorPrefs.GetString("ComponentSearchString", "");
 }
 private void OnEnable()
 {
   AddComponentWindow.s_AddComponentWindow = this;
   AddComponentWindow.s_Lang = (AddComponentWindow.Language) EditorPrefs.GetInt("NewScriptLanguage", 0);
   if (!Enum.IsDefined(typeof (AddComponentWindow.Language), (object) AddComponentWindow.s_Lang))
   {
     EditorPrefs.SetInt("NewScriptLanguage", 0);
     AddComponentWindow.s_Lang = AddComponentWindow.Language.CSharp;
   }
   this.m_Search = EditorPrefs.GetString("ComponentSearchString", string.Empty);
 }