Создать IExecutor в .net Maui для Android?C#

Место общения программистов C#
Гость
Создать IExecutor в .net Maui для Android?

Сообщение Гость »


Я не уверен, как реализовать IExecutor в .Net Maui. Мне нужен этот исполнитель, чтобы иметь возможность просто запускать функцию в Android (он принимает IExecutor в качестве параметра). Я буквально не знаю, как реализовать все функции, но этот объект должен реализовывать IExecutor...

Код: Выделить всё

#if ANDROID
using Java.Interop;
using Java.Lang;
using Java.Util.Concurrent;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CellularSignal1
{
public class Executor : Java.Lang.Object, IExecutor
{
public nint Handle => throw new NotImplementedException();

public int JniIdentityHashCode => throw new NotImplementedException();

public JniObjectReference PeerReference => new JniObjectReference();

public JniPeerMembers JniPeerMembers => throw new NotImplementedException();

public JniManagedPeerStates JniManagedPeerState => throw new NotImplementedException();

public void Dispose()
{
throw new NotImplementedException();
}

public void Disposed()
{
throw new NotImplementedException();
}

public void DisposeUnlessReferenced()
{
throw new NotImplementedException();
}

public void Execute(IRunnable command)
{
command.Run();
}

public void Finalized()
{
throw new NotImplementedException();
}

public void SetJniIdentityHashCode(int value)
{
throw new NotImplementedException();
}

public void SetJniManagedPeerState(JniManagedPeerStates value)
{
throw new NotImplementedException();
}

public void SetPeerReference(JniObjectReference reference)
{
throw new NotImplementedException();
}

public void UnregisterFromRuntime()
{
throw new NotImplementedException();
}
}
}
#endif
I tried just leaving as is, but was starting to get a bunch of 'not implemented' exceptions from this


Источник: https://stackoverflow.com/questions/756 ... or-android

Вернуться в «C#»