RegistrationAttribute.RegistrationContext.EscapePath Method

Reformats a string as needed by the registration tool.

Namespace:  Microsoft.VisualStudio.Shell
Assembly:  Microsoft.VisualStudio.Shell.Immutable.10.0 (in Microsoft.VisualStudio.Shell.Immutable.10.0.dll)

Syntax

'Declaration
Public MustOverride Function EscapePath ( _
    str As String _
) As String
public abstract string EscapePath(
    string str
)
public:
virtual String^ EscapePath(
    String^ str
) abstract
abstract EscapePath : 
        str:string -> string 
public abstract function EscapePath(
    str : String
) : String

Parameters

Return Value

Type: System.String
The reformatted path string.

Remarks

Many registration programs require strings to be in a special format in order to work. For instance, the files used by regedit.exe (.reg / .vbr) use back slash characters ("\") to indicate special characters using character escapes. In order for regedit.exe to interpret a file path correctly, each back slash must be repeated to form the correct character escape ("\\"). For more information on character escapes, see Character Escapes. In CreatePkgDef, EscapePath formats a string containing a file path by replacing single back slash characters ("\") with double back slash characters ("\\"). However, other classes that implement EscapePath can perform whatever string conversion is required.

.NET Framework Security

See Also

Reference

RegistrationAttribute.RegistrationContext Class

Microsoft.VisualStudio.Shell Namespace

RegistrationAttribute.RegistrationContext

Other Resources

Character Escapes