示例#1
0
 static Database()
 {
     if (TitleDb == null)
     {
         TitleDb = new MapleDictionary(Settings.LibraryDirectory);
     }
 }
示例#2
0
        public static async void AddOnUi(this MapleDictionary collection, Title item)
        {
            var action = new Action(() => collection.Add(item));

            if (Application.Current == null)
            {
                action.DynamicInvoke();
            }
            else
            {
                await Application.Current.Dispatcher.BeginInvoke(action);
            }
        }
示例#3
0
        public static void AddOnUI(this MapleDictionary collection, Title item)
        {
            var add = new Action(() => collection.Add(item));

            Application.Current.Dispatcher.BeginInvoke(add);
        }
示例#4
0
        public static object AddOnUI(this MapleDictionary collection, Title item)
        {
            var add = new Action(() => collection.Add(item));

            return(Application.Current?.Dispatcher.BeginInvoke(add) ?? add.DynamicInvoke());
        }