public Note AddNote(Document aDocument, NoteType aNoteType, string aText, long?width, long?height, long?xPos, long?yPos, long?aPage = null) { using (DocumentLock lDocumentLock = aDocument.LockDocument()) { if (lDocumentLock.Status != DocumentLockStatus.LockObtained) { throw new DocumentLockedException(aDocument, lDocumentLock); } NoteModifier lModifier = aDocument.CreateNoteModifier(); NoteProperties lProperties = lModifier.CreateNoteProperties(); if (width.HasValue && height.HasValue) { lProperties.Size = lModifier.CreateNoteSize(width.Value, height.Value); } lProperties.Position = lModifier.CreateNotePosition(xPos.GetValueOrDefault(0), yPos.GetValueOrDefault(0)); lProperties.PageNumber = aPage; lProperties.Text = aText; Note lNote = aNoteType.CreateNote(lProperties); lModifier.AddNote(lNote); lModifier.ApplyChanges(); return(lNote); } }
/// <summary> /// Сортировка заметок по одному из свойств /// </summary> /// <param name="noteProperties">Свойство, являющееся ключом для сортировки</param> public void Sort(NoteProperties noteProperties) { switch (noteProperties) { case NoteProperties.Index: Notes = Notes.OrderBy(x => x.Index).ToArray(); break; case NoteProperties.Date: Notes = Notes.OrderBy(x => x.Date).ToArray(); break; case NoteProperties.Caption: Notes = Notes.OrderBy(x => x.Caption).ToArray(); break; case NoteProperties.Description: Notes = Notes.OrderBy(x => x.Description).ToArray(); break; case NoteProperties.Author: Notes = Notes.OrderBy(x => x.Author).ToArray(); break; case NoteProperties.Category: Notes = Notes.OrderBy(x => x.Category).ToArray(); break; default: break; } }
void Awake() { LineDrawer = GetComponentInChildren <LineRenderer>(); np = GetComponent <NoteProperties> (); circleTrans = transform.Find("TimeCircle"); }
private void ShowNoteProperties() { var form = new NoteProperties(User, Model) { IsReadOnly = IsReadOnly }; form.Owner = this.FindParentWindow(); form.ShowDialog(); }
// Use this for initialization void Awake() { prop = this.GetComponent <NoteProperties> (); }