/// <summary> /// Builds a functionCall object with no parameters /// </summary> /// <param name="function">The function name to be called</param> /// <returns>The serializeable functionCall object</returns> public eveobjects.functionCall build(string function) { this.function = new eveobjects.functionCall(); eveobjects.functionCall.Builder builder = this.function.ToBuilder(); builder.Name = function; return(builder.Build()); }
/// <summary> /// Builds a functionCall object with no parameters /// </summary> /// <param name="function">The function name to be called</param> /// <returns>The serializeable functionCall object</returns> public eveobjects.functionCall build(string function) { this.function = new eveobjects.functionCall(); eveobjects.functionCall.Builder builder = this.function.ToBuilder(); builder.Name = function; return builder.Build(); }
/// <summary> /// Builds a functionCall object with one parameter /// </summary> /// <param name="function">The function name to be called</param> /// <param name="arg">The parameter to pass with the functionCall object</param> /// <returns>The serializeable functionCall object</returns> public eveobjects.functionCall build(string function, string arg) { this.function = new eveobjects.functionCall(); eveobjects.functionCall.Builder builder = this.function.ToBuilder(); builder.Name = function; builder.Strparameter = arg; return(builder.Build()); }
/// <summary> /// Builds a functionCall object with one parameter /// </summary> /// <param name="function">The function name to be called</param> /// <param name="arg">The parameter to pass with the functionCall object</param> /// <returns>The serializeable functionCall object</returns> public eveobjects.functionCall build(string function, string arg) { this.function = new eveobjects.functionCall(); eveobjects.functionCall.Builder builder = this.function.ToBuilder(); builder.Name = function; builder.Strparameter = arg; return builder.Build(); }
/// <summary> /// Builds a functionCall object with a variable argument list /// </summary> /// <param name="function">The function name to be called</param> /// <param name="arguments">A List of Strings containing the parameters to pass with the functionCall object</param> /// <returns>The serializeable functionCall object</returns> public eveobjects.functionCall build(string function, List<string> arguments) { this.function = new eveobjects.functionCall(); eveobjects.functionCall.Builder builder = this.function.ToBuilder(); builder.Name = function; for (int i = 0; i < arguments.Count; i++) { builder.Strparameter = builder.Strparameter += arguments[i] + ";"; } builder.Strparameter = builder.Strparameter.Substring(0, builder.Strparameter.Length - 1); return builder.Build(); }
/// <summary> /// Builds a functionCall object with a variable argument list /// </summary> /// <param name="function">The function name to be called</param> /// <param name="arguments">A List of Strings containing the parameters to pass with the functionCall object</param> /// <returns>The serializeable functionCall object</returns> public eveobjects.functionCall build(string function, List <string> arguments) { this.function = new eveobjects.functionCall(); eveobjects.functionCall.Builder builder = this.function.ToBuilder(); builder.Name = function; for (int i = 0; i < arguments.Count; i++) { builder.Strparameter = builder.Strparameter += arguments[i] + ";"; } builder.Strparameter = builder.Strparameter.Substring(0, builder.Strparameter.Length - 1); return(builder.Build()); }
/// <summary> /// Calls functions on Black /// </summary> /// <param name="fcall">The functionCall object representing the function to be called</param> /// <returns>The byte representation of the Response object</returns> public byte[] pipeClient(eveobjects.functionCall fcall) { lock (this) { //Console.WriteLine("Connecting to pipe"); uint bread; uint bsent; byte[] buf = new byte[20000]; NativeOverlapped n = new NativeOverlapped(); //Console.WriteLine("Writing to server"); if (!WriteFile(npipe, fcall.ToByteArray(), (uint)fcall.SerializedSize, out bsent, ref n)) { Console.WriteLine(Marshal.GetLastWin32Error()); Console.WriteLine(pipeName); Console.WriteLine("Error writing the named pipe\n"); //return null; } byte[] recvdata = new byte[500]; //Console.WriteLine("Reading from server"); ReadFile(npipe, buf, 20000, out bread, IntPtr.Zero); byte[] tempbuf = new byte[bread]; for (int i = 0; i < bread; i++) { tempbuf[i] = buf[i]; } buf = tempbuf; return(buf); } }