Ejemplo n.º 1
0
        public bool FromXml(ref XmlReader xr)
        {
            var results = false;

            try
            {
                while (xr.Read())
                {
                    if (xr.IsStartElement())
                    {
                        if (!xr.IsEmptyElement)
                        {
                            switch (xr.Name)
                            {
                            case "Bvin":
                                xr.Read();
                                Bvin = xr.ReadString();
                                break;

                            case "DisplayName":
                                xr.Read();
                                DisplayName = xr.ReadString();
                                break;

                            case "SystemColumn":
                                xr.Read();
                                SystemColumn = bool.Parse(xr.ReadString());
                                break;

                            case "Blocks":
                                if (xr.ReadToDescendant("ContentBlock"))
                                {
                                    var blocks = new List <ContentBlock>();
                                    do
                                    {
                                        var block = new ContentBlock();
                                        block.FromXml(ref xr);
                                        blocks.Add(block);
                                    } while (xr.ReadToNextSibling("ContentBlock"));

                                    Blocks = blocks;
                                }
                                break;
                            }
                        }
                    }
                }

                results = true;
            }

            catch (XmlException XmlEx)
            {
                EventLog.LogEvent(XmlEx);
                results = false;
            }

            return(results);
        }
Ejemplo n.º 2
0
        public ContentBlock Clone()
        {
            var clone = new ContentBlock();

            clone.StoreId     = StoreId;
            clone.LastUpdated = DateTime.UtcNow;
            clone.ColumnId    = ColumnId;
            clone.SortOrder   = SortOrder;
            clone.ControlName = ControlName;
            foreach (var q in BaseSettings)
            {
                clone.BaseSettings.Add(q.Key, q.Value);
            }
            foreach (var q in TextSettings)
            {
                clone.TextSettings.Add(q.Key, q.Value);
            }
            foreach (var y in Lists.Items)
            {
                clone.Lists.AddItem(y.Clone());
            }
            return(clone);
        }
Ejemplo n.º 3
0
 public bool UpdateBlock(ContentBlock item)
 {
     return(BlockRepository.Update(item));
 }