| 1234567891011121314151617181920212223242526272829 | using System;namespace OpenSEMI.ClientBase.Command{	public class CommandParameter<TCustomParameter>	{		public TCustomParameter CustomParameter		{			get;			private set;		}		protected CommandParameter(TCustomParameter customParameter)		{			CustomParameter = customParameter;		}		public static CommandParameter<TCustomParameter> Cast(object parameter)		{			CommandParameter<object> commandParameter = parameter as CommandParameter<object>;			if (commandParameter == null)			{				throw new InvalidCastException($"Failed to case {parameter.GetType()} to {typeof(CommandParameter<object>)}");			}			return new CommandParameter<TCustomParameter>((TCustomParameter)commandParameter.CustomParameter);		}	}}
 |