Exemplo n.º 1
0
        protected override void SaveCustomPersonalizationState(PersonalizationDictionary state)
        {
            object[] parts = new object[6 * base.WebParts.Count];
            int      count = 0;

            foreach (WebPart webPart in base.WebParts)
            {
                parts[count++] = webPart.ID;
                parts[count++] = webPart.Title;
                parts[count++] = SerializationServices.ShortAssemblyQualifiedName(webPart.GetType().AssemblyQualifiedName);
                if (null != webPart.Zone)
                {
                    parts[count++] = webPart.Zone.ID;
                }
                else
                {
                    parts[count++] = null;
                }
                parts[count++] = (webPart is IContainerWebPart);
                parts[count++] = (webPart is IProxyWebPart);
            }
            if (!state.Contains("lwas.info"))
            {
                state.Add("lwas.info", new PersonalizationEntry(parts, base.Personalization.Scope));
            }
            else
            {
                state["lwas.info"] = new PersonalizationEntry(parts, base.Personalization.Scope);
            }
            base.SaveCustomPersonalizationState(state);
        }
Exemplo n.º 2
0
 public override void ExportWebPart(WebPart webPart, XmlWriter writer)
 {
     if (webPart is IConfigurableWebPart)
     {
         writer.WriteStartElement("webPart");
         writer.WriteAttributeString("type", SerializationServices.ShortAssemblyQualifiedName(webPart.GetType().AssemblyQualifiedName));
         IConfiguration config = (webPart as IConfigurableWebPart).Configuration;
         SerializationServices.Serialize(config, writer);
         writer.WriteEndElement();
     }
     else
     {
         base.ExportWebPart(webPart, writer);
     }
 }