示例#1
0
        private void btnDelete_Click(object sender, RoutedEventArgs e)
        {
            GetNeedControl(sender);
            if (mw.hintModelDictionary.ContainsKey(2))
            {
                if (mw.hintModelDictionary[2].IsHint == false)
                {
                    DeleteFile(sender, e);
                    return;
                }
            }
            HintDialog hintDialog = new HintDialog("删除文件", "您确定要删除文件?",
                                                   delegate(System.Object _o, RoutedEventArgs _e)
            {
                DeleteFile(_o, _e);
                mw.RemoveDialog();
            },
                                                   delegate(System.Object _o, RoutedEventArgs _e)
            {
                mw.RemoveDialog();
            },
                                                   delegate(System.Object _o, RoutedEventArgs _e)
            {
                mw.NotHint(2);
            });

            mw.ShowMakerDialog(hintDialog);
        }
示例#2
0
        private void ChangeLanguage(object sender, RoutedEventArgs e)
        {
            if (mw.hintModelDictionary.ContainsKey(0))
            {
                if (mw.hintModelDictionary[0].IsHint == false)
                {
                    ChangeLanguage();
                    return;
                }
            }
            HintDialog hintDialog = new HintDialog("更改语言", "您是否要更改语言?",
                                                   delegate(System.Object _o, RoutedEventArgs _e)
            {
                ChangeLanguage();

                foo();
                // .net 4.5
                async void foo()
                {
                    await Task.Delay(50);
                    //mw.projectUserControl.SetSpFilePosition(mw.projectUserControl.filePosition);
                }
                mw.RemoveDialog();
            },
                                                   delegate(System.Object _o, RoutedEventArgs _e)
            {
                mw.RemoveDialog();
            },
                                                   delegate(System.Object _o, RoutedEventArgs _e)
            {
                mw.NotHint(0);
            }
                                                   );

            mw.ShowMakerDialog(hintDialog);
        }