public static void CopyFrom(this IAzureEnvironment environment, IAzureEnvironment other) { if (environment != null && other != null) { environment.Name = other.Name; environment.OnPremise = other.OnPremise; if (other.IsEndpointSet(AzureEnvironment.Endpoint.ActiveDirectoryServiceEndpointResourceId)) { environment.ActiveDirectoryServiceEndpointResourceId = other.ActiveDirectoryServiceEndpointResourceId; } if (other.IsEndpointSet(AzureEnvironment.Endpoint.AdTenant)) { environment.AdTenant = other.AdTenant; } if (other.IsEndpointSet(AzureEnvironment.Endpoint.Gallery)) { environment.GalleryUrl = other.GalleryUrl; } if (other.IsEndpointSet(AzureEnvironment.Endpoint.ManagementPortalUrl)) { environment.ManagementPortalUrl = other.ManagementPortalUrl; } if (other.IsEndpointSet(AzureEnvironment.Endpoint.ServiceManagement)) { environment.ServiceManagementUrl = other.ServiceManagementUrl; } if (other.IsEndpointSet(AzureEnvironment.Endpoint.PublishSettingsFileUrl)) { environment.PublishSettingsFileUrl = other.PublishSettingsFileUrl; } if (other.IsEndpointSet(AzureEnvironment.Endpoint.ResourceManager)) { environment.ResourceManagerUrl = other.ResourceManagerUrl; } if (other.IsEndpointSet(AzureEnvironment.Endpoint.SqlDatabaseDnsSuffix)) { environment.SqlDatabaseDnsSuffix = other.SqlDatabaseDnsSuffix; } if (other.IsEndpointSet(AzureEnvironment.Endpoint.StorageEndpointSuffix)) { environment.StorageEndpointSuffix = other.StorageEndpointSuffix; } if (other.IsEndpointSet(AzureEnvironment.Endpoint.ActiveDirectory)) { environment.ActiveDirectoryAuthority = other.ActiveDirectoryAuthority; } if (other.IsEndpointSet(AzureEnvironment.Endpoint.Graph)) { environment.GraphUrl = other.GraphUrl; } if (other.IsEndpointSet(AzureEnvironment.Endpoint.GraphEndpointResourceId)) { environment.GraphEndpointResourceId = other.GraphEndpointResourceId; } if (other.IsEndpointSet(AzureEnvironment.Endpoint.TrafficManagerDnsSuffix)) { environment.TrafficManagerDnsSuffix = other.TrafficManagerDnsSuffix; } if (other.IsEndpointSet(AzureEnvironment.Endpoint.AzureKeyVaultDnsSuffix)) { environment.AzureKeyVaultDnsSuffix = other.AzureKeyVaultDnsSuffix; } if (other.IsEndpointSet(AzureEnvironment.Endpoint.AzureDataLakeStoreFileSystemEndpointSuffix)) { environment.AzureDataLakeStoreFileSystemEndpointSuffix = other.AzureDataLakeStoreFileSystemEndpointSuffix; } if (other.IsEndpointSet(AzureEnvironment.Endpoint.AzureDataLakeAnalyticsCatalogAndJobEndpointSuffix)) { environment.AzureDataLakeAnalyticsCatalogAndJobEndpointSuffix = other.AzureDataLakeAnalyticsCatalogAndJobEndpointSuffix; } if (other.IsEndpointSet(AzureEnvironment.Endpoint.AzureKeyVaultServiceEndpointResourceId)) { environment.AzureKeyVaultServiceEndpointResourceId = other.AzureKeyVaultServiceEndpointResourceId; } environment.VersionProfiles.Clear(); foreach (var profile in other.VersionProfiles) { environment.VersionProfiles.Add(profile); } environment.CopyPropertiesFrom(other); } }