Пример #1
0
        private void GridForm_Save(GridForm m, SaveLayoutEventArgs e)
        {
            ReportCentral           rc         = (ReportCentral)View.CurrentObject;
            ReportCentralLayoutData layoutData = this.ObjectSpace.CreateObject <ReportCentralLayoutData>();
            bool IsOkay = false;

            if (rc.ReportCentralLayoutData.Count > 0)
            {
                foreach (ReportCentralLayoutData layout in rc.ReportCentralLayoutData)
                {
                    if (layout.Owner.Oid.ToString() == SecuritySystem.CurrentUserId.ToString())
                    {
                        IsOkay            = true;
                        layout.GridLayout = e.LayoutXML;
                    }
                }
            }
            if (!IsOkay)
            {
                layoutData.Owner      = ObjectSpace.GetObjectByKey <Employee>(SecuritySystem.CurrentUserId);
                layoutData.GridLayout = e.LayoutXML;
                rc.ReportCentralLayoutData.Add(layoutData);
            }
            ObjectSpace.CommitChanges();
        }
Пример #2
0
        private void GridForm_SaveDefaultLayout(GridForm m, SaveLayoutEventArgs e)
        {
            ReportCentral           rc         = (ReportCentral)View.CurrentObject;
            ReportCentralLayoutData layoutData = this.ObjectSpace.CreateObject <ReportCentralLayoutData>();

            rc.Save();
            ObjectSpace.CommitChanges();
        }
Пример #3
0
        /// <summary>
        /// This method is executed if the corresponding
        /// Save Workspace Layout command is executed.
        /// </summary>
        private void SaveWorkspaceLayout()
        {
            var s = new SaveLayoutEventArgs();

            SaveLayoutEvent.Instance.Publish(s);

            _currentLayout = s.XmlLayout;
            SaveDockingManagerLayout(_currentLayout);
        }
Пример #4
0
        /// <summary>
        /// This method is executed if the corresponding
        /// Save Workspace Layout command is executed.
        /// </summary>
        private void SaveWorkspaceLayout_Executed()
        {
            string xmlLayout = string.Empty;

            SaveLayoutEventArgs s = new SaveLayoutEventArgs();

            SynchronousEvent <SaveLayoutEventArgs> .Instance.Publish(s);

            this.current_layout = s.XmlLayout;
        }
Пример #5
0
        private void PivotForm_SaveDefaultLayout(PivotFormWin m, SaveLayoutEventArgs e)
        {
            ReportCentral rc = (ReportCentral)View.CurrentObject;

            rc.PivotViewXML = e.LayoutXML;
            MediaDataObject mediaDataObject = ObjectSpace.CreateObject <MediaDataObject>();

            mediaDataObject.MediaData = ConvertBitMapToByteArray(e.ImageData);
            rc.PivotLayout            = mediaDataObject;
            rc.Save();
            ObjectSpace.CommitChanges();
        }
Пример #6
0
        /// <summary>
        /// Is executed when PRISM sends a <seealso cref="SynchronousEvent"/> notification
        /// that was initiallized by a third party (viewmodel).
        /// </summary>
        /// <param name="param">Can be used to return a result of this event</param>
        private void OnSaveLayout(SaveLayoutEventArgs param)
        {
            string xmlLayoutString = string.Empty;

            using (StringWriter fs = new StringWriter())
            {
                XmlLayoutSerializer xmlLayout = new XmlLayoutSerializer(this.dockManager);

                xmlLayout.Serialize(fs);

                xmlLayoutString = fs.ToString();
            }

            param.XmlLayout = xmlLayoutString;
        }
Пример #7
0
        private void OnSaveLayout(SaveLayoutEventArgs param)
        {
            string xmlLayoutString;

            using (var fs = new StringWriter())
            {
                var xmlLayout = new XmlLayoutSerializer(_avalonDockManager);

                xmlLayout.Serialize(fs);

                xmlLayoutString = fs.ToString();
            }

            param.XmlLayout = xmlLayoutString;
        }