Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
DXMenuItem.cs
Package: ASPXGridView.rar [view]
Upload User: lh8511
Upload Date: 2013-01-28
Package Size: 7353k
Code Size: 4k
Category:
ActiveX-DCOM-ATL
Development Platform:
Visual C++
- namespace DevExpress.Utils.Menu
- {
- using System;
- using System.Drawing;
- using System.Runtime.CompilerServices;
- using System.Windows.Forms;
- public class DXMenuItem : IDisposable
- {
- private bool beginGroup;
- private string caption;
- private DXMenuItemCollection collection;
- private bool enabled;
- private System.Drawing.Image image;
- private System.Windows.Forms.Shortcut shortcut;
- private object tag;
- private bool visible;
- public event EventHandler Click;
- public DXMenuItem() : this("")
- {
- }
- public DXMenuItem(string caption) : this(caption, null)
- {
- }
- public DXMenuItem(string caption, EventHandler click) : this(caption, click, null)
- {
- }
- public DXMenuItem(string caption, EventHandler click, System.Drawing.Image image)
- {
- this.enabled = true;
- this.visible = true;
- this.Click = click;
- this.caption = caption;
- this.image = image;
- }
- public virtual void Dispose()
- {
- this.Click = null;
- }
- public void GenerateClickEvent()
- {
- this.OnClick();
- }
- protected virtual void OnChanged()
- {
- if (this.Collection != null)
- {
- this.Collection.OnMenuItemChanged(this);
- }
- }
- protected virtual void OnClick()
- {
- if (this.Click != null)
- {
- this.Click(this, EventArgs.Empty);
- }
- }
- protected internal void SetCollection(DXMenuItemCollection collection)
- {
- this.collection = collection;
- }
- public bool BeginGroup
- {
- get
- {
- return this.beginGroup;
- }
- set
- {
- if (this.BeginGroup != value)
- {
- this.beginGroup = value;
- this.OnChanged();
- }
- }
- }
- public string Caption
- {
- get
- {
- return this.caption;
- }
- set
- {
- if (this.Caption != value)
- {
- this.caption = value;
- this.OnChanged();
- }
- }
- }
- public DXMenuItemCollection Collection
- {
- get
- {
- return this.collection;
- }
- }
- public bool Enabled
- {
- get
- {
- return this.enabled;
- }
- set
- {
- if (this.Enabled != value)
- {
- this.enabled = value;
- this.OnChanged();
- }
- }
- }
- public System.Drawing.Image Image
- {
- get
- {
- return this.image;
- }
- set
- {
- if (this.Image != value)
- {
- this.image = value;
- this.OnChanged();
- }
- }
- }
- public System.Windows.Forms.Shortcut Shortcut
- {
- get
- {
- return this.shortcut;
- }
- set
- {
- if (this.Shortcut != value)
- {
- this.shortcut = value;
- this.OnChanged();
- }
- }
- }
- public object Tag
- {
- get
- {
- return this.tag;
- }
- set
- {
- if (this.Tag != value)
- {
- this.tag = value;
- this.OnChanged();
- }
- }
- }
- public bool Visible
- {
- get
- {
- return this.visible;
- }
- set
- {
- if (this.Visible != value)
- {
- this.visible = value;
- this.OnChanged();
- }
- }
- }
- }
- }