Exemplo n.º 1
0
        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);
            }
        }
Exemplo n.º 2
0
        /// <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;
            }
        }
Exemplo n.º 3
0
    void Awake()
    {
        LineDrawer = GetComponentInChildren <LineRenderer>();
        np         = GetComponent <NoteProperties> ();

        circleTrans = transform.Find("TimeCircle");
    }
Exemplo n.º 4
0
 private void ShowNoteProperties()
 {
     var form = new NoteProperties(User, Model) { IsReadOnly = IsReadOnly };
     form.Owner = this.FindParentWindow();
     form.ShowDialog();
 }
Exemplo n.º 5
0
 // Use this for initialization
 void Awake()
 {
     prop = this.GetComponent <NoteProperties> ();
 }