예제 #1
0
 public extern var this[var propertyName]
 {
     [XaeiOSMethodImpl(MethodImplOptions.Inline, Implementation = "{this}[{0}]")]
     get;
     [XaeiOSMethodImpl(MethodImplOptions.Inline, Implementation = "{this}[{0}] = {1}")]
     set;
 }
예제 #2
0
    static void Main()
    {
        var a;
        a = new var();
        a.Field = 1234;

        Console.WriteLine(a.Field);
    }
예제 #3
0
파일: test-var-07.cs 프로젝트: nobled/mono
	public static int Main ()
	{
		var i = null;
		var v = new var ();
		
		if (v.GetType () != typeof (var))
			return 1;
		
		return 0;	
	}
예제 #4
0
 public var this[var propertyName]
 {
     get
     {
         return _internalDictionary[propertyName];
     }
     set
     {
         _internalDictionary[propertyName] = value;
     }
 }
예제 #5
0
파일: funcs.cs 프로젝트: MAKABEO/log
 public Boolean IsUsuario(var nombre, var clave)
 {
     Boolean isEncontrado = false;
     for(int i = 0; i < nombres.Length; i++)
     {
         if(nombres[i] == nombre && claves[i] == clave)
         {
             isEncontrado = true;
         }
         else
         {
             isEncontrado = false;
         }
     }
     return isEncontrado;
 }
예제 #6
0
        private static void BootCallback(TaskHandle taskId, string taskName, var returnValue, TaskExitStatus exitStatus)
        {
            if (!_booted)
            {
                string reason = "reason unknown";
                if (exitStatus == TaskExitStatus.UnhandledException)
                {
                    if (returnValue != null)
                    {
                        Exception exception = returnValue.Cast<Exception>();
                        reason = exception.ToString() + "\n " + exception.StackTrace;

                    }
                }
                throw new NativeError("XaeiOS.Boot process failed to boot: " + reason);
            }
        }
예제 #7
0
 public NativeFunction Bind(var self)
 {
     NativeFunction fn = GenerateCodeForThis();
     if (GetArguments().Length == 1) // optimization for delegate create
     {
         return GenerateCodeForBoundNativeFunctionSimple(fn, self);
     }
     else
     {
         throw new NativeError("Not yet implemented");
         /* // TODO: This code causes a bug in CopyPropagation for BasicMiddleEnd: Array out of bounds for a Set
         NativeArray args = new NativeArray();
         for (int i = 0; i < GetArguments().Length; i++)
         {
             args[i] = GetArguments()[i];
         }
         var self = args.Shift();
         return GenerateCodeForBoundNativeFunction(fn, self, args);
          */
     }
 }
예제 #8
0
파일: Global.cs 프로젝트: sidecut/xaeios
 public static extern void ClearTimeout(var timeoutId);
예제 #9
0
파일: Global.cs 프로젝트: sidecut/xaeios
 public static extern void ClearInterval(var intervalId);
예제 #10
0
 public static extern NativeFunction GenerateCodeForBoundNativeFunction(NativeFunction fn, var self, var[] args);
예제 #11
0
 public static extern NativeFunction GenerateCodeForBoundNativeFunctionSimple(NativeFunction fn, var self);
예제 #12
0
 public extern var Apply(var target, var[] args);
예제 #13
0
 public extern var Call(var target, params var[] args);
예제 #14
0
 static (bool success, int value) Parse(string s) => int.TryParse(s, out var x) ? (true, x) : (false, 0);
예제 #15
0
 public void Cancel()
 {
     Logging.Trace("Unblocker::Cancel()");
     Global.ClearTimeout(TimeoutId);
     TimeoutId = null;
     Task = null;
 }
예제 #16
0
 public extern void RemoveKey(var key);
예제 #17
0
파일: Condition.cs 프로젝트: sidecut/xaeios
 public void ScheduleUnblock(int timeoutMs)
 {
     TimeoutId = Global.SetTimeout((NativeFunction)new NativeVoidDelegate(Unblock), timeoutMs);
 }
예제 #18
0
파일: Thread.cs 프로젝트: sidecut/xaeios
 private void InternalSleep(int milliseconds)
 {
     CancelUnblock();
     SystemCalls.BlockTask(Task);
     _unblockTimeoutId = Global.SetTimeout((NativeFunction)new NativeVoidDelegate(WakeUp), milliseconds);
     SystemCalls.Yield();
 }
예제 #19
0
파일: Thread.cs 프로젝트: sidecut/xaeios
        private void InternalCallback(TaskHandle task, string taskName, var returnValue, TaskExitStatus exitStatus)
        {
            //Logging.Trace("Thread internal callback: " + this + ":" + this.Name);
            _running = false;
            //Logging.Trace("Unregistering thread: " + this + ":" + this.Name);
            ThreadManager.UnregisterThread(this);

            if (exitStatus == TaskExitStatus.UnhandledException)
            {
                _unhandledException = returnValue.Cast<Object>() as Exception;
            }
            else if (exitStatus == TaskExitStatus.CriticalError)
            {
                _unhandledException = new ExecutionEngineException(returnValue.NativeToString());
            }

            if (Callback != null)
            {
                // TODO: Use the SIP thread pool to run this callback
                Callback();
            }
            else
            {
                if (_unhandledException != null)
                {
                    Console.WriteLine("An unhandled exception occurred in thread: " + this + ": " + _unhandledException + "\n" + _unhandledException.StackTrace);
                }
            }
        }
		private static string getHandProximity(var handPos, double threshold)	// Returns the hand distance in relation to the three instruments and returns the closest instrument
																					// If the instrument are outside the threshold, returns "far"																				
		{
			float[] handDistance = new float[3];				// Array of hand distance to each instrument
				
			for (int j = 0; j < 3; j++)
			{
				float handDistance[j] = (float)Math.Sqrt(Math.Pow(handPos.X - instrumentXYZ[j].X, 2) + Math.Pow(handPos.Y - instrumentXYZ[j].Y, 2) + Math.Pow(handPos.Z - instrumentXYZ[j].Z, 2));