Example #1
0
        static TimelineChange extractADDCommandFromXmlNode(XmlElement node)
        {
            try
            {
                TimelineChange ADDchange = new TimelineChange();
                ADDchange.ChangeType = TypeOfChange.ADD;
                ADDchange.ChangedIdeaID = Int32.Parse(node.Attributes["NoteID"].Value, CultureInfo.InvariantCulture);
                string contentType = node.Attributes["ContentType"].Value;
                string contentStr = node.Attributes["Content"].Value;
                if (contentStr.CompareTo("BITMAP") == 0)
                {
                    byte[] contentBytes = Convert.FromBase64String(contentStr);
                    ADDchange.MetaData = Utilities.UtilitiesLib.BytesToBitmap(contentBytes);
                }
                else if (contentStr.CompareTo("STROKE") == 0)
                {
                    //ADDchange.MetaData = PostItObjects.StrokeBasedIdea.ParseContentFromString(contentStr);
                    StrokeData strokeData = new StrokeData();
                    strokeData.ParseStrokePointsFromString(contentStr);
                    if (node.HasAttribute("IsErasing"))
                    {
                        strokeData.ParseIsErasingFromString(node.Attributes["IsErasing"].Value);
                    }
                    if (node.HasAttribute("Color"))
                    {
                        strokeData.StrokeColorCode = node.Attributes["Color"].Value;
                    }
                    ADDchange.MetaData = strokeData;
                }
                else if (contentStr.CompareTo("GROUP") == 0)
                {

                }
                return ADDchange;
            }
            catch (Exception ex)
            {
                Utilities.UtilitiesLib.LogError(ex);
            }
            return null;
        }