Event data for saving docking page configuration.
Inheritance: DockGlobalSavingEventArgs
示例#1
0
        /// <summary>
        /// Saves docking configuration information using a provider xml writer.
        /// </summary>
        /// <param name="xmlWriter">Xml writer object.</param>
        public override void SaveElementToXml(XmlWriter xmlWriter)
        {
            KryptonDockingManager manager = DockingManager;

            // Output docking manager element
            xmlWriter.WriteStartElement(XmlElementName);
            xmlWriter.WriteAttributeString("N", Name);
            xmlWriter.WriteAttributeString("C", AutoHiddenGroupControl.Pages.Count.ToString());

            // Output an element per page
            foreach (KryptonPage page in AutoHiddenGroupControl.Pages)
            {
                // Are we allowed to save the page?
                if (page.AreFlagsSet(KryptonPageFlags.AllowConfigSave))
                {
                    xmlWriter.WriteStartElement("KP");
                    xmlWriter.WriteAttributeString("UN", page.UniqueName);
                    xmlWriter.WriteAttributeString("V", CommonHelper.BoolToString(page.LastVisibleSet));
                    xmlWriter.WriteAttributeString("S", CommonHelper.BoolToString(page is KryptonStorePage));

                    // Give event handlers a chance to save custom data with the page
                    xmlWriter.WriteStartElement("CPD");
                    DockPageSavingEventArgs args = new DockPageSavingEventArgs(manager, xmlWriter, page);
                    manager?.RaisePageSaving(args);
                    xmlWriter.WriteEndElement();

                    xmlWriter.WriteFullEndElement();
                }
            }

            // Terminate the workspace element
            xmlWriter.WriteFullEndElement();
        }
示例#2
0
        private void OnSpaceControlPageSaving(object sender, PageSavingEventArgs e)
        {
            KryptonDockingManager dockingManager = DockingManager;

            if (dockingManager != null)
            {
                DockPageSavingEventArgs args = new DockPageSavingEventArgs(dockingManager, e.XmlWriter, e.Page);
                dockingManager.RaisePageSaving(args);
            }
        }
示例#3
0
        /// <summary>
        /// Saves docking configuration information using a provider xml writer.
        /// </summary>
        /// <param name="xmlWriter">Xml writer object.</param>
        public override void SaveElementToXml(XmlWriter xmlWriter)
        {
            // Output navigator docking element
            xmlWriter.WriteStartElement(XmlElementName);
            xmlWriter.WriteAttributeString(@"N", Name);
            xmlWriter.WriteAttributeString(@"C", DockableNavigatorControl.Pages.Count.ToString());

            // Persist each child page in turn
            KryptonDockingManager dockingManager = DockingManager;

            foreach (KryptonPage page in DockableNavigatorControl.Pages)
            {
                // Are we allowed to save the page?
                if (page.AreFlagsSet(KryptonPageFlags.AllowConfigSave))
                {
                    xmlWriter.WriteStartElement("KP");
                    CommonHelper.TextToXmlAttribute(xmlWriter, @"UN", page.UniqueName);
                    CommonHelper.TextToXmlAttribute(xmlWriter, @"S", CommonHelper.BoolToString(page is KryptonStorePage));
                    CommonHelper.TextToXmlAttribute(xmlWriter, @"V", CommonHelper.BoolToString(page.LastVisibleSet), @"True");

                    // Give event handlers a chance to save custom data with the page
                    xmlWriter.WriteStartElement(@"CPD");
                    DockPageSavingEventArgs args = new DockPageSavingEventArgs(dockingManager, xmlWriter, page);
                    dockingManager.RaisePageSaving(args);
                    xmlWriter.WriteEndElement();

                    // Terminate the page element
                    xmlWriter.WriteEndElement();
                }
            }

            // Output an xml for the contained workspace

            // Terminate the workspace element
            xmlWriter.WriteFullEndElement();
        }
示例#4
0
 private void kryptonDockingManager_PageSaving(object sender, DockPageSavingEventArgs e)
 {
     // Example code showing how to save extra data into the page config
     e.XmlWriter.WriteStartElement("CustomPageData");
     e.XmlWriter.WriteAttributeString("SavedMilliseconds", DateTime.Now.Millisecond.ToString());
     e.XmlWriter.WriteEndElement();
 }
示例#5
0
 private void OnSpaceControlPageSaving(object sender, PageSavingEventArgs e)
 {
     KryptonDockingManager dockingManager = DockingManager;
     if (dockingManager != null)
     {
         DockPageSavingEventArgs args = new DockPageSavingEventArgs(dockingManager, e.XmlWriter, e.Page);
         dockingManager.RaisePageSaving(args);
     }
 }
        /// <summary>
        /// Saves docking configuration information using a provider xml writer.
        /// </summary>
        /// <param name="xmlWriter">Xml writer object.</param>
        public override void SaveElementToXml(XmlWriter xmlWriter)
        {
            KryptonDockingManager manager = DockingManager;

            // Output docking manager element
            xmlWriter.WriteStartElement(XmlElementName);
            xmlWriter.WriteAttributeString("N", Name);
            xmlWriter.WriteAttributeString("C", AutoHiddenGroupControl.Pages.Count.ToString());

            // Output an element per page
            foreach (KryptonPage page in AutoHiddenGroupControl.Pages)
            {
                // Are we allowed to save the page?
                if (page.AreFlagsSet(KryptonPageFlags.AllowConfigSave))
                {
                    xmlWriter.WriteStartElement("KP");
                    xmlWriter.WriteAttributeString("UN", page.UniqueName);
                    xmlWriter.WriteAttributeString("V", CommonHelper.BoolToString(page.LastVisibleSet));
                    xmlWriter.WriteAttributeString("S", CommonHelper.BoolToString(page is KryptonStorePage));

                    // Give event handlers a chance to save custom data with the page
                    xmlWriter.WriteStartElement("CPD");
                    DockPageSavingEventArgs args = new DockPageSavingEventArgs(manager, xmlWriter, page);
                    manager.RaisePageSaving(args);
                    xmlWriter.WriteEndElement();

                    xmlWriter.WriteFullEndElement();
                }
            }

            // Terminate the workspace element
            xmlWriter.WriteFullEndElement();
        }
示例#7
0
 /// <summary>
 /// Raises the PageSaving event.
 /// </summary>
 /// <param name="e">An DockPageSavingEventArgs containing event data.</param>
 protected virtual void OnPageSaving(DockPageSavingEventArgs e)
 {
     if (PageSaving != null)
         PageSaving(this, e);
 }
示例#8
0
 internal void RaisePageSaving(DockPageSavingEventArgs e)
 {
     OnPageSaving(e);
 }