Пример #1
0
        protected InstanceConnectionSettings ApplyDefaults(ZoneConnectionSettings zoneSettings)
        {
            var prototype = new InstanceConnectionSettings(this.ProjectId, this.InstanceName);

            ApplyOverlay(prototype, zoneSettings, this);
            return(prototype);
        }
Пример #2
0
        public InstanceConnectionSettings OverlayBy(InstanceConnectionSettings instanceSettings)
        {
            var result = InstanceConnectionSettings.CreateNew(
                instanceSettings.ProjectId,
                instanceSettings.InstanceName);

            ApplyOverlay(result, this, instanceSettings);
            return(result);
        }
Пример #3
0
        //-------------------------------------------------------------------------
        // Create.
        //-------------------------------------------------------------------------

        public static InstanceConnectionSettings FromKey(
            string projectId,
            string instanceName,
            RegistryKey registryKey)
        {
            var settings = new InstanceConnectionSettings(projectId, instanceName);

            settings.InitializeFromKey(registryKey);
            return(settings);
        }
Пример #4
0
 public void SetVmInstanceSettings(InstanceConnectionSettings settings)
 {
     using (var key = this.projectRepository.OpenRegistryKey(
                settings.ProjectId,
                VmPrefix + settings.InstanceName,
                true))
     {
         settings.Save(key);
     }
 }
Пример #5
0
        //---------------------------------------------------------------------
        // Virtual Machines.
        //---------------------------------------------------------------------

        public InstanceConnectionSettings GetVmInstanceSettings(string projectId, string instanceName)
        {
            using (var key = this.projectRepository.OpenRegistryKey(
                       projectId,
                       VmPrefix + instanceName,
                       true))
            {
                return(InstanceConnectionSettings.FromKey(
                           projectId,
                           instanceName,
                           key));
            }
        }