예제 #1
0
        private void AddToRecentFiles(string fileName)
        {
            DaxFile df = (from DaxFile f in RecentFiles
                          where f.FullPath.Equals(fileName, StringComparison.CurrentCultureIgnoreCase)
                          select f).FirstOrDefault <DaxFile>();

            if (df == null)
            {
                RecentFiles.Insert(0, new DaxFile(fileName));
            }
            else
            {
                // move the file to the first position in the list
                RecentFiles.Remove(df);
                RecentFiles.Insert(0, df);
            }
        }
예제 #2
0
        public override ObservableCollection <IDaxFile> ReadJson(JsonReader reader, Type objectType, ObservableCollection <IDaxFile> existingValue, bool hasExistingValue, JsonSerializer serializer)
        {
            JArray ja = JArray.Load(reader);
            //JObject jo = JObject.Load(reader);
            var coll = new ObservableCollection <IDaxFile>();

            foreach (var jo in ja.Children())
            {
                // Read the properties which will be used as constructor parameters
                string path   = (string)jo["FullPath"];
                bool   pinned = (bool?)jo["Pinned"] ?? false;
                var    file   = new DaxFile(path, pinned);
                coll.Add(file);
            }
            return(coll);
            //if (!hasExistingValue) return null;
            //return new DaxFile(path, pinned);
        }
예제 #3
0
 public void OpenRecentFile(DaxFile file, Fluent.Backstage backstage)
 {
     backstage.IsOpen = false;
     _eventAggregator.PublishOnUIThread(new OpenRecentFileEvent(file.FullPath));
 }