Table of Contents

Class GuidStringOptions

Namespace
Cuemon.Text
Assembly
Cuemon.Core.dll

Configuration options for FromGuid().

public class GuidStringOptions : IParameterObject
Inheritance
GuidStringOptions
Implements

Examples

The following example demonstrates how to configure GuidStringOptions to restrict which GUID formats are accepted when parsing with ParserFactory.FromGuid.

using System;
using Cuemon;
using Cuemon.Text;

namespace MyApp.Examples;

public class GuidStringOptionsExample
{
    public void Demonstrate()
    {
        // Direct instantiation of GuidStringOptions
        var options = new GuidStringOptions
        {
            Formats = GuidFormats.D
        };

        var parser = ParserFactory.FromGuid();
        var guidString = "{3f2504e0-4f89-41d3-9a0c-0305e82c3301}";

        var result = parser.Parse(guidString, o =>
        {
            o.Formats = GuidFormats.B;
        });

        Console.WriteLine(result);
        // outputs: 3f2504e0-4f89-41d3-9a0c-0305e82c3301

}
}

Constructors

GuidStringOptions()

Initializes a new instance of the GuidStringOptions class.

public GuidStringOptions()

Remarks

The following table shows the initial property values for an instance of GuidStringOptions.

PropertyInitial Value
FormatsGuidFormats.BraceFormat | GuidFormats.DigitFormat | GuidFormats.ParenthesisFormat

Properties

Formats

Gets or sets the allowed GUID formats.

public GuidFormats Formats { get; set; }

Property Value

GuidFormats

The allowed GUID formats.

See Also