private void Bind(Info_Node node, int vid, int type, stringGroupNo)
{
label1.Visible= true;
pic= null; question = null; answer = null; content = null; cour = null; anslist = null;
axWindowsMediaPlayer1.currentPlaylist.clear();if (type == -1)
{
lblTitle.Visible= false;
picTP.Visible= false;
lblContent.Visible= false;
lblSubject.Visible= true;
lblSubject.Text=node.NodeTitle;
lblSubject.Location= new Point((this.Width - lblSubject.Width) / 2, (this.Height - lblSubject.Height) / 2);
}else{
lblTitle.alphaRichTextBox1.Rtf=node.NodeRft;
TypeConverter converter= TypeDescriptor.GetConverter(typeof(Point));
lblTitle.Location=(Point)converter.ConvertFromString(node.NodeLocation);
TypeConverter converters= TypeDescriptor.GetConverter(typeof(Size));
lblTitle.Size=(Size)converters.ConvertFromString(node.NodeSize);
lblTitle.Visible= true;if (type == 0) //视频
{
picTP.ImageLocation= "";
picTP.Visible= false;
lblContent.Visible= false;
lblSubject.Visible= false;
cour=Info_CoursewareBLL.GetInfo_Courseware(vid);
axWindowsMediaPlayer1.URL=cour.CoursewareURL;
axWindowsMediaPlayer1.Visible= true;
}else if (type == 1)//文字
{
picTP.Visible= false; lblSubject.Visible = false;
lblContent.Visible= true; lblContent.Show();
axWindowsMediaPlayer1.Visible= false;
content=Info_ContentBLL.GetModel(node.NodeId);if (content != null && content.Contents != "")
{
lblContent.Location=(Point)converter.ConvertFromString(pointSize(content.CLocation, locOrSize.autoSize));
lblContent.Size=(Size)converters.ConvertFromString(content.CSize);
lblContent.alphaRichTextBox1.Rtf=content.Contents;
lblContent.Focus();
}
}else if (type == 3)//问题
{
axWindowsMediaPlayer1.Visible= false;
picTP.ImageLocation= "";
picTP.Visible= false; lblSubject.Visible = false;
lblContent.Visible= true;
content= null; pic = null;
question=Info_QuestionBLL.GetModel(node.NodeId);if (question != null && question.QuestionContent != "")
{if (question.QuestionSeconds > 0)
{
UPublic.Timers=question.QuestionSeconds;
UPublic.QuesId=question.QuestionId.ToString();
mainform.bottom.TimerStar();
}
lblContent.alphaRichTextBox1.Rtf=question.QuestionContent;
lblContent.Location=(Point)converter.ConvertFromString(pointSize(question.QLocation.Trim(), locOrSize.location));
lblContent.Size=(Size)converters.ConvertFromString(question.QSize);
}//加载(刷新)
mainform.BindData("wenti");
}
}
Thread.Sleep(800);
label1.Visible= false;
}
这段代码展示了如何根据不同的类型(视频、文字、问题)来动态地显示和配置界面元素,如标题、内容区域、播放器等。同时,它处理了数据加载,包括视频播放、内容显示和问题呈现,并且在加载完成后隐藏了一个标签。

被折叠的 条评论
为什么被折叠?



