Esempio n. 1
0
        void ShowRemarkDialog(Topic topic)
        {
            var dialog = new NoteWidgetDialog();

            dialog.ReadOnly = this.ReadOnly;
            dialog.Remark   = topic.Remark;
            if (dialog.ShowDialog(this) == DialogResult.OK && !ReadOnly)
            {
                topic.Remark = dialog.Remark;
            }
        }
Esempio n. 2
0
        public void AddRemark()
        {
            if (SelectedTopics != null && SelectedTopics.Length > 0)
            {
                var dialog = new NoteWidgetDialog();

                //
                if (Clipboard.ContainsText())
                {
                    dialog.Remark = ClipboardHelper.GetHtml();
                }

                if (dialog.ShowDialog(this) == DialogResult.OK)
                {
                    var template = new NoteWidget();
                    template.Remark = dialog.Remark;
                    AddWidget(NoteWidget.TypeID, template, false);
                }
            }
        }
Esempio n. 3
0
        public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            if (value is string)
            {
                var edSvc = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));
                if (edSvc != null)
                {
                    //var dlg = new RemarkDialog();
                    //dlg.RemarkObject = (IRemark)value;
                    NoteWidgetDialog dlg = new NoteWidgetDialog();
                    dlg.Remark = (string)value;

                    if (edSvc.ShowDialog(dlg) == System.Windows.Forms.DialogResult.OK)
                    {
                        return(dlg.Remark);
                    }
                }
            }

            return(base.EditValue(context, provider, value));
        }