示例#1
0
 public ConnectionManagerVM(IDialogCoordinator instance, ConnectionBuilderBase connectionModel = null)
 {
     dialogCoordinator = instance;
     if (connectionModel != null)
     {
         isEdit = true;
         DTEXMLConnection xMLCore    = new DTEXMLConnection();
         var connection_builder_base = xMLCore.Connections.FirstOrDefault(x => x.ConnectionBuilder.Id == connectionModel.Id)?.ConnectionBuilder;
         ConnectionBuilder                = ConnectionBuilderFactory.CreateConnectionBuilder(connection_builder_base.ConnectionType, connection_builder_base.ConnectionString);
         ConnectionBuilder.Id             = connection_builder_base.Id;
         ConnectionBuilder.ConnectionName = connection_builder_base.ConnectionName;
         ConnectionBuilder.InitBuilder();
     }
     else
     {
         ConnectionBuilder = ConnectionBuilderFactory.CreateConnectionBuilder(SupportedConnectionsTypes.MySQL);
     }
 }