本文整理汇总了C#中Tomboy.Note类的典型用法代码示例。如果您正苦于以下问题:C# Note类的具体用法?C# Note怎么用?C# Note使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Note类属于Tomboy命名空间,在下文中一共展示了Note类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: NoteHasUri
public void NoteHasUri()
{
var note = new Note ();
var guid = note.Guid;
Assert.AreEqual ("note://tomboy/" + guid, note.Uri);
}
示例2: GetTesterNote
public static Note GetTesterNote()
{
if (note == null)
note = new Note ("tomboy://90d8eb70-989d-4b26-97bc-ba4b9442e51d");
SetUpNote ();
return note;
}
示例3: BacklinkMenuItem
public BacklinkMenuItem (Note note, string title_search) :
base (note.Title)
{
this.note = note;
this.title_search = title_search;
this.Image = new Gtk.Image (NoteIcon);
}
示例4: WatchNote
public static void WatchNote (Note note)
{
if (!openNotes.Contains (note)) {
openNotes.Add (note);
UpdateWindowMenu ();
}
}
示例5: ConvertBackAndForth
public void ConvertBackAndForth()
{
var tn1 = new Note () {
Title = "This is my Title with Umlauts: äöü",
Text = "This is my note body text.",
CreateDate = DateTime.Now - new TimeSpan (365, 0, 0, 0),
MetadataChangeDate = DateTime.Now,
ChangeDate = DateTime.Now - new TimeSpan (14, 0, 0, 0)
// TODO check why OpenOnStartup is of type string in Tomboy
//OpenOnStartup = "true"
};
var dto_note = tn1.ToDTONote ();
var tn2 = dto_note.ToTomboyNote ();
// notes should be identical
Assert.AreEqual (tn1.Guid, tn2.Guid);
Assert.AreEqual (tn1.Uri, tn2.Uri);
Assert.AreEqual (tn1.Title, tn2.Title);
Assert.AreEqual (tn1.Text, tn2.Text);
Assert.AreEqual (tn1.ChangeDate, tn2.ChangeDate);
Assert.AreEqual (tn1.MetadataChangeDate, tn2.MetadataChangeDate);
Assert.AreEqual (tn1.CreateDate, tn2.CreateDate);
Assert.AreEqual (tn1.OpenOnStartup, tn2.OpenOnStartup);
Assert.AreEqual (tn1.Tags.Keys, tn2.Tags.Keys);
}
示例6: ExportSingleNote
/// <summary>
/// Exports a single Note to HTML in a specified location.
/// </summary>
public override void ExportSingleNote (Note note,
string output_folder)
{
string output_path = output_folder + SanitizeNoteTitle (note.Title)
+ "." + export_file_suffix;
Logger.Debug ("Exporting Note '{0}' to '{1}'...", note.Title, output_path);
StreamWriter writer = null;
try {
// FIXME: Warn about file existing. Allow overwrite.
File.Delete (output_path);
} catch {
}
writer = new StreamWriter (output_path);
WriteHTMLForNote (writer, note);
if (writer != null)
writer.Close ();
return;
}
示例7: NoteEqualityOperator
public void NoteEqualityOperator()
{
var note1 = new Note ();
var note2 = note1;
Assert.AreEqual (note1, note2);
Assert.That (note1 == note2);
}
示例8: MyDocument
public MyDocument (Note note) : base ()
{
// some contructors might pass in null and not an actual note.
if (note != null) {
this.currentNoteID = note.Uri;
this.currentNote = note;
}
}
示例9: SaveNote
public override void SaveNote(Note note)
{
var db_note = note.ToDTONote ().ToDBNote (Username);
db_note.EncryptedKey = GetEncryptedNoteKey (db_note);
EncryptNoteBody (db_note);
base.SaveDBNote (db_note);
}
示例10: GetNoteFileNameFromURI
/// <summary>
/// Gets the note file name from URI.
/// </summary>
/// <returns>
/// The note file name from URI.
/// </returns>
/// <param name='note'>
/// Note.
/// </param>
public static string GetNoteFileNameFromURI(Note note)
{
string name = "";
int begin = note.Uri.LastIndexOf ("/");
begin++;
name = note.Uri.Substring (begin,(note.Uri.Length - begin));
return name;
}
示例11: Init
public void Init()
{
tagMgr = TagManager.Instance;
tag_google = tagMgr.GetOrCreateTag (TAG_NAME_GOOGLE);
tag_school = new Tag ("School");
note = TesterNote.GetTesterNote ();
note.Tags.Add ("School", tag_school);
}
示例12: HasChanged
public static bool HasChanged (Note note)
{
string original_xml = GetContent(note.CreateDate, note.Manager);
if (GetContentWithoutTitle (note.TextContent) ==
GetContentWithoutTitle (XmlDecoder.Decode (original_xml))) {
return false;
}
return true;
}
示例13: SaveNote
public void SaveNote(Note note)
{
var dbNote = note.ToDTONote ().ToDBNote (User);
// unforunately, we can't know if that note already exist
// so we delete any previous incarnations of that note and
// re-insert
db.Delete<DBNote> (n => n.CompoundPrimaryKey == dbNote.CompoundPrimaryKey);
db.Insert (dbNote);
}
示例14: Initialize
public void Initialize (Note note)
{
this.note = note;
this.note.Opened += OnNoteOpenedEvent;
Initialize ();
if (note.IsOpened)
OnNoteOpened ();
}
示例15: Read
/// <summary>
/// Read the specified xml and uri.
/// </summary>
/// <description>XML is the raw Note XML for each note in the system.</description>
/// <description>uri is in the format of //tomboy:NoteHash</description>
/// <param name='xml'>
/// Xml.
/// </param>
/// <param name='uri'>
/// URI.
/// </param>
public static Note Read(XmlTextReader xml, string uri)
{
Note note = new Note (uri);
DateTime date;
int num;
string version = String.Empty;
while (xml.Read ()) {
switch (xml.NodeType) {
case XmlNodeType.Element:
switch (xml.Name) {
case "note":
version = xml.GetAttribute ("version");
break;
case "title":
note.Title = xml.ReadString ();
break;
case "text":
// <text> is just a wrapper around <note-content>
// NOTE: Use .text here to avoid triggering a save.
note.Text = xml.ReadInnerXml ();
break;
case "last-change-date":
if (DateTime.TryParse (xml.ReadString (), out date))
note.ChangeDate = date;
else
note.ChangeDate = DateTime.Now;
break;
case "last-metadata-change-date":
if (DateTime.TryParse (xml.ReadString (), out date))
note.MetadataChangeDate = date;
else
note.MetadataChangeDate = DateTime.Now;
break;
case "create-date":
if (DateTime.TryParse (xml.ReadString (), out date))
note.CreateDate = date;
else
note.CreateDate = DateTime.Now;
break;
case "x":
if (int.TryParse (xml.ReadString (), out num))
note.X = num;
break;
case "y":
if (int.TryParse (xml.ReadString (), out num))
note.Y = num;
break;
}
break;
}
}
return note;
}