Пример #1
0
        private void comboLayoutType_SelectedIndexChanged(object sender, System.EventArgs e)
        {
            if (comboLayoutType.SelectedItem == null || comboLayout.SelectedItem == null)
            {
                return;
            }

            DevComponents.Tree.eNodeLayout layout = (DevComponents.Tree.eNodeLayout)Enum.Parse(typeof(DevComponents.Tree.eNodeLayout), comboLayout.SelectedItem.ToString());
            if (layout == DevComponents.Tree.eNodeLayout.Map)
            {
                DevComponents.Tree.eMapFlow mapFlow = (DevComponents.Tree.eMapFlow)Enum.Parse(typeof(DevComponents.Tree.eMapFlow), comboLayoutType.SelectedItem.ToString());
                if (treeGX1.MapLayoutFlow != mapFlow)
                {
                    treeGX1.MapLayoutFlow = mapFlow;
                    treeGX1.RecalcLayout();
                    treeGX1.Refresh();
                }
            }
            else if (layout == DevComponents.Tree.eNodeLayout.Diagram)
            {
                DevComponents.Tree.eDiagramFlow diagramFlow = (DevComponents.Tree.eDiagramFlow)Enum.Parse(typeof(DevComponents.Tree.eDiagramFlow), comboLayoutType.SelectedItem.ToString());
                if (treeGX1.DiagramLayoutFlow != diagramFlow)
                {
                    treeGX1.DiagramLayoutFlow = diagramFlow;
                    treeGX1.RecalcLayout();
                    treeGX1.Refresh();
                }
            }
        }
Пример #2
0
        private void comboLayout_SelectedIndexChanged(object sender, System.EventArgs e)
        {
            comboLayoutType.Items.Clear();

            if (comboLayout.SelectedItem == null)
            {
                return;
            }

            DevComponents.Tree.eNodeLayout layout = (DevComponents.Tree.eNodeLayout)Enum.Parse(typeof(DevComponents.Tree.eNodeLayout), comboLayout.SelectedItem.ToString());
            if (treeGX1.LayoutType != layout)
            {
                treeGX1.LayoutType = layout;
                treeGX1.RecalcLayout();
            }

            if (layout == DevComponents.Tree.eNodeLayout.Map)
            {
                comboLayoutType.Items.AddRange(Enum.GetNames(typeof(DevComponents.Tree.eMapFlow)));
                comboLayoutType.SelectedItem = treeGX1.MapLayoutFlow.ToString();
            }
            else if (layout == DevComponents.Tree.eNodeLayout.Diagram)
            {
                comboLayoutType.Items.AddRange(Enum.GetNames(typeof(DevComponents.Tree.eDiagramFlow)));
                comboLayoutType.SelectedItem = treeGX1.DiagramLayoutFlow.ToString();
            }
        }