/// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="locations">Locations to include in this template.</param>
 /// <param name="notes">Footnote definitions to include in this template.</param>
 /// <param name="classes">Train classes to include in this template.</param>
 /// <param name="boxes">Signalboxes to include in this template.</param>
 public DocumentTemplate(IEnumerable <Location> locations, IEnumerable <Note> notes, IEnumerable <TrainClass> classes, IEnumerable <Signalbox> boxes)
 {
     Locations       = new LocationCollection(locations ?? Array.Empty <Location>());
     NoteDefinitions = new NoteCollection(notes ?? Array.Empty <Note>());
     TrainClasses    = new TrainClassCollection(classes ?? Array.Empty <TrainClass>());
     Signalboxes     = new SignalboxCollection(boxes ?? Array.Empty <Signalbox>());
 }
        /// <summary>
        /// Default constructor - sets the version number and creates empty objects for deep properties.
        /// </summary>
        public TimetableDocument()
        {
            Version = 2;

            TrainClassList = new TrainClassCollection();
            TrainClassList.TrainClassAdd    += TrainClassChangedHandler;
            TrainClassList.TrainClassRemove -= TrainClassChangedHandler;
            TrainList                                   = new TrainCollection();
            TrainList.TrainAdd                         += TrainAddHandler;
            TrainList.TrainRemove                      += TrainRemoveHandler;
            LocationList                                = new LocationCollection();
            LocationList.LocationAdd                   += LocationChangedHandler;
            LocationList.LocationRemove                += LocationChangedHandler;
            DownTrainsDisplay                           = new TimetableSectionModel(Direction.Down, LocationList);
            UpTrainsDisplay                             = new TimetableSectionModel(Direction.Up, LocationList);
            Signalboxes                                 = new SignalboxCollection();
            Signalboxes.SignalboxAdd                   += SignalboxChangedHandler;
            Signalboxes.SignalboxRemove                += SignalboxChangedHandler;
            SignalboxHoursSets                          = new SignalboxHoursSetCollection();
            SignalboxHoursSets.SignalboxHoursSetAdd    += SignalboxHoursSetChangedHandler;
            SignalboxHoursSets.SignalboxHoursSetRemove += SignalboxHoursSetChangedHandler;
            Options                     = new DocumentOptions();
            NoteDefinitions             = new NoteCollection();
            NoteDefinitions.NoteAdd    += NoteChangedHandler;
            NoteDefinitions.NoteRemove += NoteChangedHandler;
            ExportOptions               = new DocumentExportOptions();
        }
Esempio n. 3
0
        /// <summary>
        ///     Initializes a new instance of the <see cref="VCard" /> class.
        /// </summary>
        public VCard()
        {
            // Per Microsoft best practices, string properties should
            // never return null.  String properties should always
            // return String.Empty.

            _additionalNames = string.Empty;
            _department      = string.Empty;
            _displayName     = string.Empty;
            _familyName      = string.Empty;
            _formattedName   = string.Empty;
            _givenName       = string.Empty;
            _mailer          = string.Empty;
            _namePrefix      = string.Empty;
            _nameSuffix      = string.Empty;
            _office          = string.Empty;
            _organization    = string.Empty;
            _productId       = string.Empty;
            _role            = string.Empty;
            _timeZone        = string.Empty;
            _title           = string.Empty;
            _uniqueId        = string.Empty;

            Categories        = new StringCollection();
            Certificates      = new CertificateCollection();
            DeliveryAddresses = new DeliveryAddressCollection();
            DeliveryLabels    = new DeliveryLabelCollection();
            EmailAddresses    = new EmailAddressCollection();
            _nicknames        = new StringCollection();
            _notes            = new NoteCollection();
            Phones            = new PhoneCollection();
            _photos           = new PhotoCollection();
            Sources           = new SourceCollection();
            Websites          = new WebsiteCollection();
        }
Esempio n. 4
0
 public void newBar()
 {
     if (!currentBar.newBar() && currentBar.getBars().Last().notes.Count > 0)
     {
         bars.Add(currentBar);
         currentBar = new Bar();
     }
 }
Esempio n. 5
0
        }                                        // tempo


        public Staff(int firstMeasure, int secondMeasure, Sound sound, int tempo)
        {
            this.firstMeasure  = firstMeasure;
            this.secondMeasure = secondMeasure;
            this.sound         = sound;
            this.tempo         = tempo;
            relative           = new AbsoluteRelative();
            currentBar         = new Bar();
        }
Esempio n. 6
0
 public NoteEditorDialog(ITypeDescriptorContext context, NoteCollection notes)
 {
     InitializeComponent();
     //this.notesEditorControl1.OriginalItems = null;
     foreach (Note note in notes)
     {
         this.notesEditorControl1.Items.Add(note);
     }
     this.notesEditorControl1.InitializeControls();
 }
Esempio n. 7
0
        public NoteManager(NoteCollection noteCollection)
        {
            InitializeComponent();
            notes = noteCollection;

            notes.SelectedChanged += new NoteEvent(notes_SelectedChanged);
            notes.NoteChanged     += new NoteEvent(notes_NoteChanged);
            notes.New             += new NoteEvent(notes_New);
            notes.Delete          += new NoteEvent(notes_Delete);
        }
Esempio n. 8
0
        private void populateListUsingTimer(NoteCollection noteCollection)
        {
            if (noteCollection == null)
            {
                return;
            }
            _collectionForIncrementalLoad = noteCollection;
            var timer = createTimer();

            timer.Tick += (sender, e) => handleTick(sender);
            timer.Start();
        }
Esempio n. 9
0
        public async Task <ActionResult <NoteCollection> > Post([FromBody] NoteCollection noteCollection)
        {
            if (noteCollection == null && noteCollection.UserId.Equals(""))
            {
                return(new BadRequestResult());
            }

            noteCollection.Id = Guid.NewGuid().ToString("N");
            await _noteRepository.Create(noteCollection);

            return(new ObjectResult(noteCollection));
        }
Esempio n. 10
0
 public IEnumerable <Notes> Get([FromQuery] string query)
 {
     if (query != null)
     {
         // Return notes based on search query
         return(NoteCollection.Find(query));
     }
     else
     {
         // Return all the notes
         return(NoteCollection.GetInstance());
     }
 }
Esempio n. 11
0
        public void addNote(BaseNote note)
        {
            if (currentBar == null)
            {
                currentBar = new Bar();
            }

            currentBar.addNote(note, getMaxBarDuration());

            if (currentBar.getDuration() >= getMaxBarDuration())
            {
                newBar();
            }
        }
Esempio n. 12
0
    private void LoadNoteData()
    {
        using (StreamReader stream = new StreamReader(_noteDataPath))
        {
            string json = stream.ReadToEnd();
            _noteCollection = JsonUtility.FromJson <NoteCollection>(json);
            for (int i = 0; i < _noteCollection.notes.Length; ++i)
            {
                notes.Add(_noteCollection.notes[i]);
            }
        }

        MakeScale(69, ScalesAndModes.Major);
    }
Esempio n. 13
0
        public async Task <ActionResult <NoteCollection> > Put(string id, [FromBody] NoteCollection noteCollection)
        {
            if (noteCollection == null)
            {
                return(new BadRequestResult());
            }
            var notesFromDb = await _noteRepository.Get(id);

            noteCollection.InternalId = notesFromDb.InternalId;
            noteCollection.Id         = notesFromDb.Id;
            noteCollection.UserId     = notesFromDb.UserId;
            await _noteRepository.Update(noteCollection);

            return(new ObjectResult(noteCollection));
        }
Esempio n. 14
0
        private void DrawNoteOfCharacter(string character)
        {
            foreach (NoteCollection coll in _currentJournal.collections)
            {
                if (coll.character != character)
                {
                    continue;
                }

                Logger.Log($"found {character}'s notes");
                _currentCollection = coll;
            }



            DrawNoteText(_currentCollection.notes[currentNoteIndex].text);
        }
Esempio n. 15
0
        public static NoteCollection GetNoteCollection(string notebookPath)
        {
            if (string.IsNullOrEmpty(notebookPath))
            {
                throw new ArgumentNullException("notebookPath");
            }
            lock (LockObj)
            {
                NoteCollection noteCollection;

                if (!NoteCollectionDict.TryGetValue(notebookPath, out noteCollection))
                {
                    noteCollection = new NoteCollection(NoteDao.Inst.GetNotesByNotebookPath(notebookPath));
                    NoteCollectionDict.Add(notebookPath, noteCollection);
                }
                noteCollection.Sort(n => n.ModifyTime, ListSortDirection.Descending);
                return noteCollection;
            }
        }
 public MasterDetailPage()
 {
     this.InitializeComponent();
     this.notes = NoteManager.Notes;
     this.MasterListView.ItemsSource = this.notes;
 }
Esempio n. 17
0
 public void SetUpJournalObject(NoteByCharacters notesObject)
 {
     _currentJournal    = notesObject;
     _currentCollection = notesObject.collections[0];
 }
Esempio n. 18
0
        private static void noteCreated(NoteEntity newNoteEntity)
        {
            var belongNotebookPath = newNoteEntity.NotebookPath;

            lock (LockObj)
            {
                NoteCollection noteCollection;
                if (NoteCollectionDict.TryGetValue(belongNotebookPath, out noteCollection))
                {
                    var flag = false;
                    for (var i = 0; i < noteCollection.Count; i++)
                    {
                        if (noteCollection[i].ModifyTime >= newNoteEntity.ModifyTime) continue;
                        noteCollection.Insert(i, newNoteEntity);
                        flag = true;
                        break;
                    }
                    if (!flag)
                    {
                        noteCollection.Add(newNoteEntity);
                    }
                }
                else
                {
                    noteCollection = new NoteCollection { newNoteEntity };
                    NoteCollectionDict.Add(belongNotebookPath, noteCollection);
                }
            }
        }
Esempio n. 19
0
        private NoteCollection CreateNotes(NoteCollection notes, object value)
        {
            IList<Note> values = value as NoteCollection;

            // 这里为什么要用反射????
            foreach (var item in notes)
            {
                var newItem = TypeDescriptor.CreateInstance(this.Context,
                    typeof(Note),
                    new Type[] { typeof(string), typeof(int) },
                    new object[] { item.Name, item.Age }
                    ) as Note;
                values.Add(newItem);
            }

            return notes;
        }
Esempio n. 20
0
 private static void initNoteListDictAsync()
 {
     Task.Run(() =>
         {
             var notebooks = NotebookDao.Inst.GetAllNotebook();
             if (null == notebooks)
             {
                 return;
             }
             foreach (var nb in notebooks)
             {
                 var noteCollection = new NoteCollection(NoteDao.Inst.GetNotesByNotebookPath(nb.Path));
                 lock (LockObj)
                 {
                     if (!NoteCollectionDict.ContainsKey(nb.Path))
                     {
                         NoteCollectionDict.Add(nb.Path, noteCollection);
                     }
                 }
             }
         });
 }
Esempio n. 21
0
 public NoteEditorControl()
 {
     InitializeComponent();
     // set originalnotes, items here
     _items = new NoteCollection();
 }
Esempio n. 22
0
 private void DestroyNotes(NoteCollection notes)
 {
     if (notes == null)
     {
         return;
     }
     foreach (var item in notes)
     {
         this.DestroyInstance(item);
     }
 }
Esempio n. 23
0
 public void startRepeat()
 {
     newBar();
     currentBar = new Repeat();
 }
 public MasterDetailPage()
 {
     this.InitializeComponent();
     this.notes = NoteManager.Notes;
     this.MasterListView.ItemsSource = this.notes;
 }
Esempio n. 25
0
 public MyCalendar()
 {
     _notes = new NoteCollection();
 }
Esempio n. 26
0
 public Notes Get(int id)
 {
     return(NoteCollection.GetNote(id));
 }
Esempio n. 27
0
 public void Post([FromBody] string json)
 {
     // For some reason I'm unable to bind to NoteBody for JSON deserialization.
     // Until that's fixed, just used the JSON string as the contents for the body.
     NoteCollection.AddNote(json);
 }
Esempio n. 28
0
 public void endRepeat()
 {
     currentBar.newBar();
     bars.Add(currentBar);
     currentBar = new Bar();
 }
Esempio n. 29
0
 private void populateListUsingTimer(NoteCollection noteCollection)
 {
     if (noteCollection == null) return;
     _collectionForIncrementalLoad = noteCollection;
     var timer = createTimer();
     timer.Tick += (sender, e) => handleTick(sender);
     timer.Start();
 }