예제 #1
0
        ///<summary>
        ///Get a value from the javascript API
        ///</summary>
        ///<remarks>
        ///Implements the interface in ScormWrapper, and looks syncronous to the caller.
        ///does the 2004/1.2 conversion.
        ///</remarks>
        ///<returns>
        ///A scormget structure with the identifier and the return value of the get command
        ///</returns>
        ///<param name="identifier">
        ///the dot notation identifier of the data model element to get
        ///</param>
        public ScormGet Get(string identifier, System.Type EDT)
        {
            ScormGet get = new ScormGet(identifier, "", EDT);


            int key = SetupCallback();

            Log("Get " + get.GetIdentifier());
            UnityEngine.Application.ExternalCall("doGetValue", new object[] { get.GetIdentifier(), CallbackObjectName, CallbackFunctionName, key });

            APICallResult returnval = WaitForReturn(key);

            get.SetValue(returnval.Result);


            if (returnval.ErrorCode == "")
            {
                Log("Got  " + get.GetValue());
            }
            else
            {
                Log("Error:" + returnval.ErrorCode.ToString() + " " + returnval.ErrorDescription);
            }


            return(get);
        }
        public ScormGet Get(string identifier, Type EDT)
        {
            ScormGet get = new ScormGet(identifier, "", EDT);
            //  get = mConverter.Map2004_to_12(get);

            get.SetIdentifier(get.GetIdentifier().Replace("._count", ".length"));
            get.SetIdentifier(get.GetIdentifier().Substring(4));
            string returnval = parser.Process("Get " + get.GetIdentifier());
            get.SetValue(returnval);
            //  get = mConverter.Map12_to_2004(get);
            Console.WriteLine("Get " + get.GetIdentifier() + " " + get.GetValue());

            return get;
        }
        public ScormGet Get(string identifier, Type EDT)
        {
            ScormGet get = new ScormGet(identifier, "", EDT);

            //  get = mConverter.Map2004_to_12(get);

            get.SetIdentifier(get.GetIdentifier().Replace("._count", ".length"));
            get.SetIdentifier(get.GetIdentifier().Substring(4));
            string returnval = parser.Process("Get " + get.GetIdentifier());

            get.SetValue(returnval);
            //  get = mConverter.Map12_to_2004(get);
            Console.WriteLine("Get " + get.GetIdentifier() + " " + get.GetValue());

            return(get);
        }
        ///<summary>
        ///Get a value from the javascript API
        ///</summary>
        ///<remarks>
        ///Implements the interface in ScormWrapper, and looks syncronous to the caller.
        ///does the 2004/1.2 conversion.
        ///</remarks>
        ///<returns>
        ///A scormget structure with the identifier and the return value of the get command
        ///</returns>
        ///<param name="identifier">
        ///the dot notation identifier of the data model element to get
        ///</param>
        public ScormGet Get(string identifier, System.Type EDT)
        {
            ScormGet get = new ScormGet(identifier, "",EDT);

            int key = SetupCallback();
            Log("Get " + get.GetIdentifier());
            UnityEngine.Application.ExternalCall("doGetValue", new object[] { get.GetIdentifier() , CallbackObjectName, CallbackFunctionName, key });

             APICallResult returnval = WaitForReturn(key);
            get.SetValue(returnval.Result);

            if(returnval.ErrorCode == "")
                Log("Got  " + get.GetValue());
            else
                Log("Error:" + returnval.ErrorCode.ToString() + " " + returnval.ErrorDescription);

            return get;
        }