Exemplo n.º 1
0
        public void AutoOpen()
        {
            // loading intelli server in debug gives deadlock
#if !DEBUG
            IntelliSenseServer.Install();
#endif
        }
Exemplo n.º 2
0
    public void AutoOpen()
    {
        // Versions before v1.1.0 required only a call to Register() in the AutoOpen().
        // The name was changed (and made obsolete) to highlight the pair of function calls now required.
        IntelliSenseServer.Install();

        // HACK: Next line only to load RDKit2DotNet before using in NCDK-AddIn.
        new GraphMolWrap.ROMol();
    }
Exemplo n.º 3
0
        public void AutoOpen()
        {
            var listener = new LogDisplayTraceListener();

            Trace.Listeners.Add(listener);
            ExcelIntegration.RegisterUnhandledExceptionHandler(
                ex => "Unhandled EXCEPTION: " + ex.ToString());
            IntelliSenseServer.Install();
        }
Exemplo n.º 4
0
 /// <summary>Initialize the <see cref="IExcelAddIn"/>.
 /// </summary>
 public void AutoOpen()
 {
     try
     {
         IntelliSenseServer.Install();
         ExcelIntegration.RegisterUnhandledExceptionHandler(UnhandledExceptionHandler);  // add a 'standard-output' if a try-catch block is missing
     }
     catch (Exception e)
     {
         MessageBox.Show(String.Format("{0} Stack trace: {1}", e.Message, e.StackTrace), "Dodoni.net (XL-BasicComponents): Fatal error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Exemplo n.º 5
0
        public void AutoOpen()
        {
            var functions = ExcelRegistration.GetExcelFunctions().ToList();

            if (HasNativeXMatch())
            {
                foreach (var func in functions)
                {
                    func.FunctionAttribute.Name = func.FunctionAttribute.Name + ".FROM.ADDIN";
                }
            }
            functions.RegisterFunctions();

            IntelliSenseServer.Install();
        }
Exemplo n.º 6
0
        public void AutoOpen()
        {
            var functions = ExcelRegistration.GetExcelFunctions().ToList();

            if (HasNativeXMatch())
            {
                foreach (var func in functions)
                {
                    func.FunctionAttribute.Name = "HUST." + func.FunctionAttribute.Name;
                }
            }
            functions.RegisterFunctions();

            ///Cho phép hiển thị các dòng gợi ý hàm và gợi ý tham số của các thuộc tính
            ///<see cref="ExcelDna.Integration.ExcelFunctionAttribute"/> và <see cref="ExcelDna.Integration.ExcelArgumentAttribute"/>
            IntelliSenseServer.Install();
        }
Exemplo n.º 7
0
        public void AutoOpen()
        {
            // Add Export Tables to SQL Custom Pane
            System.Windows.Forms.Application.EnableVisualStyles();
            XLIG.ExportTables.CTPManager.InitCTManager();
            // Enable IntelliSense for UDF
            IntelliSenseServer.Install();
            // Ref Current Excel App to Global Var for further usage
            AddinContext.XlApp = (Excel.Application)ExcelDnaUtil.Application;
            // Hook Mouse on First Load
            MouseHook_Main.M_AppHook = Hook.AppEvents();
            MouseHook_Main.Init_Unload(XLIG.Properties.Settings.Default.HScroll);

            // Hook ws event to Ctrl+Tab switch back to old sheet
            AddinContext.XlApp.SheetDeactivate    += XlAppEvent_SheetDeactivate;
            AddinContext.XlApp.WorkbookDeactivate += XlAppEvent_WorkbookDeactivate;
            AddinContext.XlApp.WorkbookActivate   += XlAppEvent_WorkbookActivate;
        }
Exemplo n.º 8
0
        public void AutoOpen()
        {
            if (AddIn.IsFirstRun == true)
            {
                IntelliSenseServer.Install();
                AddIn.IsFirstRun = false;
            }

            ExcelApp = ExcelDnaUtil.Application as Excel.Application;
            //ExcelApp.SheetActivate += ExcelApp_SheetActivate;
            ExcelApp.SheetSelectionChange += ExcelApp_SheetSelectionChange;
            ExcelApp.WindowActivate       += ExcelApp_WindowActivate;
            ExcelRegistration.GetExcelFunctions()//在此处显示注册函数
            .Where(func => func.FunctionAttribute.Name.StartsWith("Params"))
            .ProcessParamsRegistrations()
            .RegisterFunctions();


            //ComAddInConnection com_addin = new ComAddInConnection();
            //ExcelComAddInHelper.LoadComAddIn(com_addin);
        }
Exemplo n.º 9
0
 public void AutoOpen()
 {
     IntelliSenseServer.Install();
 }
 public override void Install()
 {
     IntelliSenseServer.Install();
 }
Exemplo n.º 11
0
 //https://msdn.microsoft.com/zh-cn/library/bb687860(v=office.15)
 //Callback function that must be implemented and exported by every valid XLL. The xlAutoOpen function is the recommended place from where to register XLL functions and commands, initialize data structures, customize the user interface, and so on.
 public void AutoOpen()
 {
     IntelliSenseServer.Install();
     //ExcelDna.Logging.LogDisplay.Show();
     //ExcelDna.Logging.LogDisplay.DisplayOrder = ExcelDna.Logging.DisplayOrder.NewestFirst;
 }
Exemplo n.º 12
0
        public void AutoOpen()
        {
            RegisterFunctions();

            IntelliSenseServer.Install();
        }
Exemplo n.º 13
0
 void IExcelAddIn.AutoOpen()
 {
     Container.Instance.Install(FromAssembly.InThisApplication());
     DataFunctionsRegistration.RegisterDataFunctions();
     IntelliSenseServer.Install();
 }
Exemplo n.º 14
0
        public void AutoOpen()
        {
            try {
                RegisterFunctions();
                IntelliSenseServer.Install();

                AppDomain cDomain = AppDomain.CurrentDomain;

                pAssemblyLocation = cDomain.BaseDirectory;

                //Even though jar tvf <> can expose the classes of a jar ExcelDna-packed into an assembly
                //javap might not be able to find the class, so holding on....
                //    //Here, we will first try to use the concept that a C# assembly is like a Java jar
                //    //and the ExcelDNA packer can include the core jar (note there can be no lzma compression
                //    //which might required an old-style ExcelDNA Post-Build line).

                //    String pWDSJniPMML = Assembly.GetExecutingAssembly().FullName;
                //    pWDSJniPMML = pAssemblyLocation+"\\"
                //    +pWDSJniPMML.Substring(0, pWDSJniPMML.IndexOf(", Version") - 1) + "-AddIn64-packed.xll";

                //The dependency on slf4j-simple has been packaged into the jar, this
                //enables finding all of the HDF5 dependencies from the HDFView location.

                //The jarhdf[5] and hdfobject jars still depend on external libs/dlls
                //that should be on the path.  However, locations can be passed in on
                //the Excel command line with /o:WDS:<libname>:<liblocation>

                String pWDSJniPMML = pAssemblyLocation + "\\WDS-JniPMML-0.5.0.jar";
                {
                    DirectoryInfo aDirectoryInfo = new DirectoryInfo(pAssemblyLocation);
                    FileInfo[]    lFileInfo      = aDirectoryInfo.GetFiles("WDS*JniPMML*.jar");
                    if (lFileInfo == null || lFileInfo.Length == 0)
                    {
                        pWDSJniPMML = pAssemblyLocation + "\\Resources\\WDS-JniPMML-0.5.0.jar";
                    }
                }
                String pjarhdf5dir   = "";
                String pjarhdf5      = "";
                String pjarhdfdir    = "";
                String pjarhdf       = "";
                String phdfobjectdir = "";
                String phdfobject    = "";
                //String pslf4j = "";
                String pHDFView = "Unk";
                String pHDF5    = "Unk";


                //parse out the command line arguments in case /o:WDS - options are being used

                String[] args = System.Environment.GetCommandLineArgs();

                for (int i = 0; i < args.Length; i++)
                {
                    if (args[i].StartsWith("/o:WDS:WDS-JniPMML"))
                    {
                        String[] parts = args[i].Split(':');
                        pWDSJniPMML = parts[parts.Length - 1];
                    }
                    else if (args[i].StartsWith("/o:WDS:jarhdf5"))
                    {
                        String[] parts = args[i].Split(':');
                        pjarhdf5 = parts[parts.Length - 1];
                    }
                    else if (args[i].StartsWith("/o:WDS:jarhdf"))
                    {
                        String[] parts = args[i].Split(':');
                        pjarhdf = parts[parts.Length - 1];
                    }
                    else if (args[i].StartsWith("/o:WDS:hdfobject"))
                    {
                        String[] parts = args[i].Split(':');
                        phdfobject = parts[parts.Length - 1];
                    }
                    //else if ( args[i].StartsWith("/o:WDS:slf4j") ) {
                    //String[] parts = args[i].Split(':');
                    //pslf4j = parts[parts.Length - 1];
                    //}
                    else if (args[i].StartsWith("/o:WDS:path:HDFView"))
                    {
                        String[] parts = args[i].Split(':');
                        pHDFView = parts[parts.Length - 1];
                    }
                    else if (args[i].StartsWith("/o:WDS:path:HDF5"))
                    {
                        String[] parts = args[i].Split(':');
                        pHDF5 = parts[parts.Length - 1];
                    }
                }



                //if not provided with command lines, check the paths
                if (pHDFView.Equals("Unk") || pHDF5.Equals("Unk"))
                {
                    //pull the locations for HDFView and HDF5 from the system path
                    String p = System.Environment.GetEnvironmentVariable("PATH");
                    if (pHDFView.Equals("Unk"))
                    {
                        pHDFView = PathElementOf(p, "HDFView") + "\\lib";
                    }
                    if (pHDF5.Equals("Unk"))
                    {
                        pHDF5 = PathElementOf(p, "HDF5\\1") + "\\lib";
                    }
                }
                if (pWDSJniPMML == "")
                {
                    DirectoryInfo aDirectoryInfo = new DirectoryInfo(pAssemblyLocation);
                    FileInfo[]    lFileInfo      = aDirectoryInfo.GetFiles("WDS*JniPMML*.jar");
                    pWDSJniPMML = lFileInfo[0].FullName;
                }
                if (pjarhdf5 == "")
                {
                    //Use the jarhdf from the HDFView location first
                    //DirectoryInfo aDirectoryInfo = new DirectoryInfo(pHDF5);
                    DirectoryInfo aDirectoryInfo = new DirectoryInfo(pHDFView);
                    FileInfo[]    lFileInfo      = aDirectoryInfo.GetFiles("jarhdf5*.jar");
                    pjarhdf5    = lFileInfo[0].FullName;
                    pjarhdf5dir = System.IO.Path.GetDirectoryName(pjarhdf5);
                }
                if (pjarhdf == "")
                {
                    //DirectoryInfo aDirectoryInfo = new DirectoryInfo(pHDF5);
                    DirectoryInfo aDirectoryInfo = new DirectoryInfo(pHDFView);
                    FileInfo[]    lFileInfo      = aDirectoryInfo.GetFiles("jarhdf-*.jar");
                    pjarhdf    = lFileInfo[0].FullName;
                    pjarhdfdir = System.IO.Path.GetDirectoryName(pjarhdf5);
                }
                //if ( pslf4j == "" ) {
                //  //the slf4j-simple should be with HDF5
                //  //DirectoryInfo aDirectoryInfo = new DirectoryInfo(pHDFView);
                //  //FileInfo[] lFileInfo = aDirectoryInfo.GetFiles("slf4j-api*.jar");
                //  DirectoryInfo aDirectoryInfo = new DirectoryInfo(pHDF5);
                //  FileInfo[] lFileInfo = aDirectoryInfo.GetFiles("slf4j-simple*.jar");
                //  pslf4j = lFileInfo[0].FullName;
                //}
                if (phdfobject == "")
                {
                    DirectoryInfo aDirectoryInfo = new DirectoryInfo(pHDFView);
                    FileInfo[]    lFileInfo      = aDirectoryInfo.GetFiles("hdfobj*.jar");
                    phdfobject    = lFileInfo[0].FullName;
                    phdfobjectdir = System.IO.Path.GetDirectoryName(phdfobject);
                }

                java_class_path = pWDSJniPMML
                                  + ";" + phdfobject
                                  + ";" + pjarhdf5
                                  + ";" + pjarhdf
                                  //+ ";" + pslf4j
                ;

                java_module_path = phdfobjectdir;
                if (!java_module_path.Contains(pjarhdf5dir))
                {
                    java_module_path += pjarhdf5dir;
                }
                if (!java_module_path.Contains(pjarhdfdir))
                {
                    java_module_path += pjarhdfdir;
                }


                if (!pair.ContainsKey("-Djava.class.path"))
                {
                    pair.Add("-Djava.class.path", java_class_path);
                }

                //java_module = "hdfobject;jarhdf5;jarhdf;slf4j.simple";
                //java_module = "hdfobject;jarhdf5;jarhdf";
                //if ( !pair.ContainsKey("--add-modules") )
                //pair.Add("--add-modules", java_module);

                if (!pair.ContainsKey("-Djava.module.path"))
                {
                    pair.Add("-Djava.module.path", java_module_path);
                }

                if (!pair.ContainsKey("-Djava.library.path"))
                {
                    pair.Add("-Djava.library.path", pHDFView + ";" + pHDF5);
                }

                //if (!pair.ContainsKey("-D64")) pair.Add("-D64", "" );
                if (!pair.ContainsKey("-Xcheck:jni "))
                {
                    pair.Add("-Xcheck:jni ", "");
                }


                //initialize JNI object
                Java = new JavaNativeInterface();

                Java.LoadVM(pair, false);

                Java.InstantiateJavaObject(java_init_class_name);
                java_init_classid = Java.FindClassID(java_init_class_name);
                __JniPMML         = new com.WDataSci.JniPMML.JniPMML(Java, java_init_classid);
            }
            catch (Exception e) {
                throw new com.WDataSci.WDS.WDSException("Error into AutoLoad", e);
            }
            GC.Collect();
            GC.WaitForPendingFinalizers();
            GC.Collect();
            GC.WaitForPendingFinalizers();
        }
Exemplo n.º 15
0
 public void AutoOpen()
 {
     // Versions before v1.1.0 required only a call to Register() in the AutoOpen().
     // The name was changed (and made obsolete) to highlight the pair of function calls now required.
     IntelliSenseServer.Install();
 }
Exemplo n.º 16
0
 public void AutoOpen()
 {
     IntelliSenseServer.Install();
     crawlerFII   = new FIISiteCrawler();
     crawlerFound = new SiteFundsExplorer();
 }