Ejemplo n.º 1
0
        public Traducciones()
        {
            //Textos = new Dictionary<string, string>();
            InitializeComponent();

            Textos = new TextoLocalizable[] { };
        }
Ejemplo n.º 2
0
        public Traducciones(IContainer container)
        {
            //Textos = new Dictionary<string, string>();
            container.Add(this);

            InitializeComponent();

            Textos = new TextoLocalizable[] {};
        }
Ejemplo n.º 3
0
        /*[Localizable(true)]
         * public class TextoLocalizable
         * {
         *  [Browsable(true)]
         *  public string Key { get; set; }
         *
         *  [Browsable(true)]
         *  [Localizable(true)]
         *  public string Text { get; set; }
         *
         *  public override string ToString()
         *  {
         *      return string.Format("{0}; {1}",Key,Text);
         *  }
         * }*/


        /// <summary>
        /// Obtiene el texto asociado a la key, o null si no se encuentra la key
        /// </summary>
        /// <param name="key">string</param>
        /// <returns>string</returns>
        public string GetTextForKey(string key)
        {
            TextoLocalizable txt = Textos.Where(x => x.Key == key).FirstOrDefault();

            if (txt != null)
            {
                return(null);
            }
            else
            {
                return(txt.Texto);
            }
        }