void UnCheck_Item_ByShare(Ad_TreeViewItem obj) { try { if (obj.ad == "cn") { Ad_ListViewItem ad_ListViewItem = obj.Ad_ListViewItem; if (ad_ListViewItem != null) { if (Ad_ListViewCollection.Contains(ad_ListViewItem)) { Ad_ListViewCollection.Remove(ad_ListViewItem); } } } else { foreach (var item in obj.Ad_Children) { UnCheck_Item_ByShare(item); item.Is_Checked = false; } } } catch (Exception ex) { LogManage.WriteLog(this.GetType(), ex); } finally { } }
void Check_Item_ByShare(Ad_TreeViewItem obj) { try { if (obj.ad == "cn") { if (obj.Ad_ListViewItem != null && Ad_ListViewCollection.Contains(obj.Ad_ListViewItem)) { return; } else { Ad_ListViewItem item = new Ad_ListViewItem(); item.name = obj.name; item.path = obj.path; item.Style = Ad_ListViewItem_Style; item.loginname = obj.loginname; obj.Ad_ListViewItem = item; item.Ad_TreeViewItem = obj; Ad_ListViewCollection.Add(item); } } else if (obj.ad == "ou") { foreach (var item in obj.Ad_Children) { Check_Item_ByShare(item); item.Is_Checked = true; } } } catch (Exception ex) { LogManage.WriteLog(this.GetType(), ex); } finally { } }
private void Item_Cancel_CallBack(Ad_ListViewItem obj) { try { if (Ad_ListViewCollection.Contains(obj)) { Ad_ListViewCollection.Remove(obj); } Ad_TreeViewItem ad_TreeViewItem = obj.Ad_TreeViewItem; if (ad_TreeViewItem != null) { ad_TreeViewItem.Is_Checked = false; this.Cancel_Selected_Parent(ad_TreeViewItem); } } catch (Exception ex) { LogManage.WriteLog(this.GetType(), ex); } finally { } }