public MainPage() { this.InitializeComponent(); Current = this; baseListRing.IsActive = true; PrepareFrame.Navigate(typeof(PreparePage)); SetControlAccessEnabled(); InitMainPageState(); GetResources(); }
protected override void OnNavigatedTo(NavigationEventArgs e) { base.OnNavigatedTo(e); var args = e.Parameter as ToastNotificationActivatedEventArgs; toastUri = args?.Argument; PrepareFrame.Navigate(typeof(PreparePage)); SetControlAccessEnabled(); InitMainPageState(); AdapteVitualNavigationBarIfNeed(); InitSlideRecState(); GetResourcesAsync(); }
/// <summary> /// Prepares the query async on the given connection. Returns immediatly if the query is already /// prepared. /// </summary> /// <param name="connection">The connection.</param> /// <param name="state">captured state</param> /// <param name="logger">The logger.</param> /// <returns></returns> /// <exception cref="CqlException">Unexpected frame received + response.OpCode</exception> /// <exception cref="System.Exception">Unexpected frame received + response.OpCode</exception> private async Task <ResultFrame> PrepareInternalAsync(Connection connection, QueryExecutionState state, Logger logger) { //check if already prepared for this connection ResultFrame result; var prepareResults = _connection.GetPrepareResultsFor(_cql); if (!prepareResults.TryGetValue(connection.Address, out result)) { //create prepare frame var query = new PrepareFrame(_cql); //update frame with tracing option if requested if (state.TracingEnabled) { query.Flags |= FrameFlags.Tracing; } logger.LogVerbose("No prepare results available. Sending prepare {0} using {1}", _cql, connection); //send prepare request Frame response = await connection.SendRequestAsync(query, logger).ConfigureAwait(false); result = response as ResultFrame; if (result == null) { throw new CqlException("Unexpected frame received " + response.OpCode); } prepareResults[connection.Address] = result; } else { logger.LogVerbose("Reusing cached preparation results"); } //set as prepared _prepared = true; //set parameters collection if not done so before if (_parameters == null) { _parameters = new CqlParameterCollection(result.Schema); } return(result); }
public MainPage() { this.InitializeComponent(); Current = this; baseListRing.IsActive = true; PrepareFrame.Navigate(typeof(PreparePage)); var isDarkOrNot = (bool?)SettingsHelper.ReadSettingsValue(SettingsConstants.IsDarkThemeOrNot) ?? true; RequestedTheme = isDarkOrNot ? ElementTheme.Dark : ElementTheme.Light; NavigateManager.BackRequested += OnBackRequested; MainContentFrame = this.ContentFrame; BaseListRing = this.baseListRing; NavigateTitlePath = this.navigateTitlePath; ChangeTitlePath(NaviPathTitle.RoutePath); StatusBarInit.InitInnerDesktopStatusBar(true); Window.Current.SetTitleBar(BasePartBorder); IfNeedAdapteVitualNavigationBar(); InitSlideRecState(); GetResources(); }