Example #1
0
        public virtual IEnumerable <string> GetAllPendingMessages()
        {
            var messageCollectorType = _assemblyLoader.GetLibType(LibType.MessageCollector);

            return(_reflectionWrapper.InvokeMethod(messageCollectorType, null, "GetAllPendingMessages",
                                                   BindingFlags.Static | BindingFlags.Public) as IEnumerable <string>);
        }
Example #2
0
        public object GetClassInstanceManager()
        {
            if (ClassInstanceManagerType == null)
            {
                return(null);
            }
            var classInstanceManager = _activatorWrapper.CreateInstance(ClassInstanceManagerType);

            Logger.Debug("Loaded Instance Manager of Type:" + classInstanceManager.GetType().FullName);
            _reflectionWrapper.InvokeMethod(ClassInstanceManagerType, classInstanceManager, "Initialize",
                                            AssembliesReferencingGaugeLib);
            return(classInstanceManager);
        }
Example #3
0
        protected void Execute(MethodInfo method, params object[] parameters)
        {
            var typeToLoad = method.DeclaringType;
            var instance   =
                _reflectionWrapper.InvokeMethod(_classInstanceManagerType, _classInstanceManager, "Get", typeToLoad);

            if (instance == null)
            {
                var error = "Could not load instance type: " + typeToLoad;
                Logger.Error(error);
                throw new Exception(error);
            }

            _reflectionWrapper.Invoke(method, instance, parameters);
        }
Example #4
0
        public bool TryScreenCapture(out byte[] screenShotBytes)
        {
            try
            {
                var instance = activatorWrapper.CreateInstance(_assemblyLoader.ScreengrabberType);
                if (instance != null)
                {
                    screenShotBytes = reflectionWrapper.InvokeMethod(_assemblyLoader.ScreengrabberType, instance, "TakeScreenShot") as byte[];
                    return(true);
                }
            }
            catch
            {
                //do nothing, return
            }

            screenShotBytes = null;
            return(false);
        }
Example #5
0
 public void ClearCache()
 {
     _reflectionWrapper.InvokeMethod(_assemblyLoader.ClassInstanceManagerType, _classInstanceManager,
                                     "ClearCache");
 }
 public virtual IEnumerable <string> GetAllPendingMessages()
 {
     return(_reflectionWrapper.InvokeMethod(_messageCollectorType, null, "GetAllPendingMessages", BindingFlags.Static | BindingFlags.Public) as IEnumerable <string>);
 }