⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 form1.cs

📁 清华大学出版社出版的 移动应用开发宝典 张大威(2008)的附书源代码
💻 CS
字号:
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Chapter9;

namespace DataConnection
{
    public partial class Form1 : Form
    {
        private Chapter9.ConnectionManager cm = new Chapter9.ConnectionManager();

        public Form1()
        {
            InitializeComponent();
            cm.ConnectionStatusChanged += new ConnectionStatusChangedEventHandler(cm_ConnectionStatusChanged);
        }

        void cm_ConnectionStatusChanged(ConnectionStatusChangedEventArgs e)
        {
            txtStatus.Text = e.ConnectionStatus.ToString();
        }

       


        private void btnMap_Click(object sender, EventArgs e)
        {
            Uri u = new Uri(txtUrl.Text);
            lbDests.DataSource = ConnectionManager.MapUrl(u);
        }

        private void btnStatus_Click(object sender, EventArgs e)
        {
            txtStatus.Text = cm.ConnectionStatus.ToString();
        }

        private void btnConnect_Click(object sender, EventArgs e)
        {
            cm.EstablishConnection((Guid)lbDests.SelectedItem);
        }

        private void btnRelease_Click(object sender, EventArgs e)
        {
            cm.ReleaseConnection();
        }
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -