Example #1
0
 public void RemoveExecHandler(ExecHandler execHandler)
 {
     if (m_execHandlers == null)
     {
         return;
     }
     m_execHandlers.RemoveAll(h => h == execHandler);
 }
Example #2
0
 public void AddExecHandler(ExecHandler execHandler)
 {
     if (m_execHandlers == null)
     {
         m_execHandlers = new ExecHandlerList();
     }
     m_execHandlers.Add(execHandler);
 }
Example #3
0
        /// <summary>
        /// Use the provided <seealso cref="Looper"/> instead of the default one and take a callback
        /// interface in which to handle messages.
        /// </summary>
        /// <param name="looper"> The looper, must not be null. </param>
        /// <param name="callback"> The callback interface in which to handle messages, or null. </param>
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: public WeakHandler(@NonNull android.os.Looper looper, @NonNull android.os.Handler.ICallback callback)
        public WeakHandler(Looper looper, Handler.ICallback callback)
        {
            if (!InstanceFieldsInitialized)
            {
                InitializeInstanceFields();
                InstanceFieldsInitialized = true;
            }
            mCallback = callback;
            mExec     = new ExecHandler(looper, new WeakReference((Java.Lang.Object)callback));
        }
Example #4
0
        /// <summary>
        /// Use the provided <seealso cref="Looper"/> instead of the default one.
        /// </summary>
        /// <param name="looper"> The looper, must not be null. </param>
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: public WeakHandler(@NonNull android.os.Looper looper)
        public WeakHandler(Looper looper)
        {
            if (!InstanceFieldsInitialized)
            {
                InitializeInstanceFields();
                InstanceFieldsInitialized = true;
            }
            mCallback = null;
            mExec     = new ExecHandler(looper);
        }
Example #5
0
        /// <summary>
        /// Constructor associates this handler with the <seealso cref="Looper"/> for the
        /// current thread and takes a callback interface in which you can handle
        /// messages.
        ///
        /// If this thread does not have a looper, this handler won't be able to receive messages
        /// so an exception is thrown.
        /// </summary>
        /// <param name="callback"> The callback interface in which to handle messages, or null. </param>
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: public WeakHandler(@Nullable android.os.Handler.ICallback callback)
        public WeakHandler(Handler.ICallback callback)
        {
            if (!InstanceFieldsInitialized)
            {
                InitializeInstanceFields();
                InstanceFieldsInitialized = true;
            }
            mCallback = callback;                                                   // Hard referencing body

            mExec = new ExecHandler(new WeakReference((Java.Lang.Object)callback)); // Weak referencing inside ExecHandler
        }
Example #6
0
 public void SetExecHandler(ExecHandler execHandler)
 {
     ClearExecHandler();
     AddExecHandler(execHandler);
 }
Example #7
0
	public void SetExecHandler(ExecHandler execHandler)
	{
		ClearExecHandler();
		AddExecHandler(execHandler);
	}
Example #8
0
	public void RemoveExecHandler(ExecHandler execHandler)
	{
		if (m_execHandlers == null)
			return;
		m_execHandlers.RemoveAll(h => h == execHandler);
	}
Example #9
0
	public void AddExecHandler(ExecHandler execHandler)
	{
		if (m_execHandlers == null)
			m_execHandlers = new ExecHandlerList();
		m_execHandlers.Add(execHandler);
	}