示例#1
0
        public void AddOptions(OptionNumber number, IEnumerable <Option> options)
        {
            if (!_options.ContainsKey(number))
            {
                _options.Add(number, new List <Option>());
            }

            _options[number].AddRange(options);
        }
示例#2
0
        public Option GetFirstOption(OptionNumber number)
        {
            if (!_options.ContainsKey(number))
            {
                return(null);
            }

            return(_options[number].FirstOrDefault());
        }
        public OptionPageOrganisation()
            : base("Organisation")
        {
            iSortTypeNew = new OptionBool("sortnew", "Sort by " + MediaCollection.SortTypeToString(MediaCollection.SortType.eNew), "When sorting your scanned collection, include a " + MediaCollection.SortTypeToString(MediaCollection.SortType.eNew) + " category", true);
            Add(iSortTypeNew);

            iNewMusicCutoffDays = new OptionNumber("newcutoff", "New music cutoff (days)", "Music files created/modified before the specified cutoff will included when scanning by 'New'", 14, 1, 999);
            Add(iNewMusicCutoffDays);

            iSortTypeArtistAlbum = new OptionBool("sortartistalbum", "Sort by " + MediaCollection.SortTypeToString(MediaCollection.SortType.eArtistAlbum), "When sorting your scanned collection, include a " + MediaCollection.SortTypeToString(MediaCollection.SortType.eArtistAlbum) + " category", true);
            Add(iSortTypeArtistAlbum);

            iSortByYear = new OptionBoolEnum("albumarrangement", "Album Arrangement", "Albums can either be arranged alphabetically or by year (as Year/Album, oldest to newest like a discography)", false, "Arrange Albums by Year", "Arrange Albums Alphabetically");
            Add(iSortByYear);

            iSortTypeArtist = new OptionBool("sortartist", "Sort by " + MediaCollection.SortTypeToString(MediaCollection.SortType.eArtist), "When sorting your scanned collection, include a " + MediaCollection.SortTypeToString(MediaCollection.SortType.eArtist) + " category", false);
            Add(iSortTypeArtist);

            iIgnoreCompilations = new OptionBoolEnum("groupcompilations", "Group Compilation Artists", "Group compilation artists as 'Various' or retain artist names (only applies when scanning by 'Artist', done automatically when scanning by 'Artist/Album')", false, "Group as 'Various'", "Retain Artist Names");
            Add(iIgnoreCompilations);

            iSortTypeAlbum = new OptionBool("sortalbum", "Sort by " + MediaCollection.SortTypeToString(MediaCollection.SortType.eAlbum), "When sorting your scanned collection, include a " + MediaCollection.SortTypeToString(MediaCollection.SortType.eAlbum) + " category", false);
            Add(iSortTypeAlbum);

            iSortTypeGenre = new OptionBool("sortgenre", "Sort by " + MediaCollection.SortTypeToString(MediaCollection.SortType.eGenre), "When sorting your scanned collection, include a " + MediaCollection.SortTypeToString(MediaCollection.SortType.eGenre) + " category", false);
            Add(iSortTypeGenre);

            iSortTypeComposer = new OptionBool("sortcomposer", "Sort by " + MediaCollection.SortTypeToString(MediaCollection.SortType.eComposer), "When sorting your scanned collection, include a " + MediaCollection.SortTypeToString(MediaCollection.SortType.eComposer) + " category", false);
            Add(iSortTypeComposer);

            iSortTypeConductor = new OptionBool("sortconductor", "Sort by " + MediaCollection.SortTypeToString(MediaCollection.SortType.eConductor), "When sorting your scanned collection, include a " + MediaCollection.SortTypeToString(MediaCollection.SortType.eConductor) + " category", false);
            Add(iSortTypeConductor);

            iSortTypeArtistAz = new OptionBool("sortartistaz", "Sort by " + MediaCollection.SortTypeToString(MediaCollection.SortType.eArtistAz), "When sorting your scanned collection, include a " + MediaCollection.SortTypeToString(MediaCollection.SortType.eArtistAz) + " category", false);
            Add(iSortTypeArtistAz);

            iSortTypeTitleAz = new OptionBool("sorttitleaz", "Sort by " + MediaCollection.SortTypeToString(MediaCollection.SortType.eTitleAz), "When sorting your scanned collection, include a " + MediaCollection.SortTypeToString(MediaCollection.SortType.eTitleAz) + " category", false);
            Add(iSortTypeTitleAz);

            iSortTypeAlbumArtistAlbum = new OptionBool("sortalbumartistalbum", "Sort by " + MediaCollection.SortTypeToString(MediaCollection.SortType.eAlbumArtistAlbum), "When sorting your scanned collection, include a " + MediaCollection.SortTypeToString(MediaCollection.SortType.eAlbumArtistAlbum) + " category", false);
            Add(iSortTypeAlbumArtistAlbum);

            iSortTypeAlbumArtist = new OptionBool("sortalbumartist", "Sort by " + MediaCollection.SortTypeToString(MediaCollection.SortType.eAlbumArtist), "When sorting your scanned collection, include a " + MediaCollection.SortTypeToString(MediaCollection.SortType.eAlbumArtist) + " category", false);
            Add(iSortTypeAlbumArtist);

            iSortTypeAll = new OptionBool("sortall", "Sort by " + MediaCollection.SortTypeToString(MediaCollection.SortType.eAll), "When sorting your scanned collection, include a " + MediaCollection.SortTypeToString(MediaCollection.SortType.eAll) + " category", false);
            Add(iSortTypeAll);

            iIncludeLocalRadio = new OptionBoolEnum("localradio", "Local Radio", "Creates a group of playlists of local radio stations (provided by TuneIn Radio) if selected", false, "Create Local Radio Playlists", "Ignore");
            Add(iIncludeLocalRadio);

            // linked options
            iNewMusicCutoffDays.Enabled = iSortTypeNew.Native;
            EventSortTypeNewChanged    += SortTypeNewChanged;
            iIgnoreCompilations.Enabled = iSortTypeArtist.Native;
            EventSortTypeArtistChanged += SortTypeArtistChanged;
        }
 public override int GetHashCode()
 {
     unchecked
     {
         int hashCode = (SecurityCode != null
                                 ? SecurityCode.GetHashCode()
                                 : 0);
         hashCode = (hashCode * 397) ^ (OptionNumber != null
                                 ? OptionNumber.GetHashCode()
                                 : 0);
         hashCode = (hashCode * 397) ^ (OptionCode != null
                                 ? OptionCode.GetHashCode()
                                 : 0);
         hashCode = (hashCode * 397) ^ Bid.GetHashCode();
         hashCode = (hashCode * 397) ^ BidVolume.GetHashCode();
         hashCode = (hashCode * 397) ^ Ask.GetHashCode();
         hashCode = (hashCode * 397) ^ AskVolume.GetHashCode();
         hashCode = (hashCode * 397) ^ Volume.GetHashCode();
         hashCode = (hashCode * 397) ^ Bid2.GetHashCode();
         hashCode = (hashCode * 397) ^ BidVolume2.GetHashCode();
         hashCode = (hashCode * 397) ^ Ask2.GetHashCode();
         hashCode = (hashCode * 397) ^ AskVolume2.GetHashCode();
         hashCode = (hashCode * 397) ^ Bid3.GetHashCode();
         hashCode = (hashCode * 397) ^ BidVolume3.GetHashCode();
         hashCode = (hashCode * 397) ^ Ask3.GetHashCode();
         hashCode = (hashCode * 397) ^ AskVolume3.GetHashCode();
         hashCode = (hashCode * 397) ^ Bid4.GetHashCode();
         hashCode = (hashCode * 397) ^ BidVolume4.GetHashCode();
         hashCode = (hashCode * 397) ^ Ask4.GetHashCode();
         hashCode = (hashCode * 397) ^ AskVolume4.GetHashCode();
         hashCode = (hashCode * 397) ^ Bid5.GetHashCode();
         hashCode = (hashCode * 397) ^ BidVolume5.GetHashCode();
         hashCode = (hashCode * 397) ^ Ask5.GetHashCode();
         hashCode = (hashCode * 397) ^ AskVolume5.GetHashCode();
         hashCode = (hashCode * 397) ^ (Greeks != null
                                 ? Greeks.GetHashCode()
                                 : 0);
         hashCode = (hashCode * 397) ^ OpenInterest.GetHashCode();
         hashCode = (hashCode * 397) ^ Turnover.GetHashCode();
         hashCode = (hashCode * 397) ^ UncoveredPositionQuantity.GetHashCode();
         hashCode = (hashCode * 397) ^ PreviousSettlementPrice.GetHashCode();
         hashCode = (hashCode * 397) ^ OpeningPrice.GetHashCode();
         hashCode = (hashCode * 397) ^ AuctionReferencePrice.GetHashCode();
         hashCode = (hashCode * 397) ^ AuctionReferenceQuantity.GetHashCode();
         hashCode = (hashCode * 397) ^ HighestPrice.GetHashCode();
         hashCode = (hashCode * 397) ^ LowestPrice.GetHashCode();
         hashCode = (hashCode * 397) ^ LatestTradedPrice.GetHashCode();
         hashCode = (hashCode * 397) ^ Change.GetHashCode();
         hashCode = (hashCode * 397) ^ ChangePercentage.GetHashCode();
         hashCode = (hashCode * 397) ^ PreviousClose.GetHashCode();
         hashCode = (hashCode * 397) ^ (Name != null
                                 ? Name.GetHashCode()
                                 : 0);
         return(hashCode);
     }
 }
示例#5
0
        public Option GetFirstOption(OptionNumber number)
        {
            if (!_options.ContainsKey(number)) {
                return null;
            }

            return _options[number].FirstOrDefault();
        }
示例#6
0
 public static BlockOption GetBlockOption(this Message message, OptionNumber optionNumber)
 {
     return(message.GetFirstOption(optionNumber) as BlockOption);
 }
示例#7
0
        public void AddOptions(OptionNumber number, IEnumerable<Option> options)
        {
            if (!_options.ContainsKey(number)) {
                _options.Add(number, new List<Option>());
            }

            _options[number].AddRange(options);
        }
示例#8
0
 public Option(OptionNumber number)
     : this(number, new byte[0])
 {
 }
示例#9
0
 public Option(OptionNumber number, byte[] value)
 {
     Number = number;
     Value  = value;
 }
示例#10
0
 public BlockOption(OptionNumber number, int num, int m, int szx)
     : base(number, Encode(num, m, szx))
 {
 }
示例#11
0
 private static int GetCount(Request request, OptionNumber number)
 {
     return request.Options.Where(o => o.Number == number).Count();
 }
示例#12
0
 private static int GetCount(Request request, OptionNumber number)
 {
     return(request.Options.Where(o => o.Number == number).Count());
 }
示例#13
0
 public Option(OptionNumber number)
     : this(number, new byte[0])
 {
 }
示例#14
0
 public BlockOption(OptionNumber number, byte[] value)
     : base(number, value)
 {
 }
示例#15
0
 public BlockOption(OptionNumber number, int num, int m, int szx)
     : base(number, Encode(num, m, szx))
 {
 }
示例#16
0
 public BlockOption(OptionNumber number)
     : base(number)
 {
 }
示例#17
0
 public static BlockOption GetBlockOption(this Message message, OptionNumber optionNumber)
 {
     return message.GetFirstOption(optionNumber) as BlockOption;
 }
示例#18
0
 public BlockOption(OptionNumber number)
     : base(number)
 {
 }
 public IStoryRecorder PicksOption(OptionNumber optionNumber, string optionOutputPlaceholder = null)
 {
     return(this.PicksOption((int)optionNumber, optionOutputPlaceholder));
 }
示例#20
0
 public Option(OptionNumber number, byte[] value)
 {
     Number = number;
     Value = value;
 }
示例#21
0
 public IStoryRecorder <T> PicksOption(OptionNumber optionNumber)
 {
     return(this.PicksOption((int)optionNumber));
 }
示例#22
0
 public BlockOption(OptionNumber number, byte[] value)
     : base(number, value)
 {
 }