public override void SyncChanges()
        {
            EnsureChildControls();
            RollUpChart webpart = WebPartToEdit as RollUpChart;

            if (webpart != null)
            {
                _topSite.Text               = webpart.TopSite;
                _lists.Text                 = webpart.Lists;
                _fields.Text                = webpart.Fields;
                _camlQuery.Text             = webpart.CamlQuery;
                _sortFields.Text            = webpart.SortByFields;
                _xsl.Text                   = webpart.Xsl;
                _maxResults.Text            = webpart.MaxRecords.ToString();
                _camlQueryRecursive.Checked = webpart.CamlQueryRecursive;
                _includeListData.Checked    = webpart.IncludeListData;
                _dateTimeISO.Checked        = webpart.DateTimeISO;
                _fixLookUp.Checked          = webpart.FixLookUp;
                _debugResults.Checked       = webpart.DebugResults;
                _debugResultsXML.Checked    = webpart.DebugResultsXML;
                _debugQuery.Checked         = webpart.DebugQuery;
                _debugEvaluator.Checked     = webpart.DebugEvaluator;
                _showExtendedErrors.Checked = webpart.ShowExtendedErrors;
                _width.Text                 = webpart.GraphWidth;
                _height.Text                = webpart.GraphHeight;
                _chartType.SelectedValue    = webpart.GraphType;

                webpart.ResetCamlPreprocessor();
                webpart.InitializeEngine();
            }
        }
        public override bool ApplyChanges()
        {
            EnsureChildControls();
            RollUpChart webpart = WebPartToEdit as RollUpChart;

            if (webpart != null)
            {
                webpart.ClearControlState();
                webpart.TopSite            = _topSite.Text;
                webpart.Lists              = _lists.Text;
                webpart.Fields             = _fields.Text;
                webpart.CamlQuery          = _camlQuery.Text;
                webpart.SortByFields       = _sortFields.Text;
                webpart.Xsl                = _xsl.Text;
                webpart.CamlQueryRecursive = _camlQueryRecursive.Checked;
                webpart.IncludeListData    = _includeListData.Checked;
                webpart.DebugResults       = _debugResults.Checked;
                webpart.DateTimeISO        = _dateTimeISO.Checked;
                webpart.FixLookUp          = _fixLookUp.Checked;
                webpart.DebugResultsXML    = _debugResultsXML.Checked;
                webpart.DebugQuery         = _debugQuery.Checked;
                webpart.DebugEvaluator     = _debugEvaluator.Checked;
                webpart.ShowExtendedErrors = _showExtendedErrors.Checked;
                webpart.GraphWidth         = _width.Text;
                webpart.GraphHeight        = _height.Text;
                webpart.GraphType          = _chartType.SelectedValue;

                int maxRecords;
                if (int.TryParse(_maxResults.Text, out maxRecords))
                {
                    webpart.MaxRecords = maxRecords;
                }
                webpart.ClearCache();
            }

            return(true);
        }