upnpeditform.cs

来自「zwave 无线通讯协议 PC controller 控制器源码」· CS 代码 · 共 270 行

CS
270
字号
//////////////////////////////////////////////////////////////////////////////////////////////// 
//
//          #######
//          #   ##    ####   #####    #####  ##  ##   #####
//             ##    ##  ##  ##  ##  ##      ##  ##  ##
//            ##  #  ######  ##  ##   ####   ##  ##   ####
//           ##  ##  ##      ##  ##      ##   #####      ##
//          #######   ####   ##  ##  #####       ##  #####
//                                           #####
//          Z-Wave, the wireless language.
//
//          Copyright Zensys A/S, 2003,2004
//
//          All Rights Reserved
//
//          Description:   This source file is the sourcefile for the UPnPEditForm
//
//          Author:   Johann Sigfredsson
//
//          Last Changed By:  $Author: jch $
//          Revision:         $Revision: 1.2 $
//          Last Changed:     $Date: 2006/04/26 08:56:30 $
//
//////////////////////////////////////////////////////////////////////////////////////////////

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;

namespace Zensys
{
	/// <summary>
	/// Summary description for UPnPEditForm.
	/// </summary>
	public class UPnPEditForm : System.Windows.Forms.Form
	{
    private System.Windows.Forms.Label labelFriendlyName;
    private System.Windows.Forms.Button buttonBridge;
    private System.Windows.Forms.Button buttonStop;
    private System.Windows.Forms.Button buttonCancel;
    private System.Windows.Forms.TextBox textBoxFriendlyName;
    private System.Windows.Forms.Label labelZWaveNoceID;
    private System.Windows.Forms.Label labelZWaveDeviceType;
    private System.Windows.Forms.Label labelZWaveNodeIDText;
    private System.Windows.Forms.Label labelZWaveDeviceTypeText;
    private System.Windows.Forms.Label labelUPnPDeviceType;
    private System.Windows.Forms.Label labelUPnPDeviceTypeText;
		/// <summary>
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.Container components = null;

    public void enableStopButton(bool enable)
    {
      buttonStop.Enabled = enable;
    }

    
    public void enableBridgeButton(bool enable)
    {
      buttonBridge.Enabled = enable;
    }


    public byte ZWaveNodeID
    {
      get {return (byte)Convert.ToByte(labelZWaveNodeIDText.Text);}
      set 
      {
        if (value < 1 || value > 232) throw new ApplicationException("Invalid Z-Wave Node ID");
        labelZWaveNodeIDText.Text = value.ToString();
      }
    }

    public string ZWaveDeviceType
    {
      get {return labelZWaveDeviceTypeText.Text;}
      set {labelZWaveDeviceTypeText.Text = value;}
    }

    public string FriendlyName
    {
      get {return textBoxFriendlyName.Text;}
      set {textBoxFriendlyName.Text = value;}
    }

    public string UPnPDeviceType
    {
      get {return labelUPnPDeviceTypeText.Text;}
      set {labelUPnPDeviceTypeText.Text = value;}
    }


		public UPnPEditForm()
		{
			//
			// Required for Windows Form Designer support
			//
			InitializeComponent();

			//
			// TODO: Add any constructor code after InitializeComponent call
			//
		}

		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if(components != null)
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		#region Windows Form Designer generated code
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
      this.textBoxFriendlyName = new System.Windows.Forms.TextBox();
      this.labelFriendlyName = new System.Windows.Forms.Label();
      this.labelZWaveNoceID = new System.Windows.Forms.Label();
      this.labelZWaveDeviceType = new System.Windows.Forms.Label();
      this.labelZWaveNodeIDText = new System.Windows.Forms.Label();
      this.labelZWaveDeviceTypeText = new System.Windows.Forms.Label();
      this.labelUPnPDeviceType = new System.Windows.Forms.Label();
      this.labelUPnPDeviceTypeText = new System.Windows.Forms.Label();
      this.buttonBridge = new System.Windows.Forms.Button();
      this.buttonStop = new System.Windows.Forms.Button();
      this.buttonCancel = new System.Windows.Forms.Button();
      this.SuspendLayout();
      // 
      // textBoxFriendlyName
      // 
      this.textBoxFriendlyName.Location = new System.Drawing.Point(112, 88);
      this.textBoxFriendlyName.Name = "textBoxFriendlyName";
      this.textBoxFriendlyName.Size = new System.Drawing.Size(200, 20);
      this.textBoxFriendlyName.TabIndex = 0;
      this.textBoxFriendlyName.Text = "";
      // 
      // labelFriendlyName
      // 
      this.labelFriendlyName.Location = new System.Drawing.Point(8, 88);
      this.labelFriendlyName.Name = "labelFriendlyName";
      this.labelFriendlyName.Size = new System.Drawing.Size(96, 16);
      this.labelFriendlyName.TabIndex = 1;
      this.labelFriendlyName.Text = "Friendlyname :";
      // 
      // labelZWaveNoceID
      // 
      this.labelZWaveNoceID.Location = new System.Drawing.Point(8, 16);
      this.labelZWaveNoceID.Name = "labelZWaveNoceID";
      this.labelZWaveNoceID.Size = new System.Drawing.Size(96, 16);
      this.labelZWaveNoceID.TabIndex = 2;
      this.labelZWaveNoceID.Text = "Z-Wave node ID :";
      // 
      // labelZWaveDeviceType
      // 
      this.labelZWaveDeviceType.Location = new System.Drawing.Point(8, 40);
      this.labelZWaveDeviceType.Name = "labelZWaveDeviceType";
      this.labelZWaveDeviceType.Size = new System.Drawing.Size(112, 16);
      this.labelZWaveDeviceType.TabIndex = 3;
      this.labelZWaveDeviceType.Text = "Z-Wave device type :";
      // 
      // labelZWaveNodeIDText
      // 
      this.labelZWaveNodeIDText.Location = new System.Drawing.Point(112, 16);
      this.labelZWaveNodeIDText.Name = "labelZWaveNodeIDText";
      this.labelZWaveNodeIDText.Size = new System.Drawing.Size(48, 16);
      this.labelZWaveNodeIDText.TabIndex = 4;
      // 
      // labelZWaveDeviceTypeText
      // 
      this.labelZWaveDeviceTypeText.Location = new System.Drawing.Point(112, 40);
      this.labelZWaveDeviceTypeText.Name = "labelZWaveDeviceTypeText";
      this.labelZWaveDeviceTypeText.Size = new System.Drawing.Size(208, 16);
      this.labelZWaveDeviceTypeText.TabIndex = 5;
      // 
      // labelUPnPDeviceType
      // 
      this.labelUPnPDeviceType.Location = new System.Drawing.Point(8, 64);
      this.labelUPnPDeviceType.Name = "labelUPnPDeviceType";
      this.labelUPnPDeviceType.Size = new System.Drawing.Size(112, 16);
      this.labelUPnPDeviceType.TabIndex = 6;
      this.labelUPnPDeviceType.Text = "UPnP device type :";
      // 
      // labelUPnPDeviceTypeText
      // 
      this.labelUPnPDeviceTypeText.Location = new System.Drawing.Point(112, 64);
      this.labelUPnPDeviceTypeText.Name = "labelUPnPDeviceTypeText";
      this.labelUPnPDeviceTypeText.Size = new System.Drawing.Size(208, 16);
      this.labelUPnPDeviceTypeText.TabIndex = 7;
      // 
      // buttonBridge
      // 
      this.buttonBridge.Location = new System.Drawing.Point(16, 120);
      this.buttonBridge.Name = "buttonBridge";
      this.buttonBridge.Size = new System.Drawing.Size(80, 40);
      this.buttonBridge.TabIndex = 8;
      this.buttonBridge.Text = "Bridge";
      this.buttonBridge.Click += new System.EventHandler(this.buttonBridge_Click);
      // 
      // buttonStop
      // 
      this.buttonStop.Location = new System.Drawing.Point(120, 120);
      this.buttonStop.Name = "buttonStop";
      this.buttonStop.Size = new System.Drawing.Size(80, 40);
      this.buttonStop.TabIndex = 9;
      this.buttonStop.Text = "Stop";
      this.buttonStop.Click += new System.EventHandler(this.buttonStop_Click);
      // 
      // buttonCancel
      // 
      this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
      this.buttonCancel.Location = new System.Drawing.Point(224, 120);
      this.buttonCancel.Name = "buttonCancel";
      this.buttonCancel.Size = new System.Drawing.Size(80, 40);
      this.buttonCancel.TabIndex = 10;
      this.buttonCancel.Text = "Cancel";
      this.buttonCancel.Click += new System.EventHandler(this.buttonCancel_Click);
      // 
      // UPnPEditForm
      // 
      this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
      this.ClientSize = new System.Drawing.Size(320, 174);
      this.Controls.Add(this.buttonCancel);
      this.Controls.Add(this.buttonStop);
      this.Controls.Add(this.buttonBridge);
      this.Controls.Add(this.labelUPnPDeviceTypeText);
      this.Controls.Add(this.labelUPnPDeviceType);
      this.Controls.Add(this.labelZWaveDeviceTypeText);
      this.Controls.Add(this.labelZWaveNodeIDText);
      this.Controls.Add(this.labelZWaveDeviceType);
      this.Controls.Add(this.labelZWaveNoceID);
      this.Controls.Add(this.labelFriendlyName);
      this.Controls.Add(this.textBoxFriendlyName);
      this.Name = "UPnPEditForm";
      this.Text = "Bridge Z-Wave node to UPnP";
      this.ResumeLayout(false);

    }
		#endregion

    private void buttonBridge_Click(object sender, System.EventArgs e)
    {
      this.DialogResult = DialogResult.OK;
    }

    private void buttonStop_Click(object sender, System.EventArgs e)
    {
      this.DialogResult = DialogResult.OK;
    }

    private void buttonCancel_Click(object sender, System.EventArgs e)
    {
      this.DialogResult = DialogResult.Cancel;
    }
	}
}

⌨️ 快捷键说明

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