/// <summary> /// 处理会话更新事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void sessionChanged(object sender, SessionChangedEventArgs e) { if (msgId == e.Info.MsgId) { return; } msgId = e.Info.MsgId; switch (e.Info.Command) { case NIMSessionCommand.kNIMSessionCommandAdd: addSession(e.Info); break; case NIMSessionCommand.kNIMSessionCommandUpdate: updateSession(e.Info); break; case NIMSessionCommand.kNIMSessionCommandRemove: removeSession(e.Info); break; } void action() => ppcSession.totalRows = sessions.Count; while (!(Parent?.IsHandleCreated ?? false)) { Thread.Sleep(100); } Invoke((Action)action); }
protected virtual void OnSessionChanged(SessionChangedEventArgs e) { if (SessionChangedEvent != null) { SessionChangedEvent(this, new SessionChangedEventArgs()); } }
private void SessionChanged(object sender, SessionChangedEventArgs e) { Log("Session Changed " + e.state); if (e.state == U3DXT.iOS.Native.MultipeerConnectivity.MCSessionState.Connected) { Log("Session Connected"); } }
void SessionExplorerVM_SessionChangedEvent(object sendor, SessionChangedEventArgs e) { switch (e.Action) { case System.Collections.Specialized.NotifyCollectionChangedAction.Add: break; case System.Collections.Specialized.NotifyCollectionChangedAction.Remove: break; } }
internal void OnSessionChanged(SessionChangedEventArgs e) { DcmCanConfig config = propertyGrid.SelectedObject as DcmCanConfig; if (config != null) { bool newEnabled = !e.DefaultSession; if (config.CanTickEnabled != newEnabled) { config.CanTickEnabled = newEnabled; RefreshPropertyGrid(config); } } }
private void SessionChanged(object sender, SessionChangedEventArgs e) { Log("Session Changed " + e.state); if (e.state == U3DXT.iOS.Native.MultipeerConnectivity.MCSessionState.Connected) { Log("CONNECTED"); string path = Application.temporaryCachePath + "/u3dxt.jpg"; // create some arbitary binary data. or load from existing location FileStream someFile = new FileStream(path, FileMode.Create); someFile.WriteByte(0x42); someFile.Close(); path = "http://u3dxt.com/wp-content/uploads/2013/06/gears_14662320_s-225x225.jpg"; _session = e.session; _peerId = e.peerID; _session.SendResourceAtURL(new U3DXT.iOS.Native.Foundation.NSURL(path), "u3dxt.jpg", e.peerID, sendResourceCompleted); } }
private void OnSessionChanged(object sender, SessionChangedEventArgs e) { if (e.Info.Command == NIMSessionCommand.kNIMSessionCommandAdd || e.Info.Command == NIMSessionCommand.kNIMSessionCommandUpdate) { var x = _sessionsCollection.Find(c => c.Id == e.Info.Id); if (x == null) { _sessionsCollection.Insert(0, e.Info); InsertSession(e.Info); } else { var i = _sessionsCollection.IndexOf(x); _sessionsCollection[i] = e.Info; Update(x, e.Info); } } if (e.Info.Command == NIMSessionCommand.kNIMSessionCommandRemove) { } }
private static void SessionManager_SessionChanged(object?sender, SessionChangedEventArgs e) { if (_LockingScene == null) { return; } OBSScene?transition = null; if (e.State == SessionState.SessionLock) { if (Settings !.ResumeScene) { // 開いていたシーンを記憶する _currentScene = GetCurrentScene(); } transition = _LockingScene; } else if (e.State == SessionState.SessionUnlock) { if (_currentScene != null) { transition = _currentScene; } } Log.WriteLogLine($"セッション状態が変化しました ({e.State}): 遷移先シーン情報: {transition?.Name ?? "(null)"}"); if (transition == null) { // 遷移先シーンが指定されていないならスルー return; } SetScene(transition); }
void Sessions_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) { if (e.NewItems != null && e.NewItems.Count > 0) { if (SessionChangedEvent != null) { SessionChangedEventArgs args = new SessionChangedEventArgs(); args.Session = e.NewItems[0]; args.Action = e.Action; SessionChangedEvent(this, args); } } if (e.OldItems != null && e.OldItems.Count > 0) { if (SessionChangedEvent != null) { SessionChangedEventArgs args = new SessionChangedEventArgs(); args.Session = e.OldItems[0]; args.Action = e.Action; SessionChangedEvent(this, args); } } }
void OnSessionChanged(object sender, SessionChangedEventArgs args) { DemoTrace.WriteLine(args.Dump()); }
private void OnRegistrySessionChanged(object sender, SessionChangedEventArgs e) { OnSessionChanged(new SessionChangedEventArgs()); }
private void SessionChanged(object sender, SessionChangedEventArgs e) { this.Save(e.Session); }