Пример #1
0
 public MainForm1()
 {
     InitializeComponent();
     _ELSession = new EchoLinkSession();
     _ELSession.Closing += new _IEchoLinkSessionEvents_ClosingEventHandler(_ELSession_Closing);
     _ELSession.Connected += new _IEchoLinkSessionEvents_ConnectedEventHandler(_ELSession_Connected);
     _ELSession.Disconnected += new _IEchoLinkSessionEvents_DisconnectedEventHandler(_ELSession_Disconnected);
 }
Пример #2
0
        private void button2_Click(object sender, EventArgs e)
        {
            this.toolStripStatusLabel1.Text = "Collecting configuration.";
            this.Refresh();

            button2.Enabled = false;

            _ELInfo = new SetupConfig();
            _ELSession = new EchoLinkSession();
            RegistryKey SUBKEY;
            RegistryKey _ELkey = RegistryKey.OpenRemoteBaseKey(Microsoft.Win32.RegistryHive.CurrentUser, "");
            string subkey = "Software\\K1RFD\\EchoLink\\Sysop";
            SUBKEY = _ELkey.OpenSubKey(subkey);
            string temp_str;
            temp_str = _ELInfo.Callsign;
            if (temp_str.Contains("-"))
            {
                textBox1.Text = _ELInfo.Callsign.Remove(_ELInfo.Callsign.Length - 1);
                textBox1.AppendText("10");
            }
            else
            {
                textBox1.Text = _ELInfo.Callsign;
                textBox1.AppendText("-10");
            }
            string _ELNode = "";

            foreach (EchoLink.IStationEntry station in _ELSession.StationEntries)
            {
                if (_ELInfo.Callsign == station.Callsign)
                {
                    _ELNode = station.NodeNumber.ToString();
                    break;
                }
            }

            textBox2.Text = _ELNode;
            object APRSlat = SUBKEY.GetValue("APRSlat");
            temp_str = APRSlat.ToString();
            string APRSlat_str = temp_str.Replace(".","");
            textBox3.Text = process_lat_long(APRSlat_str);
            object APRSlon = SUBKEY.GetValue("APRSlon");
            temp_str = APRSlon.ToString();
            string APRSlon_str = temp_str.Replace(".","");
            textBox4.Text = process_lat_long(APRSlon_str);
            textBox5.Text = "PASSCODE";
            textBox6.Text = "srvr.aprs-is.net"; // http://www.aprs-is.net/SendOnlyPorts.aspx
            textBox7.Text = "8080";
            textBox8.Text = "30";
            textBox9.Text = "WIDW1-1,WIDE2-2";
            button2.Enabled = true;
            checkBox1.Checked = false;
            toolStripStatusLabel1.Text = "Default values loaded.";
        }
Пример #3
0
 public void _ELSession_Closing()
 {
     _ELSession.Closing -= _ELSession_Closing;
     _ELSession = null;
 }