System.IO.FileSystemWatcher.RunningInstance.WatchedDirectory.AppendSeparatorIfNeeded C# (CSharp) Méthode

AppendSeparatorIfNeeded() private static méthode

Adds a directory path separator to the end of the builder if one isn't there.
private static AppendSeparatorIfNeeded ( StringBuilder builder ) : void
builder System.Text.StringBuilder The builder.
Résultat void
                private static void AppendSeparatorIfNeeded(StringBuilder builder)
                {
                    if (builder.Length > 0)
                    {
                        char c = builder[builder.Length - 1];
                        if (c != System.IO.Path.DirectorySeparatorChar && c != System.IO.Path.AltDirectorySeparatorChar)
                        {
                            builder.Append(System.IO.Path.DirectorySeparatorChar);
                        }
                    }
                }
            }
FileSystemWatcher.RunningInstance.WatchedDirectory