public override Pattern CreatePattern() { if (!Patterns.ContainsKey(PatternType.Pyramide)) { Patterns[PatternType.Pyramide] = new PatternPyramide(); } return(Patterns[PatternType.Pyramide]); }
public string GetPattern(string key) { if (Patterns == null || !Patterns.ContainsKey(key)) { return(null); } return(Patterns[key]); }
public override Pattern CreatePattern() { if (!Patterns.ContainsKey(PatternType.Box)) { Patterns[PatternType.Box] = new PatternBox(); } return(Patterns[PatternType.Box]); }
public void AddPattern(string name, List <IGeneratorCommand> commands) { if (Patterns.ContainsKey(name)) { throw new ToffeeGeneratorException("Cannot have two patterns that share the same name. Pattern '{0}' already exists.", name); } Patterns.Add(name, commands); Log("Add Pattern (Name: {0}, Size: {1})", name, commands.Count); }
public string this[string key] { get { if (Patterns.ContainsKey(key)) { return(Patterns[key]); } return(string.Empty); } }
public void AddPatternParam(string localID, object model) { if (Patterns.ContainsKey(localID)) { Patterns[localID] = model; } else { Patterns.Add(localID, model); } }
public object GetPatternParam(string localID) { if (Patterns.ContainsKey(localID)) { return(Patterns[localID]); } else { return(null); } }
public static Patterns FindPatterns(List <Phrase> phrases) { var patterns = new Patterns(); foreach (var phrase in phrases) { var phrasePatterns = FindPatterns(phrase); foreach (var pattern in phrasePatterns) { if (!patterns.ContainsKey(pattern.Key)) { patterns.Add(pattern.Key, pattern.Value); } } } return(patterns); }
public bool HasPattern(string name) { return(Patterns.ContainsKey(name)); }