# ValueType

***

**1. Storing a Date/Time:**

```csharp
DateTime birthDate = new DateTime(1970, 01, 01, 00, 00, 00, DateTimeKind.Utc);
Console.WriteLine(birthDate.ToString("yyyy-MM-dd HH:mm:ss"));
```

**2. Representing a Currency Value:**

```csharp
decimal balance = 1234.56M;
Console.WriteLine(balance.ToString("C"));
```

**3. Holding a Complex Number:**

```csharp
Complex number = new Complex(3, 4);
Console.WriteLine($"Re: {number.Real}, Im: {number.Imaginary}");
```

**4. Storing a Coordinate Pair:**

```csharp
Point point = new Point(10, 20);
Console.WriteLine($"X: {point.X}, Y: {point.Y}");
```

**5. Representing a Rectangle:**

```csharp
Rectangle rectangle = new Rectangle(10, 20, 30, 40);
Console.WriteLine($"Left: {rectangle.Left}, Top: {rectangle.Top}, Width: {rectangle.Width}, Height: {rectangle.Height}");
```

**6. Storing a File Size:**

```csharp
long fileSize = 1234567890;
Console.WriteLine(fileSize.ToString("N0"));
```

**7. Representing a Boolean Value:**

```csharp
bool isTrue = true;
Console.WriteLine(isTrue ? "True" : "False");
```

**8. Storing a Time Span:**

```csharp
TimeSpan duration = TimeSpan.FromHours(2) + TimeSpan.FromMinutes(30);
Console.WriteLine(duration.ToString("hh\\:mm\\:ss"));
```

**9. Representing a Web URL:**

```csharp
Uri url = new Uri("https://www.example.com");
Console.WriteLine(url.ToString());
```

**10. Storing a Phone Number:**

```csharp
PhoneNumber phoneNumber = new PhoneNumber("1234567890");
Console.WriteLine(phoneNumber.ToString());
```

**11. Representing an RGB Color:**

```csharp
Color color = Color.FromArgb(255, 0, 0);
Console.WriteLine($"R: {color.R}, G: {color.G}, B: {color.B}");
```

**12. Storing a GUID:**

```csharp
Guid id = Guid.NewGuid();
Console.WriteLine(id.ToString());
```

**13. Representing a Size:**

```csharp
Size size = new Size(100, 200);
Console.WriteLine($"Width: {size.Width}, Height: {size.Height}");
```

**14. Storing a Temperature:**

```csharp
double temperature = 25.5;
Console.WriteLine($"{temperature} °C");
```

**15. Representing a Measurement:**

```csharp
Measurement length = new Measurement(10, MeasurementUnit.Centimeters);
Console.WriteLine($"{length.Value} {length.Unit}");
```

**16. Storing a Percentage:**

```csharp
double percentage = 0.5;
Console.WriteLine($"{percentage * 100}%");
```

**17. Representing a Rotation:**

```csharp
Rotation rotation = new Rotation(Math.PI / 2);
Console.WriteLine($"Angle: {rotation.Angle} radians");
```

**18. Storing a Pixel Format:**

```csharp
PixelFormat format = PixelFormat.Format32bppArgb;
Console.WriteLine(format.ToString());
```

**19. Representing a Date Range:**

```csharp
DateRange range = new DateRange(new DateTime(2023, 01, 01), new DateTime(2023, 12, 31));
Console.WriteLine($"Start: {range.Start}, End: {range.End}");
```

**20. Storing a Payment Amount:**

```csharp
Money amount = new Money(100, "USD");
Console.WriteLine($"{amount.Value} {amount.Currency}");
```

**21. Representing a Dimension:**

```csharp
Dimension dimension = new Dimension(10, 20, 30);
Console.WriteLine($"Length: {dimension.Length}, Width: {dimension.Width}, Height: {dimension.Height}");
```

**22. Storing a File Path:**

```csharp
string filePath = @"C:\Users\John Doe\Documents\file.txt";
Console.WriteLine(filePath);
```

**23. Representing a Spectral Color:**

```csharp
SpectralColor color = SpectralColor.Red;
Console.WriteLine(color.ToString());
```

**24. Storing a Bitmap:**

```csharp
Bitmap bitmap = new Bitmap(100, 100);
Graphics graphics = Graphics.FromImage(bitmap);
graphics.FillRectangle(Brushes.Red, 0, 0, 100, 100);
bitmap.Save("bitmap.png");
```

**25. Representing a Look:**

```csharp
Look look = Look.Bold | Look.Italic;
Console.WriteLine(look.ToString());
```

**26. Storing a File Extension:**

```csharp
string fileExtension = ".txt";
Console.WriteLine(fileExtension);
```

**27. Representing an Enum:**

```csharp
enum Gender { Male, Female }
Gender gender = Gender.Male;
Console.WriteLine(gender.ToString());
```

**28. Storing a Logical Operator:**

```csharp
LogicalOperator operator = LogicalOperator.And;
Console.WriteLine(operator.ToString());
```

**29. Representing a Font Style:**

```csharp
FontStyle style = FontStyle.Bold;
Console.WriteLine(style.ToString());
```

**30. Storing an Icon:**

```csharp
Icon icon = new Icon("icon.ico");
Console.WriteLine(icon.ToString());
```

**31. Representing a Keyboard Key:**

```csharp
Keys key = Keys.Enter;
Console.WriteLine(key.ToString());
```

**32. Storing a URL Query:**

```csharp
string query = "name=John&age=30";
Console.WriteLine(query);
```

**33. Representing a DPI Resolution:**

```csharp
DpiResolution resolution = DpiResolution.Dpi120;
Console.WriteLine(resolution.ToString());
```

**34. Storing a Media Type:**

```csharp
MediaType mediaType = MediaType.Video;
Console.WriteLine(mediaType.ToString());
```

**35. Representing a Line Style:**

```csharp
LineStyle style = LineStyle.Dot;
Console.WriteLine(style.ToString());
```

**36. Storing a Signature:**

```csharp
Signature signature = new Signature("John Doe");
Console.WriteLine(signature.ToString());
```

**37. Representing a Collision Mode:**

```csharp
CollisionMode mode = CollisionMode.Bounce;
Console.WriteLine(mode.ToString());
```

**38. Storing a Download State:**

```csharp
DownloadState state = DownloadState.InProgress;
Console.WriteLine(state.ToString());
```

**39. Representing a Channel Type:**

```csharp
ChannelType type = ChannelType.Ethernet;
Console.WriteLine(type.ToString());
```

**40. Storing a Time Zone:**

```csharp
TimeZone timeZone = TimeZone.CurrentTimeZone;
Console.WriteLine(timeZone.ToString());
```

**41. Representing a File Mode:**

```csharp
FileMode mode = FileMode.Create;
Console.WriteLine(mode.ToString());
```

**42. Storing a Measurement Type:**

```csharp
MeasurementType type = MeasurementType.Weight;
Console.WriteLine(type.ToString());
```

**43. Representing a Dimension Unit:**

```csharp
DimensionUnit unit = DimensionUnit.Centimeters;
Console.WriteLine(unit.ToString());
```

**44. Storing a Property Identifier:**

```csharp
PropertyIdentifier identifier = PropertyIdentifier.ElementId;
Console.WriteLine(identifier.ToString());
```

**45. Representing a Message Type:**

```csharp
MessageType type = MessageType.TextMessage;
Console.WriteLine(type.ToString());
```

**46. Storing a Payment Gateway:**

```csharp
PaymentGateway gateway = PaymentGateway.PayPal;
Console.WriteLine(gateway.ToString());
```

**47. Representing a State:**

```csharp
State state = State.California;
Console.WriteLine(state.ToString());
```

**48. Storing a File Type:**

```csharp
FileType type = FileType.Text;
Console.WriteLine(type.ToString());
```

**49. Representing a Compression Method:**

```csharp
CompressionMethod method = CompressionMethod.GZip;
Console.WriteLine(method.ToString());
```

**50. Storing a Country Code:**

```csharp
CountryCode code = CountryCode.US;
Console.WriteLine(code.ToString());
```
