/************************** *************************** ***** PRIVATE METHODS ***** *************************** **************************/ private void AddExpertiseToResume() { if (SelectedOutExpertise == null) { return; } try { InExpertises.Add(SelectedOutExpertise); OutExpertises.Remove(SelectedOutExpertise); SelectedOutExpertise = null; } catch (Exception e) { ls.Log(e, "Exception"); } }
private void MoveExpertiseDownInResume() { try { if (SelectedInExpertise == null) { return; } int currentIndex = InExpertises.IndexOf(SelectedInExpertise); InExpertises.Move(currentIndex, currentIndex + 1); NotifyPropertyChanged(); } catch (Exception e) { ls.Log(e, "Exception"); } }
private void RemoveExpertiseFromResume() { try { if (SelectedInExpertise == null) { return; } OutExpertises.Add(SelectedInExpertise); InExpertises.Remove(SelectedInExpertise); SelectedInExpertise = null; } catch (Exception e) { ls.Log(e, "Exception"); } }
// SKETCHY, HACKY DOCUMENT SEARCH METHODS ABOVE private void SetUpRelayCommands() { AddExpertiseCommand = new RelayCommand(T => AddExpertiseToResume(), T => SelectedOutExpertise != null); RemoveExpertiseCommand = new RelayCommand(T => RemoveExpertiseFromResume(), T => SelectedInExpertise != null); MoveExpertiseUpCommand = new RelayCommand( T => MoveExpertiseUpInResume(), T => SelectedInExpertise != null && InExpertises.IndexOf(SelectedInExpertise) > 0); MoveExpertiseDownCommand = new RelayCommand( T => MoveExpertiseDownInResume(), T => SelectedInExpertise != null && InExpertises.IndexOf(SelectedInExpertise) < InExpertises.Count - 1); AddExperienceCommand = new RelayCommand(T => AddExperienceItemToResume(), T => SelectedOutExperience != null); RemoveExperienceCommand = new RelayCommand(T => RemoveExperienceItemFromResume(), T => SelectedInExperience != null); MoveExperienceUpCommand = new RelayCommand( T => MoveExperienceItemUpInResume(), T => SelectedInExperience != null && SelectedJob.SelectedDetails.IndexOf(SelectedInExperience) > 0); MoveExperienceDownCommand = new RelayCommand( T => MoveExperienceItemDownInResume(), T => SelectedInExperience != null && SelectedJob.SelectedDetails.IndexOf(SelectedInExperience) < SelectedJob.SelectedDetails.Count - 1); AddEducationCommand = new RelayCommand(T => AddEducationToResume(), T => SelectedOutEducation != null); RemoveEducationCommand = new RelayCommand(T => RemoveEducationFromResume(), T => SelectedInEducation != null); MoveEducationUpCommand = new RelayCommand( T => MoveEducationUpInResume(), T => SelectedInEducation != null && InEducations.IndexOf(SelectedInEducation) > 0); MoveEducationDownCommand = new RelayCommand( T => MoveEducationDownInResume(), T => SelectedInEducation != null && InEducations.IndexOf(SelectedInEducation) < InEducations.Count - 1); AddPublicationCommand = new RelayCommand(T => AddPublicationToResume(), T => SelectedOutPublication != null); RemovePublicationCommand = new RelayCommand(T => RemovePublicationFromResume(), T => SelectedInPublication != null); MovePublicationUpCommand = new RelayCommand( T => MovePublicationUpInResume(), T => SelectedInPublication != null && InPublications.IndexOf(SelectedInPublication) > 0); MovePublicationDownCommand = new RelayCommand( T => MovePublicationDownInResume(), T => SelectedInPublication != null && InPublications.IndexOf(SelectedInPublication) < InPublications.Count - 1); SearchCmd = new RelayCommand( T => SearchDocumentPreview((string)T), T => true); }