Exemple #1
0
        private void securityGroupToolStripMenuItem_Click(object sender, EventArgs e)
        {
            TerraformGen tfGen = new TerraformGen();

            // For Loading Security Group
            List <amazonSecurityGrp> secgrpList = new List <amazonSecurityGrp>();

            tfGen.LoadSecurityGroup(drawFilename, secgrpList);

            foreach (amazonSecurityGrp aSNet in secgrpList)
            {
                richTextBox1.Text += aSNet.ToString();
            }
            dataGridView1.DataSource = secgrpList;
        }
Exemple #2
0
        private string GenerateSecurityGroup(string InputFile)
        {
            TerraformGen tfGen    = new TerraformGen();
            string       outputTF = "";
            // For Loading Security Group
            List <amazonSecurityGrp> secgrpList = new List <amazonSecurityGrp>();

            tfGen.LoadSecurityGroup(InputFile, secgrpList);

            foreach (amazonSecurityGrp aSNet in secgrpList)
            {
                outputTF += aSNet.ToString();
            }

            return(outputTF);
        }
Exemple #3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void openForLINQToolStripMenuItem_Click(object sender, EventArgs e)
        {
            OpenFileDialog openFileDialog = new OpenFileDialog();

            if (openFileDialog.ShowDialog() == DialogResult.OK)
            {
                var          path  = openFileDialog.FileName;
                TerraformGen tfGen = new TerraformGen();

                // For Loading VPC

                /* List<amazonVPC> VPCList = new List<amazonVPC>();
                 *
                 * tfGen.LoadVPC(path, VPCList);
                 *
                 * foreach ( amazonVPC aVpc in VPCList)
                 * {
                 *   richTextBox1.Text += aVpc.ToString();
                 * }
                 * dataGridView1.DataSource = VPCList;
                 */

                /*
                 * // For Loading Subnets
                 * List<amazonSubnet> subnetList = new List<amazonSubnet>();
                 *
                 * tfGen.LoadSubnet(path, subnetList);
                 *
                 * foreach (amazonSubnet aSNet in subnetList)
                 * {
                 *  richTextBox1.Text += aSNet.ToString();
                 * }
                 * dataGridView1.DataSource = subnetList;
                 */

                // For Loading Security Group
                List <amazonSecurityGrp> secgrpList = new List <amazonSecurityGrp>();

                tfGen.LoadSecurityGroup(path, secgrpList);

                foreach (amazonSecurityGrp aSNet in secgrpList)
                {
                    richTextBox1.Text += aSNet.ToString();
                }
                dataGridView1.DataSource = secgrpList;
            }
        }
Exemple #4
0
        private void LoadPropWindowWithSG(string SGName)
        {
            TerraformGen tfGen = new TerraformGen();
            // For Loading SG
            List <amazonSecurityGrp> sgList = new List <amazonSecurityGrp>();

            tfGen.LoadSecurityGroup(GlobalVars.varPrj.DiagramFilename, sgList);

            foreach (amazonSecurityGrp aSG in sgList)
            {
                if (aSG.name == SGName)
                {
                    prgPropGrid.SelectedObject = aSG;
                    return;
                }
            }
        }
Exemple #5
0
        private void LoadTreeWithSecurityGroup()
        {
            TerraformGen tfGen = new TerraformGen();

            // For Loading Security Group
            List <amazonSecurityGrp> sgList = new List <amazonSecurityGrp>();

            tfGen.LoadSecurityGroup(GlobalVars.varPrj.DiagramFilename, sgList);

            foreach (amazonSecurityGrp sg in sgList)
            {
                TreeNode[] tvwNode = tvwStructure.Nodes.Find("SG:" + sg.vpc_id, true);

                if (tvwNode.Length > 0)
                {
                    tvwNode[0].Nodes.Add(sg.name, "SG[" + sg.name + "|" + sg.vpc_id + "]");

                    tvwNode[0].ExpandAll();
                }
            }
        }