123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154 |
- using System;
- using System.Globalization;
- using System.Resources;
- using System.Windows.Data;
- using Compdfkit_Tools.Helper;
- namespace Compdfkit_Tools.Common
- {
- public class BotaResourceConverter : IValueConverter
- {
- public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
- {
- if (parameter == null || string.IsNullOrEmpty(parameter.ToString()))
- {
- return string.Empty;
- }
- return LanguageHelper.BotaManager.GetString(parameter.ToString());
- }
- public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
- {
- throw new NotSupportedException();
- }
- }
- public class CommonResourceConverter : IValueConverter
- {
- public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
- {
- if (parameter == null || string.IsNullOrEmpty(parameter.ToString()))
- {
- return string.Empty;
- }
- return LanguageHelper.CommonManager.GetString(parameter.ToString());
- }
- public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
- {
- throw new NotSupportedException();
- }
- }
- public class PropertyPanelResourceConverter : IValueConverter
- {
- public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
- {
- if (parameter == null || string.IsNullOrEmpty(parameter.ToString()))
- {
- return string.Empty;
- }
- return LanguageHelper.PropertyPanelManager.GetString(parameter.ToString());
- }
- public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
- {
- throw new NotSupportedException();
- }
- }
- public class ToolBarResourceConverter : IValueConverter
- {
- public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
- {
- if (parameter == null || string.IsNullOrEmpty(parameter.ToString()))
- {
- return string.Empty;
- }
- return LanguageHelper.ToolBarManager.GetString(parameter.ToString());
- }
- public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
- {
- throw new NotSupportedException();
- }
- }
- public class SigResourceConverter : IValueConverter
- {
- public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
- {
- if (parameter == null || string.IsNullOrEmpty(parameter.ToString()))
- {
- return string.Empty;
- }
- return LanguageHelper.SigManager.GetString(parameter.ToString());
- }
- public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
- {
- throw new NotSupportedException();
- }
- }
-
- public class DocInfoResourceConverter : IValueConverter
- {
- public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
- {
- if (parameter == null || string.IsNullOrEmpty(parameter.ToString()))
- {
- return string.Empty;
- }
- return LanguageHelper.DocInfoManager.GetString(parameter.ToString());
- }
- public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
- {
- throw new NotSupportedException();
- }
- }
-
- public class SecurityResourceConverter : IValueConverter
- {
- public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
- {
- if (parameter == null || string.IsNullOrEmpty(parameter.ToString()))
- {
- return string.Empty;
- }
- return LanguageHelper.SecurityManager.GetString(parameter.ToString());
- }
- public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
- {
- throw new NotSupportedException();
- }
- }
-
- public class DocEditorResourceConverter : IValueConverter
- {
- public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
- {
- if (parameter == null || string.IsNullOrEmpty(parameter.ToString()))
- {
- return string.Empty;
- }
- return LanguageHelper.DocEditorManager.GetString(parameter.ToString());
- }
- public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
- {
- throw new NotSupportedException();
- }
- }
- }
|