/// <summary>
        /// Update the visible content.
        /// </summary>
        /// <param name="sender">The source object.</param>
        /// <param name="e">The selection changed event data.</param>
        private void OnApiChanged(object sender, SelectionChangedEventArgs e)
        {
            MemberInfoData mim = ControlApi.SelectedItem as MemberInfoData;

            IntelliSenseIcon.Content = ControlApi.SelectedItem == null ? null : mim.Icon;
            SelectedInformation.Text = mim == null ? string.Empty : mim.MemberInfo.Name;
        }
        /// <summary>
        /// Handle the Loaded event of the page.
        /// </summary>
        /// <param name="sender">The source object.</param>
        /// <param name="rea">The event arguments.</param>
        private void OnLoaded(object sender, RoutedEventArgs rea)
        {
            ControlApi.ItemFilter = (prefix, item) =>
            {
                if (string.IsNullOrEmpty(prefix))
                {
                    return(true);
                }
                MemberInfoData pme = item as MemberInfoData;
                if (pme == null)
                {
                    return(false);
                }
                return(pme.Name.ToUpper(CultureInfo.InvariantCulture).Contains(prefix.ToUpper(CultureInfo.InvariantCulture)));
            };

            // Reflect and load data
            ControlApi.ItemsSource    = MemberInfoData.GetSetForType(typeof(AutoCompleteBox));
            ControlPicker.ItemsSource = InitializeTypeList();

            // Set the changed handlers
            ControlApi.SelectionChanged    += OnApiChanged;
            ControlPicker.SelectionChanged += OnPickerChanged;

            // Setup the dictionary converter
            ControlPicker.ValueMemberBinding = new Binding
            {
                Converter = new DictionaryKeyValueConverter <string, Type>()
            };
        }
 /// <summary>
 /// Update the API system.
 /// </summary>
 /// <param name="sender">The source object.</param>
 /// <param name="e">The selection changed event data.</param>
 private void OnPickerChanged(object sender, SelectionChangedEventArgs e)
 {
     if (ControlPicker.SelectedItem == null)
     {
         ControlApi.ItemsSource   = null;
         ControlApi.Text          = null;
         IntelliSenseIcon.Content = null;
         ControlApi.IsEnabled     = false;
     }
     else
     {
         KeyValuePair <string, Type> pair = (KeyValuePair <string, Type>)ControlPicker.SelectedItem;
         ControlApi.ItemsSource = MemberInfoData.GetSetForType(pair.Value);
         ControlApi.IsEnabled   = true;
     }
 }
        /// <summary>
        /// Gets an enumerable set of PME information objects.
        /// </summary>
        /// <param name="type">The type to reflect over.</param>
        /// <returns>Returns the set of MemberInfoData objects.</returns>
        public static IEnumerable <MemberInfoData> GetSetForType(Type type)
        {
            MemberInfo[] members = type.GetMembers();
            if (members.Length > 0)
            {
                foreach (MemberInfo member in members)
                {
                    if (member.Name.Contains("get_") || member.Name.Contains("set_") || member.Name.Contains("add_") || member.Name.Contains("remove_"))
                    {
                        continue;
                    }

                    MemberInfoData pme = new MemberInfoData(member);
                    yield return(pme);
                }
            }
            else
            {
                yield break;
            }
        }
        /// <summary>
        /// Gets an enumerable set of PME information objects.
        /// </summary>
        /// <param name="type">The type to reflect over.</param>
        /// <returns>Returns the set of MemberInfoData objects.</returns>
        public static IEnumerable<MemberInfoData> GetSetForType(Type type)
        {
            MemberInfo[] members = type.GetMembers();
            if (members.Length > 0)
            {
                foreach (MemberInfo member in members)
                {
                    if (member.Name.Contains("get_") || member.Name.Contains("set_") || member.Name.Contains("add_") || member.Name.Contains("remove_"))
                    {
                        continue;
                    }

                    MemberInfoData pme = new MemberInfoData(member);
                    yield return pme;
                }
            }
            else
            {
                yield break;
            }
        }