/// <summary>
        /// 设置调整大小模式。
        /// </summary>
        /// <param name="window"></param>
        /// <param name="value"></param>
        public static void SetResizeMode(this Window window, ResizeMode value)
        {
            var p = DI.Get <IPlatformService>();

            switch (value)
            {
            case ResizeMode.NoResize:
            case ResizeMode.CanMinimize:
                window.CanResize = false;
                break;

            case ResizeMode.CanResize:
#pragma warning disable CS0618 // 类型或成员已过时
            case ResizeMode.CanResizeWithGrip:
#pragma warning restore CS0618 // 类型或成员已过时
                window.CanResize = true;
                break;
            }
            p.SetResizeMode(window.PlatformImpl.Handle.Handle, value);
        }
示例#2
0
        static async Task Main(string[] args)
        {
            ReadAzureTranslationKey();

            DI.Init(ConfigureServices);

            //var r = await Translatecs.TranslateTextAsync(route + to_ + "en", "测试翻译文本");

            // 不带后缀的相对路径
            var resx_path = AppRes;

            // true 读取翻译后的excel写入resx
            // false 读取resx机翻后写入excel
            var isReadOrWrite = true;

            // 读取翻译的excel值 是否覆盖已有的resx值?
            var isOverwrite = false;

            await Handle(resx_path, isReadOrWrite, isOverwrite);

            Console.WriteLine("OK");
            Console.ReadLine();
        }
示例#3
0
        /// <inheritdoc cref="IToast.Show(string, int?)"/>
        public static void Show(string text, int?duration = null)
        {
            var toast = DI.Get <IToast>();

            toast.Show(text, duration);
        }
示例#4
0
        /// <inheritdoc cref="IToast.Show(string, ToastLength)"/>
        public static void Show(string text, ToastLength duration)
        {
            var toast = DI.Get <IToast>();

            toast.Show(text, duration);
        }
示例#5
0
        /// <inheritdoc cref="IAreaResource{TArea}.GetFullName(TArea)"/>
        public static string GetFullName <TArea>(this TArea area) where TArea : class, IArea
        {
            var s = DI.Get <IAreaResourceHelper <TArea> >();

            return(s.GetFullName(area));
        }
示例#6
0
        /// <inheritdoc cref="IAreaResource{TArea}.GetSecondaryOrThis(TArea)"/>
        public static TArea GetSecondaryOrThis <TArea>(this TArea area) where TArea : class, IArea
        {
            var s = DI.Get <IAreaResourceHelper <TArea> >();

            return(s.GetSecondaryOrThis(area));
        }