Example #1
0
            public Info(string path)
            {
                using (SimpleDictionary dict = new SimpleDictionary(path, false, false))
                    Load(dict);


                GetFullInstance = () => new SimpleDictionary(Path);
            }
Example #2
0
 public Section(List <Entry> entries, bool translationsLoaded, SimpleDictionary dictionary)
 {
     this.entries    = entries;
     this.dictionary = dictionary;
     if (translationsLoaded)
     {
         fullyLoadedEntries = entries.Count;
     }
 }
Example #3
0
            public Info(SimpleDictionary dict)
            {
                Load(dict);

                // Keep a weak reference to the dictionary. This way we don't have to load the
                // dictionary again if we re-open it soon after we close it.
                var weak = new NullWeakReference <SimpleDictionary>(dict);

                GetFullInstance = () => FromWeak(weak);
            }
Example #4
0
            void Load(SimpleDictionary dict)
            {
                Path   = dict.Path;
                Name   = dict.Name;
                Author = dict.Author;
                Url    = dict.Url;

                SectionNames = dict.SectionNames;
                if (dict.FirstLanguage != null || dict.SecondLanguage != null)
                {
                    Languages = new string[] { dict.FirstLanguage, dict.SecondLanguage }
                }
                ;
                SectionSizes = dict.SectionSizes;
            }
        }
Example #5
0
 public Section(List<Entry> entries, bool translationsLoaded, SimpleDictionary dictionary)
 {
     this.entries = entries;
     this.dictionary = dictionary;
     if (translationsLoaded)
         fullyLoadedEntries = entries.Count;
 }
Example #6
0
            void Load(SimpleDictionary dict)
            {
                Path = dict.Path;
                Name = dict.Name;
                Author = dict.Author;
                Url = dict.Url;

                SectionNames = dict.SectionNames;
                if (dict.FirstLanguage != null || dict.SecondLanguage != null)
                    Languages = new string[] { dict.FirstLanguage, dict.SecondLanguage };
                SectionSizes = dict.SectionSizes;
            }
Example #7
0
            public Info(SimpleDictionary dict)
            {
                Load(dict);

                // Keep a weak reference to the dictionary. This way we don't have to load the
                // dictionary again if we re-open it soon after we close it.
                var weak = new NullWeakReference<SimpleDictionary>(dict);
                GetFullInstance = () => FromWeak(weak);
            }
Example #8
0
            public Info(string path)
            {
                using (SimpleDictionary dict = new SimpleDictionary(path, false, false))
                    Load(dict);

                GetFullInstance = () => new SimpleDictionary(Path);
            }