예제 #1
0
        public static CharacterGroupList LoadCharacterGroupListFromFile(string filename, Project project)
        {
            var comparer = new CharacterByKeyStrokeComparer(project.GetKeyStrokesByCharacterId());
            var list     = XmlSerializationHelper.DeserializeFromFile <CharacterGroupList>(filename);

            foreach (var characterGroup in list.CharacterGroups)
            {
                characterGroup.Initialize(project, comparer);
            }
            return(list);
        }
예제 #2
0
        public CharacterGroup(Project project, IComparer <string> characterIdPriorityComparer = null) : this()
        {
            // In its current usage, the only reason it makes sense to allow this to be passed in is for efficiency.
            // In some places in the code, we create one comparer and pass it in to multiple constuctors.
            if (characterIdPriorityComparer == null)
            {
                characterIdPriorityComparer = new CharacterByKeyStrokeComparer(project.GetKeyStrokesByCharacterId());
            }

            Initialize(project, characterIdPriorityComparer);
        }