Beispiel #1
0
        public void SelectLocalHost()
        {
            var localhostItem = StudioResourceRepository.FindItem(model => model.DisplayName.ToLower().Contains("localhost"));

            if (localhostItem != null)
            {
                localhostItem.IsExplorerSelected = true;
                Dev2Logger.Log.Debug("Publish message of type - " + typeof(SetActiveEnvironmentMessage));
                var localHost = EnvironmentRepository.FindSingle(model => model.ID == localhostItem.EnvironmentId);
                _eventPublisher.Publish(new SetActiveEnvironmentMessage(localHost));
            }
        }
Beispiel #2
0
        /// <summary>
        /// Selects the server from initial value.
        /// </summary>
        private void SelectSourceServerFromInitialValue()
        {
            IEnvironmentModel environment = null;

            if (_initialItemResourceID != Guid.Empty)
            {
                environment = EnvironmentRepository.FindSingle(model => model.ID == _initialItemEnvironmentID);
            }
            if (environment != null)
            {
                var server = Servers.FirstOrDefault(s => ServerEqualityComparer.Current.Equals(s, environment));
                //
                // Setting the SelectedSourceServer will run the LoadSourceEnvironment method,
                // which takes care of selecting and expanding the correct node
                //
                SelectedSourceServer = server;
            }
        }