示例#1
0
		internal static Pon FromPixelportPon(PixelportPon value, bool owned, Pon parent) {
			if (value == IntPtr.Zero) {
				return null;
			} else {
				return new Pon(value, owned, parent);
			}
		}
示例#2
0
		public Stream Stream(Pon request) {
			var channelId = Lib.pixelport_send_message(this.instance, request.value);
			var stream = new Stream {
				channelId = channelId,
				app = this
			};
			this.channels[channelId] = (message) => {
				stream.SendMessage(message);
			};
			return stream;
		}
示例#3
0
		public static Pon Call(string functionName, Pon arg) {
			return FromPixelportPon(Lib.pixelport_new_call_pon(functionName, arg.value), true, null);
		}
示例#4
0
		public Task<Pon> Request(Pon request) {
			var channelId = Lib.pixelport_send_message(this.instance, request.value);
			var tcs = new TaskCompletionSource<Pon>();
			this.channels[channelId] = (message) => {
				this.channels.Remove(channelId);
				tcs.SetResult(message);
			};
			return tcs.Task;
		}
示例#5
0
		public App(Pon options) {
			this.instance = Lib.pixelport_new(options.value);
		}
示例#6
0
		internal void SendMessage(Pon message) {
			Message(message);
		}
示例#7
0
		private Pon(PixelportPon value, bool owned, Pon parent) {
			this.value = value;
			this.owned = owned;
			this.parent = parent;
		}
示例#8
0
		public void Push(Pon item) {
			Lib.pixelport_push_pon_array_item(this.value, item.value);
		}