/// <summary>
        /// This is overridden to edit the value using the
        /// <see cref="ProjectSummaryEditorDlg"/> dialog.
        /// </summary>
        /// <param name="context">The descriptor context</param>
        /// <param name="provider">The provider</param>
        /// <param name="value">The project summary text as an object</param>
        /// <returns>The edited project summary text as an object</returns>
        public override object EditValue(System.ComponentModel.ITypeDescriptorContext context,
          IServiceProvider provider, object value)
        {
            // Get the project summary text
            string summary = value as string;

            if(context == null || provider == null || context.Instance == null ||
              summary == null)
                return base.EditValue(context, provider, value);

            using(ProjectSummaryEditorDlg dlg = new ProjectSummaryEditorDlg())
            {
                dlg.Summary = summary;
                dlg.ShowDialog();
                summary = dlg.Summary;
            }

            return summary;
        }
示例#2
0
        /// <summary>
        /// This is overridden to edit the value using the
        /// <see cref="ProjectSummaryEditorDlg"/> dialog.
        /// </summary>
        /// <param name="context">The descriptor context</param>
        /// <param name="provider">The provider</param>
        /// <param name="value">The project summary text as an object</param>
        /// <returns>The edited project summary text as an object</returns>
        public override object EditValue(System.ComponentModel.ITypeDescriptorContext context,
                                         IServiceProvider provider, object value)
        {
            // Get the project summary text
            string summary = value as string;

            if (context == null || provider == null || context.Instance == null ||
                summary == null)
            {
                return(base.EditValue(context, provider, value));
            }

            using (ProjectSummaryEditorDlg dlg = new ProjectSummaryEditorDlg())
            {
                dlg.Summary = summary;
                dlg.ShowDialog();
                summary = dlg.Summary;
            }

            return(summary);
        }