Пример #1
0
 private static void LocalizeString(object sender, DevComponents.DotNetBar.LocalizeEventArgs e)
 {
     if (e.Key == LocalizationKeys.MessageBoxOkButton)
     {
         e.LocalizedValue = "自定义";
         e.Handled        = true;
     }
 }
Пример #2
0
 static void LocalizationKeys_LocalizeString(object sender, DevComponents.DotNetBar.LocalizeEventArgs e)
 {
     if (e.Key == DevComponents.DotNetBar.LocalizationKeys.MessageBoxCancelButton)
     {
         e.LocalizedValue = "取消";
         e.Handled        = true;
     }
     if (e.Key == DevComponents.DotNetBar.LocalizationKeys.MessageBoxNoButton)
     {
         e.LocalizedValue = "取消";
         e.Handled        = true;
     }
     if (e.Key == DevComponents.DotNetBar.LocalizationKeys.MessageBoxOkButton)
     {
         e.LocalizedValue = "确定";
         e.Handled        = true;
     }
     if (e.Key == DevComponents.DotNetBar.LocalizationKeys.MessageBoxYesButton)
     {
         e.LocalizedValue = "确定";
         e.Handled        = true;
     }
     if (e.Key == DevComponents.DotNetBar.LocalizationKeys.MonthCalendarClearButtonText)
     {
         e.LocalizedValue = "清除";
         e.Handled        = true;
     }
     if (e.Key == DevComponents.DotNetBar.LocalizationKeys.MonthCalendarTodayButtonText)
     {
         e.LocalizedValue = "今天";
         e.Handled        = true;
     }
     if (e.Key == DevComponents.DotNetBar.LocalizationKeys.TimeSelectorHourLabel)
     {
         e.LocalizedValue = "时";
         e.Handled        = true;
     }
     if (e.Key == DevComponents.DotNetBar.LocalizationKeys.TimeSelectorMinuteLabel)
     {
         e.LocalizedValue = "分";
         e.Handled        = true;
     }
     if (e.Key == DevComponents.DotNetBar.LocalizationKeys.TimeSelectorClearButton)
     {
         e.LocalizedValue = "清除";
         e.Handled        = true;
     }
     if (e.Key == DevComponents.DotNetBar.LocalizationKeys.TimeSelectorOkButton)
     {
         e.LocalizedValue = "确定";
         e.Handled        = true;
     }
 }
Пример #3
0
 void IOwnerLocalize.InvokeLocalizeString(LocalizeEventArgs e)
 {
     if (LocalizeString != null)
         LocalizeString(this, e);
 }
Пример #4
0
        public string GetLocalizedString(string key)
        {
            string s = "";
            if (m_ResourceManager == null)
                m_ResourceManager = BarFunctions.GetResourceManager();
            if (m_ResourceManager != null)
            {
                s = m_ResourceManager.GetString(key);
                if (s == null)
                    s = "";
            }

            // Fire static event first
            LocalizeEventArgs e = new LocalizeEventArgs();
            e.Key = key;
            e.LocalizedValue = s;
            LocalizationKeys.InvokeLocalizeString(e);
            if (e.Handled)
                return e.LocalizedValue;


            if (m_Manager != null)
            {
                m_Manager.InvokeLocalizeString(e);
                if (e.Handled)
                    return e.LocalizedValue;
            }

            return s;
        }
Пример #5
0
        public static string GetLocalizedString(string key, string defaultValue)
        {
            LocalizeEventArgs e = new LocalizeEventArgs();
            e.Key = key;
            e.LocalizedValue = defaultValue;
            LocalizationKeys.InvokeLocalizeString(e);
            if (e.Handled)
                return e.LocalizedValue;

            return defaultValue;
        }
Пример #6
0
 void navBar_LocalizeString(object sender, LocalizeEventArgs e)
 {
     if (LocalizeString != null)
         LocalizeString(this, e);
 }
Пример #7
0
 private void RibbonStripLocalizeString(object sender, LocalizeEventArgs e)
 {
     if (LocalizeString != null)
         LocalizeString(this, e);
 }
Пример #8
0
 static void LocalizationKeys_LocalizeString(object sender, LocalizeEventArgs e)
 {
     e.LocalizedValue = Localization.GetValue(e.Key, e.LocalizedValue);
     e.Handled = true;
 }
Пример #9
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// This gets called when the DotNetBar requests a localized version of a string for
		/// displaying in places like the dialog that lets the user configure toolbars (e.g.
		/// show/hide toolbars, add new ones, etc.).
		/// </summary>
		/// <param name="sender"></param>
		/// <param name="e"></param>
		/// ------------------------------------------------------------------------------------
		private void HandleGettingLocalizedString(object sender, LocalizeEventArgs e)
		{
			e.Handled = false;

			string kstid = (string)m_htSystemStringIds[e.Key];
			string localizedStr = m_rmlocalMngmntStrings.GetString(kstid).Trim();

			if (localizedStr != null && localizedStr != string.Empty)
			{
				e.LocalizedValue = localizedStr;
				e.Handled = true;
			}
		}
Пример #10
0
 internal static void InvokeLocalizeString(LocalizeEventArgs e)
 {
     if (LocalizeString != null)
     {
         LocalizeString(null, e);
     }
 }