Ejemplo n.º 1
0
 internal TokenTimeRange(int position, TimeRangeKeywordsType range)
     : base(position)
 {
     index = 0;
     timeRangeType = TimeRangeType.DEFAULT;
     timeRange = range;
 }
Ejemplo n.º 2
0
 internal TokenTimeRange(int position, int val, TimeRangeType type)
     : base(position)
 {
     index = val;
     timeRangeType = type;
     timeRange = TimeRangeKeywordsType.NONE;
     Logger.Info("Created an time range token object", "TokenTimeRange::TokenTimeRange");
 }
        /// <summary>
        ///     Get the current user’s top artists based on calculated affinity.
        /// </summary>
        /// <param name="timeRange">Over what time frame the affinities are computed.
        /// Valid values: long_term (calculated from several years of data and including all new data as it becomes available),
        /// medium_term (approximately last 6 months), short_term (approximately last 4 weeks). </param>
        /// <param name="limit">The number of entities to return. Default: 20. Minimum: 1. Maximum: 50</param>
        /// <param name="offest">The index of the first entity to return. Default: 0 (i.e., the first track). Use with limit to get the next set of entities.</param>
        /// <returns></returns>
        /// <remarks>AUTH NEEDED</remarks>
        public string GetUsersTopArtists(TimeRangeType timeRange = TimeRangeType.MediumTerm, int limit = 20, int offest = 0)
        {
            limit = Math.Min(50, limit);
            StringBuilder builder = new StringBuilder($"{APIBase}/me/top/artists");

            builder.Append("?limit=" + limit);
            builder.Append("&offset=" + offest);
            builder.Append("&time_range=" + timeRange.GetStringAttribute());
            return(builder.ToString());
        }
Ejemplo n.º 4
0
        private string FormatStatsPeriod(TimeRangeType period)
        {
            switch (period)
            {
            case TimeRangeType.ShortTerm: return("in the last month");

            case TimeRangeType.MediumTerm: return("in the last 6 months");

            case TimeRangeType.LongTerm: return("");

            default: throw new ArgumentException($"Unknown value {period}");
            }
        }
Ejemplo n.º 5
0
 /// <summary>
 /// This is the constructor for the Schedule operation.
 /// This operation accepts a time range and tries to schedule a task
 /// for the specified time period within the time range at the earliest
 /// possible point on execution.</summary>
 /// <param name="taskName">The name of the task to schedule.</param>
 /// <param name="startDateTime">The start date/time which the task should be scheduled within.</param>
 /// <param name="endDateTime">The end date/time which the task should be scheduled within.</param>
 /// <param name="isSpecific">The specificity of the start and end date time ranges.</param>
 /// <param name="timeRangeAmount">The numerical value of the task length of the task to be scheduled.</param>
 /// <param name="timeRangeType">The type of time length the task uses: hour, day, week or month.</param>
 /// <param name="sortType">The type of sort to sort the diplay list by after the operation is executed.</param>
 /// <returns>Nothing.</returns>
 public OperationSchedule(
     string taskName,
     DateTime startDateTime,
     DateTime? endDateTime,
     DateTimeSpecificity isSpecific,
     int timeRangeAmount,
     TimeRangeType timeRangeType,
     SortType sortType)
     : base(sortType)
 {
     this.taskName = taskName;
     this.startDateTime = startDateTime;
     this.endDateTime = endDateTime;
     this.isSpecific = isSpecific;
     this.taskDurationAmount = timeRangeAmount;
     this.taskDurationType = timeRangeType;
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Set default time length type (HOUR,DAY etc.) for Command SCHEDULE
 /// </summary>
 /// <param name="timeRange">default time length type</param>
 public void SetDefaultScheduleTimeLengthType(TimeRangeType timeRange)
 {
     settingInfo.misc.DefaultScheduleTimeLengthType = timeRange;
     EventHandlers.UpdateSettings(settingInfo);
     UpdateDictionaryPostponeSchedule();
     string loggerString = string.Format("User set default schedule time length type to {0}..", timeRange.ToString());
     Logger.Info(loggerString, "Logc::Settings");
 }
        /// <summary>
        /// Retrieves a log of emails sent, or scheduled to be sent, to buyers.
        ///
        /// The standard Trading API
        /// deprecation process is not applicable to this call.
        /// </summary>
        ///
        /// <param name="ItemID">
        /// Unique identifier for the eBay item listing associated with the Selling
        /// Manager email log. Unless the <b>OrderID</b> or <b>OrderLineItemID</b> value is
        /// specified in the request, the <b>ItemID</b> and <b>TransactionID</b> fields must be
        /// used to identify the Selling Manager email log to retrieve. You can
        /// use <b>GetSellingManagerSoldListings</b> to retrieve the <b>ItemID</b>, <b>TransactionID</b>
        /// or <b>OrderLineItemID</b> values that correspond to the Selling Manager sale
        /// record (<b>SaleRecordID</b>). All four of these fields are returned under the
        /// <b>SellingManagerSoldTransaction</b> container of the
        /// <b>GetSellingManagerSoldListings</b> request.
        /// </param>
        ///
        /// <param name="TransactionID">
        /// Unique identifier for the order line item (transaction) associated with
        /// the Selling Manager email log. Unless the <b>OrderID</b> or <b>OrderLineItemID</b>
        /// value is specified in the request, the <b>ItemID</b> and <b>TransactionID</b> fields
        /// must be used to identify the Selling Manager email log to retrieve.
        /// You can use <b>GetSellingManagerSoldListings</b> to retrieve the <b>ItemID</b>,
        /// <b>TransactionID</b> or <b>OrderLineItemID</b> values that correspond to the Selling
        /// Manager sale record (<b>SaleRecordID</b>). All four of these fields are
        /// returned under the <b>SellingManagerSoldTransaction</b> container of the
        /// <b>GetSellingManagerSoldListings</b> request.
        /// </param>
        ///
        /// <param name="OrderID">
        /// A unique identifier that identifies a single line item or multiple line item
        /// (Combined Invoice) order associated with the Selling Manager email log.
        ///
        /// For a single line item order, the <b>OrderID</b> value is identical to the
        /// <b>OrderLineItemID</b> value that is generated upon creation of the order line
        /// item. For a Combined Invoice order, the <b>OrderID</b> value is created by eBay
        /// when the buyer or seller (sharing multiple, common order line items)
        /// combines multiple order line items into a Combined Invoice order through
        /// the eBay site (or when the seller creates Combined Invoice order through
        /// <b>AddOrder</b>). If an <b>OrderID</b> is used in the request, the <b>OrderLineItemID</b> and
        /// <b>ItemID</b>/<b>TransactionID</b> pair are not required.
        /// </param>
        ///
        /// <param name="EmailDateRange">
        /// Specifies the earliest (oldest) and latest (most recent) dates to use in a
        /// date range filter based on email sent date. Each of the time ranges can be
        /// up to 90 days.
        /// </param>
        ///
        /// <param name="OrderLineItemID">
        /// A unique identifier for an eBay order line item that is associated with
        /// the Selling Manager email log. This field is created as soon as there
        /// is a commitment to buy from the seller, and its value is based upon the
        /// concatenation of <b>ItemID</b> and <b>TransactionID</b>, with a hyphen in between
        /// these two IDs. You can use <b>GetSellingManagerSoldListings</b> to retrieve the
        /// <b>ItemID</b>, <b>TransactionID</b> or <b>OrderLineItemID</b> values that correspond to the
        /// Selling Manager sale record (<b>SaleRecordID</b>). All four of these fields are
        /// returned under the <b>SellingManagerSoldTransaction</b> container of the
        /// <b>GetSellingManagerSoldListings</b> request. Unless an <b>OrderID</b> or an
        /// <b>ItemID</b>/<b>TransactionID</b> pair is specified in the <b>GetSellingManagerSaleRecord</b>
        /// request, the <b>OrderLineItemID</b> is required.
        ///
        /// </param>
        ///
        public SellingManagerEmailLogTypeCollection GetSellingManagerEmailLog(string ItemID, long TransactionID, string OrderID, TimeRangeType EmailDateRange, string OrderLineItemID)
        {
            this.ItemID          = ItemID;
            this.TransactionID   = TransactionID;
            this.OrderID         = OrderID;
            this.EmailDateRange  = EmailDateRange;
            this.OrderLineItemID = OrderLineItemID;

            Execute();
            return(ApiResponse.EmailLog);
        }
        /// <summary>
        /// Returns a Selling Manager user's sold listings.
        ///
        /// This call is subject to change without notice; the deprecation process is inapplicable to this call. The user must have a Selling Manager Pro subscription to use this call.
        /// </summary>
        ///
        /// <param name="Search">
        /// This container is used if the seller would like to search for Selling Manager Sele Records based on certain identifiers like Saler Record ID, Item ID, listing title, buyer user ID, etc. The seller will specify one of the supported search types in <b>SellingManagerSearchTypeCodeType</b>, and then provides the value for that search type.
        /// </param>
        ///
        /// <param name="StoreCategoryID">
        /// This field is used if the seller would like to retrieve all Selling Manager Sale Records for products listed in a specific eBay Store Category.
        /// </param>
        ///
        /// <param name="FilterList">
        /// One or more <b>Filter</b> fields can be used to retrieve Selling Manager Sale Records for orders that are in a certain state. See <b>SellingManagerSoldListingsPropertyTypeCodeType</b> for the supported values.
        /// </param>
        ///
        /// <param name="Archived">
        /// This field is included and set to <code>true</code> if the seller would like to retrieve one or more archived orders between 90 and 120 days old.
        /// </param>
        ///
        /// <param name="Sort">
        /// This field is used if the seller would like to sort Selling Manager Sale Record results based on a specific aspect such as purchase date, checkout status, total price, etc. See <b>SellingManagerSoldListingsSortTypeCodeType</b> to read more about the available sorting options.
        /// </param>
        ///
        /// <param name="SortOrder">
        /// This field allows the seller to sort in ascending or descending order (based on the selected aspect in the <b>Sort</b> field).
        /// </param>
        ///
        /// <param name="Pagination">
        /// This container is used if the seller would like to control how many Sale Records are returned per page and which page to view.
        /// </param>
        ///
        /// <param name="SaleDateRange">
        /// This container allows the seller to retrieve orders that were purchased within a specified time range. A time range can be set up to 90 days in the past (or up to 120 days if the <b>Archived</b> field is included and set to <code>true</code>.
        /// </param>
        ///
        public SellingManagerSoldOrderTypeCollection GetSellingManagerSoldListings(SellingManagerSearchType Search, long StoreCategoryID, SellingManagerSoldListingsPropertyTypeCodeTypeCollection FilterList, bool Archived, SellingManagerSoldListingsSortTypeCodeType Sort, SortOrderCodeType SortOrder, PaginationType Pagination, TimeRangeType SaleDateRange)
        {
            this.Search          = Search;
            this.StoreCategoryID = StoreCategoryID;
            this.FilterList      = FilterList;
            this.Archived        = Archived;
            this.Sort            = Sort;
            this.SortOrder       = SortOrder;
            this.Pagination      = Pagination;
            this.SaleDateRange   = SaleDateRange;

            Execute();
            return(ApiResponse.SaleRecord);
        }
        /// <summary>
        /// Retrieves a log of emails sent, or scheduled to be sent, to buyers.
        /// 
        /// The standard Trading API
        /// deprecation process is not applicable to this call.
        /// </summary>
        /// 
        /// <param name="ItemID">
        /// Unique identifier for the eBay item listing associated with the Selling
        /// Manager email log. Unless the <b>OrderID</b> or <b>OrderLineItemID</b> value is
        /// specified in the request, the <b>ItemID</b> and <b>TransactionID</b> fields must be
        /// used to identify the Selling Manager email log to retrieve. You can
        /// use <b>GetSellingManagerSoldListings</b> to retrieve the <b>ItemID</b>, <b>TransactionID</b>
        /// or <b>OrderLineItemID</b> values that correspond to the Selling Manager sale
        /// record (<b>SaleRecordID</b>). All four of these fields are returned under the
        /// <b>SellingManagerSoldTransaction</b> container of the
        /// <b>GetSellingManagerSoldListings</b> request.
        /// </param>
        ///
        /// <param name="TransactionID">
        /// Unique identifier for the order line item (transaction) associated with
        /// the Selling Manager email log. Unless the <b>OrderID</b> or <b>OrderLineItemID</b>
        /// value is specified in the request, the <b>ItemID</b> and <b>TransactionID</b> fields
        /// must be used to identify the Selling Manager email log to retrieve.
        /// You can use <b>GetSellingManagerSoldListings</b> to retrieve the <b>ItemID</b>,
        /// <b>TransactionID</b> or <b>OrderLineItemID</b> values that correspond to the Selling
        /// Manager sale record (<b>SaleRecordID</b>). All four of these fields are
        /// returned under the <b>SellingManagerSoldTransaction</b> container of the
        /// <b>GetSellingManagerSoldListings</b> request.
        /// </param>
        ///
        /// <param name="OrderID">
        /// A unique identifier that identifies a single line item or multiple line item
        /// (Combined Invoice) order associated with the Selling Manager email log. 
        /// 
        /// For a single line item order, the <b>OrderID</b> value is identical to the
        /// <b>OrderLineItemID</b> value that is generated upon creation of the order line
        /// item. For a Combined Invoice order, the <b>OrderID</b> value is created by eBay
        /// when the buyer or seller (sharing multiple, common order line items)
        /// combines multiple order line items into a Combined Invoice order through
        /// the eBay site (or when the seller creates Combined Invoice order through
        /// <b>AddOrder</b>). If an <b>OrderID</b> is used in the request, the <b>OrderLineItemID</b> and
        /// <b>ItemID</b>/<b>TransactionID</b> pair are not required.
        /// </param>
        ///
        /// <param name="EmailDateRange">
        /// Specifies the earliest (oldest) and latest (most recent) dates to use in a
        /// date range filter based on email sent date. Each of the time ranges can be
        /// up to 90 days.
        /// </param>
        ///
        /// <param name="OrderLineItemID">
        /// A unique identifier for an eBay order line item that is associated with
        /// the Selling Manager email log. This field is created as soon as there
        /// is a commitment to buy from the seller, and its value is based upon the
        /// concatenation of <b>ItemID</b> and <b>TransactionID</b>, with a hyphen in between
        /// these two IDs. You can use <b>GetSellingManagerSoldListings</b> to retrieve the
        /// <b>ItemID</b>, <b>TransactionID</b> or <b>OrderLineItemID</b> values that correspond to the
        /// Selling Manager sale record (<b>SaleRecordID</b>). All four of these fields are
        /// returned under the <b>SellingManagerSoldTransaction</b> container of the
        /// <b>GetSellingManagerSoldListings</b> request. Unless an <b>OrderID</b> or an
        /// <b>ItemID</b>/<b>TransactionID</b> pair is specified in the <b>GetSellingManagerSaleRecord</b>
        /// request, the <b>OrderLineItemID</b> is required. 
        /// 
        /// </param>
        ///
        public SellingManagerEmailLogTypeCollection GetSellingManagerEmailLog(string ItemID, long TransactionID, string OrderID, TimeRangeType EmailDateRange, string OrderLineItemID)
        {
            this.ItemID = ItemID;
            this.TransactionID = TransactionID;
            this.OrderID = OrderID;
            this.EmailDateRange = EmailDateRange;
            this.OrderLineItemID = OrderLineItemID;

            Execute();
            return ApiResponse.EmailLog;
        }
Ejemplo n.º 10
0
 /// <summary>
 /// Resets enums to their default values.
 /// </summary>
 /// <returns>Nothing.</returns>
 private void ResetEnumerations()
 {
     commandType = CommandType.INVALID;
     currentMode = ContextType.STARTTIME;
     currentSpecifier = ContextType.CURRENT;
     sortType = SortType.DEFAULT;
     searchType = SearchType.NONE;
     timeRangeType = TimeRangeType.DEFAULT;
     timeRangeOne = TimeRangeKeywordsType.NONE;
     timeRangeTwo = TimeRangeKeywordsType.NONE;
 }
Ejemplo n.º 11
0
        /// <summary>
        /// Initializes the generator's configuration to it's default values.
        /// </summary>
        /// <returns></returns>
        public void InitializeNewConfiguration()
        {
            commandType = new CommandType();
            isSpecific = new DateTimeSpecificity();
            timeRangeType = new TimeRangeType();
            timeRangeOne = new TimeRangeKeywordsType();
            timeRangeTwo = new TimeRangeKeywordsType();
            sortType = new SortType();
            searchType = new SearchType();
            taskName = null;
            taskRangeIndex = null;
            timeRangeIndex = 0;
            rangeIsAll = false;
            startDateTime = null; endDateTime = null;
            startTimeOnly = null; endTimeOnly = null;
            startDateOnly = null; endDateOnly = null;
            startDayOfWeekSet = false; endDayOfWeekSet = false;
            currentSpecifier = new ContextType();
            currentMode = new ContextType();
            crossDayBoundary = false;

            ResetEnumerations();
        }
Ejemplo n.º 12
0
 /// <summary>
 /// This operation generates an operation based on how this generator has been configured.
 /// </summary>
 /// <returns>The generated operation.</returns>
 public Operation CreateOperation()
 {
     Task task;
     Operation newOperation = null;
     switch (commandType)
     {
         case CommandType.ADD:
             task = Task.CreateNewTask(taskName, startDateTime, endDateTime, isSpecific);
             newOperation = new OperationAdd(task, sortType);
             break;
         case CommandType.DELETE:
             newOperation = new OperationDelete(taskName, taskRangeIndex, startDateTime, endDateTime, isSpecific, rangeIsAll, searchType, sortType);
             break;
         case CommandType.DISPLAY:
             newOperation = new OperationDisplayDefault(sortType);
             break;
         case CommandType.MODIFY:
             newOperation = new OperationModify(taskName, taskRangeIndex, startDateTime, endDateTime, isSpecific, rangeIsAll, searchType, sortType);
             break;
         case CommandType.SEARCH:
             newOperation = new OperationSearch(taskName, startDateTime, endDateTime, isSpecific, searchType, sortType);
             break;
         case CommandType.SORT:
             newOperation = new OperationSort(sortType);
             break;
         case CommandType.REDO:
             newOperation = new OperationRedo(sortType);
             break;
         case CommandType.UNDO:
             newOperation = new OperationUndo(sortType);
             break;
         case CommandType.DONE:
             newOperation = new OperationMarkAsDone(taskName, taskRangeIndex, startDateTime, endDateTime, isSpecific, rangeIsAll, searchType, sortType);
             break;
         case CommandType.UNDONE:
             newOperation = new OperationMarkAsUndone(taskName, taskRangeIndex, startDateTime, endDateTime, isSpecific, rangeIsAll, searchType, sortType);
             break;
         case CommandType.POSTPONE:
             TimeSpan postponeDuration = new TimeSpan();
             if (timeRangeType == TimeRangeType.DEFAULT)
             {
                 timeRangeType = CustomDictionary.defaultPostponeDurationType;
                 timeRangeIndex = CustomDictionary.defaultPostponeDurationLength;
             }
             switch (timeRangeType)
             {
                 case TimeRangeType.HOUR:
                     postponeDuration = new TimeSpan(timeRangeIndex, 0, 0);
                     break;
                 case TimeRangeType.DAY:
                     postponeDuration = new TimeSpan(timeRangeIndex, 0, 0, 0);
                     break;
                 case TimeRangeType.WEEK:
                     postponeDuration = new TimeSpan(timeRangeIndex * CustomDictionary.DAYS_IN_WEEK, 0, 0, 0);
                     break;
                 case TimeRangeType.MONTH:
                     postponeDuration = new TimeSpan(timeRangeIndex * CustomDictionary.DAYS_IN_MONTH, 0, 0, 0);
                     break;
             }
             newOperation = new OperationPostpone(taskName, taskRangeIndex, startDateTime, endDateTime, isSpecific, rangeIsAll, searchType, postponeDuration, sortType);
             break;
         case CommandType.SCHEDULE:
             newOperation = new OperationSchedule(taskName, (DateTime)startDateTime, endDateTime, isSpecific, timeRangeIndex, timeRangeType, sortType);
             break;
         case CommandType.EXIT:
             System.Environment.Exit(0);
             break;
     }
     return newOperation;
 }
Ejemplo n.º 13
0
 public MiscSettings(bool firstLoad,bool loadOnStartup, bool startMinimized, bool stayOnTop, int textSize, string fontSelection,
                     Color taskDoneColor, Color taskMissedDeadlineColor, Color taskNearingDeadlineColor, Color taskOverColor,
                     int defaultScheduleTimeLength, TimeRangeType defaultScheduleTimeLengthType,int defaultPostponeDurationLength,TimeRangeType defaultPostponeDurationType)
 {
     _firstLoad = firstLoad;
     _loadOnStartup = loadOnStartup;
     _startMinimized = startMinimized;
     _stayOnTop = stayOnTop;
     _textSize = textSize;
     _fontSelection = fontSelection;
     _taskDoneColor = taskDoneColor;
     _taskMissedDeadlineColor = taskMissedDeadlineColor;
     _taskNearingDeadlineColor = taskNearingDeadlineColor;
     _taskOverColor = taskOverColor;
     _defaultScheduleTimeLength = defaultScheduleTimeLength;
     _defaultScheduleTimeLengthType = defaultScheduleTimeLengthType;
     _defaultPostponeDurationLength = defaultPostponeDurationLength;
     _defaultPostponeDurationType = defaultPostponeDurationType;
 }
		/// <summary>
		/// Returns a Selling Manager user's sold listings.
		/// 
		/// This call is subject to change without notice; the deprecation process is
		/// inapplicable to this call.
		/// </summary>
		/// 
		/// <param name="Search">
		/// Search filters for sold listings.
		/// </param>
		///
		/// <param name="StoreCategoryID">
		/// Listings with this store category ID will be listed.
		/// </param>
		///
		/// <param name="FilterList">
		/// This holds the list of filters that can be applicable for sold listings.
		/// </param>
		///
		/// <param name="Archived">
		/// Requests listing records that are more than 90 days old. Records are archived between 90
		/// and 120 days after being created, and thereafter can only be retrieved using this tag.
		/// </param>
		///
		/// <param name="Sort">
		/// Field to be used to sort the response.
		/// </param>
		///
		/// <param name="SortOrder">
		/// Order to be used for sorting the requested listings.
		/// </param>
		///
		/// <param name="Pagination">
		/// Details about how many listings to return per page and which page to view.
		/// </param>
		///
		/// <param name="SaleDateRange">
		/// Specifies the earliest (oldest) and latest (most recent) dates to use in a date
		/// range filter based on item start time. A time range can be up to 120
		/// days.
		/// </param>
		///
		public SellingManagerSoldOrderTypeCollection GetSellingManagerSoldListings(SellingManagerSearchType Search, long StoreCategoryID, SellingManagerSoldListingsPropertyTypeCodeTypeCollection FilterList, bool Archived, SellingManagerSoldListingsSortTypeCodeType Sort, SortOrderCodeType SortOrder, PaginationType Pagination, TimeRangeType SaleDateRange)
		{
			this.Search = Search;
			this.StoreCategoryID = StoreCategoryID;
			this.FilterList = FilterList;
			this.Archived = Archived;
			this.Sort = Sort;
			this.SortOrder = SortOrder;
			this.Pagination = Pagination;
			this.SaleDateRange = SaleDateRange;

			Execute();
			return ApiResponse.SaleRecord;
		}
Ejemplo n.º 15
0
        private void timeRangeTree_AfterSelect(object sender, TreeViewEventArgs e)
        {
            this.contextTree.SelectedNode = null;
            this.commandTree.SelectedNode = null;
            this.timeRangeKeywordTree.SelectedNode = null;
            this.rangeController.Enabled = false;
            schedPostponePanel.Hide();

            this.commandTree.SelectedNode = null;
            this.selectedType = SelectedType.TimeRangeSelected;
            string selected = timeRangeTree.SelectedNode.Text;
            this.selectedTimeRangeType = ConvertStringToTimeRange(selected);

            UpdateFlexiCommandList();
            UpdateDescription();
        }
Ejemplo n.º 16
0
 /// <summary>
 ///     Get the current user’s top tracks based on calculated affinity.
 /// </summary>
 /// <param name="timeRange">Over what time frame the affinities are computed. 
 /// Valid values: long_term (calculated from several years of data and including all new data as it becomes available), 
 /// medium_term (approximately last 6 months), short_term (approximately last 4 weeks). </param>
 /// <param name="limit">The number of entities to return. Default: 20. Minimum: 1. Maximum: 50</param>
 /// <param name="offest">The index of the first entity to return. Default: 0 (i.e., the first track). Use with limit to get the next set of entities.</param>
 /// <returns></returns>
 /// <remarks>AUTH NEEDED</remarks>
 public string GetUsersTopTracks(TimeRangeType timeRange = TimeRangeType.MediumTerm, int limit = 20, int offest = 0)
 {
     limit = Math.Min(50, limit);
     StringBuilder builder = new StringBuilder($"{APIBase}/me/top/tracks");
     builder.Append("?limit=" + limit);
     builder.Append("&offset=" + offest);
     builder.Append("&time_range=" + timeRange.GetStringAttribute(""));
     return builder.ToString();
 }
Ejemplo n.º 17
0
 /// <summary>
 /// This method sets the task duration to the default task duration if it was not specified by the user.
 /// </summary>
 private void SetTaskDuration()
 {
     // if there is no task duration specified i.e. 3 days etc., get default
     if (taskDurationType == TimeRangeType.DEFAULT)
     {
         taskDurationAmount = CustomDictionary.defaultScheduleTimeLength;
         taskDurationType = CustomDictionary.defaultScheduleTimeLengthType;
     }
 }
Ejemplo n.º 18
0
 /// <summary>
 /// This method breaks the task duration down to blocks of hours or days if the schedule start time is
 /// not specific.
 /// </summary>
 /// <param name="type">The task duration type: hours, days, weeks or months</param>
 /// <param name="startTime">The time slot's start time</param>
 /// <returns>Returns the number of divided blocks</returns>
 private int GetNumberOfLoops(TimeRangeType type, DateTime startTime)
 {
     int numberOfSetsToLoop = 0;
     switch (taskDurationType)
     {
         case TimeRangeType.DAY:
             if (!isSpecific.StartTime)
             {
                 taskDurationType = TimeRangeType.HOUR;
                 taskDurationAmount *= CustomDictionary.HOURS_IN_DAY;
             }
             numberOfSetsToLoop = taskDurationAmount;
             break;
         case TimeRangeType.WEEK:
             if (!isSpecific.StartTime)
             {
                 taskDurationType = TimeRangeType.HOUR;
                 taskDurationAmount *= CustomDictionary.HOURS_IN_DAY * CustomDictionary.DAYS_IN_WEEK;
             }
             else
             {
                 taskDurationType = TimeRangeType.DAY;
                 taskDurationAmount *= CustomDictionary.DAYS_IN_WEEK;
             }
             numberOfSetsToLoop = taskDurationAmount;
             break;
         case TimeRangeType.MONTH:
             TimeSpan span = startTime.AddMonths(taskDurationAmount) - startTime;
             if (!isSpecific.StartTime)
             {
                 taskDurationType = TimeRangeType.HOUR;
                 taskDurationAmount = numberOfSetsToLoop = (int)span.TotalHours;
             }
             else
             {
                 numberOfSetsToLoop = (int)span.TotalDays;
             }
             break;
     }
     return numberOfSetsToLoop;
 }