public override bool ApplyChanges()
        {
            EnsureChildControls();
            try
            {
                SPSWebPart webpart = WebPartToEdit as SPSWebPart;

                if (webpart != null)
                {
                    webpart.EnableCache = chkEnableCache.Checked;

                    int converted;
                    if (int.TryParse(txtCacheTimeInSeconds.Text, out converted))
                    {
                        webpart.CacheTimeInSeconds = converted;
                    }

                    webpart.ClearControlState();
                    webpart.ClearCache();
                    return(true);
                }
            }
            catch (Exception ex)
            {
                _errorMessage += ex.ToString();
            }

            return(false);
        }
        public override void SyncChanges()
        {
            EnsureChildControls();
            SPSWebPart webpart = WebPartToEdit as SPSWebPart;

            if (webpart != null)
            {
                chkEnableCache.Checked     = webpart.EnableCache;
                txtCacheTimeInSeconds.Text = webpart.CacheTimeInSeconds.ToString();
            }
        }