// Token: 0x06000FBE RID: 4030 RVA: 0x000598F0 File Offset: 0x00057AF0
        protected int GetPreviewLength()
        {
            int result = 0;
            List <BodyPreference> list = base.Options["BodyPreference"] as List <BodyPreference>;

            AirSyncDiagnostics.Assert(list != null);
            int i = 0;

            while (i < list.Count)
            {
                if (list[i].Type == base.BodyType)
                {
                    if (list[i].Preview == 0)
                    {
                        return(0);
                    }
                    result = list[i].Preview;
                    break;
                }
                else
                {
                    i++;
                }
            }
            if (base.Truncated && (base.Data == null || base.Data.Length == 0L))
            {
                return(result);
            }
            if (base.BodyType == BodyType.PlainText)
            {
                return(0);
            }
            return(result);
        }
Esempio n. 2
0
 public void BindToParent(XmlNode xmlParentNode)
 {
     if (xmlParentNode == null)
     {
         throw new ArgumentNullException("xmlParentNode");
     }
     base.State         = PropertyState.Uninitialized;
     this.xmlParentNode = xmlParentNode;
     this.xmlNode       = null;
     AirSyncDiagnostics.Assert(PropertyState.Uninitialized == base.State);
 }
Esempio n. 3
0
        protected void ProcessImageTag(HtmlTagContextAttribute filterAttribute, HtmlTagContext context, HtmlWriter writer)
        {
            AirSyncDiagnostics.Assert(context != null);
            string         value          = filterAttribute.Value;
            AttachmentLink attachmentLink = this.IsInlineReference(value);

            if (attachmentLink != null)
            {
                this.OutputInlineReference(filterAttribute, attachmentLink, writer);
                return;
            }
            if (SafeHtmlCallback.IsSafeUrl(filterAttribute.Value, filterAttribute.Id))
            {
                filterAttribute.Write();
            }
        }
Esempio n. 4
0
        // Token: 0x06001392 RID: 5010 RVA: 0x000709F0 File Offset: 0x0006EBF0
        public AttachmentPolicy.Level GetLevel(string attachmentType, AttachmentPolicy.TypeSignifier typeSignifier)
        {
            AirSyncDiagnostics.Assert(attachmentType != null);
            AttachmentPolicy.Level result = AttachmentPolicy.Level.Unknown;
            switch (typeSignifier)
            {
            case AttachmentPolicy.TypeSignifier.File:
                result = AttachmentPolicy.FindLevel(this.fileTypeLevels, attachmentType);
                break;

            case AttachmentPolicy.TypeSignifier.Mime:
                result = AttachmentPolicy.FindLevel(this.mimeTypeLevels, attachmentType);
                break;
            }
            return(result);
        }
Esempio n. 5
0
        // Token: 0x06000FB8 RID: 4024 RVA: 0x00059758 File Offset: 0x00057958
        protected bool IsAcceptable(BodyType type, out long truncationSize, out bool allOrNone)
        {
            allOrNone      = false;
            truncationSize = -1L;
            List <BodyPreference> list = base.Options["BodyPreference"] as List <BodyPreference>;

            AirSyncDiagnostics.Assert(list != null);
            for (int i = 0; i < list.Count; i++)
            {
                if (list[i].Type == type)
                {
                    allOrNone      = list[i].AllOrNone;
                    truncationSize = list[i].TruncationSize;
                    return(true);
                }
            }
            return(false);
        }