コード例 #1
0
 public LanguageConverter_VisualPascalABCPlugin(IWorkbench Workbench)
 {
     Languages       = LoadLanguages();
     currentLanguage = Languages[0];
     this.VisualEnvironmentCompiler = Workbench.VisualEnvironmentCompiler;
     //TextFormatter = new TextFormatter();
     TextFormatterForm        = new TextFormatterForm();
     TextFormatterForm.Plugin = this;
     TextFormatterForm.Init();
     VisualEnvironmentCompiler.StandartCompiler.OnChangeCompilerState += new PascalABCCompiler.ChangeCompilerStateEventDelegate(Compiler_OnChangeCompilerState);
 }
コード例 #2
0
 public LanguageConverter_VisualPascalABCPlugin(IWorkbench Workbench)
 {
     Languages = LoadLanguages();
     currentLanguage = Languages[0];
     this.VisualEnvironmentCompiler = Workbench.VisualEnvironmentCompiler;
     //TextFormatter = new TextFormatter();
     TextFormatterForm = new TextFormatterForm();
     TextFormatterForm.Plugin = this;
     TextFormatterForm.Init();
     VisualEnvironmentCompiler.StandartCompiler.OnChangeCompilerState += new PascalABCCompiler.ChangeCompilerStateEventDelegate(Compiler_OnChangeCompilerState);
 }
コード例 #3
0
        // стырено
        private List <ISemanticNodeConverter> LoadLanguages()
        {
            List <ISemanticNodeConverter> Langs = new List <ISemanticNodeConverter>();
            // директория этого плагина
            string        dir = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.FullyQualifiedName);
            DirectoryInfo di  = new DirectoryInfo(dir);

            FileInfo[] dllfiles = di.GetFiles("*LanguageConverter.dll");
            System.Reflection.Assembly asssembly = null;
            Type constr = null;
            ISemanticNodeConverter pc = null;

            foreach (FileInfo fi in dllfiles)
            {
                asssembly = System.Reflection.Assembly.LoadFile(fi.FullName);
                try
                {
                    if (asssembly != null && asssembly.FullName != System.Reflection.Assembly.GetExecutingAssembly().FullName)
                    {
                        Type[] types = asssembly.GetTypes();
                        foreach (Type type in types)
                        {
                            if (type.Name.IndexOf("SemanticNodeConverter") >= 0)
                            {
                                Object obj = Activator.CreateInstance(type);
                                if (obj is ISemanticNodeConverter)
                                {
                                    Langs.Add(obj as ISemanticNodeConverter);
                                }
                            }
                        }
                    }
                }
                catch (Exception e)
                {
                }
            }
            return(Langs);
        }
コード例 #4
0
ファイル: Visitor.cs プロジェクト: CSRedRat/pascalabcnet
 public SemanticTreeVisitor(ISemanticNodeConverter _semanticNodeConverter)
 {
     ISemanticNodeConverter = _semanticNodeConverter;
 }