// 根据 $u 内容设置 this.textBox_objectRights.Text 值。这用于对话框打开的时候 // 如果 $u 内容当作 id 去对象列表中找没有找到,则不改变 this.textBox_objectRights.Text 值 void FillObjectRights() { if (String.IsNullOrEmpty(this.comboBox_u.Text) == true) { goto IS_NOT_ID; } GetResInfoEventArgs e1 = new GetResInfoEventArgs(); e1.ID = this.comboBox_u.Text; this.GetResInfo(this, e1); if (String.IsNullOrEmpty(e1.ErrorInfo) == false) { goto IS_NOT_ID; } if (e1.Results == null || e1.Results.Count == 0) { goto IS_NOT_ID; } this.textBox_objectRights.Text = e1.Results[0].Rights; EnableObjectRights(true); return; IS_NOT_ID: EnableObjectRights(false); }
private void comboBox_u_SelectedIndexChanged(object sender, EventArgs e) { if (String.IsNullOrEmpty(this.comboBox_u.Text) == true) { goto IS_NOT_ID; } GetResInfoEventArgs e1 = new GetResInfoEventArgs(); e1.ID = this.comboBox_u.Text; this.GetResInfo(this, e1); if (String.IsNullOrEmpty(e1.ErrorInfo) == false) { MessageBox.Show(this, e1.ErrorInfo); goto IS_NOT_ID; } if (e1.Results == null || e1.Results.Count == 0) { goto IS_NOT_ID; } this.textBox_f.Text = e1.Results[0].LocalPath; this.textBox_q.Text = e1.Results[0].Mime; this.textBox_s.Text = e1.Results[0].Size.ToString(); this.textBox_objectRights.Text = e1.Results[0].Rights; EnableObjectRights(true); return; IS_NOT_ID: EnableObjectRights(false); }
private void comboBox_u_DropDown(object sender, EventArgs e) { // 防止重入 if (this.m_nInDropDown > 0) { return; } if (this.comboBox_u.Items.Count != 0) { return; } if (this.GetResInfo == null) { return; } Cursor oldCursor = this.Cursor; this.Cursor = Cursors.WaitCursor; this.m_nInDropDown++; try { GetResInfoEventArgs e1 = new GetResInfoEventArgs(); e1.ID = ""; this.GetResInfo(this, e1); if (String.IsNullOrEmpty(e1.ErrorInfo) == false) { MessageBox.Show(this, e1.ErrorInfo); return; } if (e1.Results == null) { return; } for (int i = 0; i < e1.Results.Count; i++) { this.comboBox_u.Items.Add(e1.Results[i].ID); } } finally { this.Cursor = oldCursor; this.m_nInDropDown--; } }
/// <summary> /// 获得对象资源信息 /// </summary> /// <param name="sender">发送者</param> /// <param name="e">事件参数</param> public void GetResInfo(object sender, GetResInfoEventArgs e) { List<ResInfo> resinfos = new List<ResInfo>(); for (int i = 0; i < this.binaryResControl1.ListView.Items.Count; i++) { ListViewItem item = this.binaryResControl1.ListView.Items[i]; string strID = ListViewUtil.GetItemText(item, BinaryResControl.COLUMN_ID); // 当 e.ID 为空的时候表示希望获得所有的行的信息。否则就是获得特定 id 的行的信息 if (String.IsNullOrEmpty(e.ID) == true || strID == e.ID) { ResInfo resinfo = new ResInfo(); resinfo.ID = strID; resinfo.LocalPath = ListViewUtil.GetItemText(item, BinaryResControl.COLUMN_LOCALPATH); resinfo.Mime = ListViewUtil.GetItemText(item, BinaryResControl.COLUMN_MIME); try { resinfo.Size = Convert.ToInt64(ListViewUtil.GetItemText(item, BinaryResControl.COLUMN_SIZE)); } catch { } resinfo.Usage = ListViewUtil.GetItemText(item, BinaryResControl.COLUMN_USAGE); resinfo.Rights = ListViewUtil.GetItemText(item, BinaryResControl.COLUMN_RIGHTS); resinfos.Add(resinfo); } } e.Results = resinfos; }
// 根据 $u 内容设置 this.textBox_objectRights.Text 值。这用于对话框打开的时候 // 如果 $u 内容当作 id 去对象列表中找没有找到,则不改变 this.textBox_objectRights.Text 值 void FillObjectRights() { if (String.IsNullOrEmpty(this.comboBox_u.Text) == true) goto IS_NOT_ID; GetResInfoEventArgs e1 = new GetResInfoEventArgs(); e1.ID = this.comboBox_u.Text; this.GetResInfo(this, e1); if (String.IsNullOrEmpty(e1.ErrorInfo) == false) goto IS_NOT_ID; if (e1.Results == null || e1.Results.Count == 0) goto IS_NOT_ID; this.textBox_objectRights.Text = e1.Results[0].Rights; EnableObjectRights(true); return; IS_NOT_ID: EnableObjectRights(false); }
private void comboBox_u_SelectedIndexChanged(object sender, EventArgs e) { if (String.IsNullOrEmpty(this.comboBox_u.Text) == true) goto IS_NOT_ID; GetResInfoEventArgs e1 = new GetResInfoEventArgs(); e1.ID = this.comboBox_u.Text; this.GetResInfo(this, e1); if (String.IsNullOrEmpty(e1.ErrorInfo) == false) { MessageBox.Show(this, e1.ErrorInfo); goto IS_NOT_ID; } if (e1.Results == null || e1.Results.Count == 0) goto IS_NOT_ID; this.textBox_f.Text = e1.Results[0].LocalPath; this.textBox_q.Text = e1.Results[0].Mime; this.textBox_s.Text = e1.Results[0].Size.ToString(); this.textBox_objectRights.Text = e1.Results[0].Rights; EnableObjectRights(true); return; IS_NOT_ID: EnableObjectRights(false); }
private void comboBox_u_DropDown(object sender, EventArgs e) { // 防止重入 if (this.m_nInDropDown > 0) return; if (this.comboBox_u.Items.Count != 0) return; if (this.GetResInfo == null) return; Cursor oldCursor = this.Cursor; this.Cursor = Cursors.WaitCursor; this.m_nInDropDown++; try { GetResInfoEventArgs e1 = new GetResInfoEventArgs(); e1.ID = ""; this.GetResInfo(this, e1); if (String.IsNullOrEmpty(e1.ErrorInfo) == false) { MessageBox.Show(this, e1.ErrorInfo); return; } if (e1.Results == null) return; for (int i = 0; i < e1.Results.Count; i++) { this.comboBox_u.Items.Add(e1.Results[i].ID); } } finally { this.Cursor = oldCursor; this.m_nInDropDown--; } }