Exemplo n.º 1
0
 public static void doNotPersist(this Stroke stroke)
 {
     var oldTag = stroke.tag();
     var newTag = new StrokeTag(
         NONPERSISTENT_STROKE,
         oldTag.privacy,
         oldTag.id,
         oldTag.startingSum,
         oldTag.isHighlighter,
         oldTag.timestamp
         );
     stroke.tag(newTag);
 }
Exemplo n.º 2
0
  public static StrokeTag tag(this Stroke stroke)
  {
      var stroketag = new StrokeTag();
      var author = (string) stroke.GetPropertyData(STROKE_TAG_GUID);
      var privacy = (Privacy)Enum.Parse(typeof(Privacy), (string)stroke.GetPropertyData(STROKE_PRIVACY_GUID), true);
      var id = (string) stroke.GetPropertyData(STROKE_IDENTITY_GUID);
      var startingSum = (Double) stroke.GetPropertyData(STARTINGCHECKSUM);
      var isHighlighter = (bool) stroke.GetPropertyData(IS_HIGHLIGHTER);
      var timestamp = (long)stroke.GetPropertyData(STROKE_TIMESTAMP_GUID);
      stroketag = new StrokeTag(author,privacy,id,startingSum,isHighlighter,timestamp);
 
     
      return stroketag;
  }
Exemplo n.º 3
0
 public static StrokeTag tag(this Stroke stroke, StrokeTag tag)
 {
     stroke.AddPropertyData(STROKE_TAG_GUID, tag.author);
     var privacy = Privacy.Private;
     if (tag.privacy != Privacy.NotSet)
         privacy = tag.privacy;
     stroke.AddPropertyData(STROKE_IDENTITY_GUID, tag.id);
     stroke.AddPropertyData(STROKE_PRIVACY_GUID, privacy.ToString());
     stroke.AddPropertyData(STARTINGCHECKSUM, tag.startingSum);
     stroke.AddPropertyData(IS_HIGHLIGHTER, tag.isHighlighter);
     stroke.AddPropertyData(STROKE_TIMESTAMP_GUID, tag.timestamp);
     return tag;
 }
Exemplo n.º 4
0
 public StrokeTag(StrokeTag copyTag, long timestamp)
 {
     id = copyTag.id;
     author = copyTag.author;
     startingSum = copyTag.startingSum;
     isHighlighter = copyTag.isHighlighter;
     this.timestamp = timestamp;
     privacy = copyTag.privacy;
 }
Exemplo n.º 5
0
 public StrokeTag(StrokeTag copyTag, Privacy newPrivacy)
 {
     id = copyTag.id; 
     author = copyTag.author;
     startingSum = copyTag.startingSum;
     isHighlighter = copyTag.isHighlighter;
     timestamp = copyTag.timestamp;
     privacy = newPrivacy;
 }
Exemplo n.º 6
0
 public static StrokeTag tag(this Stroke stroke, StrokeTag tag)
 {
     stroke.AddPropertyData(STROKE_TAG_GUID, tag.author);
     stroke.AddPropertyData(STROKE_PRIVACY_GUID, tag.privacy);
     stroke.AddPropertyData(IS_HIGHLIGHTER, tag.isHighlighter);
     return tag;
 }
Exemplo n.º 7
0
 public static StrokeTag tag(this Stroke stroke)
 {
     var stroketag = new StrokeTag();
     stroketag = new StrokeTag
                {
                    author = (string) stroke.GetPropertyData(STROKE_TAG_GUID),
                    privacy = (string) stroke.GetPropertyData(STROKE_PRIVACY_GUID),
                    isHighlighter = (bool) stroke.GetPropertyData(IS_HIGHLIGHTER)
                };
     return stroketag;
 }
 public void tagTest1()
 {
     Stroke stroke = null; // TODO: Initialize to an appropriate value
     StrokeTag tag = new StrokeTag(); // TODO: Initialize to an appropriate value
     StrokeTag expected = new StrokeTag(); // TODO: Initialize to an appropriate value
     StrokeTag actual;
     actual = StrokeExtensions.tag(stroke, tag);
     Assert.AreEqual(expected, actual);
     Assert.Inconclusive("Verify the correctness of this test method.");
 }