public void ButtonPress(User u) { if (ButtonPressed != null) { ButtonPressed(this, u); } }
public Press(TimeSpan start, TimeSpan end, User user) { this.Start = start; this.End = end; this.User = user; Id = Guid.NewGuid(); }
public MainWindow() { InitializeComponent(); currentUser = new User(Properties.Settings.Default.UserId, null); panopticonPercentage = 0; panopticonState = Stage2UI.PanopticonState.PROCESSING; toDownload = 0; downloaded = 0; Stage2Control.AnnotationMade += new Stage2UI.AnnotationMadeEventHandler(Stage2Control_AnnotationMade); Stage2Control.ResearchQuestionSubmitted += new Stage2UI.ResearchQuestionSubmittedEventHandler(Stage2Control_ResearchQuestionSubmitted); Loaded += new RoutedEventHandler(MainWindow_Loaded); }
public Annotation(User user, string comment, Press press) { this.User = user; this.Comment = comment; this.Press = press; }
private Point GetPostItStartPosition(User u) { switch (u.Id) { case 0: return new Point(0.0, ActualHeight / 2.0); case 1: return new Point(ActualWidth / 2.0, 0.0); case 2: return new Point(ActualWidth, ActualHeight / 2.0); case 3: return new Point(ActualWidth / 2.0, ActualHeight); default: return new Point(0.0, 0.0); } }
public static Color GetColorFromUser(User u) { Color c; switch (u.Id) { case 0: c = CovertColor(Properties.Settings.Default.User0Colour); break; case 1: c = CovertColor(Properties.Settings.Default.User1Colour); break; case 2: c = CovertColor(Properties.Settings.Default.User2Colour); break; case 3: c = CovertColor(Properties.Settings.Default.User3Colour); break; default: c = Colors.White; break; } return c; }
public void Register(User u) { try { ICallbackContract tablet = OperationContext.Current.GetCallbackChannel<ICallbackContract>(); if (tablets.ContainsKey(u.Id)) { tablets.Remove(u.Id); } tablet.SetUserColor(GetColorFromUser(u)); tablets[u.Id] = tablet; tablet.SetRound(currentRound); } catch (Exception e) { throw new FaultException(new FaultReason(e.Message + "\r\n" + e.StackTrace)); } }
public void ButtonPress(User u) { try { if (gameStarted && roundInProgress) { Color c = GetColorFromUser(u); u.Color = c; TimeSpan end = DateTime.UtcNow - startTime; TimeSpan start = end - Properties.Settings.Default.PressClipLength; if (start < TimeSpan.Zero) { start = TimeSpan.Zero; } if (end < TimeSpan.Zero) { end = TimeSpan.Zero; } Press p = new Press(start, end, u); presses.Add(p); } } catch (Exception e) { throw new FaultException(new FaultReason(e.Message + "\r\n" + e.StackTrace)); } }
public AnnotationMadeEventArgs(Press press, string comment, User user) { this.Press = press; this.Comment = comment; this.User = user; }