Exemplo n.º 1
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Android.OS.Bundle savedInstanceState)
        {
            Dialog.RequestWindowFeature((int)WindowFeatures.NoTitle);
            // Inflate the layout for this fragment
            var view = inflater.Inflate(Resource.Layout.prompt_dialog, container);

            var tv_title = view.FindViewById <TextView>(Resource.Id.tv_title);

            tv_title.Text = Title;
            var tv_message = view.FindViewById <TextView>(Resource.Id.tv_message);

            tv_message.Text = Message;
            var bt_discard = view.FindViewById <Button>(Resource.Id.bt_discard);
            var bt_preview = view.FindViewById <Button>(Resource.Id.bt_preview);

            bt_discard.Click += (sender, e) =>
            {
                Dismiss();
                DiscardClick?.Invoke(sender, e);
            };
            bt_preview.Click += (sender, e) =>
            {
                Dismiss();
                PreviewClick?.Invoke(sender, e);
            };
            return(view);
        }
Exemplo n.º 2
0
 private void buttonItemPreview_Click(object sender, EventArgs e)
 {
     if (!AppManager.Instance.CheckPowerPointRunning())
     {
         return;
     }
     PreviewClick?.Invoke();
 }
Exemplo n.º 3
0
        private void ButtonClickEventHandler(object sender, RoutedEventArgs e)
        {
            PreviewClick?.Invoke(sender, e);
            if (OperateType == OperateTypes.OpenFile || OperateType == OperateTypes.OpenFolder)
            {
                CommonOpenFileDialog oepnDialog = new CommonOpenFileDialog()
                {
                    AddToMostRecentlyUsedList = AddToMostRecentlyUsedList,
                    AllowNonFileSystemItems   = AllowNonFileSystemItems,
                    DefaultDirectory          = DefaultDirectory,
                    DefaultExtension          = DefaultExtension,
                    EnsureFileExists          = EnsureFileExists,
                    DefaultFileName           = DefaultFileName,
                    EnsurePathExists          = EnsurePathExists,
                    IsFolderPicker            = OperateType == OperateTypes.OpenFolder,
                    Multiselect     = Multiselect,
                    ShowHiddenItems = ShowHiddenItems,
                };
                if (Filters != null)
                {
                    foreach (var i in Filters)
                    {
                        oepnDialog.Filters.Add(new CommonFileDialogFilter(i.Key, i.Value));
                    }
                }
                var result = oepnDialog.ShowDialog();
                if (result == CommonFileDialogResult.Ok)
                {
                    DialogComplete?.Invoke(this, new StorageOperationEventArgs(oepnDialog.FileNames.ToArray()));
                }
                else
                {
                    DialogFailed?.Invoke(this, new StorageOperationEventArgs());
                }
            }


            else if (OperateType == OperateTypes.SaveFile)
            {
                CommonSaveFileDialog saveDialog = new CommonSaveFileDialog()
                {
                    AddToMostRecentlyUsedList = AddToMostRecentlyUsedList,
                    DefaultDirectory          = DefaultDirectory,
                    DefaultExtension          = DefaultExtension,
                    EnsureFileExists          = EnsureFileExists,
                    DefaultFileName           = DefaultFileName,
                    EnsurePathExists          = EnsurePathExists,
                    ShowHiddenItems           = ShowHiddenItems,
                };
                if (Filters != null)
                {
                    foreach (var i in Filters)
                    {
                        saveDialog.Filters.Add(new CommonFileDialogFilter(i.Key, i.Value));
                    }
                }
                var result = saveDialog.ShowDialog();
                if (result == CommonFileDialogResult.Ok)
                {
                    DialogComplete?.Invoke(this, new StorageOperationEventArgs(saveDialog.FileName));
                }

                else
                {
                    DialogFailed?.Invoke(this, new StorageOperationEventArgs());
                }
            }
            else
            {
                throw new Exception("未指定操作类型");
            }
        }