Manos.Tool.ServerCommand.SetServerUser C# (CSharp) Method

SetServerUser() public method

public SetServerUser ( string user ) : void
user string
return void
        public void SetServerUser(string user)
        {
            if (user == null)
                throw new ArgumentNullException ("user");

            PlatformID pid = System.Environment.OSVersion.Platform;
            if (pid != PlatformID.Unix /* && pid != PlatformID.MacOSX */) {
                // TODO: Not sure if this works on OSX yet.

                //
                // Throw an exception here, we don't want to silently fail
                // otherwise people might be unknowingly running as root
                //

                throw new InvalidOperationException ("User can not be set on Windows platforms.");
            }

            AppHost.AddTimeout (TimeSpan.Zero, RepeatBehavior.Single, user, DoSetUser);
        }