// Token: 0x06000803 RID: 2051 RVA: 0x0001A5D8 File Offset: 0x000187D8
        internal AttachmentPolicyType CreateAttachmentPolicyType(UserContext userContext, UserAgent userAgent, WacConfigData wacData)
        {
            AttachmentPolicyType attachmentPolicyType = new AttachmentPolicyType();

            attachmentPolicyType.DirectFileAccessOnPublicComputersEnabled  = this.directFileAccessOnPublicComputersEnabled;
            attachmentPolicyType.DirectFileAccessOnPrivateComputersEnabled = this.directFileAccessOnPrivateComputersEnabled;
            attachmentPolicyType.AllowedFileTypes   = this.allowedFileTypes;
            attachmentPolicyType.AllowedMimeTypes   = this.allowedMimeTypes;
            attachmentPolicyType.BlockedFileTypes   = this.blockedFileTypes;
            attachmentPolicyType.BlockedMimeTypes   = this.blockedMimeTypes;
            attachmentPolicyType.ForceSaveFileTypes = this.forceSaveFileTypes;
            attachmentPolicyType.ForceSaveMimeTypes = this.forceSaveMimeTypes;
            attachmentPolicyType.ActionForUnknownFileAndMIMETypes = this.treatUnknownTypeAs.ToString();
            if (userAgent != null && (string.Equals(userAgent.Platform, "iPhone", StringComparison.OrdinalIgnoreCase) || string.Equals(userAgent.Platform, "iPad", StringComparison.OrdinalIgnoreCase)))
            {
                string[] collection = new string[]
                {
                    ".dotm",
                    ".ppsm",
                    ".pptm",
                    ".xlsb",
                    ".xlsm",
                    ".wma"
                };
                List <string> list = new List <string>();
                list.AddRange(this.blockedFileTypes);
                list.AddRange(collection);
                attachmentPolicyType.BlockedFileTypes = list.ToArray();
            }
            attachmentPolicyType.AttachmentDataProviderAvailable = AttachmentPolicy.IsAttachmentDataProviderAvailable(wacData);
            userContext.SetWacEditingEnabled(wacData);
            attachmentPolicyType.WacViewableFileTypes = wacData.WacViewableFileTypes;
            attachmentPolicyType.WacEditableFileTypes = (userContext.IsWacEditingEnabled ? wacData.WacEditableFileTypes : new string[0]);
            attachmentPolicyType.WacViewingOnPublicComputersEnabled                  = this.wacViewingOnPublicComputersEnabled;
            attachmentPolicyType.WacViewingOnPrivateComputersEnabled                 = this.wacViewingOnPrivateComputersEnabled;
            attachmentPolicyType.ForceWacViewingFirstOnPublicComputers               = this.forceWacViewingFirstOnPublicComputers;
            attachmentPolicyType.ForceWacViewingFirstOnPrivateComputers              = this.forceWacViewingFirstOnPrivateComputers;
            attachmentPolicyType.ForceWebReadyDocumentViewingFirstOnPublicComputers  = this.forceWebReadyDocumentViewingFirstOnPublicComputers;
            attachmentPolicyType.ForceWebReadyDocumentViewingFirstOnPrivateComputers = this.forceWebReadyDocumentViewingFirstOnPrivateComputers;
            attachmentPolicyType.WebReadyDocumentViewingOnPublicComputersEnabled     = this.webReadyDocumentViewingOnPublicComputersEnabled;
            attachmentPolicyType.WebReadyDocumentViewingOnPrivateComputersEnabled    = this.webReadyDocumentViewingOnPrivateComputersEnabled;
            attachmentPolicyType.WebReadyFileTypes = this.webReadyFileTypes;
            attachmentPolicyType.WebReadyMimeTypes = this.webReadyMimeTypes;
            attachmentPolicyType.WebReadyDocumentViewingSupportedFileTypes   = this.webReadyDocumentViewingSupportedFileTypes;
            attachmentPolicyType.WebReadyDocumentViewingSupportedMimeTypes   = this.webReadyDocumentViewingSupportedMimeTypes;
            attachmentPolicyType.WebReadyDocumentViewingForAllSupportedTypes = this.webReadyDocumentViewingForAllSupportedTypes;
            attachmentPolicyType.DirectFileAccessOnPrivateComputersEnabled   = this.directFileAccessOnPrivateComputersEnabled;
            attachmentPolicyType.DirectFileAccessOnPublicComputersEnabled    = this.directFileAccessOnPublicComputersEnabled;
            return(attachmentPolicyType);
        }
Ejemplo n.º 2
0
        internal void SetWacEditingEnabled(WacConfigData wacData)
        {
            bool flag = AttachmentPolicy.IsAttachmentDataProviderAvailable(wacData);

            this.isWacEditingEnabled = new bool?(wacData.IsWacEditingEnabled && flag);
        }