示例#1
0
        public override object EditValue(
            ITypeDescriptorContext context,
            IServiceProvider provider,
            object Value)
        {
            XVBAOptions opt = Value as XVBAOptions;

            if (opt == null)
            {
                opt = new XVBAOptions();
            }
            else
            {
                opt = opt.Clone();
            }
            IWindowsFormsEditorService svc = (IWindowsFormsEditorService)provider.GetService(
                typeof(IWindowsFormsEditorService));

            using (dlgScriptOptions dlg = new dlgScriptOptions())
            {
                dlg.OptionsInstance = opt;
                if (svc.ShowDialog(dlg) == System.Windows.Forms.DialogResult.OK)
                {
                    return(opt);
                }
            }
            return(Value);
        }
示例#2
0
        object System.ICloneable.Clone()
        {
            XVBAOptions opt = new XVBAOptions();

            if (this.myImportNamespaces != null)
            {
                opt.myImportNamespaces = myImportNamespaces.Clone();
            }
            if (this.myReferenceAssemblies != null)
            {
                opt.myReferenceAssemblies = this.myReferenceAssemblies.Clone();
            }
            if (this.myInnerReferenceAssemblies != null)
            {
                opt.myInnerReferenceAssemblies = this.myInnerReferenceAssemblies.Clone();
            }
            return(opt);
        }