コード例 #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
ファイル: ObjectInspector.cs プロジェクト: shellscape/Lumen
        public T GetValue <T>(String name)
        {
            object res = _dispatch.GetType().InvokeMember(name, System.Reflection.BindingFlags.GetProperty, null, _dispatch, null);

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