protected override void ExecuteCore(ConfigurationNode node)
        {
            AddNewKeyAlgorithmWizard wizard = new AddNewKeyAlgorithmWizard();

            if (wizard.ShowDialog() == DialogResult.OK)
            {
                FileKeyAlgorithmStorageProviderWizard fileWizard = new FileKeyAlgorithmStorageProviderWizard(wizard.KeyAlgorithmPair, ServiceProvider);

                if (fileWizard.ShowDialog() == DialogResult.OK)
                {
                    base.ExecuteCore(node);
                    FileKeyAlgorithmPairStorageProviderNode pairStorageNode = (FileKeyAlgorithmPairStorageProviderNode)ChildNode;
                    pairStorageNode.DpapiSettings = fileWizard.DpapiSettings;
                    pairStorageNode.File          = fileWizard.Path;
                }
            }
        }
示例#2
0
 /// <summary>
 /// <para>Edits the specified object's value using the editor style indicated by <see cref="UITypeEditor.GetEditStyle"/>. This should be a <see cref="DpapiSettings"/> object.</para>
 /// </summary>
 /// <param name="context"><para>An <see cref="ITypeDescriptorContext"/> that can be used to gain additional context information.</para></param>
 /// <param name="provider"><para>An <see cref="IServiceProvider"/> that this editor can use to obtain services.</para></param>
 /// <param name="value"><para>The object to edit. This should be a <see cref="DpapiSettings"/> object.</para></param>
 /// <returns><para>The new value of the <see cref="DpapiSettings"/> object.</para></returns>
 /// <seealso cref="UITypeEditor.EditValue(ITypeDescriptorContext, IServiceProvider, object)"/>
 public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
 {
     ConfirmMessage = SR.DpapiConvertKeyConfirmMessage;
     currentNode    = (FileKeyAlgorithmPairStorageProviderNode)context.Instance;
     return(base.EditValue(context, provider, value));
 }
 /// <summary>
 /// <para>Edits the specified object's value using the editor style indicated by <see cref="UITypeEditor.GetEditStyle"/>. This should be a <see cref="DpapiSettings"/> object.</para>
 /// </summary>
 /// <param name="context"><para>An <see cref="ITypeDescriptorContext"/> that can be used to gain additional context information.</para></param>
 /// <param name="provider"><para>An <see cref="IServiceProvider"/> that this editor can use to obtain services.</para></param>
 /// <param name="value"><para>The object to edit. This should be a <see cref="DpapiSettings"/> object.</para></param>
 /// <returns><para>The new value of the <see cref="DpapiSettings"/> object.</para></returns>
 /// <seealso cref="UITypeEditor.EditValue(ITypeDescriptorContext, IServiceProvider, object)"/>
 public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
 {
     ConfirmMessage = SR.DpapiConvertKeyConfirmMessage;
     currentNode = (FileKeyAlgorithmPairStorageProviderNode)context.Instance;
     return base.EditValue(context, provider, value);
 }