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
weituo.cs
Package: Visual.rar [view]
Upload User: yiyuerguo
Upload Date: 2014-09-27
Package Size: 3781k
Code Size: 1k
Category:
CSharp
Development Platform:
Others
- using System;
- class MathClass
- {
- public static int max(int a,int b)
- {
- return(a>b?a:b);
- }
- public static int min(int a,int b)
- {
- return(a<b?a:b);
- }
- public static int sub(int a,int b)
- {
- return (a+b);
- }
- public static int minus(int a,int b)
- {
- return (a-b);
- }
- }
- class Handler
- {
- private delegate int Calculation(int a, int b);
- private static Calculation[] myCalculation=new Calculation[2];
- public static void EventHandler(int i,int a,int b)
- {
- switch (i)
- {
- case 1:
- myCalculation[0]=new Calculation(MathClass.max);
- myCalculation[1]=new Calculation(MathClass.min);
- Console.WriteLine(myCalculation[0](a,b));
- Console.WriteLine(myCalculation[1](a,b));
- break;
- case 2:
- myCalculation[0]=new Calculation(MathClass.sub);
- myCalculation[1]=new Calculation(MathClass.minus);
- Console.WriteLine(myCalculation[0](a,b));
- Console.WriteLine(myCalculation[1](a,b));
- break;
- default:
- return;
- }
- }
- }
- class Test
- {
- static void Main()
- {
- Handler.EventHandler(1,10,3);
- Handler.EventHandler(2,10,3);
- Console.ReadLine();
- }
- }