/// <summary> /// Initializes the projector to display the projection specified by the Action and TypeName, which get their default values from the "a" and "t" query strings respectively. /// </summary> /// <param name="e"></param> protected override void OnInit(EventArgs e) { using (LogGroup logGroup = LogGroup.StartDebug("Initializing the projector control.")) { LogWriter.Debug("Url: " + Page.Request.Url.ToString()); LogWriter.Debug("Action: " + Action); LogWriter.Debug("Type Name: " + TypeName); LogWriter.Debug("Projection Name: " + ProjectionName); LogWriter.Debug("Format: " + Format); InitializeProjections(); ProjectionInfo projection = null; if (QueryStrings.Name != String.Empty) { if (ProjectionState.Projections.Contains(QueryStrings.Name, Format)) { projection = ProjectionState.Projections[QueryStrings.Name, Format]; } else { LogWriter.Debug("Projection not found with name '" + QueryStrings.Name + "' and format '" + QueryStrings.Format + "'."); } } else if (QueryStrings.Action != String.Empty && QueryStrings.Type != String.Empty) { if (ProjectionState.Projections.Contains(QueryStrings.Action, QueryStrings.Type, Format)) { projection = ProjectionState.Projections[QueryStrings.Action, QueryStrings.Type, Format]; } else { LogWriter.Debug("Projection not found with action '" + QueryStrings.Action + "', type '" + QueryStrings.Type + "' and format '" + QueryStrings.Format + "'."); } } else { LogWriter.Debug("No projection specified by the query string."); } DataSource = projection; Control control = projection.Load(Page); if (control != null) { LogWriter.Debug("Projection control found: " + projection.ProjectionFilePath); Controls.Add(control); FoundProjection = true; } else { LogWriter.Debug("No projection found."); FoundProjection = false; } base.OnInit(e); } }