protected void OKButton_Click(object sender, EventArgs e) { try { if (!String.IsNullOrEmpty(IndexSelector.SelectedValue)) { SessionManager.Instance.ClearAll(); IIndexResolver resolver = ResolverFactory.GetIndexResolver(IndexType); SessionManager.Instance.CurrentIndex = resolver.GetIndex(IndexSelector.SelectedValue); Response.Write("<script language='javascript'>window.top.dialogClose();</script>"); } else { Response.Write(String.Format("<script language='javascript'>window.alert({0});</script>", Translate.Text("'The index is not selected. Please select an index.'"))); } } catch (Exception ex) { ErrorResolver.ResolveError(ex, this); } }
protected void CancelButton_Click(object sender, EventArgs e) { try { Response.Write("<script language='javascript'>window.top.dialogClose();</script>"); } catch (Exception ex) { ErrorResolver.ResolveError(ex, this); } }
protected void CustomControl_Error(object sender, EventArgs e) { ExceptionEventArgs args = e as ExceptionEventArgs; if (args != null) { ErrorResolver.ResolveError(args.Exception, args.Sender); } else { ErrorResolver.ResolveError(); } }
protected void AjaxScriptManager_OnExecute(object sender, AjaxCommandEventArgs args) { Assert.ArgumentNotNull(sender, "sender"); Assert.ArgumentNotNull(args, "args"); try { switch (args.Name.ToLowerInvariant()) { case "indexviewer:indexrebuilded": break; case "indexviewer:indexoptimized": break; case "indexviewer:indexselected": IndexTabs.ActiveViewIndex = 0; SetViewButtonActive(true); SheerResponse.Eval(String.Format("disableBtn('{0}', false); disableBtn('{1}', false); disableBtn('{2}', false); disableBtn('{3}', false);", OverviewButton.UniqueID, DocumentsButton.UniqueID, LuceneSearchButton.UniqueID, SitecoreSearchButton.UniqueID)); SheerResponse.Eval(String.Format("clickBtn('{0}');", OverviewButton.UniqueID)); break; case "indexviewer:closed": IndexTabs.ActiveViewIndex = 0; SheerResponse.Eval(String.Format("clickBtn('{0}');", OverviewButton.UniqueID)); SetViewButtonActive(false); break; case "indexviewer:exitindexviewer": SessionManager.Instance.ClearAll(); Sitecore.Shell.Framework.Windows.Close(); break; } } catch (Exception ex) { ErrorResolver.ResolveError(ex, this); } }
protected void IndexTypeSelector_SelectedIndexChanged(object sender, EventArgs e) { try { SessionManager.Instance.ClearAll(); OKButton.Enabled = false; if (!String.IsNullOrEmpty(IndexTypeSelector.SelectedValue)) { InitilizeIndexSelector(); } } catch (Exception ex) { ErrorResolver.ResolveError(ex, this); } }
//---------------------------------------------------------------------------------- /// <summary> /// Handles the Load event of the Page control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> /// <remark>Created 02/01/2009 11:30 by jm</remark> //---------------------------------------------------------------------------------- protected void Page_Load(object sender, EventArgs e) { try { CheckUser(); if (!Page.IsPostBack) { SessionManager.Instance.ClearAll(); SetViewButtonActive(false); IndexTabs.ActiveViewIndex = 0; } } catch (Exception ex) { ErrorResolver.ResolveError(ex, this); } }
protected void SitecoreSearchButton_Click(object sender, EventArgs e) { try { if (SessionManager.Instance.CurrentIndex != null) { ShowSitecoreSearch(); } else { IndexTabs.ActiveViewIndex = 0; SetViewButtonActive(false); } } catch (Exception ex) { ErrorResolver.ResolveError(ex, this); } }
protected void IndexSelector_SelectedIndexChanged(object sender, EventArgs e) { try { SessionManager.Instance.ClearAll(); if (!String.IsNullOrEmpty(IndexSelector.SelectedValue)) { IIndexResolver resolver = ResolverFactory.GetIndexResolver(IndexType); SessionManager.Instance.CurrentIndex = resolver.GetIndex(IndexSelector.SelectedValue); OKButton.Enabled = true; } else { OKButton.Enabled = false; } } catch (Exception ex) { ErrorResolver.ResolveError(ex, this); } }
protected void Page_Error(object sender, EventArgs e) { Exception ex = Server.GetLastError(); ErrorResolver.ResolveError(ex, this); }