private static void ResolveStringAnsi(RemoteCall data, Stream pipe) { try { // Read Ansi string from memory of current process string stringAnsi = Marshal.PtrToStringAnsi((IntPtr)data.Parameters[0]); RemoteCallResult callResult = new RemoteCallResult { Result = stringAnsi }; // Write result back to the client formatter.Serialize(pipe, callResult); } catch (Exception e) { WriteExceptionToClient(pipe, e); } }
private static void ProcedureExists(RemoteCall data, Stream pipe, NativeLibrary library) { try { // Check if procedure with given name exists in target library bool exists = library.ProcedureExists(data.Name); RemoteCallResult callResult = new RemoteCallResult { Result = exists }; // Write result back to the client formatter.Serialize(pipe, callResult); } catch (Exception e) { WriteExceptionToClient(pipe, e); } }
private static void Invoke(RemoteCall data, Stream pipe, NativeLibrary library) { try { Delegate method; if (!delegateCache.TryGetValue(data.Name, out method)) { method = library.Resolve(data.Name, data.Delegate); delegateCache.Add(data.Name, method); } // Invoke requested method object result = method.DynamicInvoke(data.Parameters); RemoteCallResult callResult = new RemoteCallResult { Result = result }; // Write result back to the client formatter.Serialize(pipe, callResult); } catch (Exception e) { WriteExceptionToClient(pipe, e); } }
public async Task <RemoteCallResult <int> > SaveSupplier(tblSupplier tblSupplier) => RemoteCallResult.Success(await _repository.SaveSupplier(tblSupplier));
public async Task <RemoteCallResult <List <Product> > > GetAllProducts() => RemoteCallResult.Success(await _repository.GetAllProducts());
public async Task <RemoteCallResult <List <Product> > > GetQuickViewProduct() => RemoteCallResult.Success(await _repository.GetQuickViewProduct());
public async Task <RemoteCallResult <List <CategoryBrand> > > GetAllCategoryBrands() => RemoteCallResult.Success(await _repository.GetAllCategoryBrands());
public async Task <RemoteCallResult <List <tblSupplier> > > GetAllSuppliers() => RemoteCallResult.Success(await _repository.GetAllSuppliers());
public async Task <RemoteCallResult <List <tblBrands> > > GetAllBrands() => RemoteCallResult.Success(await _repository.GetAllBrands());