Esempio n. 1
0
 /// <summary>
 /// Validate the object.
 /// </summary>
 /// <exception cref="ValidationException">
 /// Thrown if validation fails
 /// </exception>
 public virtual void Validate()
 {
     if (TargetConnectionInfo == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "TargetConnectionInfo");
     }
     if (TargetDatabaseName == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "TargetDatabaseName");
     }
     if (ProjectName == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "ProjectName");
     }
     if (ProjectLocation == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "ProjectLocation");
     }
     if (SelectedTables == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "SelectedTables");
     }
     if (TargetConnectionInfo != null)
     {
         TargetConnectionInfo.Validate();
     }
 }
Esempio n. 2
0
 /// <summary>
 /// Validate the object.
 /// </summary>
 /// <exception cref="ValidationException">
 /// Thrown if validation fails
 /// </exception>
 public virtual void Validate()
 {
     if (SourceConnectionInfo == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "SourceConnectionInfo");
     }
     if (TargetConnectionInfo == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "TargetConnectionInfo");
     }
     if (SelectedSourceDatabases == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "SelectedSourceDatabases");
     }
     if (SelectedTargetDatabases == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "SelectedTargetDatabases");
     }
     if (SourceConnectionInfo != null)
     {
         SourceConnectionInfo.Validate();
     }
     if (TargetConnectionInfo != null)
     {
         TargetConnectionInfo.Validate();
     }
 }
Esempio n. 3
0
 /// <summary>
 /// Validate the object.
 /// </summary>
 /// <exception cref="ValidationException">
 /// Thrown if validation fails
 /// </exception>
 public virtual void Validate()
 {
     if (TargetConnectionInfo == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "TargetConnectionInfo");
     }
     if (TargetConnectionInfo != null)
     {
         TargetConnectionInfo.Validate();
     }
 }
 /// <summary>
 /// Validate the object.
 /// </summary>
 /// <exception cref="ValidationException">
 /// Thrown if validation fails
 /// </exception>
 public virtual void Validate()
 {
     if (SelectedDatabases == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "SelectedDatabases");
     }
     if (StorageResourceId == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "StorageResourceId");
     }
     if (SourceConnectionInfo == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "SourceConnectionInfo");
     }
     if (TargetConnectionInfo == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "TargetConnectionInfo");
     }
     if (AzureApp == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "AzureApp");
     }
     if (SelectedDatabases != null)
     {
         foreach (var element in SelectedDatabases)
         {
             if (element != null)
             {
                 element.Validate();
             }
         }
     }
     if (BackupFileShare != null)
     {
         BackupFileShare.Validate();
     }
     if (SourceConnectionInfo != null)
     {
         SourceConnectionInfo.Validate();
     }
     if (TargetConnectionInfo != null)
     {
         TargetConnectionInfo.Validate();
     }
     if (AzureApp != null)
     {
         AzureApp.Validate();
     }
 }
        public static int GetClientSession(
            this ILifelistService LifelistService,
            string address,
            string configName,
            string accessibleName,
            out ICoreObject AccessibleNode,
            ConnectionOpenedEventHandler connectionOpenedEventHandler = null
            )
        {
            ICoreObjectCollection boardConfigurations = ((IOnlineConfiguration)LifelistService.GetIConnectionService()).GetUsableConfigurations("OMS");
            ICoreObject           boardConfiguration  = LifelistService.GetBoardConfigurationByName(configName);


            ICoreObjectCollection accessibleNodes = LifelistService.GetAccessibleNodes(boardConfiguration, true);
            var names = accessibleNodes.GetNames();

            if (names.Contains(accessibleName))
            {
                AccessibleNode = accessibleNodes.GetCoreObjectByName(accessibleName);
                Type t            = AccessibleNode.GetType();
                var  onlineObject = LifelistService.GetOnlineNode(AccessibleNode);

                var connection = onlineObject.GetConnectionServiceProvider();
                var ConnectionServiceProviderProxy = new ConnectionServiceProviderProxy(connection);
                ConnectionServiceProviderProxy.ConnectionOpened += connectionOpenedEventHandler;

                IOamAddress oamAddress;
                int         createResult = OamObjectCreatorProxy.CreateAddress(address, out oamAddress);

                TargetConnectionInfo TargetConnectionInfo =
                    new TargetConnectionInfo(boardConfiguration, null, null, oamAddress);

                connection.SetTargetConnectionPath(onlineObject, TargetConnectionInfo);
                IConnection omsc = connection.ConnectToOnline(onlineObject, "OMS",
                                                              OnlineConnectionModes.UseTargetConnectionInfo,
                                                              TargetConnectionInfo);
                return(0);
            }
            AccessibleNode = null;
            return(-1);
        }