protected override void CreateChildControls() { var application = StoredProcs.Applications_GetApplication(this.EditorContext.ApplicationId) .Execute() .Applications_Extended .First(); var repositories = GetProjects(application); this.ddlRepositories = new ComboSelect(); this.ddlRepositories.Items.AddRange( from r in repositories orderby r.Name select new ListItem(r.Name, r.Owner + "/" + r.Name) ); this.Controls.Add( new SlimFormField("GitHub repository:", this.ddlRepositories) ); }
protected override void CreateChildControls() { this.ddlCollection = new ComboSelect(); this.ddlCollection.Items.AddRange( from c in this.collections.Value orderby c.Name select new ListItem(c.Name, c.Id.ToString()) ); if (this.HasProviderWiql()) { this.Controls.Add( new InfoBox( InfoBox.InfoBoxTypes.Info, new P("There is a custom WIQL query defined at the provider level. That query will override any project or area filtering here."), new P("However, you may still specify a custom WIQL query here to override the provider's WIQL query.") ) ); } this.ddlUseWiql = new ComboSelect { Items = { new ListItem("Not using a custom query", "False"), new ListItem("Custom WIQL query", "True") } }; this.ctlProject = new HiddenField { ID = "ctlProject" }; this.ctlAreaPath = new HiddenField { ID = "ctlAreaPath" }; var ctlNoWiql = new Div( new SlimFormField("Project:", this.ctlProject), new SlimFormField("Area Path:", this.ctlAreaPath) ); this.txtCustomWiql = new TextBox { TextMode = TextBoxMode.MultiLine, Rows = 5 }; var ctlWiql = new SlimFormField("Custom query:", this.txtCustomWiql); this.Controls.Add( new SlimFormField("Collection:", this.ddlCollection), new SlimFormField("Query mode:", this.ddlUseWiql), ctlNoWiql, ctlWiql, new RenderJQueryDocReadyDelegator( w => { w.Write("TfsIssueTrackingApplicationFilterEditor_Init("); InedoLib.Util.JavaScript.WriteJson( w, new { ddlCollection = ddlCollection.ClientID, ddlUseWiql = ddlUseWiql.ClientID, ctlWiql = ctlWiql.ClientID, ctlNoWiql = ctlNoWiql.ClientID, ctlProject = ctlProject.ClientID, ctlArea = ctlAreaPath.ClientID, getProjectsUrl = DynamicHttpHandling.GetJavascriptDataUrl <int, string, object>(GetProjects), getAreasUrl = DynamicHttpHandling.GetJavascriptDataUrl <int, string, string, object>(GetAreas), applicationId = this.EditorContext.ApplicationId } ); w.Write(");"); } ) ); }
protected override void CreateChildControls() { this.ddlCollection = new ComboSelect(); this.ddlCollection.Items.AddRange( from c in this.collections.Value orderby c.Name select new ListItem(c.Name, c.Id.ToString()) ); if (this.HasProviderWiql()) { this.Controls.Add( new InfoBox( InfoBox.InfoBoxTypes.Info, new P("There is a custom WIQL query defined at the provider level. That query will override any project or area filtering here."), new P("However, you may still specify a custom WIQL query here to override the provider's WIQL query.") ) ); } this.ddlUseWiql = new ComboSelect { Items = { new ListItem("Not using a custom query", "False"), new ListItem("Custom WIQL query", "True") } }; this.ctlProject = new HiddenField { ID = "ctlProject" }; this.ctlAreaPath = new HiddenField { ID = "ctlAreaPath" }; var ctlNoWiql = new Div( new SlimFormField("Project:", this.ctlProject), new SlimFormField("Area Path:", this.ctlAreaPath) ); this.txtCustomWiql = new TextBox { TextMode = TextBoxMode.MultiLine, Rows = 5 }; var ctlWiql = new SlimFormField("Custom query:", this.txtCustomWiql); this.Controls.Add( new SlimFormField("Collection:", this.ddlCollection), new SlimFormField("Query mode:", this.ddlUseWiql), ctlNoWiql, ctlWiql, new RenderJQueryDocReadyDelegator( w => { w.Write("TfsIssueTrackingApplicationFilterEditor_Init("); InedoLib.Util.JavaScript.WriteJson( w, new { ddlCollection = ddlCollection.ClientID, ddlUseWiql = ddlUseWiql.ClientID, ctlWiql = ctlWiql.ClientID, ctlNoWiql = ctlNoWiql.ClientID, ctlProject = ctlProject.ClientID, ctlArea = ctlAreaPath.ClientID, getProjectsUrl = DynamicHttpHandling.GetJavascriptDataUrl<int, string, object>(GetProjects), getAreasUrl = DynamicHttpHandling.GetJavascriptDataUrl<int, string, string, object>(GetAreas), applicationId = this.EditorContext.ApplicationId } ); w.Write(");"); } ) ); }