示例#1
0
        public TypeCobolWindow()
        {
            InitializeComponent();

            // Default directory at startup
            currentProject = new CompilationProject("project",
                                                    DEFAULT_DIRECTORY, new string[] { ".txt", "*.cbl", "*.cpy" },
                                                    DEFAULT_DOCUMENT_FORMAT.Encoding, DEFAULT_DOCUMENT_FORMAT.EndOfLineDelimiter, DEFAULT_DOCUMENT_FORMAT.FixedLineLength, DEFAULT_DOCUMENT_FORMAT.ColumnsLayout, new TypeCobolOptions());

            // Default compiler options
            compilerOptions = new TypeCobolOptions();

            // Incremental TypeCobol compilation
            TypeCobolCompilerService.AttachIncrementalCompilerToTextEditorDocument(textEditor, currentProject, null, compilerOptions, this);
        }
示例#2
0
        void openFileClick(object sender, RoutedEventArgs e)
        {
            OpenFileDialog dlg = new OpenFileDialog();

            dlg.CheckFileExists = true;
            if (Directory.Exists(DEFAULT_DIRECTORY))
            {
                dlg.InitialDirectory = DEFAULT_DIRECTORY;
            }
            if (dlg.ShowDialog() ?? false)
            {
                currentProject = new CompilationProject("project",
                                                        Path.GetDirectoryName(dlg.FileName), new string[] { ".txt", "*.cbl", "*.cpy" },
                                                        DEFAULT_DOCUMENT_FORMAT.Encoding, DEFAULT_DOCUMENT_FORMAT.EndOfLineDelimiter, DEFAULT_DOCUMENT_FORMAT.FixedLineLength, DEFAULT_DOCUMENT_FORMAT.ColumnsLayout, new TypeCobolOptions());
                string textName = Path.GetFileNameWithoutExtension(dlg.FileName);
                TypeCobolCompilerService.AttachIncrementalCompilerToTextEditorDocument(textEditor, currentProject, textName, compilerOptions, this);
            }
        }