public static string GetStringValue(this ThreadType enumValue) { switch (enumValue) { case ThreadType.Cpu: return("cpu"); case ThreadType.Wait: return("wait"); case ThreadType.Block: return("block"); } throw new ArgumentException($"'{enumValue.ToString()}' is not a valid value for enum 'ThreadType'"); }
public static FMOD.THREAD_TYPE ToFMODThreadType(ThreadType threadType) { switch (threadType) { case ThreadType.Mixer: return(FMOD.THREAD_TYPE.MIXER); case ThreadType.Feeder: return(FMOD.THREAD_TYPE.FEEDER); case ThreadType.Stream: return(FMOD.THREAD_TYPE.STREAM); case ThreadType.File: return(FMOD.THREAD_TYPE.FILE); case ThreadType.Nonblocking: return(FMOD.THREAD_TYPE.NONBLOCKING); case ThreadType.Record: return(FMOD.THREAD_TYPE.RECORD); case ThreadType.Geometry: return(FMOD.THREAD_TYPE.GEOMETRY); case ThreadType.Profiler: return(FMOD.THREAD_TYPE.PROFILER); case ThreadType.Studio_Update: return(FMOD.THREAD_TYPE.STUDIO_UPDATE); case ThreadType.Studio_Load_Bank: return(FMOD.THREAD_TYPE.STUDIO_LOAD_BANK); case ThreadType.Studio_Load_Sample: return(FMOD.THREAD_TYPE.STUDIO_LOAD_SAMPLE); case ThreadType.Convolution_1: return(FMOD.THREAD_TYPE.CONVOLUTION1); case ThreadType.Convolution_2: return(FMOD.THREAD_TYPE.CONVOLUTION2); default: throw new ArgumentException("Unrecognised thread type '" + threadType.ToString() + "'"); } }
public override void Serialize(IXunitSerializationInfo data) { base.Serialize(data); data.AddValue(nameof(ThreadType), ThreadType.ToString()); }
public static string DisplayName(this ThreadType thread) { return(thread.ToString().Replace('_', ' ')); }
/// <summary> /// Creates a new <see cref="IThread"/> instance of the specified thread type. /// </summary> /// <param name="threadType">The type of <see cref="IThread"/> to create.</param> public static IThread Create(ThreadType threadType) { return(MXContainer.Resolve <IThread>(threadType.ToString())); }