utilities.cs

来自「应用于C#中的参照功能」· CS 代码 · 共 66 行

CS
66
字号
using System;

namespace WATestPGB
{
	/// <summary>
	/// This class provides some basic functionality needed in the controls
	/// </summary>
	public class Utilities
	{
		/// <summary>
		/// Default constructor
		/// </summary>
		public Utilities()
		{
			// No initialization needed
		}

		/// <summary>
		/// Add method (standard mathematical operation, used in NumberPicker)
		/// </summary>
		/// <param name="x">First parameter</param>
		/// <param name="y">Second parameter</param>
		/// <returns>The result of adding the first parameter to the second one</returns>
		public static double Add(double x, double y) 
		{
			return x+y;
		}
		
		/// <summary>
		/// Substract method (standard mathematical operation, used in 
		/// NumberPicker)
		/// </summary>
		/// <param name="x">First parameter</param>
		/// <param name="y">Second parameter</param>
		/// <returns>The result of substracting the second parameter from the first one</returns>
		public static double Substract(double x, double y) 
		{
			return x-y;
		}
		
		/// <summary>
		/// Divide method (standard mathematical operation, used in
		/// NumberPicker)
		/// </summary>
		/// <param name="x">First parameter</param>
		/// <param name="y">Second parameter</param>
		/// <returns>The result of dividing the first parameter by the second one</returns>
		public static double Divide(double x, double y) 
		{
			return x/y;
		}
		
		/// <summary>
		/// Multiply method (standard mathematical operation, used in
		/// NumberPicker)
		/// </summary>
		/// <param name="x">First parameter</param>
		/// <param name="y">Second parameter</param>
		/// <returns>The result of multiplying the first parameter to the second one</returns>
		public static double Multiply(double x, double y) 
		{
			return x*y;
		}
	}
}

⌨️ 快捷键说明

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