# IFormattingExtensionsToggle

> Lets a source stop formatter extensions from running for the placeholder it resolved.

## Definition

* **Type:** Interface
* **Namespace:** [Unity.SmartStrings.Core.Extensions](/engine/6000.7/script-reference/unity/smartstrings/core/extensions.md)
* **Assembly:** UnityEngine.SmartStringsModule

```csharp
public interface IFormattingExtensionsToggle
```

## Remarks

[SmartFormatter](/engine/6000.7/script-reference/unity/smartstrings/smartformatter.md) passes a [FormattingInfo](/engine/6000.7/script-reference/unity/smartstrings/core/formatting/formattinginfo.md), which implements this interface, as the [ISelectorInfo](/engine/6000.7/script-reference/unity/smartstrings/core/extensions/iselectorinfo.md) argument of [ISource.TryEvaluateSelector](/engine/6000.7/script-reference/unity/smartstrings/core/extensions/isource/tryevaluateselector.md). Cast that argument to [IFormattingExtensionsToggle](/engine/6000.7/script-reference/unity/smartstrings/core/extensions/iformattingextensionstoggle.md) and set [IFormattingExtensionsToggle.DisableFormattingExtensions](/engine/6000.7/script-reference/unity/smartstrings/core/extensions/iformattingextensionstoggle/disableformattingextensions.md) to `true` when default formatting can't reasonably handle the value the source found. The source can then write the output itself with [IFormattingInfo.Write](/engine/6000.7/script-reference/unity/smartstrings/core/extensions/iformattinginfo/write.md), or write nothing.

Additional Resources: [ISource](/engine/6000.7/script-reference/unity/smartstrings/core/extensions/isource.md), [FormattingInfo](/engine/6000.7/script-reference/unity/smartstrings/core/formatting/formattinginfo.md)

## Examples

```csharp
using Unity.SmartStrings.Core.Extensions;

// Resolves {Password} to the real value, but writes a mask instead of formatting it.
public class MaskedSource : ISource
{
    public bool TryEvaluateSelector(ISelectorInfo selectorInfo)
    {
        if (selectorInfo.SelectorText != "Password")
            return false;

        if (selectorInfo is IFormattingExtensionsToggle toggle)
            toggle.DisableFormattingExtensions = true;

        if (selectorInfo is IFormattingInfo formattingInfo)
            formattingInfo.Write("********");

        selectorInfo.Result = selectorInfo.CurrentValue;
        return true;
    }
}
```

## Properties

| Property                                                                                                                                                     | Description                                                                        |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------- |
| [DisableFormattingExtensions](/engine/6000.7/script-reference/unity/smartstrings/core/extensions/iformattingextensionstoggle/disableformattingextensions.md) | Gets or sets whether formatter extensions are skipped for the current placeholder. |
