本文整理汇总了C#中Tomboy.Note类的典型用法代码示例。如果您正苦于以下问题:C# Note类的具体用法?C# Note怎么用?C# Note使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Note类属于Tomboy命名空间,在下文中一共展示了Note类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: NoteHasUri
public void NoteHasUri()
{
var note = new Note ();
var guid = note.Guid;
Assert.AreEqual ("note://tomboy/" + guid, note.Uri);
}
开发者ID:Dynalon,项目名称:tomboy-library,代码行数:7,代码来源:NoteTests.cs
示例2: GetTesterNote
public static Note GetTesterNote()
{
if (note == null)
note = new Note ("tomboy://90d8eb70-989d-4b26-97bc-ba4b9442e51d");
SetUpNote ();
return note;
}
开发者ID:wickedshimmy,项目名称:tomboy-library,代码行数:7,代码来源:TesterNote.cs
示例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);
}
开发者ID:MichaelAquilina,项目名称:tomboy,代码行数:7,代码来源:BacklinkMenuItem.cs
示例4: WatchNote
public static void WatchNote (Note note)
{
if (!openNotes.Contains (note)) {
openNotes.Add (note);
UpdateWindowMenu ();
}
}
开发者ID:MichaelAquilina,项目名称:tomboy,代码行数:7,代码来源:MacApplication.cs
示例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);
}
开发者ID:BooTeK,项目名称:Rainy,代码行数:30,代码来源:DtoConversionTests.cs
示例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;
}
开发者ID:MichaelAquilina,项目名称:tomboy,代码行数:28,代码来源:ExportToHtmlApplicationAddin.cs
示例7: NoteEqualityOperator
public void NoteEqualityOperator()
{
var note1 = new Note ();
var note2 = note1;
Assert.AreEqual (note1, note2);
Assert.That (note1 == note2);
}
开发者ID:Dynalon,项目名称:tomboy-library,代码行数:7,代码来源:NoteTests.cs
示例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;
}
}
开发者ID:gitter-badger,项目名称:tomboy.osx,代码行数:8,代码来源:MyDocument.cs
示例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);
}
开发者ID:rashoodkhan,项目名称:Rainy,代码行数:8,代码来源:DbEncryptedStorage.cs
示例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;
}
开发者ID:robpvn,项目名称:tomboy-library,代码行数:17,代码来源:Utils.cs
示例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);
}
开发者ID:wickedshimmy,项目名称:tomboy-library,代码行数:8,代码来源:TagManagerTests.cs
示例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;
}
开发者ID:MichaelAquilina,项目名称:tomboy,代码行数:9,代码来源:NoteOfTheDay.cs
示例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);
}
开发者ID:BooTeK,项目名称:Rainy,代码行数:10,代码来源:DbStorage.cs
示例14: Initialize
public void Initialize (Note note)
{
this.note = note;
this.note.Opened += OnNoteOpenedEvent;
Initialize ();
if (note.IsOpened)
OnNoteOpened ();
}
开发者ID:MichaelAquilina,项目名称:tomboy,代码行数:10,代码来源:NoteAddin.cs
示例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;
}
开发者ID:robpvn,项目名称:tomboy-library,代码行数:66,代码来源:Reader.cs
示例16: Initialize
public override void Initialize()
{
try {
GlobalTodo = Note.Manager.Find(GLOBALTITLE);
if(GlobalTodo == null)
GlobalTodo = Note.Manager.Create(GLOBALTITLE, GLOBALCONTENT);
} catch (Exception e) {
Console.WriteLine("Error at initialize: " + e);
}
}
开发者ID:humbhenri,项目名称:Global-TODO-Addin-for-Tomboy,代码行数:11,代码来源:GlobalTodo.cs
示例17: SaveNote
public void SaveNote(Note note)
{
var dbNote = note.ToDTONote ().ToDBNote ();
dbNote.Username = Username;
// 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.Username == Username && n.Guid == dbNote.Guid);
db.Insert (dbNote);
}
开发者ID:jonpolak,项目名称:Rainy,代码行数:11,代码来源:DbStorage.cs
示例18: NewNote
public static Note NewNote(string title, string body)
{
Note note = new Note ("tomboy://" + Guid.NewGuid ().ToString ());
if (title != null)
note.Title = title;
if (body != null)
note.Text = body;
return note;
}
开发者ID:robpvn,项目名称:tomboy-library,代码行数:11,代码来源:NoteCreator.cs
示例19: RemoveBrokenLinkTag
public void RemoveBrokenLinkTag (Note note)
{
NoteTag broken_link_tag = note.TagTable.BrokenLinkTag;
Gtk.TextIter note_start, note_end;
// We get the whole note as a range
// and then just remove the "broken link" tag from it
note.Buffer.GetBounds (out note_start, out note_end);
// Sweep 'em
note.Buffer.RemoveTag (broken_link_tag,note_start,note_end);
Logger.Debug ("Removed broken links from a note: " + note.Title);
}
开发者ID:MichaelAquilina,项目名称:tomboy,代码行数:15,代码来源:RemoveBrokenLinksUtils.cs
示例20: NewNote
public static Note NewNote(string title, string body)
{
Note note = new Note ("note://tomboy/" + Guid.NewGuid ().ToString ());
note.CreateDate = DateTime.UtcNow;
if (title != null)
note.Title = title;
if (body != null)
note.Text = title + "\n\n" + body;
else
note.Text = title + "\n\n";
return note;
}
开发者ID:wickedshimmy,项目名称:tomboy-library,代码行数:15,代码来源:NoteCreator.cs
注:本文中的Tomboy.Note类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论