// 得到指定小节的权限 private string GetSectionRights(string strRights, string strCategory) { DigitalPlatform.Text.SectionPropertyString.PropertyCollection propertyColl = new DigitalPlatform.Text.SectionPropertyString.PropertyCollection("this", strRights, DelimiterFormat.Semicolon); Section section = propertyColl[strCategory]; if (section == null) { return(""); } return(section.Value); }
private void textBox_property_TextChanged(object sender, EventArgs e) { if (this.DisableEvent > 0) { return; } REDO: string strCurCategory = this.SelectedCategory; if (String.IsNullOrEmpty(strCurCategory)) { strCurCategory = "*"; } if (strCurCategory == "*") { this.m_pc = new DigitalPlatform.Text.SectionPropertyString.PropertyCollection( "this", this.textBox_property.Text, DelimiterFormat.Mix); } else { // 观察是否有两个以上的冒号 int nRet = this.textBox_property.Text.IndexOf(":"); if (nRet != -1) { nRet = this.textBox_property.Text.IndexOf(":", nRet + 1); if (nRet != -1) { // 先切换为*类目,然后继续执行changetext功能 string strSaveText = this.textBox_property.Text; this.SelectedCategory = "*"; this.textBox_property.Text = strSaveText; goto REDO; } } m_pc.NewSection("this", strCurCategory, this.textBox_property.Text); } SetCheckList(this.m_pc); }
private void textBox_property_TextChanged(object sender, EventArgs e) { if (this.DisableEvent > 0) return; REDO: string strCurCategory = this.SelectedCategory; if (String.IsNullOrEmpty(strCurCategory)) strCurCategory = "*"; if (strCurCategory == "*") { this.m_pc = new DigitalPlatform.Text.SectionPropertyString.PropertyCollection( "this", this.textBox_property.Text, DelimiterFormat.Mix); } else { // 观察是否有两个以上的冒号 int nRet = this.textBox_property.Text.IndexOf(":"); if (nRet != -1) { nRet = this.textBox_property.Text.IndexOf(":", nRet + 1); if (nRet != -1) { // 先切换为*类目,然后继续执行changetext功能 string strSaveText = this.textBox_property.Text; this.SelectedCategory = "*"; this.textBox_property.Text = strSaveText; goto REDO; } } m_pc.NewSection("this", strCurCategory, this.textBox_property.Text); } SetCheckList(this.m_pc); }
// 得到指定小节的权限 private string GetSectionRights(string strRights, string strCategory) { DigitalPlatform.Text.SectionPropertyString.PropertyCollection propertyColl = new DigitalPlatform.Text.SectionPropertyString.PropertyCollection("this", strRights, DelimiterFormat.Semicolon); Section section = propertyColl[strCategory]; if (section == null) return ""; return section.Value; }
void SetCheckList(DigitalPlatform.Text.SectionPropertyString.PropertyCollection pc) { PrepareTag(); string strCurCategory = this.SelectedCategory; if (String.IsNullOrEmpty(strCurCategory)) { strCurCategory = "*"; } for (int i = 0; i < m_pc.Count; i++) { Section section = m_pc[i]; // 析出名字 string strSectionName = section.Name; string strValues = section.ToString(); if (String.IsNullOrEmpty(strSectionName) == true) { strSectionName = "this"; } // 看看是否在可显示范围 if (strCurCategory == "*" || String.Compare(strCurCategory, strSectionName, true) == 0) { } else { continue; } for (int j = 0; j < section.Count; j++) { Item propertyItem = section[j]; ListViewItem item = LocateListItem(strSectionName, propertyItem.PureValue); if (item == null) { // 未定义的保留值 } else { if (item.ImageIndex != STATE_ON && propertyItem.Enabled == true) { /* * item.BackColor = CheckedBackColor; * item.ImageIndex = STATE_ON; */ SetItemState(item, STATE_ON); item.Tag = null; // 标记,表示本次触及到了 } else if (item.ImageIndex != STATE_OFF && propertyItem.Enabled == false) { /* * item.BackColor = UncheckedBackColor; * item.ImageIndex = STATE_OFF; */ SetItemState(item, STATE_OFF); item.Tag = null; // 标记,表示本次触及到了 } else { item.Tag = null; // 不用动 } } } } // uncheck本次没有on的 for (int i = 0; i < this.listView_property.Items.Count; i++) { ListViewItem item = this.listView_property.Items[i]; if (item.Tag == null) { } else { if ((int)item.Tag == STATE_NONE && item.ImageIndex != STATE_NONE) { /* * item.BackColor = UncheckedBackColor; * item.ImageIndex = STATE_NONE; */ SetItemState(item, STATE_NONE); } else if ((int)item.Tag == STATE_ON && item.ImageIndex != STATE_ON) { /* * item.BackColor = CheckedBackColor; * item.ImageIndex = STATE_ON; */ SetItemState(item, STATE_ON); } else if ((int)item.Tag == STATE_OFF && item.ImageIndex != STATE_OFF) { /* * item.BackColor = UncheckedBackColor; * item.ImageIndex = STATE_OFF; */ SetItemState(item, STATE_OFF); } } } }
void SetCheckList(DigitalPlatform.Text.SectionPropertyString.PropertyCollection pc) { PrepareTag(); string strCurCategory = this.SelectedCategory; if (String.IsNullOrEmpty(strCurCategory)) { strCurCategory = "*"; } for (int i = 0; i < m_pc.Count; i++) { Section section = m_pc[i]; // 析出名字 string strSectionName = section.Name; string strValues = section.ToString(); if (String.IsNullOrEmpty(strSectionName) == true) { strSectionName = "this"; } // 看看是否在可显示范围 if (strCurCategory == "*" || String.Compare(strCurCategory, strSectionName, true) == 0) { } else { continue; } for (int j = 0; j < section.Count; j++) { Item propertyItem = section[j]; ListViewItem item = LocateListItem(strSectionName, propertyItem.Value); if (item == null) { // 未定义的保留值 } else { if (item.Checked != true) { item.BackColor = CheckedBackColor; item.Checked = true; item.Tag = null; // 标记,表示本次触及到了 } else { item.Tag = null; // 不用动 } } } } // uncheck本次没有on的 for (int i = 0; i < this.listView_property.Items.Count; i++) { ListViewItem item = this.listView_property.Items[i]; if (item.Tag == null) { } else { if ((bool)item.Tag == false && item.Checked != false) { item.BackColor = UncheckedBackColor; item.Checked = false; } if ((bool)item.Tag == true && item.Checked != true) { item.BackColor = CheckedBackColor; item.Checked = true; } } } }