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); }
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; }
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; }
public StrokeTag(StrokeTag copyTag, long timestamp) { id = copyTag.id; author = copyTag.author; startingSum = copyTag.startingSum; isHighlighter = copyTag.isHighlighter; this.timestamp = timestamp; privacy = copyTag.privacy; }
public StrokeTag(StrokeTag copyTag, Privacy newPrivacy) { id = copyTag.id; author = copyTag.author; startingSum = copyTag.startingSum; isHighlighter = copyTag.isHighlighter; timestamp = copyTag.timestamp; privacy = newPrivacy; }
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; }
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."); }