private void recieveSubmission(TargettedSubmission submission)
 {
     if (String.IsNullOrEmpty(submission.target) || submission.target != "submission") return;
     Dispatcher.adopt(delegate
     {
         submissions.Add(load(submission));
     });
 }
 public void timeTest()
 {
     TargettedSubmission target = new TargettedSubmission(); // TODO: Initialize to an appropriate value
     long expected = 0; // TODO: Initialize to an appropriate value
     long actual;
     target.time = expected;
     actual = target.time;
     Assert.AreEqual(expected, actual);
     Assert.Inconclusive("Verify the correctness of this test method.");
 }
        public PrivacyWrapper(TargettedSubmission sub, Dictionary<string, string> userMapping)
        {
            targettedSubmission = sub;

            var labelIndex = 1;
            foreach (var user in sub.blacklisted)
            {
                privateusers.Add(new PrivateUser(user.UserName, GenerateDisplayName(userMapping, user.UserName, ref labelIndex), MeTLStanzas.Ink.stringToColor(user.Color)));
            }
        }
 private DisplayableSubmission load(TargettedSubmission submission)
 {
     var uri = App.controller.config.getResource(submission.url);
     var bitmap = new BitmapImage();
     bitmap.BeginInit();
     bitmap.StreamSource = new System.IO.MemoryStream(App.controller.client.resourceProvider.secureGetData(uri));
     bitmap.EndInit();
     return new DisplayableSubmission
     {
         Image = bitmap,
         Source = submission.url,
         Url = uri,
         Identity = submission.identity,
         Author = submission.author,
         Message = submission.title,
         Date = SandRibbonObjects.DateTimeFactory.FromMilis(submission.timestamp).ToString()
     };
 }
 private void SendSubmission(TargettedSubmission ts)
 {
     client.SendSubmission(ts);
 }
 public void receiveSubmission(TargettedSubmission ts) { }
 public void TargettedSubmissionConstructorTest()
 {
     TargettedSubmission target = new TargettedSubmission();
     Assert.Inconclusive("TODO: Implement code to verify target");
 }
Ejemplo n.º 8
0
 public void SendSubmission(TargettedSubmission ts)
 {
     Trace.TraceInformation("Beginning Submission send: " + ts.url);
     Action work = delegate
     {
         wire.SendScreenshotSubmission(ts);
     };
     tryIfConnected(work);
 }
 private bool IHaveThisSubmission(TargettedSubmission submission)
 {
     if (submissionList.Where(s => s.time == submission.time && s.author == submission.author && s.url == submission.url).ToList().Count > 0)
         return true;
     return false;
 }
Ejemplo n.º 10
0
 void IReceiveEvents.receiveSubmission(TargettedSubmission ts)
 {
     SubmissionAvailable(this, new SubmissionAvailableEventArgs { submission = ts });
 }
 private void ReceiveSubmission(TargettedSubmission sub)
 {
     if (sub.target == "bannedcontent")
     {
         foreach (var historicallyBannedUser in sub.blacklisted)
         {
             constructPersonFromUsername(historicallyBannedUser.UserName);
         }
     }
     RegisterAction(sub.author);
     RegisterSubmission(sub.author);
 }
 private void ReceiveSubmission(TargettedSubmission submission)
 {
     if (submission.target != "bannedcontent")
         return;
     Dispatcher.adopt(delegate
     {
         submissionList.Add(new PrivacyWrapper(submission, userMapping));
     });
     }
 public ScreenshotSubmission(TargettedSubmission submission)
     : this()
 {
     this.parameters = submission;
 }