Ejemplo n.º 1
0
        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);
            }
        }
Ejemplo n.º 2
0
        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);
            }
        }
Ejemplo n.º 3
0
        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);
            }
        }
Ejemplo n.º 4
0
 public async Task <RemoteCallResult <int> > SaveSupplier(tblSupplier tblSupplier) => RemoteCallResult.Success(await _repository.SaveSupplier(tblSupplier));
Ejemplo n.º 5
0
 public async Task <RemoteCallResult <List <Product> > > GetAllProducts() => RemoteCallResult.Success(await _repository.GetAllProducts());
Ejemplo n.º 6
0
 public async Task <RemoteCallResult <List <Product> > > GetQuickViewProduct() => RemoteCallResult.Success(await _repository.GetQuickViewProduct());
Ejemplo n.º 7
0
 public async Task <RemoteCallResult <List <CategoryBrand> > > GetAllCategoryBrands() => RemoteCallResult.Success(await _repository.GetAllCategoryBrands());
Ejemplo n.º 8
0
 public async Task <RemoteCallResult <List <tblSupplier> > > GetAllSuppliers() => RemoteCallResult.Success(await _repository.GetAllSuppliers());
Ejemplo n.º 9
0
 public async Task <RemoteCallResult <List <tblBrands> > > GetAllBrands() => RemoteCallResult.Success(await _repository.GetAllBrands());