Categories
How To

How to Return Status in C#

I use the design pattern of returning a Status. Example:

	public enum Status : Int16 {

		[Description( Symbols.SkullAndCrossbones )]
		Fatal = Exception - 1,

		[Description( Symbols.Exception )]
		Exception = Error - 1,

		[Description( Symbols.Error )]
		Error = Warning - 1,

		[Description( Symbols.Warning )]
		Warning = Skip - 1,

		[Description( Symbols.Fail )]
		Skip = Timeout - 1,

			[Description( Symbols.Timeout )]
			Timeout = Stop - 1,

				[Description( Symbols.StopSign )]
				Stop = Halt - 1,

					[Description( Symbols.StopSign )]
					Halt = Negative - 1,

						[Description( Symbols.FailBig )]
						Negative = No - 1,

							[Description( Symbols.Fail )]
							No = Bad - 1,

								[Description( Symbols.Fail )]
								Bad = Failure - 1,

									[Description( Symbols.BlackStar )]
									Failure = -1,

										[Description( Symbols.Unknown )]
										Unknown = 0,

									[Description( Symbols.WhiteStar )]
									Success = 1,

									[Description( Symbols.WhiteStar )]
									Okay = Success,

								[Description( Symbols.CheckMark )]
								Good = Success + 1,

							[Description( Symbols.CheckMark )]
							Yes = Good + 1,

						[Description( Symbols.CheckMark )]
						Positive = Yes + 1,

					[Description( Symbols.CheckMark )]
					Continue = Positive + 1,

				[Description( Symbols.CheckMark )]
				Go = Continue + 1,

			[Description( Symbols.CheckMark )]
			Proceed = Go + 1,

		[Description( Symbols.CheckMark )]
		Advance = Proceed + 1,

		[Description( Symbols.CheckMark )]
		Flawless = Advance + 1
	}

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s