void UpdatePermissions() { _permissions = 0; if (chkOwnerRead.Checked) { _permissions |= FtpFilePermissions.OwnerRead; } if (chkOwnerWrite.Checked) { _permissions |= FtpFilePermissions.OwnerWrite; } if (chkOwnerExecute.Checked) { _permissions |= FtpFilePermissions.OwnerExecute; } if (chkGroupRead.Checked) { _permissions |= FtpFilePermissions.GroupRead; } if (chkGroupWrite.Checked) { _permissions |= FtpFilePermissions.GroupWrite; } if (chkGroupExecute.Checked) { _permissions |= FtpFilePermissions.GroupExecute; } if (chkPublicRead.Checked) { _permissions |= FtpFilePermissions.PublicRead; } if (chkPublicWrite.Checked) { _permissions |= FtpFilePermissions.PublicWrite; } if (chkPublicExecute.Checked) { _permissions |= FtpFilePermissions.PublicExecute; } }
/// <summary> /// Parses permissions from the given permissions string. /// </summary> /// <param name="data">The permissions string.</param> private static string ToPermissions(FtpFilePermissions data) { return(Convert.ToString((uint)data, 8) + " " + FtpFileInfo.GetPermissionsString(data)); }