Esempio n. 1
0
        public options(options newOptions)
        {
            useEncryption = newOptions.useEncryption;
            portname = newOptions.portname;
            myKey = newOptions.myKey;
            rulesPath = newOptions.rulesPath;
            Uri path;
            if (Uri.TryCreate(rulesPath, UriKind.RelativeOrAbsolute, out path))
            {
                if (path.Scheme == Uri.UriSchemeHttp || path.Scheme == Uri.UriSchemeHttps)
                    RuleRepository = new serviceRuleRepository(rulesPath);
                else
                    RuleRepository = new ruleRepository(rulesPath);

            }
        }
Esempio n. 2
0
 private void btnOK_Click(object sender, EventArgs e)
 {
     try
     {
         key parsed = new key();
         try
         {
             parsed.setKey(this.txtNewKey.Text);
             toChange.doSetNodeKey(parsed);
             MessageBox.Show("Node key has been changed. Note that this node will be inaccesible under the old key. You must change the network key in the Options menu to access this node.");
             this.Close();
         } catch (FormatException)
         {
             MessageBox.Show("Please enter a network key of 32 characters long, containing only the digits 0 through 9 and A through F.");
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Esempio n. 3
0
        public void doSetNodeKey(key newKey)
        {
            safelyMakeWait();

            try
            {
                Mydriver.doSetNodeKey(id, newKey.keyArray);
                Mydriver.doFlashReRead(id);
            }
            finally
            {
                safelyEndWait();
            }
        }