public CalendarPlugin(IMessageDispatcher remote, IUIThreadDispatcher uiThreadDispatcher) { this._remote = remote; this._uiThreadDispatcher = uiThreadDispatcher; uiThreadDispatcher.BlockingInvoke(() => { calendar = new CalendarPanel(); calendar.EventSelected += entrySelected; calendar.DaySelected += daySelected; calendar.getMonthPanel().NumRows = 4; pluginContainer = new Viewbox(); pluginContainer.Child = calendar; }); _remote.RegisterReceiveHandler("calendar.display", new MessageHandlerDelegateWrapper(m => display(m))); }
public StoryPlugin(IMessageDispatcher remote, IUIThreadDispatcher uiThreadDispatcher) { this._remote = remote; this._uiThreadDispatcher = uiThreadDispatcher; uiThreadDispatcher.BlockingInvoke(() => { story = new StoryPage(); pluginContainer = new Viewbox(); pluginContainer.Child = story; }); _remote.RegisterReceiveHandler("story.stopRecording", new MessageHandlerDelegateWrapper(m => endVideoCapture())); _remote.RegisterReceiveHandler("story.startRecording", new MessageHandlerDelegateWrapper(m => startVideoCapture(m))); _remote.RegisterReceiveHandler("story.saveRecording", new MessageHandlerDelegateWrapper(m => saveRecording(m))); foreach (EncoderDevice edv in EncoderDevices.FindDevices(EncoderDeviceType.Video)) { //Debug.WriteLine("found a video deviced named: " + edv.Name); videoDevice = edv; } foreach (EncoderDevice edv in EncoderDevices.FindDevices(EncoderDeviceType.Audio)) { //Debug.WriteLine("found a audio deviced named: " + edv.Name); if (edv.Name.ToLower().Contains("microphone")) { audioDevice = edv; } } story.SizeChanged += new System.Windows.SizeChangedEventHandler(story_SizeChanged); job = new LiveJob(); if (!System.IO.Directory.Exists("C:\\Dropbox\\" + System.Windows.Forms.SystemInformation.ComputerName + "\\videos\\")) { System.IO.Directory.CreateDirectory("C:\\Dropbox\\" + System.Windows.Forms.SystemInformation.ComputerName + "\\videos\\"); } fileOut = new FileArchivePublishFormat(); fileOut.OutputFileName = "C:\\Dropbox\\" + System.Windows.Forms.SystemInformation.ComputerName + "\\videos\\tempVideo.wmv"; System.Console.WriteLine(fileOut.OutputFileName); }
public CheckersPlugin(IMessageDispatcher remote, IUIThreadDispatcher uiThreadDispatcher) { this._remote = remote; this._uiThreadDispatcher = uiThreadDispatcher; uiThreadDispatcher.BlockingInvoke(() => { game = new GameShape(); game.UserPlayed += (s, e) => { JObject body = new JObject(); body["humanMove"] = ((CheckerEventArg)e).moveDesc; _remote.Send("checkers.human_played_move", body); }; game.UserTouchedAgentChecker += (s, e) => { JObject body = new JObject(); body["howMany"] = ((UserTouchedAgentStuffEventArg)e).howManyTimes; _remote.Send("checkers.touched_agent_piece", body); }; pluginContainer = new Viewbox(); pluginContainer.Child = game; game.MakeTheBoardUnplayable(); }); _remote.RegisterReceiveHandler("checkers.agent_move", new MessageHandlerDelegateWrapper(x => PlayAgentMove(x))); _remote.RegisterReceiveHandler("checkers.reset", new MessageHandlerDelegateWrapper(x => game.ResetGame(_uiThreadDispatcher))); _remote.RegisterReceiveHandler("checkers.confirm_human_move", new MessageHandlerDelegateWrapper(x => game.ReceivedConfirmation())); _remote.RegisterReceiveHandler("checkers.playability", new MessageHandlerDelegateWrapper(x => SetPlayability(x))); }
/// <summary> /// The count of _pingTimers expired, and still client is disconnected /// </summary> /// Constructor of S22Comms. Setups communications and file transfer entities. /// Important notice: no actul connection yet takes place public SharpComms(String jid, String passphrase, string resource, IUIThreadDispatcher uidis) { if (passphrase == null || jid == null) { throw new ArgumentNullException("Provided null arguments to S22Comms constructor"); } uiDispatcher = uidis; string[] temp = jid.Split(new Char[] { '@' }); _defaultNet = temp[1]; //After the first @ _defaultUser = temp[0]; //Before the first @ _resource = resource; //Resource provided in Constructor xmppClient = new XmppClient(_defaultNet, _defaultUser, passphrase); xmppClient.DefaultTimeOut = DefaultTimeOut; //Define the ping period multiplierf and the internal ping period remoteRosterList = new List <RosterItem>(); //Method fired when a subscription request arrives xmppClient.SubscriptionRequest = SubScribeRequest; //Event fired when Subscription request has been approved. xmppClient.SubscriptionApproved += presenceMgt_OnSubscribed; //Event fired when Remote user or resource unsubscribed from receiving presence notifications xmppClient.Unsubscribed += presenceMgt_OnUnsubscribed; //Event fired when presence is detected xmppClient.StatusChanged += xmppClient_OnPresence; //Event fired when protocol error detected xmppClient.Error += xmppClient_OnError; //Event fired when Roster Updated xmppClient.RosterUpdated += xmppClient_RosterUpdated; //Delegate for incoming file transfer events xmppClient.FileTransferRequest = fileTransferMgt_OnFile_Delegate; //Delegate for incoming file transfer events progress xmppClient.FileTransferProgress += _xmppClient_FileTransferProgress; // Receive Messagea xmppClient.Message += xmppClient_Message; }
/// <summary> /// The count of _pingTimers expired, and still client is disconnected /// </summary> /// Constructor of S22Comms. Setups communications and file transfer entities. /// Important notice: no actul connection yet takes place public SharpComms(String jid, String passphrase, string resource, IUIThreadDispatcher uidis) { if (passphrase == null || jid == null) { throw new ArgumentNullException("Provided null arguments to S22Comms constructor"); } uiDispatcher = uidis; string[] temp = jid.Split(new Char[] { '@' }); _defaultNet = temp[1]; //After the first @ _defaultUser = temp[0]; //Before the first @ _resource = resource; //Resource provided in Constructor xmppClient = new XmppClient(_defaultNet, _defaultUser, passphrase); xmppClient.DefaultTimeOut = DefaultTimeOut; //Define the ping period multiplierf and the internal ping period remoteRosterList = new List<RosterItem>(); //Method fired when a subscription request arrives xmppClient.SubscriptionRequest = SubScribeRequest; //Event fired when Subscription request has been approved. xmppClient.SubscriptionApproved += presenceMgt_OnSubscribed; //Event fired when Remote user or resource unsubscribed from receiving presence notifications xmppClient.Unsubscribed += presenceMgt_OnUnsubscribed; //Event fired when presence is detected xmppClient.StatusChanged += xmppClient_OnPresence; //Event fired when protocol error detected xmppClient.Error += xmppClient_OnError; //Event fired when Roster Updated xmppClient.RosterUpdated += xmppClient_RosterUpdated; //Delegate for incoming file transfer events xmppClient.FileTransferRequest = fileTransferMgt_OnFile_Delegate; //Delegate for incoming file transfer events progress xmppClient.FileTransferProgress += _xmppClient_FileTransferProgress; // Receive Messagea xmppClient.Message += xmppClient_Message; }
public TTTPlugin(IMessageDispatcher remote, IUIThreadDispatcher uiThreadDispatcher) { this._remote = remote; this._uiThreadDispatcher = uiThreadDispatcher; uiThreadDispatcher.BlockingInvoke(() => { game = new GameShape(); game.Played += (s, e) => { JObject body = new JObject(); body["cellNum"] = ((cellEventArg)e).cellNum; _remote.Send("tictactoe.human_played_cell", body); }; pluginContainer = new Viewbox(); pluginContainer.Child = game; }); _remote.RegisterReceiveHandler("tictactoe.agent_cell", new MessageHandlerDelegateWrapper(x => PlayAgentMove(x))); _remote.RegisterReceiveHandler("tictactoe.playability", new MessageHandlerDelegateWrapper(x => SetPlayability(x))); }
/// <summary> /// Constructor. /// </summary> /// <param name="view">View object.</param> public ViewState(object view) { _view = view; _dispatcher = new DefaultUIThreadDispatcher(); }
/// <summary> /// Constructor. /// </summary> /// <param name="view">View object.</param> /// <param name="dispatcher">UI thread dispatcher.</param> public ViewState(INotifyPropertyChanged view, IUIThreadDispatcher dispatcher) : this(view) { _dispatcher = dispatcher; }
/// <summary> /// Constructor. /// </summary> /// <param name="view">View object.</param> /// <param name="dispatcher">UI thread dispatcher.</param> public ViewState(INotifyPropertyChanged view, IUIThreadDispatcher dispatcher) { _view = view; _dispatcher = dispatcher; }
/// <summary> /// Constructor. /// </summary> /// <param name="hubProxy">DotNetify hub server proxy.</param> /// <param name="dispatcher">UI thread dispatcher.</param> public DotNetifyClient(IDotNetifyHubProxy hubProxy, IUIThreadDispatcher dispatcher) { _hubProxy = hubProxy; _dispatcher = dispatcher; }
/// <summary> /// Constructor. /// </summary> /// <param name="view">View object.</param> /// <param name="dispatcher">UI thread dispatcher.</param> public ViewState(object view, IUIThreadDispatcher dispatcher) { _view = view; _dispatcher = dispatcher; }
public CheckersPluginCreator(IUIThreadDispatcher uiThreadDispatcher, IMessageDispatcher remoteDispatcher) { _uiThreadDispatcher = uiThreadDispatcher; _remoteDispatcher = remoteDispatcher; }
public EnrollPluginCreator(IUIThreadDispatcher uiThreadDispatcher, IMessageDispatcher remoteDispatcher) { _uiThreadDispatcher = uiThreadDispatcher; _remoteDispatcher = remoteDispatcher; }
public SoftKeyboardPluginCreator(IUIThreadDispatcher uiThreadDispatcher, IMessageDispatcher remoteDispatcher) { _uiThreadDispatcher = uiThreadDispatcher; _remoteDispatcher = remoteDispatcher; }