Example #1
0
        public IPTZ LoadPTZPlugin(string protocol)
        {
            Lazy <IPTZ> plugin = PluginsCatalog.mefContainer.GetExports <IPTZ>(protocol).FirstOrDefault(); //TODO: change this to select from app settings which tracking plugin to use instead of just using the 1st one found
            IPTZ        ptz    = (plugin != null) ? plugin.Value : null;

            try
            {
                (ptz as IInitializable)?.Initialize(Settings.Default);
            } catch (Exception e)
            {
                ptz = null;
                MessageBox.Show((e.InnerException ?? e).Message);
            }
            return(ptz);
        }
Example #2
0
 public void LoadPTZPlugins()
 {
     ptzFoscam = LoadPTZPlugin("PTZ.Foscam");
     ptz       = ptzFoscam;
 }