public void protectSheet(String password, boolean shouldProtectObjects,boolean shouldProtectScenarios) {if (password == null) {_passwordRecord = null;_protectRecord = null;_objectProtectRecord = null;_scenarioProtectRecord = null;return;}ProtectRecord prec = getProtect();PasswordRecord pass = getPassword();prec.setProtect(true);pass.setPassword((short)CryptoFunctions.createXorVerifier1(password));if (_objectProtectRecord == null && shouldProtectObjects) {ObjectProtectRecord rec = createObjectProtect();rec.setProtect(true);_objectProtectRecord = rec;}if (_scenarioProtectRecord == null && shouldProtectScenarios) {ScenarioProtectRecord srec = createScenarioProtect();srec.setProtect(true);_scenarioProtectRecord = srec;}}
public void ProtectSheet(String password, bool shouldProtectObjects,bool shouldProtectScenarios){if (password == null){_passwordRecord = null;_protectRecord = null;_objectProtectRecord = null;_scenarioProtectRecord = null;return;}ProtectRecord prec = this.Protect;PasswordRecord pass = this.Password;prec.Protect = true;pass.Password = (PasswordRecord.HashPassword(password));if (_objectProtectRecord == null && shouldProtectObjects){ObjectProtectRecord rec = CreateObjectProtect();rec.Protect = (true);_objectProtectRecord = rec;}if (_scenarioProtectRecord == null && shouldProtectScenarios){ScenarioProtectRecord srec = CreateScenarioProtect();srec.Protect = (true);_scenarioProtectRecord = srec;}}