예제 #1
0
        static BulkExample()
        {
            API ClarizenAPI = new API();

            if (!ClarizenAPI.Login(ConfigurationManager.AppSettings["username"], ConfigurationManager.AppSettings["password"]))
            {
                return;
            }

            ClarizenAPI.StartBulkService();
            ClarizenAPI.DescribeMetadata(new string[] { "User" }, new string[] { "relations", "fields" });
            ClarizenAPI.DescribeEntityRelations(new string[] { "User" });
            execute bulkService = ClarizenAPI.CommitBulkService();

            if (bulkService.IsCalledSuccessfully)
            {
                foreach (response res in bulkService.Data.responses)
                {
                    if (res.statusCode == 200)
                    {
                        //
                        // Result is cast to its target type so it could be used as follows
                        //
                        switch (res.BodyType)
                        {
                        case "Clarizen.API.V2_0.Metadata.Result.describeMetadata":
                            WriteEntityFields(res.body.entityDescriptions[0]);
                            break;

                        case "Clarizen.API.V2_0.Metadata.Result.describeEntityRelations":
                            WriteEntityRelationsDescription(res.body.entityRelations);
                            break;
                        }
                        Console.WriteLine();
                    }
                    else
                    {
                        Console.WriteLine("Error {0}: {1}", res.statusCode, ((error)res.body).formatted);
                    }
                }
            }
            else
            {
                Console.WriteLine("Bulk service failed. Error: " + bulkService.Error);
            }

            if (ClarizenAPI.Logout())
            {
                Console.WriteLine("{0} API calls made in this session", ClarizenAPI.TotalAPICallsMadeInCurrentSession);
            }
        }
예제 #2
0
        /// <summary>
        /// 烘烤出站接口()
        /// </summary>
        /// <param name="strJson">Json字符串</param>
        public executeResponse OutService(string strJson)
        {
            ExecutingServiceService Service = new ExecutingServiceService()
            {
                Url         = Core.AppContext.Current.MesModel.OutUrl,
                Credentials = new System.Net.NetworkCredential(Core.AppContext.Current.MesModel.Account, Core.AppContext.Current.MesModel.Pwd, null),
            };
            executingServiceRequest Request = new executingServiceRequest()
            {
                site        = Core.AppContext.Current.MesModel.OutSite,        //工厂代号
                serviceCode = Core.AppContext.Current.MesModel.OutServiceCode, //接口表示
                data        = strJson,
            };
            execute ex = new execute()
            {
                pRequest = Request,
            };

            return(Service.execute(ex));
        }
예제 #3
0
        public static void Main(string[] args)
        {
            WorkingWithDelegates w = new WorkingWithDelegates();

            //delegate 1
            execute e1 = new execute(w.add);

            e1 += w.sub;              // directly add method
            e1 += new execute(w.mul); //create new delegate then combine
            e1 += new execute(w.div); // create new delegate then combine
            //  e1(3,5); // execute delegate


            // an Math power operation
            e1 += delegate(int a, int b)
            {
                Console.WriteLine("{0} ^ {1} is {2} ", a, b, Math.Pow(a, b));
            };

            e1(3, 5); // execute delegate
        }
예제 #4
0
    void ExecuteAndNextState(float require_lessthanval, bool cardornot,
                             execute enter = null,
                             execute stay  = null,
                             execute exit  = null)
    {
        if (stateframe == 0)
        {
            if (enter != null)
            {
                enter();                                  //第一帧执行
            }
        }

        if (stay != null)
        {
            stay();                                       //日常执行
        }
        if (lifeval <= require_lessthanval)
        {
            if (exit != null)
            {
                exit();                                   //最后一帧执行
            }
            if (!cardornot)                               //击破非符
            {
                cardnum++;
            }
            else                                          //击破符卡
            {
                nextcardnum = cardnum + 1;
                cardnum     = -1;
                Invoke("nextcard", 2);
            }
            stateframe = 0;
        }
        else
        {
            stateframe++;
        }
    }
예제 #5
0
        /// <summary>
        /// 烘烤进站接口
        /// </summary>
        /// <param name="strJson">Json字符串</param>
        public bool InService(string strJson)
        {
            ExecutingServiceService Service = new ExecutingServiceService()
            {
                Url         = Core.AppContext.Current.MesModel.InUrl,
                Credentials = new System.Net.NetworkCredential(Core.AppContext.Current.MesModel.Account, Core.AppContext.Current.MesModel.Pwd, null),
            };
            executingServiceRequest Request = new executingServiceRequest()
            {
                site        = Core.AppContext.Current.MesModel.InSite,     //工厂代号
                serviceCode = Core.AppContext.Current.MesModel.InRESOURCE, //接口表示
                data        = strJson,
            };
            execute ex = new execute()
            {
                pRequest = Request,
            };
            executeResponse ReturnData = new executeResponse();

            ReturnData = Service.execute(ex);
            return([email protected]() == "TRUE"? true : false);
        }
예제 #6
0
 get => new Command(
     execute: async() => { await App.Current.MainPage.Navigation.PushAsync(new LoginView()); });
예제 #7
0
 get => new Command(
     execute: async() =>
 {
예제 #8
0
 get => new Command(
     execute: async() =>
 {
     if (VisualState.SelectedIndex > 0)
예제 #9
0
 get => new Command(
     execute: async() => { VisualState.OrderByDescenting = !VisualState.OrderByDescenting; });
        static private void MapConsoleExterns(string dllname)
            {

            mtorque_gethwnd = (torque_gethwnd)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dllname, "torque_gethwnd"), typeof(torque_gethwnd));
            mdnt_torque_engineinit = (dnt_torque_engineinit)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dllname, "dnt_torque_engineinit"), typeof(dnt_torque_engineinit));

            mgetEulerRotation = (getEulerRotation)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dllname, "getEulerRotation"), typeof(getEulerRotation));
            misMemberOfClass = (isMemberOfClass)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dllname, "isMemberOfClass"), typeof(isMemberOfClass));
            mpathOnMissionLoadDone = (pathOnMissionLoadDone)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dllname, "pathOnMissionLoadDone"), typeof(pathOnMissionLoadDone));



            mSetHandler_Instance_Eval = (SetHandler_Instance_Eval)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dllname, "SetHandler_Instance_Eval"), typeof(SetHandler_Instance_Eval));
            mSetHandler_Instance_Eval_Direct_New = (SetHandler_Instance_Eval_Direct_New)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dllname, "SetHandler_Instance_Eval_Direct_New"), typeof(SetHandler_Instance_Eval_Direct_New));


            mtorque_engineinit = (torque_engineinit)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dllname, "torque_engineinit"), typeof(torque_engineinit));
            mtorque_enginetick = (torque_enginetick)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dllname, "torque_enginetick"), typeof(torque_enginetick));
            mtorque_engineshutdown = (torque_engineshutdown)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dllname, "torque_engineshutdown"), typeof(torque_engineshutdown));
            mtorque_setwebdeployment = (torque_setwebdeployment)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dllname, "torque_setwebdeployment"), typeof(torque_setwebdeployment));
            mtorque_enginesignalshutdown = (torque_enginesignalshutdown)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dllname, "torque_enginesignalshutdown"), typeof(torque_enginesignalshutdown));
            mtorque_reset = (torque_reset)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dllname, "torque_reset"), typeof(torque_reset));
            mtorque_resizewindow = (torque_resizewindow)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dllname, "torque_resizewindow"), typeof(torque_resizewindow));



            mclientGroup_getCount = (clientGroup_getCount)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dllname, "clientGroup_getCount"), typeof(clientGroup_getCount));
            mclientGroup_getObject = (clientGroup_getObject)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dllname, "clientGroup_getObject"), typeof(clientGroup_getObject));
            mNameSpace_isMethod = (NameSpace_isMethod)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dllname, "NameSpace_isMethod"), typeof(NameSpace_isMethod));
            mremoveTaggedString = (removeTaggedString)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dllname, "removeTaggedString"), typeof(removeTaggedString));
            mConsoleCall = (ConsoleCall)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dllname, "ConsoleCall"), typeof(ConsoleCall));
            mgetTaggedString = (getTaggedString)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dllname, "getTaggedString"), typeof(getTaggedString));
            maddTaggedString = (addTaggedString)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dllname, "addTaggedString"), typeof(addTaggedString));
            mConsole_warnf = (Console_warnf)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dllname, "Console_warnf"), typeof(Console_warnf));
            mConsole_printf = (Console_printf)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dllname, "Console_printf"), typeof(Console_printf));
            mConsole_errorf = (Console_errorf)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dllname, "Console_errorf"), typeof(Console_errorf));
            mdeleteVariables = (deleteVariables)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dllname, "deleteVariables"), typeof(deleteVariables));
            mobjectHasMethod = (objectHasMethod)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dllname, "objectHasMethod"), typeof(objectHasMethod));
            misFunction = (isFunction)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dllname, "isFunction"), typeof(isFunction));
            mGetObjectID = (GetObjectID)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dllname, "GetObjectID"), typeof(GetObjectID));
            mclearServerPaths = (clearServerPaths)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dllname, "clearServerPaths"), typeof(clearServerPaths));
            mgetDataBlock = (getDataBlock)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dllname, "getDataBlock"), typeof(getDataBlock));
            mgetName = (getName)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dllname, "getName"), typeof(getName));
            mnameToID = (nameToID)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dllname, "nameToID"), typeof(nameToID));
            mspawnObject = (spawnObject)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dllname, "spawnObject"), typeof(spawnObject));
            mgetClassName = (getClassName)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dllname, "getClassName"), typeof(getClassName));
            mParentCall = (ParentCall)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dllname, "ParentCall"), typeof(ParentCall));
            mParentCallFunct = (ParentCallFunct)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dllname, "ParentCallFunct"), typeof(ParentCallFunct));
            mClassname_Call = (Classname_Call)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dllname, "Classname_Call"), typeof(Classname_Call));
            mcommandToClient = (commandToClient)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dllname, "commandToClient"), typeof(commandToClient));
            mcommandToServer = (commandToServer)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dllname, "commandToServer"), typeof(commandToServer));
            mConsole_getSimTime = (Console_getSimTime)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dllname, "Console_getSimTime"), typeof(Console_getSimTime));
            mNameSpace_isInNamespaceHierarchy = (NameSpace_isInNamespaceHierarchy)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dllname, "NameSpace_isInNamespaceHierarchy"), typeof(NameSpace_isInNamespaceHierarchy));
            mContainerRadiusSearch = (ContainerRadiusSearch)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dllname, "ContainerRadiusSearch"), typeof(ContainerRadiusSearch));
            //mwle_fn_SimObject_getFieldValue = (wle_fn_SimObject_getFieldValue)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dllname, "wle_fn_SimObject_getFieldValue"), typeof(wle_fn_SimObject_getFieldValue));
            mcs_torque_getvariable = (cs_torque_getvariable)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dllname, "cs_torque_getvariable"), typeof(cs_torque_getvariable));
            mcs_torque_setvariable = (cs_torque_setvariable)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dllname, "cs_torque_setvariable"), typeof(cs_torque_setvariable));
            //mwle_fn_SimObject_setFieldValue = (wle_fn_SimObject_setFieldValue)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dllname, "wle_fn_SimObject_setFieldValue"), typeof(wle_fn_SimObject_setFieldValue));
            mSceneObject_getTypeMask = (SceneObject_getTypeMask)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dllname, "SceneObject_getTypeMask"), typeof(SceneObject_getTypeMask));
            mSceneObject_initContainerRadiusSearch = (SceneObject_initContainerRadiusSearch)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dllname, "SceneObject_initContainerRadiusSearch"), typeof(SceneObject_initContainerRadiusSearch));
            mexecute = (execute)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dllname, "execute"), typeof(execute));
            mSimObject_Call = (SimObject_Call)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dllname, "SimObject_Call"), typeof(SimObject_Call));
            mMath_MatrixCreateFromEuler = (Math_MatrixCreateFromEuler)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dllname, "Math_MatrixCreateFromEuler"), typeof(Math_MatrixCreateFromEuler));
            mMath_MatrixMulVector = (Math_MatrixMulVector)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dllname, "Math_MatrixMulVector"), typeof(Math_MatrixMulVector));
            //mwle_fn_activatePackage = (wle_fn_activatePackage)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dllname, "wle_fn_activatePackage"), typeof(wle_fn_activatePackage));
            misObject = (isObject)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dllname, "isObject"), typeof(isObject));
            mSimObject_isField = (SimObject_isField)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dllname, "SimObject_isField"), typeof(SimObject_isField));
            }
 static private void ClearConsoleExterns()
            {
            mClearHandler_Instance_EvalHandler_Instance_Eval = null;
            mClearHandler_Instance_Eval_Direct_New = null;
            mtorque_gethwnd = null;
            mdnt_torque_engineinit = null;
            mgetEulerRotation = null;
            misMemberOfClass = null;
            mpathOnMissionLoadDone = null;
            mSetHandler_Instance_Eval = null;
            mSetHandler_Instance_Eval_Direct_New = null;
            mtorque_engineinit = null;
            mtorque_enginetick = null;
            mtorque_engineshutdown = null;
            mtorque_setwebdeployment = null;
            mtorque_enginesignalshutdown = null;
            mtorque_reset = null;
            mtorque_resizewindow = null;
            mclientGroup_getCount = null;
            mclientGroup_getObject = null;
            mNameSpace_isMethod = null;
            mremoveTaggedString = null;
            mConsoleCall = null;
            mgetTaggedString = null;
            maddTaggedString = null;
            mConsole_warnf = null;
            mConsole_printf = null;
            mConsole_errorf = null;
            mdeleteVariables = null;
            mobjectHasMethod = null;
            misFunction = null;
            mGetObjectID = null;
            mclearServerPaths = null;
            mgetDataBlock = null;
            mgetName = null;
            mnameToID = null;
            mspawnObject = null;
            mgetClassName = null;
            mParentCall = null;
            mParentCallFunct = null;
            mClassname_Call = null;
            mcommandToClient = null;
            mcommandToServer = null;
            mConsole_getSimTime = null;
            mNameSpace_isInNamespaceHierarchy = null;
            mContainerRadiusSearch = null;
            mcs_torque_getvariable = null;
            mcs_torque_setvariable = null;
            mSceneObject_getTypeMask = null;
            mSceneObject_initContainerRadiusSearch = null;
            mexecute = null;
            mSimObject_Call = null;
            mMath_MatrixCreateFromEuler = null;
            mMath_MatrixMulVector = null;
            misObject = null;
            mSimObject_isField = null;
            GC.Collect();
            }
예제 #12
0
 private void Start()
 {
     execute = GameObject.Find("execute").GetComponent <execute>();
 }
예제 #13
0
 get => new Command(
     execute: async() =>
 {
     if (!string.IsNullOrWhiteSpace(VisualState.SignupEmail) &&
예제 #14
0
        public executeResponse execute(execute request)
        {
            string debt = "";

            try
            {
                //init data
                WinFormsTest.nci.execute     ex  = new WinFormsTest.nci.execute();
                WinFormsTest.nci.Parameter[] prs = new WinFormsTest.nci.Parameter[request.parameter.Length];
                int count = 0;
                foreach (Parameter param in request.parameter)
                {
                    prs[count]       = new WinFormsTest.nci.Parameter();
                    prs[count].key   = param.key;//"abonentCode";
                    prs[count].value = param.value;
                    count++;
                }

                ex.parameter = prs;
                ex.serviceId = request.serviceId;

                // WinFormsTest.nci.NCIServiceWCFClient ee = UCCProxyFactory.CreateNCIServiceClient(new Uri("http://0330X395:8089/nci/NCIServiceWCFBean"));
                WinFormsTest.nci.NCIServiceWCFClient ee = UCCProxyFactory.CreateNCIServiceClient(new Uri("http://92.241.79.133:8080/nci/NCIServiceWCFBean"));
                //nci.NCIServiceWCFClient ee = UCCProxyFactory.CreateNCIServiceClient(new Uri("http://10.87.12.181:7000/ExternalServices/UCCNCIService"));
                WinFormsTest.nci.executeResponse resp = new WinFormsTest.nci.executeResponse();

                executeResponse rtn = new executeResponse();
                //execute
                try
                {
                    resp = ee.execute(ex);



                    StringBuilder sb = new StringBuilder();

                    if (resp.outParameter != null)
                    {
                        rtn.outParameter = new Parameter[resp.outParameter.Length];
                        count            = 0;
                        foreach (WinFormsTest.nci.Parameter param in resp.outParameter)
                        {
                            //System.Diagnostics.Trace.WriteLine(param.key + " " + param.value);
                            rtn.outParameter[count]       = new Parameter();
                            rtn.outParameter[count].key   = param.key;
                            rtn.outParameter[count].value = param.value;
                            sb.AppendFormat("{0}={1}\r\n", param.key, param.value);
                            count++;
                        }
                    }

                    if (resp.faultEntry != null)
                    {
                        rtn.faultEntry = new FaultEntry[resp.faultEntry.Length];
                        count          = 0;
                        foreach (WinFormsTest.nci.FaultEntry fe in resp.faultEntry)
                        {
                            //System.Diagnostics.Trace.WriteLine(param.key + " " + param.value);
                            rtn.faultEntry[count]                  = new FaultEntry();
                            rtn.faultEntry[count].errorKey         = fe.errorKey;
                            rtn.faultEntry[count].invalidParameter = fe.invalidParameter;
                            rtn.faultEntry[count].errorParameters  = fe.errorParameters;
                            sb.AppendFormat("{0}={1}\r\n", "error", fe.errorKey);
                            count++;
                        }
                    }
                }
                catch (Exception exc)
                {
                    //System.Diagnostics.Debug.WriteLine(exc.Message)
                    return(null);
                }

                return(rtn);
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine(ex.Message);
            }

            return(null);
        }
예제 #15
0
 get => new Command(
     execute: async() =>
 {
     if (VisualState.SQLiteManager.LoginTask(VisualState.LoginUsername, VisualState.LoginPassword).Result)