Example #1
0
        /// <inheritdoc cref="SelectionBoxOptionsAttribute(int, SelectType_e[])"/>
        /// <param name="customFilter">Type of custom filter of <see cref="ISelectionCustomFilter"/> for custom logic for filtering selection objects</param>
        /// <exception cref="InvalidCastException"/>
        public SelectionBoxOptionsAttribute(int mark, Type customFilter, SelectionBoxStyle_e style,
                                            StandardSelectionColor_e selColor, params SelectType_e[] filters)
        {
            Style          = style;
            SelectionColor = selColor;

            Filters       = filters;
            SelectionMark = mark;

            if (customFilter != null)
            {
                if (!typeof(ISelectionCustomFilter).IsAssignableFrom(customFilter))
                {
                    throw new InvalidCastException($"{customFilter.FullName} doesn't implement {typeof(ISelectionCustomFilter).FullName}");
                }

                CustomFilter = customFilter;
            }
        }
Example #2
0
 /// <summary>
 /// Constructor for selection box options
 /// </summary>
 /// <param name="style">Selection box style</param>
 /// <param name="selColor">Color of the selections in this selection box</param>
 public SelectionBoxOptionsAttribute(
     SelectionBoxStyle_e style         = SelectionBoxStyle_e.None,
     StandardSelectionColor_e selColor = 0) : this(-1, null, style, selColor)
 {
 }