예제 #1
0
파일: AddIn.cs 프로젝트: sandboxorg/QuantSA
    /// <summary>
    /// Expose all plugins in the Plugins folder
    /// </summary>
    private void ExposePlugins()
    {
        string dllDirectory = AppDomain.CurrentDomain.BaseDirectory + "\\Plugins";

        if (!Directory.Exists(dllDirectory))
        {
            return;                                  // No plugin folder, return without doing anything.
        }
        string[] fileEntries = Directory.GetFiles(dllDirectory);
        foreach (string file in fileEntries)
        {
            if (Path.GetExtension(file).ToLower().Equals(".dll"))
            {
                try
                {
                    ExposePlugin(file);
                }
                catch (Exception e)
                {
                    ExcelMessage le = new ExcelMessage(e);
                    le.ShowDialog();
                }
            }
        }
    }
예제 #2
0
파일: AddIn.cs 프로젝트: zhangz/QuantSA
    /// <summary>
    /// Expose all plugins in the Plugins folder
    /// </summary>
    private void GetPlugins()
    {
        var dllDirectory = AppDomain.CurrentDomain.BaseDirectory + "\\Plugins";

        if (!Directory.Exists(dllDirectory))
        {
            return;                                  // No plugin folder, return without doing anything.
        }
        var fileEntries = Directory.GetFiles(dllDirectory);

        foreach (var file in fileEntries)
        {
            if (Path.GetExtension(file).ToLower().Equals(".dll"))
            {
                try
                {
                    var assembly = Assembly.LoadFile(file);
                    var plugin   = GetPlugin(assembly);
                    Plugins.Add(Tuple.Create(plugin, assembly));
                }
                catch (Exception e)
                {
                    var le = new ExcelMessage(e);
                    le.ShowDialog();
                }
            }
        }
    }
예제 #3
0
        public static object ShowAbout()
        {
            ExcelMessage message = new ExcelMessage("QuantSA Plugin demo.", PluginConnection.instance.GetAboutString());

            message.ShowDialog();
            return(null);
        }
예제 #4
0
    public static int ShowAbout()
    {
        ExcelMessage em = new ExcelMessage("QuantSA", "QuantSA is an open source library for quantitative finance, customized for the South African market\n\n" +
                                           "View the code at: https://github.com/JamesLTaylor/QuantSA \n\n" +
                                           "Visit the website at www.quantsa.org");

        em.ShowDialog();
        return(0);
    }
예제 #5
0
        public static string LatestError()
        {
            if (ObjectMap.Instance.LatestException == null)
            {
                var latestError = new ExcelMessage("No errors have occurred.");
                latestError.ShowDialog();
            }
            else
            {
                var latestError = new ExcelMessage(ObjectMap.Instance.LatestException);
                latestError.ShowDialog();
            }

            return("");
        }