コード例 #1
0
        public void saveSelectedControl()
        {
            if (_activeControl != null)
            {
                BaseDocumentCollection col = _manager.View.Documents;

                foreach (BaseDocument document in col)
                {
                    VisualControl vc = (VisualControl)document.Control;
                    if (vc.VisualControlInfo == _activeControl.VisualControlInfo)
                    {
                        vc.SaveChanges();
                        _controlsForSave.Remove(_activeControl);
                        foreach (DevExpress.XtraBars.BarItem item in _saveComponents)
                        {
                            item.Enabled = false;
                        }
                        if (_controlsForSave.Count == 0)
                        {
                            foreach (DevExpress.XtraBars.BarItem item in _saveAllComponents)
                            {
                                item.Enabled = false;
                            }
                        }
                    }
                }
            }
        }
コード例 #2
0
        public void SaveChangedControls()
        {
            BaseDocumentCollection col = _manager.View.Documents;

            foreach (BaseDocument document in col)
            {
                VisualControl vc = (VisualControl)document.Control;
                if (vc != null)
                {
                    if (_controlsForSave.Find(x => x.VisualControlInfo == vc.VisualControlInfo) != null)
                    {
                        vc.SaveChanges();
                    }
                }
            }
            _controlsForSave.Clear();

            foreach (DevExpress.XtraBars.BarItem item in _saveComponents)
            {
                item.Enabled = false;
            }
            foreach (DevExpress.XtraBars.BarItem item in _saveAllComponents)
            {
                item.Enabled = false;
            }
        }