private void AddDistinguishedNamesToObs(object obj) { if (ObDistinguishedNames == null) { ObDistinguishedNames = new ObservableCollection <DistinguishedNames>(); } ObDistinguishedNames.Add(new DistinguishedNames() { Index = ObDistinguishedNames.Count }); }
private void RemoveDistinguishedNamesToObs(object obj) { DistinguishedNames dn = obj as DistinguishedNames; if (dn != null) { ObDistinguishedNames.RemoveAt(dn.Index); } for (int i = 0; i < ObDistinguishedNames.Count; i++) { ObDistinguishedNames[i].Index = i; } }
private bool canActiveDirectoryPrinters(object obj) { if (ObDistinguishedNames != null) { if (ObDistinguishedNames.Any(d => !string.IsNullOrEmpty(d.Printers))) { return(true); } else { return(false); } } else { return(false); } }