public other_document() { InitializeComponent(); //txt_gender.Choices = gender_choices; template = new InstanceTemplate(); var args = new InstanceArgs("api/auth/users/", null, User.Api, "个人资料", Deleteable: false); args.margin = new Thickness(0, 10, 0, 10); args.items.Add(new InstanceArgs.Item("id", "用户名", "text")); args.items.Add(new InstanceArgs.Item("name", "姓名", "text")); args.items.Add(new InstanceArgs.Item("gender", "性别", "choice", data: gender_choices.ToArray())); args.items.Add(new InstanceArgs.Item("register_time", "注册时间", "text")); args.items.Add(new InstanceArgs.Item("last_login_time", "最近登录", "text")); template.Construct(args); ContentGrid.Children.Add(template); list_temp = new ListTemplate(); var largs = new ListArgs(null, User.Api, "管理的班级"); largs.columns.Add(new ListArgs.Column("id", "班级编号", hyperlink: ListArgs.autohyperlink("class-instance").add("id").lambda)); largs.columns.Add(new ListArgs.Column("name", "班级名称", hyperlink: ListArgs.autohyperlink("class-instance").add("id").lambda)); list_temp.Construct(largs); ListGrid.Children.Add(list_temp); }
/// <summary> /// Add Calendar Web Part to client site /// </summary> /// <param name="clientContext">SharePoint Client Context</param> /// <param name="matter">Matter object containing Matter data</param> internal static void AddCalendarList(ClientContext clientContext, Matter matter) { string calendarName = string.Concat(matter.MatterName, ConfigurationManager.AppSettings["CalendarNameSuffix"]); try { Web web = clientContext.Web; clientContext.Load(web, item => item.ListTemplates); clientContext.ExecuteQuery(); ListTemplate listTemplate = null; foreach (var calendar in web.ListTemplates) { if (calendar.Name == Constants.CalendarName) { listTemplate = calendar; } } ListCreationInformation listCreationInformation = new ListCreationInformation(); listCreationInformation.TemplateType = listTemplate.ListTemplateTypeKind; listCreationInformation.Title = calendarName; // Added URL property for URL consolidation changes listCreationInformation.Url = Constants.TitleListPath + matter.MatterGuid + ConfigurationManager.AppSettings["CalendarNameSuffix"]; web.Lists.Add(listCreationInformation); web.Update(); clientContext.ExecuteQuery(); MatterProvisionHelperFunction.BreakPermission(clientContext, matter.MatterName, matter.CopyPermissionsFromParent, calendarName); } catch (Exception exception) { //// Generic Exception MatterProvisionHelperFunction.DeleteMatter(clientContext, matter); MatterProvisionHelperFunction.DisplayAndLogError(errorFilePath, "Message: " + exception.Message + "\nStacktrace: " + exception.StackTrace); } }
public instance() { InitializeComponent(); template = new InstanceTemplate(); var args = new InstanceArgs("api/classrooms/basic/", null, User.Api, Title, Margin: new Thickness(0, 10, 0, 10)); args.items.Add(new InstanceArgs.Item("id", "教室编号", "text")); args.items.Add(new InstanceArgs.Item("name", "教室名称", "text")); args.items.Add(new InstanceArgs.Item("size", "教室大小", "text")); template.Construct(args); ContentGrid.Children.Add(template); list_temp = new ListTemplate(); var largs = new ListArgs("api/record/classroom-records/", User.Api, "教室使用记录", Searchable: true); largs.columns.Add(new ListArgs.Column("id", "编号")); largs.columns.Add(new ListArgs.Column("student_name_related", "学生姓名", hyperlink: ListArgs.autohyperlink("student-other-document").add("id", "student").lambda)); largs.columns.Add(new ListArgs.Column("time_in", "进入时间")); largs.columns.Add(new ListArgs.Column("time_out", "离开时间")); list_temp.Construct(largs); //ListGrid.Children.Add(list_temp); }
public classroom_list() { InitializeComponent(); default_auth = new AuthSetting[] { new AuthSetting(Authority.ClassroomManage) }; template = new ListTemplate(); var cargs = new CreateArgs("api/classrooms/basic/", User.Api, "创建教室", Margin: new Thickness(0, 10, 0, 10)); cargs.items.Add(new CreateArgs.Item("id", "教室编号", "text")); cargs.items.Add(new CreateArgs.Item("name", "教室名称", "text")); cargs.items.Add(new CreateArgs.Item("size", "教室大小", "text")); cargs.items.Add(new CreateArgs.Item("password", "教室密码", "text")); var args = new ListArgs("api/classrooms/basic/", User.Api, Title, Searchable: true, Createable: true, Createargs: cargs); args.columns.Add(new ListArgs.Column("id", "教室编号", hyperlink: ListArgs.autohyperlink("classroom-instance").add("id").lambda)); args.columns.Add(new ListArgs.Column("name", "教室名称", ordering: "name", hyperlink: ListArgs.autohyperlink("classroom-instance").add("id").lambda)); args.columns.Add(new ListArgs.Column("size", "教室大小", ordering: "size")); template.Construct(args); ContentGrid.Children.Add(template); }
public void ExecuteSelectTableTemplateTest() { string dbfile = "taskaludb29.sqlite"; string path = Path.GetTempPath() + "\\" + dbfile; TouchTestDB(dbfile); var lt = new ListTemplate(); lt.Order = 1; lt.Name = "name"; lt.Template = "template"; SQLiteClass.ExecuteInsertTableTemplate(path, lt); var lt2 = new ListTemplate(); lt2.Order = 2; lt2.Name = "name2"; lt2.Template = "template2"; SQLiteClass.ExecuteInsertTableTemplate(path, lt2); var tlv = new TemplateListViewModel(); var result = SQLiteClass.ExecuteSelectTableTemplate(path, tlv); Debug.Assert(result); Debug.Assert(tlv.Entries.Count == 2); }
public void AutoGenerateTaskTest2() { string dbfile = "taskaludb_autogenerate1.sqlite"; string path = Path.GetTempPath() + "\\" + dbfile; TouchTestDB(dbfile); var lt = new ListTemplate(); lt.Order = 1; lt.Name = "name"; lt.Template = "template"; SQLiteClass.ExecuteInsertTableTemplate(path, lt); var la = new ListAutoGenerate(); la.Order = 1; la.Type = 0; la.Name = "name"; la.Priority = ""; la.Template = 1; la.Number0 = 2; la.Number1 = 0; la.Checked_date = "2019-02-02 00:00:00"; var result = AutoGenerate.AutoGenerateTask(path, la, new DateTime(2019, 2, 2)); Debug.Assert(result == 1 + 2 + 4 + 8); }
public course_list() { InitializeComponent(); default_auth = new AuthSetting[] { new AuthSetting(Authority.CourseManage) }; template = new ListTemplate(); var cargs = new CreateArgs("api/courses/basic/", User.Api, "创建课程", Margin: new Thickness(0, 10, 0, 10)); cargs.items.Add(new CreateArgs.Item("id", "课程编号", "text")); cargs.items.Add(new CreateArgs.Item("name", "课程名称", "text")); cargs.items.Add(new CreateArgs.Item("teacher", "教师(工号)", "text")); cargs.items.Add(new CreateArgs.Item("as_student_set", "学生列表(学号)", "multitext")); var args = new ListArgs("api/courses/basic/", User.Api, Title, Searchable: true, Createable: true, Createargs: cargs); args.columns.Add(new ListArgs.Column("id", "课程编号", ordering: "id", hyperlink: ListArgs.autohyperlink("course-instance").add("id").lambda)); args.columns.Add(new ListArgs.Column("name", "课程名称", ordering: "name", hyperlink: ListArgs.autohyperlink("course-instance").add("id").lambda)); args.columns.Add(new ListArgs.Column("teacher", "任课教师", ordering: "teacher", hyperlink: ListArgs.autohyperlink("teacher-other-document").add("id", "teacher").lambda)); template.Construct(args); ContentGrid.Children.Add(template); }
public instance() { InitializeComponent(); template = new InstanceTemplate(); var args = new InstanceArgs("api/classes/", null, User.Api, Title, Margin: new Thickness(0, 10, 0, 10)); args.items.Add(new InstanceArgs.Item("id", "班级编号", "text")); args.items.Add(new InstanceArgs.Item("grade", "年级", "text")); args.items.Add(new InstanceArgs.Item("college", "学院", "text")); args.items.Add(new InstanceArgs.Item("major", "专业", "text")); args.items.Add(new InstanceArgs.Item("number", "班号", "text")); template.Construct(args); ContentGrid.Children.Add(template); list_temp = new ListTemplate(); var largs = new ListArgs(null, User.Api, "学生列表"); largs.columns.Add(new ListArgs.Column("id", "学号", customaction: HyperlinkToStudent)); largs.columns.Add(new ListArgs.Column("name", "姓名", customaction: HyperlinkToStudent)); list_temp.Construct(largs); ListGrid.Children.Add(list_temp); list_temp2 = new ListTemplate(); var largs2 = new ListArgs(null, User.Api, "辅导员列表"); largs2.columns.Add(new ListArgs.Column("id", "工号", customaction: HyperlinkToInstructor)); largs2.columns.Add(new ListArgs.Column("name", "姓名", customaction: HyperlinkToInstructor)); list_temp2.Construct(largs2); ListGrid2.Children.Add(list_temp2); }
public instructor_list() { InitializeComponent(); default_auth = new AuthSetting[] { new AuthSetting(Authority.InstructorManage) }; template = new ListTemplate(); var cargs = new CreateArgs("api/auth/instructors/", User.Api, "创建辅导员用户", Margin: new Thickness(0, 10, 0, 10)); cargs.items.Add(new CreateArgs.Item("username", "工号", "text")); cargs.items.Add(new CreateArgs.Item("password", "密码", "text")); cargs.items.Add(new CreateArgs.Item("name", "姓名", "text")); cargs.items.Add(new CreateArgs.Item("gender", "性别", "choice", data: gender_choices.ToArray())); var args = new ListArgs("api/auth/instructors/", User.Api, Title, Searchable: true, Createable: true, Createargs: cargs); args.columns.Add(new ListArgs.Column("id", "工号", ordering: "id", hyperlink: ListArgs.autohyperlink("instructor-other-document").add("id").lambda)); args.columns.Add(new ListArgs.Column("user", "姓名", ordering: "username", hyperlink: ListArgs.autohyperlink("instructor-other-document").add("id").lambda)); args.columns.Add(new ListArgs.Column("gender_related", "性别", type: "choice", data: gender_choices)); template.Construct(args); ContentGrid.Children.Add(template); }
public admin_schedule() { InitializeComponent(); default_auth = new AuthSetting[] { new AuthSetting(Authority.Admin) }; template = new ListTemplate(); var cargs = new CreateArgs("api/schedule/system-schedules/", User.Api, "创建时间表", Margin: new Thickness(0, 10, 0, 10)); cargs.items.Add(new CreateArgs.Item("year", "学年", "text")); cargs.items.Add(new CreateArgs.Item("term", "学期", "text")); cargs.items.Add(new CreateArgs.Item("begin", "开始时间", "text")); cargs.items.Add(new CreateArgs.Item("end", "结束时间", "text")); var args = new ListArgs("api/schedule/system-schedules/", User.Api, Title, Searchable: true, Createable: true, Createargs: cargs); args.columns.Add(new ListArgs.Column("id", "编号", ordering: "id", hyperlink: ListArgs.autohyperlink("admin-admin-schedule-instance").add("id").lambda)); args.columns.Add(new ListArgs.Column("year", "学年")); args.columns.Add(new ListArgs.Column("term", "学期")); args.columns.Add(new ListArgs.Column("begin", "开始时间")); args.columns.Add(new ListArgs.Column("end", "结束时间")); template.Construct(args); ContentGrid.Children.Add(template); }
public class_list() { InitializeComponent(); default_auth = new AuthSetting[] { new AuthSetting(Authority.ClassManage) }; template = new ListTemplate(); var cargs = new CreateArgs("api/classes/", User.Api, "创建班级", Margin: new Thickness(0, 10, 0, 10)); cargs.items.Add(new CreateArgs.Item("id", "班级编号", "text")); cargs.items.Add(new CreateArgs.Item("grade", "年级", "text")); cargs.items.Add(new CreateArgs.Item("college", "学院", "text")); cargs.items.Add(new CreateArgs.Item("major", "专业", "text")); cargs.items.Add(new CreateArgs.Item("number", "班级", "text")); cargs.items.Add(new CreateArgs.Item("as_instructor_set", "辅导员列表(工号)", "multitext")); cargs.items.Add(new CreateArgs.Item("as_student_set", "学生列表(学号)", "multitext")); var args = new ListArgs("api/classes/", User.Api, Title, Searchable: true, Createable: true, Createargs: cargs); args.columns.Add(new ListArgs.Column("id", "班级编号", hyperlink: ListArgs.autohyperlink("class-instance").add("id").lambda)); args.columns.Add(new ListArgs.Column("grade", "年级", ordering: "grade")); args.columns.Add(new ListArgs.Column("college", "学院", ordering: "college")); args.columns.Add(new ListArgs.Column("major", "专业", ordering: "major")); args.columns.Add(new ListArgs.Column("number", "班级", ordering: "number")); template.Construct(args); ContentGrid.Children.Add(template); }
protected override void Render(HtmlTextWriter output) { var operationsPart = new TableTemplate { Title = "Operations:", Items = this.OperationNames, ForEachItem = RenderRow }.ToString(); var xsdsPart = new ListTemplate { Title = "XSDS:", ListItemsIntMap = this.Xsds, ListItemTemplate = @"<li><a href=""?xsd={0}"">{1}</a></li>" }.ToString(); var wsdlTemplate = new StringBuilder(); var soap11Config = MetadataConfig.GetMetadataConfig("soap11") as SoapMetadataConfig; var soap12Config = MetadataConfig.GetMetadataConfig("soap12") as SoapMetadataConfig; if (soap11Config != null || soap12Config != null) { wsdlTemplate.AppendLine("<h3>WSDLS:</h3>"); wsdlTemplate.AppendLine("<ul>"); if (soap11Config != null) { wsdlTemplate.AppendFormat( @"<li><a href=""{0}"">{0}</a></li>", soap11Config.WsdlMetadataUri); } if (soap12Config != null) { wsdlTemplate.AppendFormat( @"<li><a href=""{0}"">{0}</a></li>", soap12Config.WsdlMetadataUri); } wsdlTemplate.AppendLine("</ul>"); } var debugOnlyInfo = new StringBuilder(); if (EndpointHost.DebugMode) { debugOnlyInfo.Append("<h3>Debug Info:</h3>"); debugOnlyInfo.AppendLine("<ul>"); debugOnlyInfo.AppendLine("<li><a href=\"operations/metadata\">Operations Metadata</a></li>"); debugOnlyInfo.AppendLine("</ul>"); } var renderedTemplate = string.Format( PageTemplate, this.Title, this.MetadataPageBodyHtml, this.XsdServiceTypesIndex, operationsPart, xsdsPart, wsdlTemplate, debugOnlyInfo); output.Write(renderedTemplate); }
protected override void Render(HtmlTextWriter output) { var operationsPart = new ListTemplate { ListItems = this.OperationNames, ListItemTemplate = @"<li><a href=""?op={0}"">{0}</a></li>" }.ToString(); var renderedTemplate = HtmlTemplates.Format(HtmlTemplates.OperationsControlTemplate, this.Title, this.MetadataOperationPageBodyHtml, operationsPart); output.Write(renderedTemplate); }
protected override void Render(HtmlTextWriter output) { var operationsPart = new ListTemplate { ListItems = this.OperationNames, ListItemTemplate = @"<li><a href=""?op={0}"">{0}</a></li>" }.ToString(); var renderedTemplate = string.Format(PageTemplate, this.Title, this.UsageExamplesBaseUri, operationsPart); output.Write(renderedTemplate); }
public void ExecuteInsertTableTemplateTest() { string dbfile = "taskaludb28.sqlite"; string path = Path.GetTempPath() + "\\" + dbfile; TouchTestDB(dbfile); var lt = new ListTemplate(); lt.Order = 1; lt.Name = "name"; lt.Template = "template"; Debug.Assert(SQLiteClass.ExecuteInsertTableTemplate(path, lt)); }
public admin_schedule_instance() { InitializeComponent(); //生成概要信息区域 template = new InstanceTemplate(); var args = new InstanceArgs("api/schedule/system-schedules/", null, User.Api, Title); args.margin = new Thickness(0, 10, 0, 10); args.items.Add(new InstanceArgs.Item("id", "编号", "text")); args.items.Add(new InstanceArgs.Item("year", "学年", "text", EditAbleStatus.Writeable)); args.items.Add(new InstanceArgs.Item("term", "学期", "text", EditAbleStatus.Writeable)); args.items.Add(new InstanceArgs.Item("begin", "开始时间", "text", EditAbleStatus.Writeable)); args.items.Add(new InstanceArgs.Item("end", "结束时间", "text", EditAbleStatus.Writeable)); template.Construct(args); ContentGrid.Children.Add(template); //生成列表区域 list_temp = new ListTemplate(); var clargs = new CreateArgs("api/schedule/system-schedule-items/", User.Api, "创建时间表项"); clargs.items.Add(new CreateArgs.Item("no", "节次", "text")); clargs.items.Add(new CreateArgs.Item("begin", "上课时间", "text")); clargs.items.Add(new CreateArgs.Item("end", "下课时间", "text")); clargs.items.Add(new CreateArgs.Item("system_schedule", "系统时间表", "hidden", data: "system_schedule")); var largs = new ListArgs("api/schedule/system-schedule-items/", User.Api, "时间表项", Createable: true, Createargs: clargs); largs.columns.Add(new ListArgs.Column("id", "编号", customaction: UpdateScheduleItemInstance)); largs.columns.Add(new ListArgs.Column("no", "节次", customaction: UpdateScheduleItemInstance)); largs.columns.Add(new ListArgs.Column("begin", "上课时间")); largs.columns.Add(new ListArgs.Column("end", "下课时间")); list_temp.Construct(largs); ListGrid.Children.Add(list_temp); //生成项的详情区域 instance_temp = new InstanceTemplate(); var iargs = new InstanceArgs("api/schedule/system-schedule-items/", null, User.Api, "表项信息"); iargs.items.Add(new InstanceArgs.Item("id", "编号", "text")); iargs.items.Add(new InstanceArgs.Item("no", "节次", "text", EditAbleStatus.Writeable)); iargs.items.Add(new InstanceArgs.Item("begin", "上课时间", "text", EditAbleStatus.Writeable)); iargs.items.Add(new InstanceArgs.Item("end", "下课时间", "text", EditAbleStatus.Writeable)); iargs.deleteaction = () => { //当按下子项的删除按钮时 InstanceGrid.Children.Clear(); //仅仅是不显示该区域。 list_temp.UpdateData(); //刷新列表。 }; instance_temp.Construct(iargs); }
public detail() { InitializeComponent(); list_temp = new ListTemplate(); var largs = new ListArgs(null, User.Api, "出勤记录表", Searchable: true); largs.columns.Add(new ListArgs.Column("id", "编号")); largs.columns.Add(new ListArgs.Column("student", "学生姓名")); largs.columns.Add(new ListArgs.Column("course_manage", "课程编号")); largs.columns.Add(new ListArgs.Column("date", "日期")); largs.columns.Add(new ListArgs.Column("course_number", "节次")); largs.columns.Add(new ListArgs.Column("status", "出勤状态", type: "choice", data: AttendanceState.attendance_state)); list_temp.Construct(largs); ListGrid.Children.Add(list_temp); }
public void ExecuteSelectTemplateOrderFromIDTest() { string dbfile = "taskaludb47.sqlite"; string path = Path.GetTempPath() + "\\" + dbfile; TouchTestDB(dbfile); var lt = new ListTemplate(); lt.Order = 2; lt.Name = "name"; lt.Template = "template"; SQLiteClass.ExecuteInsertTableTemplate(path, lt); Debug.Assert(SQLiteClass.ExecuteSelectTemplateOrderFromID(path, 1) == 2); }
public static void createCSVLoaderList() { Uri ProjUri = new Uri("https://kineticsys.sharepoint.com/sites/projects"); ListCreationInformation listInfo = new ListCreationInformation(); listInfo.Title = "CSV Uploader"; ClientContext ctx = getProjectSpCtx(ProjUri); ListTemplate listTemplate = ctx.Site.GetCustomListTemplates(ctx.Site.RootWeb).GetByName("CSV Uploader"); ctx.Load(listTemplate, tL => tL.Name, tL => tL.FeatureId, tL => tL.ListTemplateTypeKind); ctx.ExecuteQuery(); listInfo.TemplateFeatureId = listTemplate.FeatureId; listInfo.TemplateType = listTemplate.ListTemplateTypeKind; //web.Lists.Add(listInfo); ctx.ExecuteQuery(); }
public self_attendances() { InitializeComponent(); default_auth = new AuthSetting[] { new AuthSetting(Authority.Student) }; template = new ListTemplate(); var args = new ListArgs("api/record/attendance-records/", User.Api, Title, Searchable: true); args.columns.Add(new ListArgs.Column("id", "编号")); args.columns.Add(new ListArgs.Column("date", "日期")); args.columns.Add(new ListArgs.Column("course_number", "节次")); args.columns.Add(new ListArgs.Column("status", "状态")); args.columns.Add(new ListArgs.Column("course_manage", "课程编号", hyperlink: ListArgs.autohyperlink("course-instance").add("id", "course_manage").lambda)); template.Construct(args); ContentGrid.Children.Add(template); }
/// <summary> /// create Ordered list /// </summary> private void CreateOrderedList() { Application app = new Application(); app.Visible = true; Document doc = app.Documents.Add(); Range range = doc.Range(0, 0); range.ListFormat.ApplyNumberDefault(); range.Text = "Birinci"; range.InsertParagraphAfter(); ListTemplate listTemplate = range.ListFormat.ListTemplate; Range subRange = doc.Range(range.StoryLength - 1); subRange.ListFormat.ApplyBulletDefault(); subRange.ListFormat.ListIndent(); subRange.Text = "Alt Birinci"; subRange.InsertParagraphAfter(); ListTemplate sublistTemplate = subRange.ListFormat.ListTemplate; Range subRange2 = doc.Range(subRange.StoryLength - 1); subRange2.ListFormat.ApplyListTemplate(sublistTemplate); subRange2.ListFormat.ListIndent(); subRange2.Text = "Alt İkinci"; subRange2.InsertParagraphAfter(); Range range2 = doc.Range(range.StoryLength - 1); range2.ListFormat.ApplyListTemplateWithLevel(listTemplate, true); WdContinue isContinue = range2.ListFormat.CanContinuePreviousList(listTemplate); range2.Text = "İkinci"; range2.InsertParagraphAfter(); Range range3 = doc.Range(range2.StoryLength - 1); range3.ListFormat.ApplyListTemplate(listTemplate); range3.Text = "Üçüncü"; range3.InsertParagraphAfter(); }
public self_teacher() { InitializeComponent(); default_auth = new AuthSetting[] { new AuthSetting(Authority.Office) }; template = new ListTemplate(); var args = new ListArgs("api/auth/teachers/", User.Api, Title, Searchable: true); args.columns.Add(new ListArgs.Column("id", "工号", ordering: "id", hyperlink: ListArgs.autohyperlink("teacher-other-document").add("id").lambda)); args.columns.Add(new ListArgs.Column("user", "姓名", ordering: "username", hyperlink: ListArgs.autohyperlink("teacher-other-document").add("id").lambda)); args.columns.Add(new ListArgs.Column("gender_related", "性别", type: "choice", data: gender_choices)); template.Construct(args); ContentGrid.Children.Add(template); }
public void LoadBoard(BoardData boardToLoad) { /// <summary> /// 1. Create the correct number of lists /// 2. Assign the correct Names /// 3. Create correct cards /// </summary> for (int i = 0; i < boardToLoad.creationIndex; i++) { GameObject createdList = Instantiate(listTemplate); createdList.transform.SetParent(listContainer); ListTemplate createdListScript = createdList.GetComponent <ListTemplate>(); createdListScript.setSize(); createdListScript.creationIndex = i; createdListScript.setName(boardToLoad.nameOfLists[i]); } }
public class_list() { InitializeComponent(); default_auth = new AuthSetting[] { new AuthSetting(Authority.Office), new AuthSetting(Authority.Instructor) }; template = new ListTemplate(); var args = new ListArgs("api/classes/", User.Api, Title, Searchable: true); args.columns.Add(new ListArgs.Column("id", "班级编号", hyperlink: ListArgs.autohyperlink("class-instance").add("id").lambda)); args.columns.Add(new ListArgs.Column("grade", "年级", ordering: "grade")); args.columns.Add(new ListArgs.Column("college", "学院", ordering: "college")); args.columns.Add(new ListArgs.Column("major", "专业", ordering: "major")); args.columns.Add(new ListArgs.Column("number", "班级", ordering: "number")); template.Construct(args); ContentGrid.Children.Add(template); }
public course_list() { InitializeComponent(); default_auth = new AuthSetting[] { new AuthSetting(Authority.Teacher), new AuthSetting(Authority.Office), }; template = new ListTemplate(); var args = new ListArgs("api/courses/basic/", User.Api, Title, Searchable: true); args.columns.Add(new ListArgs.Column("id", "课程编号", ordering: "id", hyperlink: ListArgs.autohyperlink("course-instance").add("id").lambda)); args.columns.Add(new ListArgs.Column("name", "课程名称", ordering: "name", hyperlink: ListArgs.autohyperlink("course-instance").add("id").lambda)); args.columns.Add(new ListArgs.Column("teacher", "任课教师", ordering: "teacher", hyperlink: ListArgs.autohyperlink("teacher-other-document").add("id", "teacher").lambda)); template.Construct(args); ContentGrid.Children.Add(template); }
public instance() { InitializeComponent(); template = new InstanceTemplate(); var args = new InstanceArgs("api/courses/basic/", null, User.Api, Title, Margin: new Thickness(0, 10, 0, 10)); args.items.Add(new InstanceArgs.Item("id", "课程编号", "text")); args.items.Add(new InstanceArgs.Item("name", "课程名称", "text")); args.items.Add(new InstanceArgs.Item("teacher_name_related", "教师", "text")); template.Construct(args); ContentGrid.Children.Add(template); list_temp = new ListTemplate(); var largs = new ListArgs(null, User.Api, "学生列表"); largs.columns.Add(new ListArgs.Column("id", "学号", customaction: HyperlinkToStudent)); largs.columns.Add(new ListArgs.Column("name", "姓名", customaction: HyperlinkToStudent)); list_temp.Construct(largs); ListGrid.Children.Add(list_temp); }
/// <summary> /// Remove /// </summary> /// <param name="template"></param> public void Remove(IHasTemplate template) { ListTemplate.Remove(template); createDrawable(); }
/// <summary> /// Add /// </summary> /// <param name="template"></param> public void Add(IHasTemplate template) { ListTemplate.Add(template); createDrawable(); }
protected override void Render(HtmlTextWriter output) { var parentPath = HttpRequest.GetParentAbsolutePath(); var ignoreFormats = EndpointHost.Config.IgnoreFormatsInMetadata; var opTemplate = new StringBuilder("<li><span>{0}</span>"); if (MetadataConfig.Xml != null && !ignoreFormats.Contains("xml")) { opTemplate.AppendFormat(@"<a href=""{0}?op={{0}}"">XML</a>", parentPath + MetadataConfig.Xml.DefaultMetadataUri); } if (MetadataConfig.Json != null && !ignoreFormats.Contains("json")) { opTemplate.AppendFormat(@"<a href=""{0}?op={{0}}"">JSON</a>", parentPath + MetadataConfig.Json.DefaultMetadataUri); } if (MetadataConfig.Jsv != null && !ignoreFormats.Contains("jsv")) { opTemplate.AppendFormat(@"<a href=""{0}?op={{0}}"">JSV</a>", parentPath + MetadataConfig.Jsv.DefaultMetadataUri); } if (MetadataConfig.Custom != null) { foreach (var format in EndpointHost.ContentTypeFilter.ContentTypeFormats.Keys) { if (ignoreFormats.Contains(format)) { continue; } var uri = parentPath + string.Format(MetadataConfig.Custom.DefaultMetadataUri, format); opTemplate.AppendFormat(@"<a href=""{0}?op={{0}}"">{1}</a>", uri, format.ToUpper()); } } if (MetadataConfig.Soap11 != null && !ignoreFormats.Contains("soap11")) { opTemplate.AppendFormat(@"<a href=""{0}?op={{0}}"">SOAP 1.1</a>", parentPath + MetadataConfig.Soap11.DefaultMetadataUri); } if (MetadataConfig.Soap12 != null && !ignoreFormats.Contains("soap12")) { opTemplate.AppendFormat(@"<a class=""last"" href=""{0}?op={{0}}"">SOAP 1.2</a>", parentPath + MetadataConfig.Soap12.DefaultMetadataUri); } opTemplate.Append("</li>"); var operationsPart = new ListTemplate { Title = "Operations:", ListItems = this.OperationNames, ForEachListItem = operation => string.Format(opTemplate.ToString(), operation) }.ToString(); var xsdsPart = new ListTemplate { Title = "XSDS:", ListItemsIntMap = this.Xsds, ListItemTemplate = @"<li><a href=""?xsd={0}"">{1}</a></li>" }.ToString(); var wsdlTemplate = new StringBuilder(); if (MetadataConfig.Soap11 != null || MetadataConfig.Soap12 != null) { wsdlTemplate.AppendLine("<h3>WSDLS:</h3>"); wsdlTemplate.AppendLine("<ul>"); if (MetadataConfig.Soap11 != null) { wsdlTemplate.AppendFormat( @"<li><a href=""{0}"">{0}</a></li>", MetadataConfig.Soap11.WsdlMetadataUri); } if (MetadataConfig.Soap12 != null) { wsdlTemplate.AppendFormat( @"<li><a href=""{0}"">{0}</a></li>", MetadataConfig.Soap12.WsdlMetadataUri); } wsdlTemplate.AppendLine("<ul>"); } var renderedTemplate = string.Format( PageTemplate, this.Title, this.MetadataPageBodyHtml, this.XsdServiceTypesIndex, operationsPart, xsdsPart, wsdlTemplate); output.Write(renderedTemplate); }
internal HtmlList(ListTemplate template) : base(new List <object>(), true) { this.Template = template; }