Using system;
Using system.componentmodel;
Using system.drawing;
Using System.Resources;
Using system.windows.forms;
USING Microsoft.win32;
Using message = com.Message;
Namespace TrafficClient
{
///
/// Summary Description for Reminder.
/// summary>
Public Class Reminder: Form
{
Private Timer Closetimer;
Private icontainer Components;
Private picturebox closewindow;
Private linkLabel ShowmainWindow;
PRIVATE INT STARTOPACITY
PRIVATE LABEL SMSHEAD;
PRIVATE LABEL SMSCONTENT;
PRIVATE FORM Mainwindow;
PRIVATE LINKLABEL ReplyMessage;
Private linkLabel StopaniMation;
PRIVATE BOOL AutoHide;
Public Reminder (Message Message, Form Parent): this (Message, Parent, true) {}
Public Reminder (Message Message, Form Parent, Bool AutoHide)
{
//
// Required for Windows Form Designer Support
//
InitializationComponent ();
//
// Todo: Add Any Constructionor Code After InitializationComponent Call
//
This.SMSHead.Text = Message.Userphone "/ N" Message.happenTime
THIS.SMSCONTENT.TEXT = Message.Content;
THIS.AUTOHIDE = AutoHide;
THIS.MAINWINDOW = PARENT;
}
///
/// 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
///
/// Required Method for Designer Support - Do Not Modify
/// The contents of this method with the code editor.
/// summary>
Private vidinitiRizeComponent ()
{
This.Components = New Container ();
ResourceManager Resources = New ResourceManager (TypeOf (Reminder);
THIS.SMSHEAD = New label (); this.smsContent = new label ();
THIS.SHOWMAINWINDOW = New LinkLabel ();
this.closetimer = new Timer (this.components);
This.CloseWindow = New PictureBox ();
THIS.ReplyMessage = New LinkLabel ();
THIS.STOPANIMATION = New LinkLabel ();
THIS.SUSPENDLAYOUT ();
//
// smshead
//
this.smshead.location = new point (16, 8);
this.smshead.name = "smshead";
this.smshead.size = new size (440, 56);
this.smshead.tabindex = 0;
//
// SMSCONTENT
//
this.smscontent.font = new font ("stzhongsong",
16f
, FontStyle.Bold, GraphicsUnit.Point, ((Byte))));
this.smscontent.location = new point (16, 80);
THIS.SMSCONTENT.NAME = "SMSCONTENT";
THIS.SMSCONTENT.SIZE = New Size (472, 232);
THIS.SMSCONTENT.TABINDEX = 1;
//
// showmainwindow
//
This.ShowMainWindow.Location = New Point (440, 320);
this.ShowMainWindow.Name = "showmainwindow";
This.ShowMainWindow.size = new size (56, 16);
This.ShowMainWindow.tabindex = 2;
THIS.SHOWMAINWINDOW.TABSTOP = TRUE;
This.ShowMainWindow.Text = "Display Interface";
This.ShowMainWindow.LinkClicked = New LinklabellinkClicKedeventHandler (this.showmainwindow_linkclicked);
//
// Closetimer
//
This.closetimer.Interval = 50;
This.closetimer.tick = new eventhandler (this.closetimer_tick);
//
// closewindow
//
This.CloseWindow.Image = ((image))))));
this.closeWindow.Location = New Point (472, 0);
this.closeWindow.Name = "closewindow";
This.closeWindow.Size = New size (32, 32);
this.closeWindow.tabindex = 3;
this.closeWindow.Tabstop = FALSE;
This.closeWindow.click = new eventhandler (this.closeWindow_click); //
// replymessage
//
this.ReplyMessage.Location = New Point (8, 320);
This.ReplyMessage.Name = "replymessage";
This.ReplyMessage.Size = New size (56, 16);
This.ReplyMessage.tabindex = 4;
This.ReplyMessage.tabstop = true;
This.ReplyMessage.Text = "Reply Information";
//
// stopanimation
//
THIS.Stopanimation.Location = New Point (360, 320);
THIS.Stopanimation.name = "stopanimation";
THIS.Stopanimation.size = new size (56, 16);
THIS.Stopanimation.tabindex = 5;
THIS.STOPANIMATION.TABSTOP = TRUE;
THIS.Stopanimation.text = "Stop Close";
THIS.Stopanimation.LinkClicked = New LinkLabellinkClickedEventHandler (this.stopaniMation_LinkClicked);
//
// Reminder
//
THIS.AUTOSCALEBASESIZE = New Size (5, 13);
THIS.BACKCOLOR = SystemColors.info;
THIS.CLIENTSIZE = New size (502, 342);
THIS.CONTROLBOX = FALSE;
This.Controls.add (this.stopaniMation);
This.Controls.add (this.ReplyMessage);
This.Controls.add (this.closewindow);
this.Controls.add (this.showmainwindow);
this.Controls.add (this.smscontent);
This.Controls.add (this.smshead);
This.FormBorderstyle = formborderstyle.fixedsingle;
THIS.ICON = ((icon))))))));
THIS.MAXIMIZEBOX = FALSE;
THIS.MINIMIZEBOX = FALSE;
This.name = "removeer";
THIS.SHOWINTASKBAR = FALSE;
THIS.StartPosition = formstartPosition.centerscreen
THIS.TOPMOST = True;
This.Load = New EventHandler (this.Reminder_load);
This.ResumeLayout (false);
}
#ndregion
Private void Closetimer_Tick (Object Sender, Eventargs E)
{
Decreaseopacity ();
}
Private void Decreaseopacity () {
THIS.STARTOPACITY -;
This.opacity = (double) this.startopacity / 100;
IF (this.Startopacity == 0)
this.dispose ();
}
Private Void Reminder_Load (Object Sender, Eventargs E)
{
IF (this.autohide)
this.closetimer.start ();
THISINITSTARTOPACITY ();
}
Private void CloseWindow_Click (Object Sender, Eventargs E)
{
this.dispose ();
}
Private void showmainwindow_linkclicked (Object Sender, LinkLabellinkClicKedeventargs E)
{
THIS.MAINWINDOW.SHOW ();
}
Private Void Stopanimation_LinkClicked (Object Sender, LinkLabellinkClickedEventArgs E)
{
This.closetimer.Stop ();
THISINITSTARTOPACITY ();
}
Private vidinitopacity ()
{
THIS.STARTOPACITY = INT32.PARS (Registry.LocalMachine.Opensubkey (@ "Software / TrafficClient"). GetValue ("Reminderopacity", "50"). TOSTRING ());
This.opacity = (double) this.startopacity / 100;
}
}
}