コード例 #1
0
        public override bool ApplyChanges()
        {
            EnsureChildControls();
            RollUpCalendar webpart = WebPartToEdit as RollUpCalendar;

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

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

            return(true);
        }
コード例 #2
0
        public override void SyncChanges()
        {
            EnsureChildControls();
            RollUpCalendar webpart = WebPartToEdit as RollUpCalendar;

            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;

                webpart.ResetCamlPreprocessor();
                webpart.InitializeEngine();
            }
        }