コード例 #1
0
 private void AddModuleToTree(TreeNode treeNode, string moduleName, fsCalculatorControl control)
 {
     if (m_modules.ContainsKey(moduleName))
     {
         throw new Exception("Module with such name is already added.");
     }
     m_modules[moduleName] = control;
     treeNode.Nodes.Add(moduleName).NodeFont = new Font("Microsoft Sans Serif", 8F, FontStyle.Regular);
 }
コード例 #2
0
ファイル: ModulesForm.cs プロジェクト: palatan6/fsim
        private void AddGroupToTree(
            string nodeName,
            TreeNodeCollection treeNodeCollection,
            IEnumerable <KeyValuePair <string, fsCalculatorControl> > calculationControls)
        {
            var node = new TreeNode(nodeName);

            foreach (var pair in calculationControls)
            {
                fsCalculatorControl calculatorControl = pair.Value;
                AddModuleToTree(node, pair.Key, calculatorControl);
            }
            treeNodeCollection.Add(node);
        }
コード例 #3
0
        private void AddGroupToTree(string nodeName,
                                    IEnumerable <KeyValuePair <string, fsCalculatorControl> > calculationControls)
        {
            var node = new TreeNode(nodeName);

            foreach (var pair in calculationControls)
            {
                fsCalculatorControl calculatorControl = pair.Value;
                AddModuleToTree(node, pair.Key, calculatorControl);
                if (calculatorControl is fsOptionsSingleTableAndCommentsCalculatorControl)
                {
                    (calculatorControl as fsOptionsSingleTableAndCommentsCalculatorControl).AllowDiagramView = false;
                }
            }
            treeView1.Nodes.Add(node);
        }
コード例 #4
0
ファイル: Module.cs プロジェクト: palatan6/fsim
 public fsModule(string name, fsCalculatorControl calculatorControl)
 {
     Name = name;
     m_calculatorControl = calculatorControl;
     if (m_calculatorControl != null)
     {
         Form = new Form
         {
             Text   = Name,
             Width  = m_calculatorControl.Width + 10,
             Height = m_calculatorControl.Height + 10
         };
         m_calculatorControl.Parent = Form;
         m_calculatorControl.ControlToResizeForExpanding = Form;
         m_calculatorControl.Dock = DockStyle.Fill;
         Form.Show();
     }
 }
コード例 #5
0
        private void TreeView1AfterSelect(object sender, TreeViewEventArgs e)
        {
            if (!m_modules.ContainsKey(treeView1.SelectedNode.Text))
            {
                return;
            }

            string selectedCalculatorControlName = treeView1.SelectedNode.Text;

            currentModuleTitleLabel.Text = selectedCalculatorControlName;

            if (SelectedCalculatorControl != null)
            {
                SelectedCalculatorControl.Parent = null;
            }

            SelectedCalculatorControl        = m_modules[selectedCalculatorControlName];
            SelectedCalculatorControl.Parent = modulePanel;
            SelectedCalculatorControl.Dock   = DockStyle.Fill;
        }