Exemplo n.º 1
0
        /// <summary>
        /// Handles the Loaded event of the Window control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="RoutedEventArgs"/> instance containing the event data.</param>
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            lblApiUsage.Text = $"API Usage: {CcbApi.Counter} / {CcbApi.DailyLimit}";

            // add group types
            ExportGroupTypes = CcbApi.GetGroupTypes();

            foreach (var groupType in ExportGroupTypes)
            {
                //cblGroupTypes.Items.Add( groupType );
                GroupTypesCheckboxItems.Add(new CheckListItem {
                    Id = groupType.Id, Text = groupType.Name, Checked = true
                });
            }

            cblGroupTypes.ItemsSource = GroupTypesCheckboxItems;

            txtImportCutOff.Text = DateTime.Now.ToShortDateString(); // remove before flight (sets today's date as the modified since)
        }
Exemplo n.º 2
0
        /// <summary>
        /// Handles the Loaded event of the Window control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="RoutedEventArgs"/> instance containing the event data.</param>
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            int remainingRequests = CcbApi.DailyLimit - CcbApi.Counter;

            CcbApi.ApiRequestLimit = remainingRequests;

            lblApiUsage.Text     = $"API Usage: {CcbApi.Counter} / {CcbApi.DailyLimit}";
            txtItemsPerPage.Text = CcbApi.ItemsPerPage.ToString();
            txtThrottleRate.Text = CcbApi.ApiThrottleRate.ToString();

            // add group types
            ExportGroupTypes = CcbApi.GetGroupTypes().OrderBy(t => t.Name).ToList();

            foreach (var groupType in ExportGroupTypes)
            {
                GroupTypesCheckboxItems.Add(new CheckListItem {
                    Id = groupType.Id, Text = groupType.Name, Checked = true
                });
            }

            cblGroupTypes.ItemsSource = GroupTypesCheckboxItems;

            txtImportCutOff.Text = new DateTime(1998, 1, 1).ToShortDateString();
        }