Exemplo n.º 1
0
        public void RefreshOptions()
        {
            CustomOptions?.Clear();

            if (this.typeConverter != null)
            {
                if (string.IsNullOrEmpty(UnmodifiedVariableName))
                {
                    throw new InvalidOperationException("UnmodifiedVariableName must be set first.");
                }
                var descriptor = new TypeDescriptorContext(UnmodifiedVariableName);
                var values     = typeConverter.GetStandardValues(descriptor);

                List <object> valuesAsList = new List <object>();

                if (values.Count != 0 && CustomOptions == null)
                {
                    CustomOptions = new List <object>();
                }

                foreach (var item in values)
                {
                    CustomOptions.Add(item);
                }
            }
        }
Exemplo n.º 2
0
 /// <summary>
 ///     Registers a new title menu to display on screen.
 /// </summary>
 /// <param name="button">
 ///     The button to add.
 /// </param>
 public static void RegisterNewTitleButton(CustomTitleOption button)
 {
     CustomOptions.Add(button);
 }