Exemple #1
0
        /// <summary>
        /// Copy Constructor
        /// </summary>
        public MRUEntryViewModel(MRUEntryViewModel copyFrom)
            : this()
        {
            if (copyFrom == null)
            {
                return;
            }

            this.LastUpdate = copyFrom.LastUpdate;
            this.File       = new PathModel(copyFrom.File);
            this.IsPinned   = copyFrom.IsPinned;
            this.GroupItem.SetGroup(copyFrom.GroupItem.Group);
        }
Exemple #2
0
        /// <summary>
        /// Adds a new entry into the list of MRU entries and
        /// ensures the correct pin counter states.
        /// </summary>
        /// <param name="pathFile"></param>
        /// <param name="emp"></param>
        private void AddEntry(string pathFile,
                              IMRUEntryViewModel emp)
        {
            // Add a completely new entry
            var newobj           = new MRUEntryViewModel(emp as MRUEntryViewModel);
            var newIsPinnedValue = (newobj.IsPinned == 0 ? false : true);

            // Reset pin counter on item to make sure its correctly placed in the sorted list
            if (newIsPinnedValue == true)
            {
                this.PinUnpinEntry(newobj, newIsPinnedValue);
            }

            this.Entries.Add(pathFile, newobj);
        }