public static string GetString(string word)
        {
            var result = FormResources.GetString(word, SelectedCulture);

            //if(result != null)
            return(result);
            //return word;
        }
Exemplo n.º 2
0
 private void simpleButton1_Click(object sender, EventArgs e)
 {
     try{
         FormResources user = new FormResources();
         user.Show();
     }
     catch (Exception ex)
     {
         System.Windows.Forms.MessageBox.Show(ex.Message);
     }
 }
Exemplo n.º 3
0
        /// <summary>
        /// Resolves the value for the specified resource.
        /// The result may be a <see cref="BindingBase"/> or a literal value.
        /// </summary>
        /// <param name="name">Resource name. This is not the object property name.</param>
        public virtual object ProvideValue(string name)
        {
            if (FieldResources.TryGetValue(name, out var resource))
            {
                return(resource.ProvideValue(Context));
            }

            if (FormResources.TryGetValue(name, out resource))
            {
                return(resource.ProvideValue(Context));
            }

            if (ThrowOnNotFound)
            {
                throw new InvalidOperationException($"Resource {name} not found.");
            }

            return(null);
        }
Exemplo n.º 4
0
 public static string GetString(string word)
 {
     return(FormResources.GetString(word, SelectedCulture));
 }