⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 interfacemultiple.cs

📁 yongle jpscxsd j cxksk xdkl sna
💻 CS
字号:
using System;

namespace Example_13
{
	///<summary>
	/// 此程序演示接口继承。
	///</summary>

	public interface IPict
	{
		int DeleteImage();
	}

	public interface IPictManip
	{
		void ApplyAlpha();
		void DisplayImage();
	}

	//继承多重接口
	public interface IPictAll:IPict, IPictManip
	{
		void ApplyBeta();
	}

	//实现接口
	public class MyImages:IPictAll
	{
		public int DeleteImage()
		{
			Console.WriteLine("DeleteImage 实现!");
			return(5);
		}	

		public void ApplyAlpha()
		{
			Console.WriteLine("ApplyAlpha 实现!");
		}

		public void ApplyBeta()
		{
			Console.WriteLine("ApplyBeta 实现!");
		}

		public void DisplayImage()
		{
			Console.WriteLine("DisplayImage 实现");
		}
	}

	class Test
	{
		///<summary>
		/// 应用程序的主入口点。
		///</summary>
		[STAThread]

		static void Main(string[] args)
		{
			MyImages objM = new MyImages();
			objM.DisplayImage();
			int val = objM.DeleteImage();
			Console.WriteLine(val);
			objM.ApplyAlpha();
			objM.ApplyBeta();
		}
	}
}

⌨️ 快捷键说明

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