internal DeviceTypeSort(ApplicationClass application, string name, DeviceTypeSort parent) { this.m_Application = application; this.Name = name; this.Parent = parent; this.Children = new DeviceTypeSortCollection(); this.DeviceTypes = new DeviceTypeCollection(); }
internal DeviceTypeSort FindSort(string sortPath) { string[] strSortNames = sortPath.Split(new char[] { '/' }, StringSplitOptions.RemoveEmptyEntries); if (strSortNames.Length == 0) { return(this); } else { foreach (DeviceTypeSort children in this.Children) { if (children.Name.Equals(strSortNames[0])) { if (strSortNames.Length == 1) { return(children); } else { string strSortName = ""; for (int intIndex = 1; intIndex < strSortNames.Length; intIndex++) { strSortName += '/' + strSortNames[intIndex]; } return(children.FindSort(strSortName.Substring(1))); } } } DeviceTypeSort sort = new DeviceTypeSort(this.m_Application, strSortNames[0], this); this.Children.Add(sort); if (strSortNames.Length == 1) { return(sort); } else { string strSortName = ""; for (int intIndex = 1; intIndex < strSortNames.Length; intIndex++) { strSortName += '/' + strSortNames[intIndex]; } return(sort.FindSort(strSortName.Substring(1))); } } }