Exemplo n.º 1
0
        private void populate_config_vals(ConfigInfo config_data)
        {
            plugins            = config_data.list();
            callback_container = build_container();
            config             = config_data.host_info();

            String working_dir = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);

            host_port = Convert.ToInt32(config["host_port"]);
            host_ip   = config["host_ip"];
            String host_proc_relative_dir = Path.GetFullPath(Path.Combine(working_dir, "..\\..\\host"));

            host_proc_name = config["proc_name"];

            if (String.IsNullOrEmpty(host_proc_name))
            {
                // Find the exe in the host proc dir
                try
                {
                    var files = Directory.EnumerateFiles(host_proc_relative_dir, "*.exe", System.IO.SearchOption.TopDirectoryOnly);
                    foreach (String file in files)
                    {
                        host_proc_name = Path.GetFileNameWithoutExtension(file);
                    }
                }
                catch (Exception e)
                {
                    System.Windows.Forms.MessageBox.Show(e.Message);
                }
            }

            host_proc_path = config["proc_path"];
            if (String.IsNullOrEmpty(host_proc_path))
            {
                // path as relative location from the dir
                host_proc_path = Path.GetFullPath(Path.Combine(host_proc_relative_dir, host_proc_name + ".exe"));
            }

            host_proc_args = config["proc_args"];
        }
Exemplo n.º 2
0
 public PluginCall(ConfigInfo config_data, SwIntegration caller)
 {
     integration = caller;
     populate_config_vals(config_data);
 }
Exemplo n.º 3
0
 public PluginCall(ConfigInfo config_data)
 {
     integration = null;
     populate_config_vals(config_data);
 }