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; } }
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); } } }
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)); }