private void InsertSimpleRecIntoListbox(List<SimpleRecommendationObject> allSimpleRecs)
 {
     clbSelectedoptions.Items.Clear();
     for (int i = 0; i < allSimpleRecs.Count; i++) {
         SimpleRecommendationObject simpleRecom = new SimpleRecommendationObject(allSimpleRecs[i].optionName,
                                                                                 allSimpleRecs[i].isRegex,
                                                                                 allSimpleRecs[i].description,
                                                                                 allSimpleRecs[i].pattern,
                                                                                 allSimpleRecs[i].replacement,
                                                                                 allSimpleRecs[i].fileName);
         clbSelectedoptions.Items.Add(simpleRecom);
     }
 }
 private void FillUiFromobject(SimpleRecommendationObject simpleRecommendationObject)
 {
     txtOptionName.Text = simpleRecommendationObject.optionName;
     txtOptionDesc.Text = simpleRecommendationObject.description;
     txtOptionPattern.Text = simpleRecommendationObject.pattern;
     txtOptionReplacement.Text = simpleRecommendationObject.replacement;
     chkIsRegex.Checked = simpleRecommendationObject.isRegex;
     btnSave.Enabled = true;
     btnAdd.Enabled = false;
 }
 private SimpleRecommendationObject ConvertToObject(string fileRead)
 {
     SimpleRecommendationObject newRecObj = new SimpleRecommendationObject();
     string[] separator = new string[] { "##SPLIT##" };
     string[] splitFile = fileRead.Split(separator, StringSplitOptions.RemoveEmptyEntries);
     newRecObj.optionName = splitFile[0].Replace("\r\n", string.Empty);
     newRecObj.description = splitFile[1].Replace("\r\n", string.Empty);
     newRecObj.isRegex = string.Equals(splitFile[2].Replace("\r\n", string.Empty), "True", StringComparison.InvariantCultureIgnoreCase) ? true : false;
     newRecObj.pattern = splitFile[3].Replace("\r\n", string.Empty);
     newRecObj.replacement = splitFile[4].Replace("\r\n", string.Empty);
     return newRecObj;
 }
 private SimpleRecommendationObject FillSimpleOpiton(string optionName, string optionDescription, string optionPattern, string optionReplacement, bool isRegegex)
 {
     SimpleRecommendationObject simpleRec = new SimpleRecommendationObject();
     simpleRec.optionName = optionName;
     simpleRec.description = optionDescription;
     simpleRec.pattern = optionPattern;
     simpleRec.replacement = optionReplacement;
     simpleRec.isRegex = isRegegex;
     return simpleRec;
 }