private void FillFreeLancerTags() { TagManager tagManager = new TagManager(); TagAccessor tagAccessor = new TagAccessor(); string lines = (Resource.freelancer_tags); char[] separators = { '\n', '\r' }; var etfs = lines.Split(separators, StringSplitOptions.RemoveEmptyEntries); int x = 0; do { if (x == etfs.Length) { break; } if (etfs[x].Substring(0, 1) == "~") { sTag top = tagManager.CreateSTag(0, etfs[x].Substring(1, etfs[x].Length - 1).Trim()); x++; if (x == etfs.Length) { break; } while (etfs[x] != "!") { int i = etfs[x].IndexOf("("); string value = etfs[x].Substring(0, i - 2); sTag mid = tagManager.CreateSTag(tagAccessor.GetSTag(top.value).id, value); x++; if (x == etfs.Length) { break; } } } if (x == etfs.Length) { break; } else if (etfs[x].Substring(0, 1) == "!") { x++; if (x == etfs.Length) { break; } } } while (x < etfs.Length); }
//doesnt yet return only unique tags private List<JsonModels.ProjectTag> GetProjectTags(int p) { TagAccessor ta = new TagAccessor(); List<JsonModels.ProjectTag> projectTags = new List<JsonModels.ProjectTag>(); List<Tag> tags = ta.GetProjectTags(p); foreach (Tag t in tags) { JsonModels.ProjectTag pt = new JsonModels.ProjectTag(); if (t.value != null) { pt.projectTagValue = t.value; pt.projectTagId = t.id; } projectTags.Add(pt); } return projectTags; }