예제 #1
0
        public IEnumerable <TestCaseData> HappyPathCaseData()
        {
            var dispatcherName = _dispatcher.GetType().Name;

            foreach (var test in PositiveTests())
            {
                yield return(new TestCaseData(test.Value)
                             .SetName($"{dispatcherName} ITestService.{test.Key}"));
            }
        }
예제 #2
0
파일: Ajax.cs 프로젝트: GaloisInc/FiveUI
 // Async implementation
 /* public void get(string url, IDispatch success, IDispatch failure) */
 /* { */
 /*     var client = new WebClient(); */
 /*     var task   = client.DownloadStringTaskAsync(url); */
 /*     task.ContinueWith(t => */
 /*     { */
 /*         if (t.Exception != null) */
 /*         { */
 /*             t.Exception.Handle(e => { */
 /*                     // TODO: send meaningful parameters on failure */
 /*                     applyIDispatch(failure, "TODO"); */
 /*                     return true; */
 /*                 }); */
 /*         } */
 /*         else { */
 /*             applyIDispatch(success, t.Result); */
 /*         } */
 /*     }); */
 /* } */
 // Based on:
 // http://bytes.com/topic/c-sharp/answers/655563-handling-javascript-functions-closures-passed-into-c-function
 private void applyIDispatch(IDispatch func, string data)
 {
     func.GetType().InvokeMember(
             "",
             BindingFlags.InvokeMethod,
             null,
             func,
             new object[] { data });
 }
예제 #3
0
        public List <JqueryObject> NextAll()
        {
            IDispatch dispatch = InvokeMember <IDispatch>("nextAll");

            string  name = "length";
            int     dispId;
            Guid    riid = Guid.Empty;
            HRESULT res  = dispatch.GetDispId(ref riid, name, 1, 0, out dispId);

            int length  = (int)dispatch.GetType().InvokeMember("length", BindingFlags.GetProperty, null, dispatch, null);
            int length2 = (int)dispatch.GetType().InvokeMember("length", BindingFlags.GetProperty, null, dispatch, null);

            for (int index = 0; index < length; index++)
            {
                IDispatch obj = dispatch.GetType().InvokeMember(index.ToString(), BindingFlags.GetProperty, null, dispatch, null) as IDispatch;
            }

            return(null);
        }
예제 #4
0
        public JqueryObject(IDispatch dispatch)
        {
            _dispatch = dispatch;
            _type     = dispatch.GetType();
            ITypeInfo type = DispatchUtility.GetType(_dispatch);

            //Type t = type.GetType();
            //Type typaae = Type.GetTypeFromProgID("JScriptTypeLib.JScriptTypeInfo", true);

            //PropertyInfo[] a = type.GetProperties();
            //MethodInfo[] b = type.GetMethods();
            //MemberInfo[] c = type.GetMembers();
            //EventInfo[] e = type.GetEvents();
        }
예제 #5
0
        public T GetValue <T>(String name)
        {
            object res = _dispatch.GetType().InvokeMember(name, System.Reflection.BindingFlags.GetProperty, null, _dispatch, null);

            return(res.Convert <T>());
        }