Beispiel #1
0
        private RmsTemplateIdentity ResolveTemplate()
        {
            string name = (this.ApplyRightsProtectionTemplate != null) ? this.ApplyRightsProtectionTemplate.ToString() : string.Empty;
            RmsTemplatePresentation rmsTemplatePresentation = (RmsTemplatePresentation)base.GetDataObject <RmsTemplatePresentation>(this.ApplyRightsProtectionTemplate, this.rmsTemplateDataProvider, null, new LocalizedString?(Strings.OutlookProtectionRuleRmsTemplateNotFound(name)), new LocalizedString?(Strings.OutlookProtectionRuleRmsTemplateNotUnique(name)));

            return((RmsTemplateIdentity)rmsTemplatePresentation.Identity);
        }
        // Token: 0x06000B72 RID: 2930 RVA: 0x000245D0 File Offset: 0x000227D0
        public RmsTemplateIdParameter(RmsTemplatePresentation template)
        {
            if (template == null)
            {
                throw new ArgumentNullException("template");
            }
            RmsTemplateIdentity rmsTemplateIdentity = (RmsTemplateIdentity)template.Identity;

            this.rawIdentity  = rmsTemplateIdentity.ToString();
            this.templateId   = rmsTemplateIdentity.TemplateId;
            this.templateName = template.Name;
        }
        private RmsTemplateIdentity ResolveTemplate(ADObject dataObject)
        {
            string name = (this.ApplyRightsProtectionTemplate != null) ? this.ApplyRightsProtectionTemplate.ToString() : string.Empty;

            if (TaskHelper.ShouldUnderscopeDataSessionToOrganization((IDirectorySession)base.DataSession, dataObject))
            {
                base.UnderscopeDataSession(dataObject.OrganizationId);
            }
            RmsTemplateDataProvider session = new RmsTemplateDataProvider((IConfigurationSession)base.DataSession, RmsTemplateType.Distributed, true);
            RmsTemplatePresentation rmsTemplatePresentation = (RmsTemplatePresentation)base.GetDataObject <RmsTemplatePresentation>(this.ApplyRightsProtectionTemplate, session, null, new LocalizedString?(Strings.OutlookProtectionRuleRmsTemplateNotFound(name)), new LocalizedString?(Strings.OutlookProtectionRuleRmsTemplateNotUnique(name)));

            return((RmsTemplateIdentity)rmsTemplatePresentation.Identity);
        }
        public void Save(IConfigurable instance)
        {
            if (this.orgId == OrganizationId.ForestWideOrgId)
            {
                throw new NotSupportedException();
            }
            RmsTemplatePresentation rmsTemplatePresentation = instance as RmsTemplatePresentation;

            if (rmsTemplatePresentation == null)
            {
                throw new ArgumentException("passed in instance not of type RmsTemplatePresentation", "instance");
            }
            Guid templateGuid = rmsTemplatePresentation.TemplateGuid;
            RMSTrustedPublishingDomain rmstrustedPublishingDomain = this.FindDefaultTPD();

            if (rmstrustedPublishingDomain == null)
            {
                return;
            }
            if (!MultiValuedPropertyBase.IsNullOrEmpty(rmstrustedPublishingDomain.RMSTemplates))
            {
                string text  = null;
                string text2 = null;
                foreach (string text3 in rmstrustedPublishingDomain.RMSTemplates)
                {
                    RmsTemplateType rmsTemplateType;
                    string          text4 = RMUtil.DecompressTemplate(text3, out rmsTemplateType);
                    Guid            templateGuidFromLicense = DrmClientUtils.GetTemplateGuidFromLicense(text4);
                    if (templateGuidFromLicense == templateGuid && rmsTemplateType != rmsTemplatePresentation.Type)
                    {
                        text  = text3;
                        text2 = RMUtil.CompressTemplate(text4, rmsTemplatePresentation.Type);
                        break;
                    }
                }
                if (!string.IsNullOrEmpty(text) && !string.IsNullOrEmpty(text2))
                {
                    rmstrustedPublishingDomain.RMSTemplates.Remove(text);
                    rmstrustedPublishingDomain.RMSTemplates.Add(text2);
                    this.adSession.Save(rmstrustedPublishingDomain);
                }
            }
        }
Beispiel #5
0
 public RmsTemplate(RmsTemplatePresentation taskRMSTemplate) : base(taskRMSTemplate.Name, taskRMSTemplate.Identity.ToString())
 {
 }