Exemplo n.º 1
0
        private void CreateNewConfig(string selectedPath)
        {
            CreateConfig frm = new CreateConfig();

            if (frm.ShowDialog() == DialogResult.OK)
            {
                gProps   = frm.Properties;
                rootPath = Path.Combine(selectedPath, string.Format("{0}.cottle", frm.ConfigName));
                Directory.CreateDirectory(rootPath);
                btSaveIni_Click(null, null);
                LoadConfiguration();
            }
        }
Exemplo n.º 2
0
        private void rbPython_CheckedChanged(object sender, EventArgs e)
        {
            Properties = new CodeGeneratorProperties()
            {
                BlockBegin    = "#@{",
                BlockContinue = "#@>",
                BlockEnd      = "#@}",

                AltBlockBegin    = "{{",
                AltBlockContinue = "|>",
                AltBlockEnd      = "}}",
                EnableAlt        = true,

                And = "and",
                Or  = "or",
                Xor = "xor",

                True  = "True",
                False = "False"
            };
        }
Exemplo n.º 3
0
        private void rbJson_CheckedChanged(object sender, EventArgs e)
        {
            Properties = new CodeGeneratorProperties()
            {
                BlockBegin    = "\"@",
                BlockContinue = "\">",
                BlockEnd      = "@\"",

                AltBlockBegin    = "{",
                AltBlockContinue = "|>",
                AltBlockEnd      = "}",
                EnableAlt        = true,

                And = "&",
                Or  = "|",
                Xor = "^",

                True  = "True",
                False = "False"
            };
        }
Exemplo n.º 4
0
        private void rbCpp_CheckedChanged(object sender, EventArgs e)
        {
            Properties = new CodeGeneratorProperties()
            {
                BlockBegin    = "/*@",
                BlockContinue = "//@",
                BlockEnd      = "//*/",

                AltBlockBegin    = "{{",
                AltBlockContinue = "|>",
                AltBlockEnd      = "}}",
                EnableAlt        = true,

                And = "&&",
                Or  = "||",
                Xor = "^",

                True  = "true",
                False = "false"
            };
        }
Exemplo n.º 5
0
        private void LoadConfiguration(string path)
        {
            gProps = new CodeGeneratorProperties(path);
            if (gData != null)
            {
                gData.Profile.Properties = gProps;
            }
            propertyGrid1.SelectedObject = gProps;

            string scriptsFolder = Path.GetDirectoryName(path);

            rootPath = scriptsFolder;
            var folderName = Path.GetFileName(scriptsFolder);
            var rootNode   = new TreeNode(folderName, 0, 0);

            rootNode.Tag = new NodeTag(scriptsFolder, new RenderingContext(scriptsFolder, ContextLevel.Project, gData, scriptsFolder));
            treeView.Nodes.Clear();
            treeView.Nodes.Add(rootNode);

            ProccessDirs(scriptsFolder, rootNode);
            foreach (string filePath in Directory.EnumerateFiles(scriptsFolder))
            {
                string fileName = Path.GetFileName(filePath);
                string fileExt  = Path.GetExtension(filePath);
                if (fileExt == ".pha")
                {
                    continue;
                }
                else if (fileName == "cottle.ini")
                {
                    rootNode.Nodes.Add(fileName, fileName, 2, 2).Tag = new NodeTag(filePath, new RenderingContext(filePath, ContextLevel.NoContext, gData, fileName));
                }
                else
                {
                    ProccessScript(filePath, rootNode);
                }
            }
            rootNode.ExpandAll();
        }
Exemplo n.º 6
0
 private void rbDefault_CheckedChanged(object sender, EventArgs e)
 {
     Properties = new CodeGeneratorProperties();
 }
Exemplo n.º 7
0
 public CreateConfig()
 {
     Properties = new CodeGeneratorProperties();
     InitializeComponent();
 }