예제 #1
0
        private void btnChange_Click(object sender, EventArgs e)
        {
            string val = NameTemplateEditorForm.Run(VersionInfo.ProgramTitle, "s_type_text", NameTemplate);

            if (val != null)
            {
                NameTemplate = val;
            }
        }
예제 #2
0
        public override object EditValue(ITypeDescriptorContext context, System.IServiceProvider provider, object value)
        {
            if (context == null || provider == null || context.Instance == null)
            {
                return(base.EditValue(provider, value));
            }

            string label = "s_type_text";

            foreach (Attribute attrib in context.PropertyDescriptor.Attributes)
            {
                if (attrib is EditorDisplayLabelAttribute)
                {
                    label = ((EditorDisplayLabelAttribute)attrib).Label;
                }
            }
            string res = NameTemplateEditorForm.Run(VersionInfo.ProgramTitle, label, value.SafeToString());

            return(res ?? value);
        }