/src/ZebraFlickr/CommandLine/Details.cs
C# | 117 lines | 33 code | 17 blank | 67 comment | 0 complexity | efa89090d3ba2e6b74f90e1d8bff8c74 MD5 | raw file
- #region License
-
- // Copyright (c) 2012 Gareth Lennox (garethl@dwakn.com)
- // All rights reserved.
- //
- // Redistribution and use in source and binary forms, with or without modification,
- // are permitted provided that the following conditions are met:
- //
- // * Redistributions of source code must retain the above copyright notice,
- // this list of conditions and the following disclaimer.
- // * Redistributions in binary form must reproduce the above copyright notice,
- // this list of conditions and the following disclaimer in the documentation
- // and/or other materials provided with the distribution.
- // * Neither the name of Gareth Lennox nor the names of its
- // contributors may be used to endorse or promote products derived from this
- // software without specific prior written permission.
- //
- // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
- // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- // OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
- #endregion
-
- using System;
-
- namespace ZebraFlickr.CommandLine
- {
- /// <summary>
- /// Details attribute
- /// </summary>
- [AttributeUsage(AttributeTargets.Property, AllowMultiple = true, Inherited = true)]
- public class DetailsAttribute : Attribute
- {
- private bool _isGeneral;
-
- /// <summary>
- /// Creates new details
- /// </summary>
- public DetailsAttribute()
- {
- Index = -1;
- OtherLongNames = new string[] {};
- OtherShortNames = new string[] {};
- }
-
- /// <summary>
- /// Short name
- /// </summary>
- public virtual string ShortName { get; set; }
-
- /// <summary>
- /// Long name
- /// </summary>
- public virtual string LongName { get; set; }
-
- /// <summary>
- /// Any other short names
- /// </summary>
- public virtual string[] OtherShortNames { get; set; }
-
- /// <summary>
- /// Any other long names
- /// </summary>
- public virtual string[] OtherLongNames { get; set; }
-
- /// <summary>
- /// Description
- /// </summary>
- public string Description { get; set; }
-
- /// <summary>
- /// Possible values
- /// </summary>
- public virtual string[] Values { get; set; }
-
- /// <summary>
- /// Index
- /// </summary>
- public virtual int Index { get; set; }
-
- /// <summary>
- /// Decoder to use
- /// </summary>
- public virtual Type Decoder { get; set; }
-
- /// <summary>
- /// Is it required?
- /// </summary>
- public bool Required { get; set; }
-
- /// <summary>
- /// Is it a bare option (i.e. just the value, no prefix)
- /// </summary>
- public bool IsBareOption { get; set; }
-
- /// <summary>
- /// Default value
- /// </summary>
- public object Default { get; set; }
-
- /// <summary>
- /// Is this a general option (i.e. all commands have this option)
- /// </summary>
- public bool IsGeneral
- {
- get { return _isGeneral; }
- set { _isGeneral = value; }
- }
- }
- }