void App_Startup(object sender, StartupEventArgs e) { try { string exeLocation = Assembly.GetExecutingAssembly().Location; string exePath = System.IO.Path.GetDirectoryName(exeLocation); DirectoryInfo di = System.IO.Directory.GetParent(exePath); string rootPath = di.FullName; string dataPath = rootPath + "\\Data"; string tilePath = dataPath + "\\TPKs"; Runtime.rootPath = rootPath; Runtime.dataPath = dataPath; Runtime.tilePath = tilePath; Runtime.servicePath = rootPath + "\\bin\\Servers"; Runtime.configurationPath = rootPath + "\\IS3-Configuration\\DBconfig.xml"; //ArcGISRuntime.Initialize(); Runtime.initializeEngines(_graphicEngine, _geometryEngine); Globals.application = this; Globals.mainthreadID = Thread.CurrentThread.ManagedThreadId; Globals.iS3Service = ServiceImporter.LoadService(Runtime.servicePath); //test(); } catch (Exception ex) { MessageBox.Show(ex.ToString()); // Exit application this.Shutdown(); } }
public override bool Execute() { var codeGeneratorOptions = new CodeGeneratorOptionsFactory().Create(CodeGeneratorOptions); var xmlTypeMappings = CreateXmlTypeMappings(); var namespaceMappings = CreateNamespaceMappings(); var typeAccessModifierMappings = CreateTypeAccessModifierMappings(); var typeRenameMappings = CreateTypeRenameMappings(); var nillableOverrides = CreateNillableOverrides(); var requiredMemberOverrides = CreateRequiredMemberOverrides(); var codeWriter = new FileSystemCodeWriter(codeGeneratorOptions, OutputDirectory); var serviceImporter = new ServiceImporter(Wsdls.ToStringArray(), xmlTypeMappings, namespaceMappings, nillableOverrides, requiredMemberOverrides, typeAccessModifierMappings, typeRenameMappings); serviceImporter.DataContractGenerationOptions = new DataContractGenerationOptionsFactory().Create(DataContractGenerationOptions); serviceImporter.ServiceContractGenerationOptions = new ServiceContractGenerationOptionsFactory().Create(ServiceContractGenerationOptions);; serviceImporter.Import(codeWriter); return(true); }
public void TestServiceImporterCSV() { //ARRANGE var moqConfiguration = new Mock <IConfiguration>(); var moqRepositoryImporter = new Mock <IRepositoryImporter>(); //auto mapper configuration var mockMapper = new MapperConfiguration(cfg => { cfg.AddProfile(new ItemProfile()); }); var mapper = mockMapper.CreateMapper(); IServiceImporter serviceImporter = new ServiceImporter(mapper, moqConfiguration.Object, moqRepositoryImporter.Object); //ACT serviceImporter.ImporterFileHelper("C:\\Users\\Emiliano Elicegui\\prueba.csv"); }
//登陆验证 private void LoginButton_Click(object sender, RoutedEventArgs e) { ServiceImporter.UpdateMainConnect(Runtime.configurationPath); XDocument xml = XDocument.Load(Runtime.configurationPath); string key = "Data Source =" + xml.Root.Element("ipaddress")?.Value + "; Initial Catalog = " + xml.Root.Element("database")?.Value + "; User Id = " + xml.Root.Element("user")?.Value + "; Password = "******"password")?.Value + ";Connect Timeout=1"; SqlConnection sqlConnection = new SqlConnection(key); try { sqlConnection.QuickOpen(1000); } catch (Exception) { MessageBox.Show("连接超时"); sqlConnection.Close(); sqlConnection.Dispose(); return; } sqlConnection.Close(); if ((LoginNameTB.Text == "") || (LoginPasswordTB.Password == "")) { MessageBox.Show("账号或密码不为空"); return; } Globals.userID = Globals.iS3Service.PrivilegeService.CheckIfValidLoginInfo(LoginNameTB.Text, LoginPasswordTB.Password); if (Globals.userID > 0) { App app = Application.Current as App; IS3MainWindow mw = (IS3MainWindow)app.MainWindow; mw.SwitchToProjectListPage(); } else { MessageBox.Show("密码错误"); } }
public ImportedServiceInstance(object instance, ServiceImporter importer) { this.importer = importer; this.instance = instance; }
public ImportedServiceInstance(object instance, ServiceImporter importer) { this.importer = importer; this.instance = instance; }