Example #1
0
        private void Profiles_ProfileLoaded(object sender, ProfileLoadedEventArgs e)
        {
            if (_ProfileEditorForm != null)
            {
                _ProfileEditorForm.Close();
            }

            Source.TextChanged      -= Source_TextChanged;
            Destination.TextChanged -= Destination_TextChanged;

            // Set form control values
            Source.Text      = ProfileManager.CurrentProfile.Source;
            Destination.Text = ProfileManager.CurrentProfile.Destination;

            // Set default paths for file/folder browsers
            if (!string.IsNullOrEmpty(ProfileManager.CurrentProfile.Source))
            {
                SourceBrowser.SelectedPath = ProfileManager.CurrentProfile.Source;
            }

            if (!string.IsNullOrEmpty(ProfileManager.CurrentProfile.Destination))
            {
                DestinationBrowser.SelectedPath = ProfileManager.CurrentProfile.Destination;
            }

            ProfileBrowser.InitialDirectory = ProfileManager.ProfilesDirectory;

            // Subscribe to form control events
            Source.TextChanged      += new EventHandler(Source_TextChanged);
            Destination.TextChanged += new EventHandler(Destination_TextChanged);
        }