?? mapallscreendisplay.cs
字號(hào):
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using CallCenter.Modules;
namespace CallCenter.BusinessInterfaces.MainForms
{
/// <summary>
/// MapAllScreenDisplay 的摘要說(shuō)明。
/// </summary>
public class MapAllScreenDisplay : System.Windows.Forms.Form
{
private System.Windows.Forms.Timer timer1;
private DevExpress.XtraEditors.PanelControl panel1;
private System.Windows.Forms.Label label1;
private AxMapXLib.AxMap axMap1;
private System.ComponentModel.IContainer components;
public MapAllScreenDisplay()
{
//
// Windows 窗體設(shè)計(jì)器支持所必需的
//
InitializeComponent();
//
// TODO: 在 InitializeComponent 調(diào)用后添加任何構(gòu)造函數(shù)代碼
//
}
/// <summary>
/// 清理所有正在使用的資源。
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
public static void Main()
{
Application.Run(new MapAllScreenDisplay());
}
#region Windows 窗體設(shè)計(jì)器生成的代碼
/// <summary>
/// 設(shè)計(jì)器支持所需的方法 - 不要使用代碼編輯器修改
/// 此方法的內(nèi)容。
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(MapAllScreenDisplay));
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.panel1 = new DevExpress.XtraEditors.PanelControl();
this.label1 = new System.Windows.Forms.Label();
this.axMap1 = new AxMapXLib.AxMap();
((System.ComponentModel.ISupportInitialize)(this.panel1)).BeginInit();
this.panel1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.axMap1)).BeginInit();
this.SuspendLayout();
//
// timer1
//
this.timer1.Enabled = true;
this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
//
// panel1
//
this.panel1.Appearance.BackColor = System.Drawing.Color.Transparent;
this.panel1.Appearance.Options.UseBackColor = true;
this.panel1.Controls.Add(this.label1);
this.panel1.Dock = System.Windows.Forms.DockStyle.Bottom;
this.panel1.Location = new System.Drawing.Point(0, 384);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(568, 40);
this.panel1.TabIndex = 5;
//
// label1
//
this.label1.Font = new System.Drawing.Font("宋體", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.label1.Location = new System.Drawing.Point(8, 9);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(280, 23);
this.label1.TabIndex = 0;
this.label1.Text = "社區(qū)服務(wù)呼叫中心系統(tǒng)";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// axMap1
//
this.axMap1.Dock = System.Windows.Forms.DockStyle.Fill;
this.axMap1.Enabled = true;
this.axMap1.Location = new System.Drawing.Point(0, 0);
this.axMap1.Name = "axMap1";
this.axMap1.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("axMap1.OcxState")));
this.axMap1.Size = new System.Drawing.Size(568, 384);
this.axMap1.TabIndex = 6;
//
// MapAllScreenDisplay
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.BackColor = System.Drawing.Color.White;
this.ClientSize = new System.Drawing.Size(568, 424);
this.Controls.Add(this.axMap1);
this.Controls.Add(this.panel1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "MapAllScreenDisplay";
this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
this.Text = "分屏顯示";
this.TopMost = true;
this.Load += new System.EventHandler(this.MapAllScreenDisplay_Load);
((System.ComponentModel.ISupportInitialize)(this.panel1)).EndInit();
this.panel1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.axMap1)).EndInit();
this.ResumeLayout(false);
}
#endregion
private void timer1_Tick(object sender, System.EventArgs e)
{
this.label1.Left=this.label1.Left -10;
if(this.label1.Left+this.label1.Width<=0)
{
this.label1.Left=this.panel1.Left+this.panel1.Width;
}
}
private void MapAllScreenDisplay_Load(object sender, System.EventArgs e)
{
try
{
Rectangle rect=new Rectangle();
rect=Screen.GetWorkingArea(this);
this.Left=rect.Width;
this.Top=rect.Y;
Rectangle rect1=new Rectangle();
rect1=Screen.GetWorkingArea(this);
this.Width=rect.Width;
this.Height=rect.Height;
}
catch(Exception ex)
{
MessageBox.Show(ex.Message);
}
}
private void button1_Click(object sender, System.EventArgs e)
{
try
{
Rectangle rect=new Rectangle();
rect=Screen.GetWorkingArea(this);
this.Left=rect.Width;
this.Top=rect.Y;
Rectangle rect1=new Rectangle();
rect1=Screen.GetWorkingArea(this);
this.Width=rect.Width;
this.Height=rect.Height;
}
catch(Exception ex)
{
MessageBox.Show(ex.Message);
}
}
private void axMap1_SelectionChanged(object sender, System.EventArgs e)
{
}
public void selectMap(string displayArea,CustomerInfo info)
{
this.axMap1.Layers[displayArea].Selection.ClearSelection();
MapXLib.Feature fea = this.axMap1.Layers[displayArea].GetFeatureByKey(info.position.ToString());
if(fea!=null)
{
this.axMap1.Layers[displayArea].Selection.Add(fea);
}
this.label1.Text="用戶(hù)名稱(chēng):"+info.cname+",電話:"+info.ctelnumber+",地址:"+info.caddress;
int lenghth=this.label1.Text.Length;
this.label1.Width=lenghth*20;
}
//
public event AlertingMapHandler AlertingMap = null;
private void onAlertingMap(object o)
{
if(AlertingMap!=null && o is CustomerInfo)
{
AlertingMapEventArgs ev = new AlertingMapEventArgs();
ev.customerInfo = (CustomerInfo)o;
AlertingMap(this,ev);
}
}
}
/// <summary>
/// 自定義事件,當(dāng)有來(lái)電時(shí)或查詢(xún)時(shí)啟動(dòng)該事件
/// author:yanqingxi
/// </summary>
public class AlertingMapEventArgs : EventArgs
{
public CustomerInfo customerInfo=null;
}
public delegate void AlertingMapHandler(object sender,AlertingMapEventArgs ev);
}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -