public PistachioPage(string name, PistachioKey key) { Name = name; ObservableCollection <PistachioKey> collection = new ObservableCollection <PistachioKey>(); collection.Add(key); Keys = collection; }
private int FindResourceReferences(PistachioKey key, Dictionary <string, string> Files) { int timesFound = 0; char[] characters = { '\n' }; foreach (KeyValuePair <string, string> pair in Files) { if (pair.Key.EndsWith(".cs")) { string[] lines = pair.Value.Split(characters); int lineNum = 0; foreach (string line in lines) { lineNum++; if (line.IndexOf(key.KeyName) != -1) { key.PagesLocatedIn.Add(new PistachioReferenceItem(pair.Key, lineNum)); timesFound++; } } } else { string[] lines = pair.Value.Split(characters); int lineNum = 0; foreach (string line in lines) { lineNum++; if (line.IndexOf("Resource " + key.KeyName) != -1) { key.PagesLocatedIn.Add(new PistachioReferenceItem(pair.Key, lineNum)); timesFound++; } } } //regexExp = new Regex("{([a-zA-z]+)Resource " + key.KeyName + ""); //if (regexExp.IsMatch(pair.Value)) //{ // matchObj = regexExp.Matches(pair.Value); // foreach (Match match in matchObj) // { // key.PagesLocatedIn.Add(new PistachioReferenceItem(pair.Key, 0)); // timesFound++; // } //} } return(timesFound); }