Ejemplo n.º 1
0
        private void MakeVms()
        {
            var vocs = EntityQuery <Vocabulary> .All(Session)();

            var vms = vocs.Select(v => Vocs
                                  .Where(vm => vm.voc == v)
                                  .FirstOrDefault() ?? new VocabularyViewModel(v));

            Vocs.SyncWith(vms);
        }
Ejemplo n.º 2
0
        private int MakeInstalledVms()
        {
            var vms = VocabularyQuery.NonCustom(Session)()
                      .Select(voc => Vocs
                              .Where(vm => vm.voc == voc)
                              .FirstOrDefault() ?? new VocabularyViewModel(voc))
                      .ToList();

            uiTaskFactory.StartNew(() =>
                                   Vocs.SyncWith(vms));

            return(vms.Count());
        }
Ejemplo n.º 3
0
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                Syncer.SyncEnded     -= syncer_SyncEnded;
                Poster.MessagePosted -= syncer_MessagePosted;
                uiTaskFactory.StartNew(() =>
                {
                    Vocs.Clear();
                    AvailableVocs.Clear();
                });

                Remote.Dispose();
                this.Send(Event.PushToSettings, new object[] { Constants.SyncServerConstrSettingName, Remote.ConnectionString }.AsParams(MessageKeys.Name, MessageKeys.Value));
                this.Send(Event.PushToSettings, new object[] { Constants.SyncServerProviderSettingName, Remote.ProviderName }.AsParams(MessageKeys.Name, MessageKeys.Value));
            }
            base.Dispose(disposing);
        }
Ejemplo n.º 4
0
 private void SelectLastChanged(Vocabulary voc)
 {
     SelectedVoc = Vocs.FirstOrDefault(x => x.voc == voc);
 }
Ejemplo n.º 5
0
 public SampleVocabularyListViewModel()
 {
     Vocs.Add(new VocabularyViewModel(Mocks.voc));
     AvailableVocs.Add(new VocabularyViewModel(Mocks.voc2));
 }