protected override void ExecuteCore(ConfigurationNode node)
        {
            TypeSelectorUI selector = new TypeSelectorUI(
                typeof(RijndaelManaged),
                typeof(SymmetricAlgorithm),
                TypeSelectorIncludeFlags.Default
                );
            DialogResult typeResult = selector.ShowDialog();
            if (typeResult == DialogResult.OK)
            {
                KeySettings keySettings = new KeySettings(new SymmetricAlgorithmKeyCreator(selector.SelectedType.AssemblyQualifiedName));
                KeyManagerEditorUI keyManager = new KeyManagerEditorUI(keySettings);
                DialogResult keyResult = keyManager.ShowDialog();

                if (keyResult == DialogResult.OK)
                {
                    INodeNameCreationService service = GetService(typeof(INodeNameCreationService)) as INodeNameCreationService;
                    Debug.Assert(service != null, "Could not find the INodeNameCreationService");
                    base.ExecuteCore(node);
                    SymmetricAlgorithmProviderNode providerNode = (SymmetricAlgorithmProviderNode)ChildNode;
                    providerNode.AlgorithmType = selector.SelectedType.AssemblyQualifiedName;
                    providerNode.Name = service.GetUniqueDisplayName(providerNode.Parent, selector.SelectedType.Name);
                    providerNode.Key = keyManager.KeySettings;
                }
            }
        }
Exemple #2
0
        /// <summary>
        /// <para>Provides a shallow copy of this instance.</para>
        /// </summary>
        /// <returns><para>A new instance of a <see cref="KeySettings"/> object.</para></returns>
        public KeySettings Clone()
        {
            KeySettings clone = new KeySettings(this.keyCreator);

            clone.Key = this.key;
            return(clone);
        }
        /// <summary>
        /// Initializes with a <c>KeyInfo</c>.
        /// </summary>
        /// <param name="keySettings">The key to manage.</param>
        public KeyManagerEditorUI(KeySettings keySettings)
        {
            this.keySettings = keySettings;

            InitializeComponent();

            keyEditor.TextChanged += new EventHandler(keyEditor_TextChanged);
            keyEditor.KeySettings = keySettings;
        }
Exemple #4
0
 /// <summary>
 /// <para>Initialize a new instance of the <see cref="KeyEditor"/> class with a <see cref="KeySettings"/> object.</para>
 /// </summary>
 /// <param name="keySettings">
 /// <para>The key information to edit.</para>
 /// </param>
 public KeyEditor(KeySettings keySettings)
 {
     InitializeComponent();
     this.keySettings = keySettings;
 }
Exemple #5
0
 /// <summary>
 /// <para>Provides a shallow copy of this instance.</para>
 /// </summary>
 /// <returns><para>A new instance of a <see cref="KeySettings"/> object.</para></returns>
 public KeySettings Clone()
 {
     KeySettings clone = new KeySettings(this.keyCreator);
     clone.Key = this.key;
     return clone;
 }
Exemple #6
0
 /// <summary>
 /// <para>Initialize a new instance of the <see cref="KeyEditor"/> class with a <see cref="KeySettings"/> object.</para>
 /// </summary>
 /// <param name="keySettings">
 /// <para>The key information to edit.</para>
 /// </param>
 public KeyEditor(KeySettings keySettings)
 {
     InitializeComponent();
     this.keySettings = keySettings;
 }