예제 #1
0
 public Wallet()
 {
     Identities.Clear();
     Identities.Add(new Identity {
         Label = "NewIdentity", IsDefault = true, Lock = false, Extra = null, Controls = new List <Control> {
             new Control("6Pxxxxxxxxx", "1")
         }, Ontid = "did:ont:AMxxxxxxxxxxxxxxxxxxxxxxx"
     });
     Accounts.Add(new Account {
         Address = "TA6xxxxxxxxxxxx", Key = "6Pxxxxxxxxxxx", Hash = "sha256", Label = "NewAccount", PublicKey = "1202xxxxxxxxxxxxxx", SignatureScheme = "SHA256withECDSA", PasswordHash = "passwordhash"
     });
     Scrypt = new Scrypt(16384, 8, 8);
 }
예제 #2
0
        private void OnCfgDefinitionsModified(object sender, EventArgs e)
        {
            NewsgroupsConfiguration cfg = (NewsgroupsConfiguration)sender;

            // take over the copies from local userIdentities and nntpServers
            // to app.FeedHandler.Identity and app.FeedHandler.NntpServers
            Identities.Clear();
            if (cfg.ConfiguredIdentities != null)
            {
                foreach (UserIdentity ui in cfg.ConfiguredIdentities.Values)
                {
                    Identities.Add(ui.Name, (UserIdentity)ui.Clone());
                }
            }

            Save();

            IBanditFeedSource extension = app.BanditFeedSourceExtension;

            if (extension != null)
            {
                lock (extension.NntpServers)
                {
                    extension.NntpServers.Clear();
                    if (cfg.ConfiguredNntpServers != null)
                    {
                        foreach (NntpServerDefinition sd in cfg.ConfiguredNntpServers.Values)
                        {
                            extension.NntpServers.Add(sd.Name, (NntpServerDefinition)sd.Clone());
                        }
                    }
                    extension.SaveNntpServers();
                }
            }

            RaiseNewsServerDefinitionsModified();
            RaiseIdentityDefinitionsModified();
        }