// Use this for initialization void Start() { lanes = this.GetComponentInParent <Lanes>(); currentLane = this.GetComponent <HasLane>(); moduleGrid = this.GetComponent <ModuleGrid>(); Reposition(); }
public void LoadGrid() { string subjectid = Request.QueryString["id"]; using (SqlConnection con = new SqlConnection(@"Data Source=LAPTOP-8444MQAL\MSSQLSERVER01;Initial Catalog=StudentModule;Integrated Security=True")) { using (SqlCommand cmd = new SqlCommand("select n.* ,u.name from notes n ,[user] u where n.teach_id=u.teach_id and sub_id=" + subjectid, con)) { using (SqlDataAdapter sda = new SqlDataAdapter(cmd)) { DataTable dt = new DataTable(); sda.Fill(dt); ModuleGrid.DataSource = dt; ModuleGrid.DataBind(); } } } using (SqlConnection con = new SqlConnection(@"Data Source=LAPTOP-8444MQAL\MSSQLSERVER01;Initial Catalog=StudentModule;Integrated Security=True")) { using (SqlCommand cmd = new SqlCommand("select qp_id,[filename] from [QUESTIONPAPER] where sub_id=" + subjectid, con)) { using (SqlDataAdapter sda = new SqlDataAdapter(cmd)) { DataTable dt = new DataTable(); sda.Fill(dt); GrdQuestionPaper.DataSource = dt; GrdQuestionPaper.DataBind(); } } } }
private void BindGrid() { IInfobasisDataSource db = InfobasisDataSource.Create(); DataTable table = db.ExecuteTable("SELECT * FROM SYtbModule ORDER BY DisplayOrder"); ModuleGrid.DataSource = table; ModuleGrid.DataBind(); }
private void Start() { this.sideConfig = new Dictionary <Side, SideConfig>(); this.sideConfig[Side.Left] = this.leftSide; this.sideConfig[Side.Right] = this.rightSide; this.sideConfig[Side.Top] = this.topSide; this.sideConfig[Side.Bottom] = this.bottomSide; lanes = GetComponentInParent <Lanes>(); castleGrid = FindObjectOfType <ModuleGrid>(); // TODO don't use FindObjectOfType, generally lane = GetComponent <HasLane>(); BoxCollider2D collider = GetComponent <BoxCollider2D>(); collider.size = new Vector2(lanes.LaneHeight, lanes.LaneHeight); }
/// <summary> /// 显示窗体上网格信息 /// </summary> private void ShowModule() { int I; TModuleInfo ModuleInfo; try { if ((GameFramework.HUtil32.GetTickCount() - DBShare.g_dwShowModuleTick) > 2000) { DBShare.g_dwShowModuleTick = GameFramework.HUtil32.GetTickCount(); ModuleGrid.RowCount = HUtil32._MAX(DBShare.g_ModuleList.Count + 1, 5); for (I = 0; I < ModuleGrid.RowCount; I++) { if (I < DBShare.g_ModuleList.Count) { ModuleInfo = DBShare.g_ModuleList[I]; ModuleGrid.Invoke((MethodInvoker) delegate() { ModuleGrid.Rows[I].Cells[0].Value = ModuleInfo.ModuleName; ModuleGrid.Rows[I].Cells[1].Value = ModuleInfo.Address; ModuleGrid.Rows[I].Cells[2].Value = ModuleInfo.Buffer; }); } else { ModuleGrid.Invoke((MethodInvoker) delegate() { ModuleGrid.Rows[I].Cells[0].Value = ""; ModuleGrid.Rows[I].Cells[1].Value = ""; ModuleGrid.Rows[I].Cells[2].Value = ""; }); } } } } catch { DBShare.MainOutMessage("[Exception] ShowModule"); } }
private void OnLoaded(object sender, RoutedEventArgs e) { Loaded -= OnLoaded; try { foreach (var checkBox in Children <CheckBox>(ModuleGrid)) { checkBox.IsEnabled = QtModuleInfo.IsInstalled(checkBox.Name); } foreach (var module in Data.DefaultModules) { var checkbox = ModuleGrid.FindName(module) as CheckBox; if (checkbox == null) { continue; } checkbox.IsChecked = QtModuleInfo.IsInstalled(module); checkbox.IsEnabled = false; // Required module, always disabled. } } catch { // Ignore if we can't find out if the library is installed. // We either disable and or un-check the button in the UI. } }