コード例 #1
0
        public FilterViewModel()
        {
            _filter          = new AlignmentFilter();
            _shouldSerialize = false;
            LocationId       = 0;
            SequenceTypeId   = 0;

            Initialize();
        }
コード例 #2
0
        private static AlignmentFilter PromptDbInfo()
        {
            IUIVisualizer uiVisualizer = ViewModel.ServiceProvider.Resolve <IUIVisualizer>();

            Debug.Assert(uiVisualizer != null);

            var savedConnections = AlignmentFilter.Load(SAVED_CONNECTION_FILE);

            using (var cvm = new FilterListViewModel(savedConnections))
            {
                try
                {
                    if (savedConnections.Count > 0)
                    {
                        if (uiVisualizer.ShowDialog(RCADDI_SELECT_EXISTING_CONNECTION_UI, cvm) == true)
                        {
                            return(cvm.SelectedFilter.Filter);
                        }
                    }
                    else
                    {
                        var vm = new FilterViewModel();
                        if (uiVisualizer.ShowDialog(RCADRI_CREATE_CONNECTION_UI, vm) == true)
                        {
                            cvm.Filters.Add(vm);
                            cvm.SelectedFilter = vm;
                            return(vm.Filter);
                        }
                    }
                    return(null);
                }
                finally
                {
                    AlignmentFilter.Save(SAVED_CONNECTION_FILE, cvm.Filters
                                         .Where(vm => vm.ShouldSerialize)
                                         .Select(vm => vm.Filter));
                }
            }
        }
コード例 #3
0
 /// <summary>
 /// This is used to initialize the BioDataLoader when it is first created.
 /// </summary>
 /// <param name="initData">String data</param>
 /// <returns>True/False success</returns>
 public bool Initialize(string initData)
 {
     _dbConnection = PromptDbInfo();
     return(_dbConnection != null && _dbConnection.IsValid);
 }
コード例 #4
0
 public FilterViewModel(AlignmentFilter filter, bool shouldSerialize)
 {
     _filter          = filter;
     _shouldSerialize = shouldSerialize;
     Initialize();
 }