예제 #1
0
 private void FillObj(CBaseObj property, dynamic descInfo)
 {
     property.Lan        = descInfo.lan;
     property.LanKey     = descInfo.lanKey;
     property.Desc       = descInfo.desc;
     property.DescLanKey = descInfo.descLanKey;
     property.UID        = descInfo.uid;
 }
예제 #2
0
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
#endif
        {
#pragma warning disable CS0436 // Type conflicts with imported type
            if (value is CBaseObj)
            {
                CBaseObj cp = value as CBaseObj;
#pragma warning restore CS0436 // Type conflicts with imported type

                if (ReadDesc)
                {
                    if (!string.IsNullOrEmpty(cp.Desc))
                    {
                        return(cp.Desc);
                    }

                    if (!string.IsNullOrEmpty(cp.DescLanKey))
                    {
                        string lan = LanService.Get(cp.DescLanKey).Result;
                        return(lan);
                    }
                    return(null);
                }
                else
                {
                    if (!string.IsNullOrEmpty(cp.Lan))
                    {
                        return(cp.Lan);
                    }

                    if (!string.IsNullOrEmpty(cp.LanKey))
                    {
                        string lan = LanService.Get(cp.LanKey).Result;
                        return(lan);
                    }
                }

#if WINDOWS_UWP
                if (!string.IsNullOrEmpty(cp.UID))
                {
                    string lan = GetString(cp.UID);
                    return(lan);
                }
#endif

                return(cp.Name);
            }

            return(value);
        }
예제 #3
0
        public object Convert(object value, Type targetType, object parameter, string language)
        {
            if (value is CBaseObj)
            {
                CBaseObj cp = value as CBaseObj;

                if (ReadDesc)
                {
                    if (!string.IsNullOrEmpty(cp.Desc))
                    {
                        return(cp.Desc);
                    }

                    if (!string.IsNullOrEmpty(cp.DescLanKey))
                    {
                        string lan = LanService.Get(cp.DescLanKey).Result;
                        return(lan);
                    }
                    return(null);
                }
                else
                {
                    if (!string.IsNullOrEmpty(cp.Lan))
                    {
                        return(cp.Lan);
                    }

                    if (!string.IsNullOrEmpty(cp.LanKey))
                    {
                        string lan = LanService.Get(cp.LanKey).Result;
                        return(lan);
                    }
                }

                if (!string.IsNullOrEmpty(cp.UID))
                {
                    string lan = GetString(cp.UID);
                    return(lan);
                }

                return(cp.Name);
            }

            return(value);
        }