예제 #1
0
        /// <summary>
        ///
        /// </summary>
        //private Dictionary<string, string> FromTo = new Dictionary<string, string>();

        /// <summary>
        ///
        /// </summary>
        //private Dictionary<string, string> ToFrom = new Dictionary<string, string>();

        /// <summary>
        /// Constructor. Processes the XML file with the mapping and updates the internal structures in order to enable Map/Unmap methods.
        /// </summary>
        private CharacterMapping()
        {
            var XML = XDocument.Load(Assembly.GetExecutingAssembly().GetManifestResourceStream("TalesOfVesperiaUtils.CharacterMapping.xml"));

            foreach (var XMLMap in XML.Descendants("map"))
            {
                var From = XMLMap.Attribute("from").Value;
                var To   = XMLMap.Attribute("to").Value;
                ReplacePairs.Add(new ReplacePair()
                {
                    From = From, To = To
                });
                //FromTo[From] = To;
                //FromTo[To] = From;
            }
        }
 /// <summary>
 /// Inicializa una nueva propiedad de tipo PropertyAttribute.
 /// </summary>
 /// <param name="xmlMap">
 /// Tipo de atributos que son mapeados al xml.</param>
 /// <param name="tipoUso">
 /// Tipo de uso que tienen los atributos al ser mapeados al xml.</param>
 public PropertyAttribute(XMLMap xmlMap, TipoUso tipoUso)
 {
     this.tipoUso = tipoUso;
     this.xmlMap  = xmlMap;
 }