Ejemplo n.º 1
0
        private async Task <bool> SetNetworkAsync(Services.ISearchService searchService,
                                                  Services.IMemberService memberService)
        {
            bool bIsCompleted = false;

            //if a network has been selected as a filter, it was passed to uri.UriNetwork constructor (not uri.URINetworkPartName)
            //but it didn't do a db hit so only partial info on hand
            if (this.SearchManagerData.SearchResult.URINetwork.PKId
                == 0)
            {
                this.SearchManagerData.SearchResult.URINetwork
                    = await memberService.GetNetworkByPartialNameAsync(
                          this.SearchManagerData.SearchResult,
                          this.SearchManagerData.SearchResult.URINetwork.NetworkURIPartName);
            }
            else
            {
                this.SearchManagerData.SearchResult.URINetwork
                    = await memberService.GetNetworkByPartialNameAsync(
                          this.SearchManagerData.SearchResult,
                          this.SearchManagerData.SearchResult.URINetwork.PKId.ToString());
            }
            bIsCompleted = true;
            return(bIsCompleted);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Initializes a new instance of the MainViewModel class.
        /// </summary>
        public MainViewModel(IDataService dataService, Services.ISearchService searchHelper, Services.IFileSystem fileService)
        {
            this.PropertyChanged += MainViewModel_PropertyChanged;

            _dataService = dataService;
            _searchHelper = searchHelper;
            _fileService = fileService;

            ((Services.ILongRunning)_searchHelper).StatusChanged += SearchHelper_StatusChanged;

            _dataService.GetData(
                (item, error) =>
                {
                    if (error != null)
                    {
                        // Report error here
                        return;
                    }

                    WelcomeTitle = item.Title;
                });

            if (IsInDesignMode)
            {
                _applicationTitle = "DumbSearch x.x - By Patware";
                _content = "...Content...";
                _contentIsRegex = true;
                _contentMatchingProgress = 12;
                _contentMatchingProgressIsVisible = true;
                _dateCreatedIsChecked = true;
                _dateCreatedToIsVisible = true;
                _dateModifiedIsChecked = true;
                _dateModifiedToIsVisible = true;
                _file = "...File...";
                _fileIsRegex = true;
                _filesDiscovered = "Files Discovered";
                _filesMatched = "Files Matched";
                _filesSurveyed = "Files Surveyed";
                _folder = "...Folder...";
                _folderIsRegex = true;
                _foldersDiscovered = "Folders Discovered";
                _foldersMatched = "Folders Matched";
                _foldersSurveyed = "Folders Surveyed";
                _foundItems.Add("C:\\Foo");
                _root = "...Root...";
                _sizeFrom = 123;
                _sizeFromUnit = "Megabyte";
                _sizeIsChecked = true;
                _sizeTo = 234;
                _sizeToIsVisible = true;
                _sizeToUnit = "Gigabyte";
                _sizeToUnitIsVisible = true;
                _status = "Lorem Ipsum Status";
            }
            else
            {
                var version = Assembly.GetExecutingAssembly().GetName().Version;

                _applicationTitle = string.Format("DumbSearch {0}.{1} - by Patware", version.Major, version.Minor);

                GalaSoft.MvvmLight.Messaging.Messenger.Default.Register<Messages.SearchStarted>(this, onSearchStarted);
                GalaSoft.MvvmLight.Messaging.Messenger.Default.Register<Messages.ThereIsProgress>(this, onThereIsProgress);
                GalaSoft.MvvmLight.Messaging.Messenger.Default.Register<Messages.FileMatched>(this, onFileMatched);
                GalaSoft.MvvmLight.Messaging.Messenger.Default.Register<Messages.ContentMatched>(this, onContentMatched);

            }

            init();
        }
 public ListingController(EPiServer.IContentLoader contentLoader,
                          Services.ISearchService searchService) : base(contentLoader, searchService)
 {
 }
Ejemplo n.º 4
0
 public HomeController(Services.ISearchService searchService)
 {
     _searchService = searchService;
 }