public EditProfileForm(ProcessModel processModel, Profile profile)
        {
            _processModel = processModel;
            _profile = profile;

            InitializeComponent();

            _updatedProfile = new Profile{FileNames = new List<string>()};

            NameTextBox.Text = _profile.Name;
            SourceTextBox.Text = _profile.SourcePath;
            DestinationTextBox.Text = _profile.DestinationPath;

            if (_profile.FileNames.Count == 0)
            {
                FileListLabel.Text = "No files in this profile";
            }
            else
            {
                FileListLabel.Text = string.Empty;
                foreach (string fileName in _profile.FileNames)
                {
                    FileListLabel.Text += string.Format("{0}\n", fileName);

                    _updatedProfile.FileNames.Add(fileName);
                }
            }
            _pendingChanges = false;
        }
        public void SaveProfiles(Profile profile)
        {
            if (GetProfileByName(profile.Name) == null)
            {
                _profileRoot.Profiles.Add(profile);
            }

            _profileRepository.SaveProfiles(_profileRoot);
        }
        private void ShowEditProfileForm(Profile profile)
        {
            var editProfile = new EditProfileForm(_processModel, profile);
            editProfile.ShowDialog();

            ProfilesDropDownList.Items.Clear();
            ProfilesDropDownList.Items.AddRange(_processModel.GetProfilesAsComboBoxItems());
            ProfilesDropDownList.Text = profile.Name;
        }