private void SaveTransportRule(TransportRule instance) { bool flag = MessagingPoliciesSyncLogDataSession.IsNameNewOrChangedForTenantScopedObject(instance); Guid empty = Guid.Empty; bool flag2 = false; if (instance.OrganizationId != OrganizationId.ForestWideOrgId && instance.IsChanged(TransportRuleSchema.Xml)) { flag2 = true; if (!instance.Guid.Equals(Guid.Empty)) { TransportRule transportRuleByGuid = DlpUtils.GetTransportRuleByGuid(this.dataSession, this.rulesCollectionName, instance.Guid); TransportRule transportRule = (TransportRule)TransportRuleParser.Instance.GetRule(transportRuleByGuid.Xml); transportRule.TryGetDlpPolicyId(out empty); } } this.dataSession.Save(instance); if (flag || flag2) { TransportRule transportRuleByName = DlpUtils.GetTransportRuleByName(this.dataSession, this.rulesCollectionName, instance.Name); Guid empty2 = Guid.Empty; List <KeyValuePair <string, object> > list = null; if (transportRuleByName != null) { TransportRule transportRule2 = (TransportRule)TransportRuleParser.Instance.GetRule(transportRuleByName.Xml); transportRule2.TryGetDlpPolicyId(out empty2); if (!empty2.Equals(empty)) { flag = true; list = new List <KeyValuePair <string, object> >(); list.Add(new KeyValuePair <string, object>("DLPPolicyId", empty2)); } } Guid value; if (flag && this.GetExternalDirectoryOrganizationIdToLog(transportRuleByName, out value)) { TenantSettingSyncLogGenerator.Instance.LogChangesForSave(transportRuleByName, new Guid?(value), new Guid?(transportRuleByName.ImmutableId), list); } } }