/// <summary>
 /// Converts a <see cref="IndexLibrary.FieldOption"/> to the Lucene equivalent object, <c>IndexReader.FieldOption</c>
 /// </summary>
 /// <param name="option">The <c>FieldOption</c> to convert into a Lucene object</param>
 /// <returns>A Lucene <c>IndexReader.FieldOption</c> that is equivalent to the specified <c>FieldOption</c></returns>
 public static Lucene29.Net.Index.IndexReader.FieldOption ConvertToLuceneFieldOption(FieldOption option)
 {
     switch (option) {
         case FieldOption.All:
             return Lucene29.Net.Index.IndexReader.FieldOption.ALL;
         case FieldOption.Indexed:
             return Lucene29.Net.Index.IndexReader.FieldOption.INDEXED;
         case FieldOption.IndexedNoTermvectors:
             return Lucene29.Net.Index.IndexReader.FieldOption.INDEXED_NO_TERMVECTOR;
         case FieldOption.IndexedWithTermvectors:
             return Lucene29.Net.Index.IndexReader.FieldOption.INDEXED_WITH_TERMVECTOR;
         case FieldOption.OmitTermFrequencyAndPositions:
             return Lucene29.Net.Index.IndexReader.FieldOption.OMIT_TERM_FREQ_AND_POSITIONS;
         case FieldOption.StoresPayloads:
             return Lucene29.Net.Index.IndexReader.FieldOption.STORES_PAYLOADS;
         case FieldOption.Termvector:
             return Lucene29.Net.Index.IndexReader.FieldOption.TERMVECTOR;
         case FieldOption.TermvectorWithOffset:
             return Lucene29.Net.Index.IndexReader.FieldOption.TERMVECTOR_WITH_OFFSET;
         case FieldOption.TermVectorWithPosition:
             return Lucene29.Net.Index.IndexReader.FieldOption.TERMVECTOR_WITH_POSITION;
         case FieldOption.TermVectorWithPositionOffset:
             return Lucene29.Net.Index.IndexReader.FieldOption.TERMVECTOR_WITH_POSITION_OFFSET;
         case FieldOption.Unindexed:
             return Lucene29.Net.Index.IndexReader.FieldOption.UNINDEXED;
         default:
             return Lucene29.Net.Index.IndexReader.FieldOption.ALL;
     }
 }
Example #2
0
        private float[] DrawMultiField(Rect position, GUIContent label, float[] values, FieldOption options)
        {
            if (!DrawLabel(ref position, null, options, label))
            {
                position.width -= MightyGUIUtilities.FIELD_SPACING * (Columns - 1);
            }

            MightyGUIUtilities.MultiFloatField(position, GetLabelContents(), values, GetLabelWidths(), Orientation);

            return(values);
        }
Example #3
0
 public AreaAttribute(FieldOption option = FieldOption.Nothing) : base(option)
 {
 }
Example #4
0
 public static bool Contains(this FieldOption option, FieldOption flag) => (option & flag) != 0;
        private Form GetForm(FieldOption fieldOption)
        {
            Field field = this.Storage.GetRepository <IFieldRepository>().WithKey(fieldOption.FieldId);

            return(this.Storage.GetRepository <IFormRepository>().WithKey(field.FormId));
        }
Example #6
0
 public static FieldOption GetByValue(FieldOption[] options, String value)
 {
     return (from o in options where o.value == value select o).SingleOrDefault();
 }
 /// <summary>
 /// [experimental] Gets a list of unique field names taht exist in this index and have the specified field option information.
 /// </summary>
 /// <param name="options">The options that a field must have applied to it.</param>
 /// <returns>A string list of field names</returns>
 public ICollection<string> GetFieldNames(FieldOption options)
 {
     if (this.isDisposed)
         throw new ObjectDisposedException("IndexReader", "You cannot call GetFieldNames(FieldOption) from a disposed IndexReader");
     return this.luceneReader.GetFieldNames(TypeConverter.ConvertToLuceneFieldOption(options));
 }
Example #8
0
			static FieldOption()
			{
				OMIT_TF = OMIT_TERM_FREQ_AND_POSITIONS;
			}
Example #9
0
 protected BaseExplorerAttribute(string defaultPath, bool pathAsCallback, FieldOption options) : base(options)
 {
     DefaultPath    = defaultPath;
     PathAsCallback = pathAsCallback;
 }
 /// <summary>
 /// Displays a Text Area which size fit the text it contains.
 /// </summary>
 /// <param name="options">Some drawing options for the field (default: Nothing).</param>
 public ResizableTextAreaAttribute(FieldOption options = FieldOption.Nothing) : base(options)
 {
 }
Example #11
0
 /// <summary>
 /// Displays a double slider for a Vector2 or a Vector2Int
 /// The min value will be saved in the x property, and the max value in the y property
 /// </summary>
 /// <param name="minValueCallback">The callback for the minimum value of the slider</param>
 /// <param name="maxValueCallback">The callback for the maximum value of the slider</param>
 /// <param name="options">Some drawing options for the field (default: Nothing)</param>
 public MinMaxSliderAttribute(string minValueCallback, string maxValueCallback, FieldOption options = FieldOption.Nothing) :
     base(options)
 {
     MinValueCallback = minValueCallback;
     MaxValueCallback = maxValueCallback;
 }
Example #12
0
 /// <summary>
 /// Displays a double slider for a Vector2Int
 /// The min value will be saved in the x property, and the max value in the y property
 /// </summary>
 /// <param name="minValue">The minimum value of the slider</param>
 /// <param name="maxValue">The maximum value of the slider</param>
 /// <param name="options">Some drawing options for the field (default: Nothing)</param>
 public MinMaxSliderAttribute(int minValue, int maxValue, FieldOption options = FieldOption.Nothing) : base(options)
 {
     MaxValue = minValue;
     MaxValue = maxValue;
 }
Example #13
0
 /// <summary>
 /// Displays a dropdown that lets you select a scene.
 /// Stores the build index of the scene in the field.
 /// </summary>
 /// <param name="options">Some drawing options for the field (default: Nothing).</param>
 public SceneDropdownAttribute(FieldOption options = FieldOption.Nothing) : base(options)
 {
 }
 public PercentSliderAttribute(FieldOption option = FieldOption.Nothing) : base(option)
 {
 }
Example #15
0
 /// <summary>
 /// Displays a dropdown that lets you select a tag name.
 /// </summary>
 /// <param name="options">Some drawing options for the field (default: Nothing).</param>
 public TagAttribute(FieldOption options = FieldOption.Nothing) : base(options)
 {
 }
Example #16
0
 /// <summary> Get a list of unique field names that exist in this index and have the specified
 /// field option information.
 /// </summary>
 /// <param name="fldOption">specifies which field option should be available for the returned fields
 /// </param>
 /// <returns> Collection of Strings indicating the names of the fields.
 /// </returns>
 /// <seealso cref="IndexReader.FieldOption">
 /// </seealso>
 public abstract ICollection<string> GetFieldNames(FieldOption fldOption);
Example #17
0
 public LayerFieldAttribute(FieldOption option = FieldOption.Nothing) : base(option)
 {
 }
Example #18
0
 public void EditFieldOption(FieldOption fieldOption)
 {
     db.Entry(fieldOption).State = EntityState.Modified;
     db.SaveChanges();
 }
Example #19
0
 /// <summary>
 /// Draws a button to the right of the field that opens a panel that lets you select a folder.
 /// </summary>
 /// <param name="defaultPath">The default path at which the panel will be open.
 /// If it’s left null, the panel will open at the “Assets” folder.</param>
 /// <param name="pathAsCallback">Choose whether or not the default path should be consider as a callback (default: false).</param>
 /// <param name="options">Some drawing options for the field (default: Nothing).</param>
 public FolderPanelAttribute(string defaultPath, bool pathAsCallback = false, FieldOption options = FieldOption.Nothing)
     : base(defaultPath, pathAsCallback, options)
 {
 }
Example #20
0
 /// <summary>
 /// Allows you to select what flags are available for an enum mask.
 /// The enum targeted has to be marked by the [System.Flags] attribute.
 /// </summary>
 /// <param name="availableMaskCallback">The callback for the mask that contains all the available flags.</param>
 /// <param name="allowEverything">Choose whether or not the "Everything" option should be available (default: true).</param>
 /// <param name="options">Some drawing options for the field (default: Nothing).</param>
 public AvailableMaskAttribute(string availableMaskCallback, bool allowEverything = true, FieldOption options = FieldOption.Nothing)
     : base(options)
 {
     AvailableMaskCallback = availableMaskCallback;
     AllowEverything       = allowEverything;
 }
Example #21
0
 /// <summary>
 /// Draws a button to the right of the field that opens a panel that lets you select a file.
 /// </summary>
 /// <param name="options">Some drawing options for the field (default: Nothing).</param>
 public FilePanelAttribute(FieldOption options = FieldOption.Nothing) : base(null, false, options)
 {
 }
 public CustomDrawerAttribute(string drawerCallback, string elementHeightCallback = null, FieldOption option = FieldOption.Nothing) :
     base(option)
 {
     DrawerCallback        = drawerCallback;
     ElementHeightCallback = elementHeightCallback;
 }
Example #23
0
 /// <summary>
 /// Draws a button to the right of the field that opens a panel that lets you select a file.
 /// </summary>
 /// <param name="extension">The extension of the file to select.
 /// Can hold multiple values if they are separated with a comma (without space).
 /// Accept any file if left null.</param>
 /// <param name="defaultPath">The default path at which the panel will be open.
 /// If it’s left null, the panel will open at the “Assets” folder.</param>
 /// <param name="extensionAsCallback">Choose whether or not the extension should be consider as a callback (default: false).</param>
 /// <param name="pathAsCallback">Choose whether or not the default path should be consider as a callback (default: false).</param>
 /// <param name="options">Some drawing options for the field (default: Nothing).</param>
 public FilePanelAttribute(string extension, string defaultPath, bool extensionAsCallback = false, bool pathAsCallback = false,
                           FieldOption options = FieldOption.Nothing) : base(defaultPath, pathAsCallback, options)
 {
     Extension           = extension;
     ExtensionAsCallback = extensionAsCallback;
 }
Example #24
0
 /// <summary>
 /// Replaces the "X" and "Y" labels of a Vector2 with "Min" and "Max".
 /// </summary>
 /// <param name="options">Some drawing options for the field (default: Nothing).</param>
 public MinMaxAttribute(FieldOption options = FieldOption.Nothing) : base(options)
 {
 }
Example #25
0
 /// <summary>
 /// Draws a button to the right of the field that opens a panel that lets you select a file.
 /// </summary>
 /// <param name="extension">The extension of the file to select.
 /// Can hold multiple values if they are separated with a comma (without space).
 /// Accept any file if left null.</param>
 /// <param name="extensionAsCallback">Choose whether or not the extension should be consider as a callback (default: false).</param>
 /// <param name="options">Some drawing options for the field (default: Nothing).</param>
 public FilePanelAttribute(string extension, bool extensionAsCallback = false, FieldOption options = FieldOption.Nothing)
     : base(null, false, options)
 {
     Extension           = extension;
     ExtensionAsCallback = extensionAsCallback;
 }
Example #26
0
 public static bool ContainsExact(this FieldOption option, FieldOption flag) => (option & flag) == flag;
Example #27
0
 public DropdownAttribute(string valuesFieldName, FieldOption option = FieldOption.Nothing) : base(option) =>
Example #28
0
 /// <summary> Get a list of unique field names that exist in this index and have the specified
 /// field option information.
 /// </summary>
 /// <param name="fldOption">specifies which field option should be available for the returned fields
 /// </param>
 /// <returns> Collection of Strings indicating the names of the fields.
 /// </returns>
 /// <seealso cref="IndexReader.FieldOption">
 /// </seealso>
 public abstract System.Collections.ICollection GetFieldNames(FieldOption fldOption);
 private void CacheForm(FieldOption fieldOption)
 {
     new SerializationManager(this).SerializeForm(this.GetForm(fieldOption));
 }
Example #30
0
        /// <summary>
        /// Converts a <see cref="IndexLibrary.FieldOption"/> to the Lucene equivalent object, <c>IndexReader.FieldOption</c>
        /// </summary>
        /// <param name="option">The <c>FieldOption</c> to convert into a Lucene object</param>
        /// <returns>A Lucene <c>IndexReader.FieldOption</c> that is equivalent to the specified <c>FieldOption</c></returns>
        public static Lucene29.Net.Index.IndexReader.FieldOption ConvertToLuceneFieldOption(FieldOption option)
        {
            switch (option)
            {
            case FieldOption.All:
                return(Lucene29.Net.Index.IndexReader.FieldOption.ALL);

            case FieldOption.Indexed:
                return(Lucene29.Net.Index.IndexReader.FieldOption.INDEXED);

            case FieldOption.IndexedNoTermvectors:
                return(Lucene29.Net.Index.IndexReader.FieldOption.INDEXED_NO_TERMVECTOR);

            case FieldOption.IndexedWithTermvectors:
                return(Lucene29.Net.Index.IndexReader.FieldOption.INDEXED_WITH_TERMVECTOR);

            case FieldOption.OmitTermFrequencyAndPositions:
                return(Lucene29.Net.Index.IndexReader.FieldOption.OMIT_TERM_FREQ_AND_POSITIONS);

            case FieldOption.StoresPayloads:
                return(Lucene29.Net.Index.IndexReader.FieldOption.STORES_PAYLOADS);

            case FieldOption.Termvector:
                return(Lucene29.Net.Index.IndexReader.FieldOption.TERMVECTOR);

            case FieldOption.TermvectorWithOffset:
                return(Lucene29.Net.Index.IndexReader.FieldOption.TERMVECTOR_WITH_OFFSET);

            case FieldOption.TermVectorWithPosition:
                return(Lucene29.Net.Index.IndexReader.FieldOption.TERMVECTOR_WITH_POSITION);

            case FieldOption.TermVectorWithPositionOffset:
                return(Lucene29.Net.Index.IndexReader.FieldOption.TERMVECTOR_WITH_POSITION_OFFSET);

            case FieldOption.Unindexed:
                return(Lucene29.Net.Index.IndexReader.FieldOption.UNINDEXED);

            default:
                return(Lucene29.Net.Index.IndexReader.FieldOption.ALL);
            }
        }
Example #31
0
 protected BaseDrawerAttribute(FieldOption option) => Option = option;
Example #32
0
 /// <summary>
 /// Draws an object field where Scene references aren't allowed.
 /// </summary>
 /// <param name="options">Some drawing options for the field (default: Nothing).</param>
 public AssetOnlyAttribute(FieldOption options = FieldOption.Nothing) : base(options)
 {
 }
Example #33
0
 /// <summary>
 /// Displays a regular enum dropdown selection for an enum marked by the [System.Flags] attribute.
 /// </summary>
 /// <param name="allowNothing">Choose whether or not a "Nothing" option should be available (default: false).
 /// If you select "Nothing", your field value will be 0.</param>
 /// <param name="options">Some drawing options for the field (default: Nothing).</param>
 public NotFlagsAttribute(bool allowNothing = false, FieldOption options = FieldOption.Nothing) : base(options) =>
Example #34
0
 /// <summary> Get a list of unique field names that exist in this index and have the specified
 /// field option information.
 /// </summary>
 /// <param name="fldOption">specifies which field option should be available for the returned fields
 /// </param>
 /// <returns> Collection of Strings indicating the names of the fields.
 /// </returns>
 /// <seealso cref="IndexReader.FieldOption">
 /// </seealso>
 public abstract System.Collections.ICollection GetFieldNames(FieldOption fldOption);
Example #35
0
 /// <summary>
 /// Displays a slider between 0 and 100, followed by a "%" sign, for an int or a float.
 /// </summary>
 /// <param name="options">Some drawing options for the field (default: Nothing).</param>
 public PercentSliderAttribute(FieldOption options = FieldOption.Nothing) : base(options) => Between01 = false;
Example #36
0
		/// <summary> Get a list of unique field names that exist in this index and have the specified
		/// field option information.
		/// </summary>
		/// <param name="fldOption">specifies which field option should be available for the returned fields
		/// </param>
		/// <returns> Collection of Strings indicating the names of the fields.
		/// </returns>
		/// <seealso cref="IndexReader.FieldOption">
		/// </seealso>
		public abstract System.Collections.Generic.ICollection<string> GetFieldNames(FieldOption fldOption);
Example #37
0
 public int CreateFieldOption(FieldOption fieldOption)
 {
     db.FieldOptions.Add(fieldOption);
     db.SaveChanges();
     return(fieldOption.FieldOptionID);
 }