private void AddEducationToResume() { try { if (SelectedOutEducation == null) { return; } InEducations.Add(SelectedOutEducation); OutEducations.Remove(SelectedOutEducation); } catch (Exception e) { ls.Log(e, "Exception"); } }
private void RemoveEducationFromResume() { try { if (SelectedInEducation == null) { return; } OutEducations.Add(SelectedInEducation); InEducations.Remove(SelectedInEducation); } catch (Exception e) { ls.Log(e, "Exception"); } }
private void MoveEducationDownInResume() { try { if (SelectedInEducation == null) { return; } int currentIndex = InEducations.IndexOf(SelectedInEducation); InEducations.Move(currentIndex, currentIndex + 1); NotifyPropertyChanged(); } 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); }
public void RefreshEducationList() { var oldInList = new List <IEducationEntity>(InEducations); var oldOutList = new List <IEducationEntity>(OutEducations); var newList = edRepos.GetAll(); OutEducations.Clear(); InEducations.Clear(); foreach (var item in newList) { if (oldInList.Any(T => T.ID == item.ID)) { InEducations.Add(item); } else { OutEducations.Add(item); } } }