// Token: 0x06007863 RID: 30819 RVA: 0x00224D80 File Offset: 0x00222F80
        private static void UpdateMetaData(XmlToken token, StickyNoteControl snc, SNCAnnotation sncAnnotation)
        {
            AnnotationResource annotationResource;
            XmlElement         xmlElement;
            bool flag;
            bool flag2;

            SNCAnnotation.GetCargoAndRoot(sncAnnotation, XmlToken.MetaData, out annotationResource, out xmlElement, out flag, out flag2);
            if ((token & XmlToken.IsExpanded) != (XmlToken)0)
            {
                bool isExpanded = snc.IsExpanded;
                sncAnnotation.UpdateAttribute(xmlElement, XmlToken.IsExpanded, isExpanded.ToString(CultureInfo.InvariantCulture));
            }
            if ((token & XmlToken.Height) != (XmlToken)0)
            {
                double num = (double)snc.GetValue(FrameworkElement.HeightProperty);
                sncAnnotation.UpdateAttribute(xmlElement, XmlToken.Height, num.ToString(CultureInfo.InvariantCulture));
            }
            if ((token & XmlToken.Width) != (XmlToken)0)
            {
                double num2 = (double)snc.GetValue(FrameworkElement.WidthProperty);
                sncAnnotation.UpdateAttribute(xmlElement, XmlToken.Width, num2.ToString(CultureInfo.InvariantCulture));
            }
            if ((token & XmlToken.Left) != (XmlToken)0)
            {
                double num3 = snc.PositionTransform.X;
                if (snc.FlipBothOrigins)
                {
                    num3 = -(num3 + snc.Width);
                }
                sncAnnotation.UpdateAttribute(xmlElement, XmlToken.Left, num3.ToString(CultureInfo.InvariantCulture));
            }
            if ((token & XmlToken.Top) != (XmlToken)0)
            {
                sncAnnotation.UpdateAttribute(xmlElement, XmlToken.Top, snc.PositionTransform.Y.ToString(CultureInfo.InvariantCulture));
            }
            if ((token & XmlToken.XOffset) != (XmlToken)0)
            {
                sncAnnotation.UpdateAttribute(xmlElement, XmlToken.XOffset, snc.XOffset.ToString(CultureInfo.InvariantCulture));
            }
            if ((token & XmlToken.YOffset) != (XmlToken)0)
            {
                sncAnnotation.UpdateAttribute(xmlElement, XmlToken.YOffset, snc.YOffset.ToString(CultureInfo.InvariantCulture));
            }
            if ((token & XmlToken.ZOrder) != (XmlToken)0)
            {
                sncAnnotation.UpdateAttribute(xmlElement, XmlToken.ZOrder, ((IAnnotationComponent)snc).ZOrder.ToString(CultureInfo.InvariantCulture));
            }
            if (flag2)
            {
                annotationResource.Contents.Add(xmlElement);
            }
            if (flag)
            {
                sncAnnotation._annotation.Cargos.Add(annotationResource);
            }
        }
        // Token: 0x06007862 RID: 30818 RVA: 0x00224C48 File Offset: 0x00222E48
        private void UpdateContent(StickyNoteControl snc, bool updateAnnotation, XmlToken token)
        {
            Invariant.Assert(snc != null, "Sticky Note Control is null.");
            Invariant.Assert((token & (XmlToken.Text | XmlToken.Ink)) > (XmlToken)0, "No token specified.");
            StickyNoteContentControl content = snc.Content;

            if (content == null)
            {
                return;
            }
            if ((token == XmlToken.Ink && content.Type != StickyNoteType.Ink) || (token == XmlToken.Text && content.Type != StickyNoteType.Text))
            {
                return;
            }
            XmlElement xmlElement = null;

            if (updateAnnotation)
            {
                AnnotationResource annotationResource = null;
                bool flag  = false;
                bool flag2 = false;
                if (!content.IsEmpty)
                {
                    SNCAnnotation.GetCargoAndRoot(this, token, out annotationResource, out xmlElement, out flag2, out flag);
                    content.Save(xmlElement);
                }
                else
                {
                    string cargoName = SNCAnnotation.GetCargoName(token);
                    annotationResource = this.FindCargo(cargoName);
                    if (annotationResource != null)
                    {
                        this._annotation.Cargos.Remove(annotationResource);
                        this._cachedXmlElements.Remove(token);
                    }
                }
                if (flag)
                {
                    Invariant.Assert(xmlElement != null, "XmlElement should have been created.");
                    Invariant.Assert(annotationResource != null, "Cargo should have been retrieved.");
                    annotationResource.Contents.Add(xmlElement);
                }
                if (flag2)
                {
                    Invariant.Assert(annotationResource != null, "Cargo should have been created.");
                    this._annotation.Cargos.Add(annotationResource);
                    return;
                }
            }
            else
            {
                XmlElement xmlElement2 = (XmlElement)this.FindData(token);
                if (xmlElement2 != null)
                {
                    content.Load(xmlElement2);
                    return;
                }
                if (!content.IsEmpty)
                {
                    content.Clear();
                }
            }
        }