ACR_CollectionLib.ACR_CollectionLib.ScriptMain C# (CSharp) Method

ScriptMain() public method

public ScriptMain ( [ ScriptParameters, [ DefaultReturnCode ) : Int32
ScriptParameters [
DefaultReturnCode [
return System.Int32
        public Int32 ScriptMain([In] object[] ScriptParameters, [In] Int32 DefaultReturnCode)
        {
            // Parse our parameters.
            int nCollection = (int)ScriptParameters[0];
            int nMethodCode = (int)ScriptParameters[1];
            string sCollectionName = (string)ScriptParameters[2];
            int nParamInt1 = (int)ScriptParameters[3];
            int nParamInt2 = (int)ScriptParameters[4];
            float fParamFlt1 = (float)ScriptParameters[5];
            float fParamFlt2 = (float)ScriptParameters[6];
            string sParamStr1 = (string)ScriptParameters[7];
            string sParamStr2 = (string)ScriptParameters[8];

            // Return value.
            Int32 nReturnValue = (int)RETURN_CODE.SUCCESS;

            // What type of request are we making?
            switch ((COLLECTION_CODE)nCollection)
            {
                case COLLECTION_CODE.INT_LIST:
                    nReturnValue = HandleIntList(sCollectionName, (METHOD_CODE)nMethodCode, nParamInt1, nParamInt2);
                    break;
                case COLLECTION_CODE.FLOAT_LIST:
                    nReturnValue = HandleFloatList(sCollectionName, (METHOD_CODE)nMethodCode, fParamFlt1, nParamInt1, nParamInt2);
                    break;
                case COLLECTION_CODE.STRING_LIST:
                    nReturnValue = HandleStringList(sCollectionName, (METHOD_CODE)nMethodCode, sParamStr1, nParamInt1, nParamInt2);
                    break;
                default:
                    nReturnValue = (int)RETURN_CODE.ERROR_COLLECTION_NOT_FOUND;
                    break;
            }

            return nReturnValue;
        }