private void FrmAccount_Load(object sender, System.EventArgs e) { if (Context == null) { Context = AppSettingHelper.GetApiContext(); Context.ApiLogManager = new ApiLogManager(); Context.ApiLogManager.ApiLoggerList.Add(new eBay.Service.Util.FileLogger("Log.txt", true, true, true)); Context.ApiLogManager.EnableLogging = true; Context.Site = eBay.Service.Core.Soap.SiteCodeType.US; } string[] sites = Enum.GetNames(typeof(SiteCodeType)); foreach (string site in sites) { if (site != "CustomCode") { CboSite.Items.Add(site); } } string[] langs = Enum.GetNames(typeof(ErrorLanguageCodeType)); foreach (string lang in langs) { if (lang != "CustomCode") { CboLanguage.Items.Add(lang); } } CboSite.SelectedIndex = 0; SetBindings(); }
private void APIAccount_Load(object sender, EventArgs e) { if (apiContext == null) { apiContext = AppSettingHelper.GetApiContext(); apiContext.ApiLogManager = new ApiLogManager(); LoggingProperties logProps = AppSettingHelper.GetLoggingProperties(); apiContext.ApiLogManager.ApiLoggerList.Add(new FileLogger(logProps.LogFileName, true, true, true)); apiContext.ApiLogManager.EnableLogging = true; apiContext.Site = SiteCodeType.US; } string[] sites = Enum.GetNames(typeof(SiteCodeType)); foreach (string site in sites) { if (site != "CustomCode") { CboSite.Items.Add(site); } } string[] langs = Enum.GetNames(typeof(ErrorLanguageCodeType)); foreach (string lang in langs) { if (lang != "CustomCode") { CboLanguage.Items.Add(lang); } } CboSite.SelectedIndex = 0; SetBindings(); }
private void APIMain_Load(object sender, EventArgs e) { apiContext = AppSettingHelper.GetApiContext(); apiContext.ApiLogManager = new ApiLogManager(); LoggingProperties logProps = AppSettingHelper.GetLoggingProperties(); apiContext.ApiLogManager.ApiLoggerList.Add(new FileLogger(logProps.LogFileName, true, true, true)); apiContext.ApiLogManager.EnableLogging = true; apiContext.ApiLogManager.MessageLoggingFilter = GetExceptionFilter(logProps); apiContext.Site = eBay.Service.Core.Soap.SiteCodeType.US; SetProxy(); }
private void FrmMain_Load(object sender, System.EventArgs e) { Context = AppSettingHelper.GetApiContext(); Context.ApiLogManager = new ApiLogManager(); LoggingProperties logProps = AppSettingHelper.GetLoggingProperties(); Context.ApiLogManager.ApiLoggerList.Add(new eBay.Service.Util.FileLogger(logProps.LogFileName, true, true, true)); Context.ApiLogManager.EnableLogging = true; Context.ApiLogManager.MessageLoggingFilter = getExceptionFilter(logProps); Context.Site = eBay.Service.Core.Soap.SiteCodeType.US; //set proxy server if necessary SetProxy(); }
// Init all ebay accounts context. public static void InitAllAccounts() { foreach (AccountType account in allAccounts) { ApiContext context = AppSettingHelper.GetApiContext(account.ebayToken); if (context == null) { //MessageBox.Show("初始化Ebay服务器连接失败,请查看网络或者配置情况!", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } context.ApiLogManager = new ApiLogManager(); LoggingProperties logProps = AppSettingHelper.GetLoggingProperties(); context.ApiLogManager.ApiLoggerList.Add(new eBay.Service.Util.FileLogger(logProps.LogFileName, true, true, true)); context.ApiLogManager.EnableLogging = true; context.ApiLogManager.MessageLoggingFilter = getExceptionFilter(logProps); context.Site = eBay.Service.Core.Soap.SiteCodeType.US; account.SellerApiContext = context; } }