Пример #1
0
        internal static void Main(string[] args)
        {
            Console.WriteLine("Content API for Shopping Command Line Sample");
            Console.WriteLine("============================================");

            ManufacturerConfig config = ManufacturerConfig.Load();

            var initializer = Authenticator.authenticate(config, ManufacturerCenterService.Scope.Manufacturercenter);

            if (initializer == null)
            {
                Console.WriteLine("Failed to authenticate, so exiting.");
                return;
            }

            // Create the service.
            var service = new ManufacturerCenterService(new BaseClientService.Initializer()
            {
                HttpClientInitializer = initializer,
                ApplicationName       = config.ApplicationName,
            });

            ProductsSample productsSample = new ProductsSample(service, MaxListPageSize);

            string manufacturerId = "accounts/" + config.ManufacturerId.ToString();

            productsSample.RunCalls(manufacturerId);
        }
 internal override void InitializeConfig(bool noconfig)
 {
     if (noconfig == true)
     {
         throw new ArgumentException(
                   "Cannot run Manufacturer Center API Samples without a configuration.");
     }
     config = ManufacturerConfig.Load(CliOptions.ConfigPath);
 }
 internal override void initializeConfig()
 {
     config = ManufacturerConfig.Load(CliOptions.ConfigPath);
 }