private static void OutputOrgTreehSizeRecursively(OrgTreeNode node) { OutputOrgTreeNodeSize(node); foreach (OrgTreeNode child in node.Children) OutputOrgTreehSizeRecursively(child); }
private static void OutputOrgTreeNodeSize(OrgTreeNode node) { if (node is ITreeNodeSize) Console.WriteLine("Name = {0}, MaxWidth = {1}, MaxLevel = {2} ", node.Name, node.MaxWidth, node.MaxLevel); else Console.WriteLine("Name = {0}, MaxWidth = {1}, MaxLevel = {2} ", node.Name, node.CalculateMaxWidth(), node.CalculateMaxLevel()); }
private static OrgTreeNode PrepareOguTree(SCOrganization organization) { OrgTreeNode node = new OrgTreeNode(organization); ProcessProgress.Current.Increment(); ProcessProgress.Current.Response(string.Format("已经处理了{0}个组织", ProcessProgress.Current.CurrentStep)); foreach (SchemaObjectBase obj in organization.CurrentChildren) { if (obj is SCOrganization) { ProcessProgress.Current.MaxStep += 1; node.Children.Add(PrepareOguTree((SCOrganization)obj)); } } return node; }
private static OrgTreeNode PreareOrgTree() { OrgTreeNode root = new OrgTreeNode("集团"); OrgTreeNode aa = root.Children.Add(new OrgTreeNode("行政部")); aa.Children.Add(new OrgTreeNode("办公室")); OrgTreeNode finance = root.Children.Add(new OrgTreeNode("财务部")); OrgTreeNode accountant = finance.Children.Add(new OrgTreeNode("会计")); accountant.Children.Add(new OrgTreeNode("审核会计")); finance.Children.Add(new OrgTreeNode("出纳")); OrgTreeNode hr = root.Children.Add(new OrgTreeNode("人事部")); hr.Children.Add(new OrgTreeNode("入职专员")); hr.Children.Add(new OrgTreeNode("福利专员")); hr.Children.Add(new OrgTreeNode("薪酬专员")); return root; }