Beispiel #1
0
            protected void AddStories(IFormattedStoryScenario formattedStory, List <IGenericValueOption <string> > results, Dictionary <string, bool> lookup)
            {
                string key = formattedStory.GetFormattedStoryManager().UnlocalizedName + ":" + formattedStory.UnlocalizedName;

                if (lookup.ContainsKey(key))
                {
                    return;
                }
                lookup.Add(key, true);

                results.Add(new ListItem(this, key));
            }
Beispiel #2
0
            protected void AddStories(Scenario scenario, List <string> prefixes, bool checkLocalization, List <IGenericValueOption <string> > results, Dictionary <string, bool> lookup)
            {
                IFormattedStoryScenario formattedScenario = scenario as IFormattedStoryScenario;

                if (formattedScenario != null)
                {
                    AddStories(formattedScenario, results, lookup);
                }
                else
                {
                    List <string> stories = scenario.GetStoryPrefixes();

                    foreach (string prefix in prefixes)
                    {
                        foreach (string story in stories)
                        {
                            if (string.IsNullOrEmpty(story))
                            {
                                return;
                            }

                            string key = prefix + ":" + story;

                            if (lookup.ContainsKey(key))
                            {
                                continue;
                            }
                            lookup.Add(key, true);

                            string result;
                            if ((!checkLocalization) || (Common.Localize(key, false, new object[0], out result)))
                            {
                                results.Add(new ListItem(this, key));
                            }
                        }
                    }
                }
            }