예제 #1
0
        private void Application_Startup(object sender, StartupEventArgs e)
        {
            s_Instance = this;

            Executor executor = null;

            m_Engine = MacroEngine.CreateApplicationInstance(executor);
            m_UI     = MacroUI.CreateApplicationInstance(m_Engine);


            AssemblyDeclaration Interop_Assembly = new AssemblyDeclaration("Microsoft.Office.Interop.Excel", "./", true);

            m_UI.AddAssembly(Interop_Assembly);

            Excel.Application oExcelApp = GetExcel();

            m_UI.SetExecutionValue("HOSTNAME", "Standalone App");
            m_UI.SetExecutionValue("Excel", oExcelApp.Application);
            m_UI.SetExecutionValue("MISSING", Type.Missing);

            m_UI.AddAccent("ExcelAccent", new Uri("pack://application:,,,/Macro Editor;component/Themes/Accents/ExcelAccent.xaml"));
            m_UI.AddAccent("WordAccent", new Uri("pack://application:,,,/Macro Editor;component/Themes/Accents/WordAccent.xaml"));
            m_UI.AddAccent("PowerPointAccent", new Uri("pack://application:,,,/Macro Editor;component/Themes/Accents/PowerPointAccent.xaml"));
            m_UI.AddAccent("OneNoteAccent", new Uri("pack://application:,,,/Macro Editor;component/Themes/Accents/OneNoteAccent.xaml"));
            m_UI.AddAccent("AccessAccent", new Uri("pack://application:,,,/Macro Editor;component/Themes/Accents/AccessAccent.xaml"));
            m_UI.AddAccent("OutlookAccent", new Uri("pack://application:,,,/Macro Editor;component/Themes/Accents/OutlookAccent.xaml"));
            m_UI.AddAccent("PublisherAccent", new Uri("pack://application:,,,/Macro Editor;component/Themes/Accents/PublisherAccent.xaml"));

            m_UI.SetAccent("ExcelAccent");

            Events.InvokeEvent("ApplicationLoaded");

            MainWindow = m_UI.MainWindow;
            MainWindow.Show();
        }
예제 #2
0
 public WorldInput(WorldModel world)
 {
     // parent reference
     World = world;
     // service references
     _network       = Service.Get <INetworkClient>();
     _userInterface = Service.Get <UserInterfaceService>();
     _input         = Service.Get <IInputService>();
     // local instances
     MousePick = new MousePicking();
     _macros   = new MacroEngine();
 }
예제 #3
0
        public WorldInput(WorldModel world)
        {
            // parent reference
            World = world;

            // service references
            m_Network       = ServiceRegistry.GetService <INetworkClient>();
            m_UserInterface = ServiceRegistry.GetService <UserInterfaceService>();
            m_Input         = ServiceRegistry.GetService <InputManager>();

            // local instances
            MousePick = new MousePicking();
            m_Macros  = new MacroEngine();
        }
예제 #4
0
 static void Main(string[] args)
 {
     if (args.Length != 1)
     {
         Console.WriteLine("Invalid number of arguments...");
         Console.ReadKey();
     }
     else
     {
         MacroEngine.Initialize(args[0]);
         MacroEngine.ParsePages();
         //Console.WriteLine(MacroEngine.Merge("..\\..\\MyMacro.mv", new Context()));
         Console.WriteLine("File Parsing Completed...Press any key to continue..");
         Console.ReadKey();
     }
 }
예제 #5
0
 public HashSet <AssemblyDeclaration> GetAssemblies()
 {
     return(MacroEngine.GetAssemblies());
 }
예제 #6
0
 public HashSet <FileDeclaration> GetFileDeclarations()
 {
     return(MacroEngine.GetFileDeclarations());
 }
예제 #7
0
 public async Task <bool> TryExecuteFile(FileDeclaration d, bool async, string runtime = "")
 {
     return(await MacroEngine.TryExecuteFile(d, async, runtime));
 }
예제 #8
0
 public void RemoveExecutionValue(string name)
 {
     MacroEngine.RemoveExecutionValue(name);
 }
예제 #9
0
 public void SetExecutionValue(string name, object value)
 {
     MacroEngine.SetExecutionValue(name, value);
 }
예제 #10
0
 public async Task <bool> DeleteFolder(DirectoryInfo info)
 {
     return(await MacroEngine.DeleteFolder(info));
 }
예제 #11
0
 public HashSet <FileDeclaration> RenameFolder(DirectoryInfo info, string newDir)
 {
     return(MacroEngine.RenameFolder(info, newDir));
 }
예제 #12
0
 public void RemoveAssembly(AssemblyDeclaration declaration)
 {
     MacroEngine.RemoveAssembly(declaration);
 }
예제 #13
0
 public HashSet <string> GetRuntimes(string language = "")
 {
     return(MacroEngine.GetRuntimes(language));
 }
예제 #14
0
 public string GetDefaultRuntime(FileDeclaration d)
 {
     return(MacroEngine.GetDefaultRuntime(d));
 }
예제 #15
0
 public string GetDefaultFileExtension()
 {
     return(MacroEngine.GetDefaultFileExtension());
 }
예제 #16
0
 public FileDeclaration GetDeclarationFromFullname(string fullname)
 {
     return(MacroEngine.GetDeclarationFromFullname(fullname));
 }
예제 #17
0
 public void RenameFile(FileDeclaration d, string newName)
 {
     MacroEngine.RenameFile(d, newName);
 }
예제 #18
0
 public void RemoveFile(FileDeclaration d)
 {
     MacroEngine.RemoveFile(d);
 }
예제 #19
0
 public void AddFile(FileDeclaration d)
 {
     MacroEngine.AddFile(d);
 }
예제 #20
0
 public void AddAssembly(AssemblyDeclaration declaration)
 {
     MacroEngine.AddAssembly(declaration);
 }
예제 #21
0
        public override string Evaluate(Context context)
        {
            string path = ParseUtilites.GetPathForIncludeParse(FilePath);

            return(MacroEngine.Merge(path, new Context()));
        }