-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathProcessorArchitectureExtensions.cs
35 lines (30 loc) · 1.15 KB
/
ProcessorArchitectureExtensions.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/////////////////////////////////////////////////////////////////////////////////
// paint.net //
// Copyright (C) dotPDN LLC, Rick Brewster, and contributors. //
// All Rights Reserved. //
/////////////////////////////////////////////////////////////////////////////////
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
namespace PaintDotNet.SystemLayer
{
public static class ProcessorArchitectureExtensions
{
public static int ToBitness(this ProcessorArchitecture procArch)
{
switch (procArch)
{
case ProcessorArchitecture.Unknown:
throw new ArgumentException();
case ProcessorArchitecture.X64:
return 64;
case ProcessorArchitecture.X86:
return 32;
default:
throw ExceptionUtil.InvalidEnumArgumentException(procArch, nameof(procArch));
}
}
}
}