예제 #1
0
        private void btnDestroy_Click(object sender, EventArgs e)
        {
            NameValueCollection props = DictionaryDialog.GetParameters(ResourceService.GetString("TITLE_DESTROY_DATASTORE"), FdoFeatureService.GetCreateDataStoreProperties(_presenter.Connection.Provider));

            if (props != null)
            {
                _presenter.DestroyDataStore(props);
                this.ShowMessage(null, ResourceService.GetString("MSG_DATA_STORE_DESTROYED"));
            }
        }
예제 #2
0
        public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            var set = (Dictionary <string, string>)value ?? new Dictionary <string, string>();

            using (var dialog = new DictionaryDialog {
                Mapping = set
            })
            {
                if (dialog.ShowDialog() == DialogResult.OK)
                {
                    set = dialog.Mapping;
                }
            }
            return(set); // can also replace the wrapper object here
        }
예제 #3
0
        private void ContextMenuInitial(Point p, double padding)
        {
            ContextMenu Menu            = new ContextMenu();
            var         AnnotationModel = new AnnotationViewModel();

            Menu.DataContext = AnnotationModel;
            AnnotationModel.UpdateTagCollection += (tagItem, tagEnum) =>
            {
                var mode = DataContext as ContentPageViewModel;
                mode.UpdateTagCollections(tagItem, tagEnum);
            };
            AnnotationModel.AddAnnotation += async(annStatue) =>
            {
                switch (annStatue)
                {
                case AnnotationStatue.Highlight:
                    await InvokeScript(ContentWebView, "insertTagAtRange();");

                    break;

                case AnnotationStatue.Note:
                    await InvokeScript(ContentWebView, "insertNodeAtRange();");

                    break;
                }
                await InvokeScript(ContentWebView, "highlightSelectedText();");
            };
            Menu.ContextMenuClick += (s) =>
            {
                switch (s)
                {
                case ContextMenuStatue.LegalDefine:
                    var              contentPageViewModel = DataContext as ContentPageViewModel;
                    double           PaddingLeft          = LeftSidePanelGrid.Visibility == Visibility.Visible ? 368 : 48;
                    string           countryCode          = HtmlHelper.GetTOCCountryCode(contentPageViewModel.SelectedContent);
                    DictionaryDialog DictinaryMenu        = new DictionaryDialog(countryCode, ContentMenuPosition, PaddingLeft);
                    DictinaryMenu.Show(SelectContent);

                    break;

                case ContextMenuStatue.Copy:
                    HtmlHelper.Copy(SelectContent);
                    break;
                }
            };
            Menu.Show(p, padding);
        }