Example #1
0
            /// <summary>
            /// Load sales transactions using the search criteria.
            /// </summary>
            /// <param name="request">Request containing the criteria used to retrieve sales transactions.</param>
            /// <returns>Instance of <see cref="GetSalesTransactionsServiceResponse"/>.</returns>
            private static GetSalesTransactionsServiceResponse GetSalesTransactions(GetSalesTransactionsServiceRequest request)
            {
                ThrowIf.Null(request, "request");

                IDictionary <string, IList <SalesLine> > linesWithUnavailableProducts;

                // Try to load the transaction
                GetCartsDataRequest            getSalesTransactionDatasetDataRequest = new GetCartsDataRequest(request.SearchCriteria, request.QueryResultSettings);
                PagedResult <SalesTransaction> salesTransactions = request.RequestContext.Execute <EntityDataServiceResponse <SalesTransaction> >(getSalesTransactionDatasetDataRequest).PagedEntityCollection;

                if (salesTransactions != null)
                {
                    // Only search remote in case of customer order.
                    SearchLocation productSearchLocation = salesTransactions.Results.Any(t => t.CartType == CartType.CustomerOrder) ? SearchLocation.All : SearchLocation.Local;

                    linesWithUnavailableProducts = PopulateProductOnSalesLines(request.RequestContext, salesTransactions.Results, request.MustRemoveUnavailableProductLines, productSearchLocation);
                }
                else
                {
                    salesTransactions = PagedResult <SalesTransaction> .Empty();

                    linesWithUnavailableProducts = new Dictionary <string, IList <SalesLine> >();
                }

                GetSalesTransactionsServiceResponse response = new GetSalesTransactionsServiceResponse(salesTransactions, linesWithUnavailableProducts);

                return(response);
            }
Example #2
0
        private Task<NugetResult> findDependenciesFor(Dependency dependency, UpdateMode mode, int depth, SearchLocation location, List<Dependency> dependencies)
        {
            var result = findLocal(dependency, location);
            return Task.Factory.StartNew(() =>
            {
                if (result.Found)
                {
                    processNuget(result.Nuget, dependency, mode, depth, location, dependencies);
                    return result;
                }

                var search = NugetSearch.Find(_solution, dependency);

                search.ContinueWith(task =>
                {
                    if (!task.Result.Found)
                    {
                        return;
                    }

                    result.Import(task.Result);
                    var nuget = task.Result.Nuget;
                    processNuget(nuget, dependency, mode, depth, location, dependencies);

                }, TaskContinuationOptions.NotOnFaulted | TaskContinuationOptions.AttachedToParent);

                return result;

            }, TaskCreationOptions.AttachedToParent);
        }
Example #3
0
        public async Task <Result <Location> > GetLocation(SearchLocation searchLocation, string languageCode)
        {
            var id = Guid.Parse(searchLocation.PredictionResult.Id);

            var location = await _context.Locations
                           .Where(l => l.Id == id)
                           .Select(l => new Location(l.Name, l.Locality, l.Country, new GeoPoint(l.Coordinates), l.DistanceInMeters, l.Source, l.Type, l.Suppliers))
                           .FirstOrDefaultAsync();

            if (location.Equals(default))
        public void SearchLocationTest()
        {
            mockRepository.Setup(x => x.SearchLocation(1))
            .Returns(listaLocations.Where(y => y.LocationId == 1).First);

            var handler = new SearchLocationHandler(mockRepository.Object);

            SearchLocation sl = new SearchLocation(1);

            var res = handler.Handle(sl, ct);

            Assert.IsNotNull(res.Result);
        }
Example #5
0
        void Add(SearchLocation loc, Key key)
        {
            var command = new RelayCommand(a => {
                this.vmSearch.SearchLocationVM.SelectedItem = loc;
                if (!this.searchControl.SearchTextBox.IsKeyboardFocusWithin)
                {
                    this.searchControl.SearchTextBox.SelectAll();
                }
                this.searchControl.SearchTextBox.Focus();
            });

            this.searchControl.InputBindings.Add(new KeyBinding(command, new KeyGesture(key, ModifierKeys.Control)));
        }
Example #6
0
        // Almost entirely covered by integration tests
        public IEnumerable<Dependency> DependenciesFor(Dependency dependency, UpdateMode mode, SearchLocation location = SearchLocation.Remote)
        {
            var cache = mode == UpdateMode.Fixed ? _dependenciesForFixedCache : _dependenciesForFloatCache;

            IEnumerable<Dependency> dependencies;
            if (cache.TryGetValue(dependency, out dependencies) == false)
            {
                dependencies = findDependenciesFor(dependency, mode, 0, location);
                cache[dependency] = dependencies;
            }

            return dependencies.ToArray();
        }
Example #7
0
        static void JpegHandler(String file, SearchLocation config, Archive archive)
        {
            DateTime createTime = File.GetCreationTime(file);

            using (FileStream stream = File.OpenRead(file))
                using (Bitmap image = (Bitmap)Bitmap.FromStream(stream))
                {
                    createTime = TagParser.Parse <ExifTags>(image.PropertyItems.ToList())
                                 .FileChangeDateTime
                                 .GetValueOrDefault(createTime);
                }

            Archive(file, createTime, archive);
        }
        /**
            use this location to search for a location on the site
            if a recent location, set that as the id
            else search for the number
        */

        public async Task<LocationResult> SelectLocation(SearchLocation location)
        {
            await LoadLocationPage();

            var data = new NameValueCollection();
            // will get correct value based on if it's recent or manual
            data.Add(location.GetWebFormData());
            data.Add(Constants.ChooseLocation.NextButton, Constants.ChooseLocation.NextButtonValue);

            var doc = await MyApi.CallApi("ChooseLocation.aspx", true, data);
            // process this result and return the correct info
            var result = ParseLocationResult(doc, MyApi);

            return result;
        }
 public void PrintTitleTestMethod()
 {
     try
     {
         log.Info("PrintTitleTestMethod test Started.");
         Thread.Sleep(3000);
         SearchLocation searchLocation = new SearchLocation(driver);
         searchLocation.PrintSearch();
         log.Info("PrintTitleTestMethod test Ended.");
     }
     catch (Exception exception)
     {
         throw new Exception(exception.Message);
     }
 }
 public void SearchLocationTestMethod()
 {
     try
     {
         log.Info("SearchLocationTestMethod test Started.");
         Thread.Sleep(3000);
         SearchLocation searchLocation = new SearchLocation(driver);
         searchLocation.SearchLocationMethod(JsonData.data.PropertySearchName);
         Assert.AreEqual(JsonData.data.PropertyLocationTitle, driver.Title);
         log.Info("SearchLocationTestMethod test Ended.");
     }
     catch (Exception exception)
     {
         throw new Exception(exception.Message);
     }
 }
Example #11
0
        public BuildUrl SetLocation(string region   = null, string suburb = null, string area = null,
                                    string postcode = null, string loc    = null, State?state = State.NSW)
        {
            var location = new SearchLocation
            {
                Suburb   = suburb,
                Region   = region,
                State    = state,
                PostCode = postcode,
                Area     = area // RB: it can be replaced by different type of SearchLocationCategory with the ?
                                //Category = SearchLocationCategory.Area,
            };

            SearchLocation = location;
            return(this);
        }
Example #12
0
        private void PlacePictureOnMap(Picture picture)
        {
            SearchLocation a = new SearchLocation
            {
                Longitude          = picture.GPSLongitude,
                Latitude           = picture.GPSLatitude,
                PushPinDescription =
                    String.Format("<IMG SRC=\"{0}\" ALT=\"{0}\" WIDTH=200 HEIGHT=200>",
                                  picture.FileName),
                PushPinLayer = "Photos",
                PushPinTitle = picture.Name
            };

            locations.Add(a);
            ucVEarth.VE_AddPushPin(a);
            ucVEarth.VE_SetCenter(a);
        }
        public void AddOrUpdateLocation(Location location)
        {
            // The lat and long of the position Class need to be reversed to get them stored correctly
            var position    = new Position(location.Longitude, location.Latitude);
            var newLocation = new SearchLocation()
            {
                id    = location.Id,
                Name  = location.Name,
                Point = new Point(position),
                Physical_Addresses = location.Physical_Addresses
            };

            var batch = IndexBatch.Upload(new List <SearchLocation> {
                newLocation
            });

            _searchIndexClient.Documents.Index(batch);
        }
Example #14
0
        internal SearchLocation GetLocation()
        {
            SearchLocation location = SearchLocation.Invalid;

            if (radioButtonSelection.Checked)
            {
                location = SearchLocation.Selection;
            }
            else if (radioButtonBook.Checked)
            {
                location = SearchLocation.Workbook;
            }
            else if (radioButtonSheet.Checked)
            {
                location = SearchLocation.Worksheet;
            }

            return(location);
        }
Example #15
0
        private NugetResult findLocal(Dependency dependency, SearchLocation location)
        {
            var result = new NugetResult();

            if (location == SearchLocation.Local && _solution.HasLocalCopy(dependency.Name))
            {
                try
                {
                    // Try to hit the local zip and read it. Mostly for testing but it'll detect a corrupted local package as well
                    result.Nuget = _solution.LocalNuget(dependency.Name);
                    result.Nuget.Dependencies().ToList();

                    RippleLog.Debug(dependency.Name + " already installed");
                }
                catch
                {
                    result.Nuget = null;
                }
            }

            return(result);
        }
Example #16
0
        public async Task <Result <Location> > GetLocation(SearchLocation searchLocation, string languageCode)
        {
            if (string.IsNullOrWhiteSpace(searchLocation.PredictionResult.SessionId))
            {
                return(Result.Failure <Location>(
                           "A session must be provided. The session begins when the user starts typing a query, and concludes when they select a place. " +
                           "Each session can have multiple queries, followed by one place selection. Once a session has concluded, the token is no longer valid; " +
                           "your app must generate a fresh token for each session."));
            }

            var url = $"place/details/json?key={_options.ApiKey}&placeid={searchLocation.PredictionResult.Id}&" +
                      $"sessiontoken={searchLocation.PredictionResult.SessionId}" +
                      "&language=en&fields=address_component,adr_address,formatted_address,geometry,name,place_id,type,vicinity";

            var maybePlaceContainer = await GetResponseContent <PlaceContainer>(url);

            if (maybePlaceContainer.HasNoValue)
            {
                return(Result.Failure <Location>("A network error has been occurred. Please retry your request after several seconds."));
            }

            var place = maybePlaceContainer.Value.Place;

            if (place.Equals(default))
Example #17
0
        /*public static PDBWebClient GetWebClientWithCookie(Match ProxyMatch)
         * {
         *
         *      PDBWebClient specialWebClient =
         *              (ProxyMatch != null ?
         *              new PDBWebClient(ProxyMatch.Groups["proxyAddress"].Value,
         *                                               ProxyMatch.Groups["username"].Value,
         *                                               ProxyMatch.Groups["password"].Value,
         *                                               (ProxyMatch.Groups["domain"] != null ? ProxyMatch.Groups["domain"].Value : String.Empty)) : new PDBWebClient());
         *
         *      AddHeadersIfNecessary(specialWebClient);
         *      return specialWebClient;
         * }*/

        /*
         * public static PDBWebClient GetWebClientWithCookie()
         * {
         *      PDBWebClient specialWebClient = new PDBWebClient();
         *      if (specialWebClient.Headers["User-Agent"] == null)
         *      {
         *              specialWebClient.Headers.Add("User-Agent", Constants.userAgentHeader);
         *      }
         *      if (!String.IsNullOrEmpty(EulaContents.GetEulaCookie()))
         *      {
         *              if (specialWebClient.Headers["Cookie"] == null)
         *              {
         *                      specialWebClient.Headers.Add("Cookie", EulaContents.GetEulaCookie());
         *              }
         *      }
         *      return specialWebClient;
         * }
         */

        public static SearchLocation ExtractFromByteArray(byte[] searchArray,
                                                          string beginHexaDecimalString,
                                                          string endHexaDecimalString,
                                                          int searchBeginPosition)
        {
            SearchLocation resultLocation;

            String searchArrayAsHex = ByteArrayToHex(searchArray);
            int    beginLocation    =
                searchArrayAsHex.IndexOf(beginHexaDecimalString, searchBeginPosition);
            int endLocation =
                searchArrayAsHex.IndexOf(endHexaDecimalString, beginLocation);

            if (beginLocation < endLocation)
            {
                resultLocation = new SearchLocation(
                    HexToByte(searchArrayAsHex.Substring(beginLocation, endLocation - beginLocation)), beginLocation);
            }
            else
            {
                resultLocation = new SearchLocation(null, -1);
            }
            return(resultLocation);
        }
Example #18
0
        private IEnumerable<Dependency> findDependenciesFor(Dependency dependency, UpdateMode mode, SearchLocation location)
        {
            var dependencies = new List<Dependency>();
            var task = findDependenciesFor(dependency, mode, 0, location, dependencies);

            try
            {
                task.Wait();
                if (!task.Result.Found)
                {
                    RippleAssert.Fail("Could not find " + dependency.Name);
                }
            }
            catch (AggregateException ex)
            {
                var flat = ex.Flatten();
                if (flat.InnerException != null)
                {
                    RippleLog.Debug(flat.InnerException.Message);
                }
            }

            return dependencies.OrderBy(x => x.Name);
        }
Example #19
0
        public AppInfoCollection FindApps(
            SearchLocation location,
            AppGroup appData,
            DeletedAppCollection recycleBin,
            bool excludeExisting,
            bool excludeBin)
        {
            if (location == SearchLocation.None)
            {
                return(new AppInfoCollection());
            }

            var searchPaths = new List <string>();

            if ((location & SearchLocation.QuickLaunch) == SearchLocation.QuickLaunch)
            {
                searchPaths.AddRange(_SearchPaths[SearchLocation.QuickLaunch]);
            }

            if ((location & SearchLocation.AllProgramsMenu) == SearchLocation.AllProgramsMenu)
            {
                searchPaths.AddRange(_SearchPaths[SearchLocation.AllProgramsMenu]);
            }

            return(FindApps(
                       searchPaths,
                       new List <string>()
            {
                "lnk"
            },
                       appData,
                       recycleBin,
                       excludeExisting,
                       excludeBin
                       ));
        }
Example #20
0
        private void processNuget(IRemoteNuget nuget, Dependency dependency, UpdateMode mode, int depth, SearchLocation location,
                                  List<Dependency> dependencies)
        {
            if (depth != 0)
            {
                var dep = dependency;
                var markAsFixed = mode == UpdateMode.Fixed || !FeedRegistry.IsFloat(_solution, dependency);

                if (dep.IsFloat() && markAsFixed)
                {
                    dep = new Dependency(nuget.Name, nuget.Version, UpdateMode.Fixed);
                }

                dependencies.Add(dep);
            }

            nuget
                .Dependencies()
                .Each(x => findDependenciesFor(x, mode, depth + 1, location, dependencies));
        }
Example #21
0
 public static DependencyCacheKey For(Dependency dependency, UpdateMode mode, SearchLocation location)
 {
     return(new DependencyCacheKey {
         Dependency = dependency, Mode = mode, Location = location
     });
 }
 public NugetAssemblyLocator AddLocation(int index, SearchLocation location)
 {
     this.Locations.Insert(index, location);
     return(this);
 }
        public IEnumerable<IFileSystemInfo> SearchDirectory(string directory, string searchPattern,
            SearchOptions searchOptions, SearchLocation searchLocation)
        {
            using (var tranHandle = GetKtmTransactionHandle())
            {
                NativeMethods.WIN32_FIND_DATA win32findData;
                var directoriesToBeSearched = new List<string>(8) {directory};

                var output = new List<IFileSystemInfo>();
                while (directoriesToBeSearched.Count > 0)
                {
                    var count = directoriesToBeSearched.Count;
                    directory = directoriesToBeSearched[count - 1];
                    directoriesToBeSearched.RemoveAt(count - 1);

                    using (var directoryHandle = GetFileHandleForInfo(
                        directory + Path.DirectorySeparatorChar + @"*", tranHandle, out win32findData))
                    {
                        while (NativeMethods.FindNextFile(directoryHandle, out win32findData))
                        {
                            if (win32findData.cFileName.Equals("..") ||
                                win32findData.cFileName.Equals("."))
                                continue;
                            bool isFile = 0 == (win32findData.dwFileAttributes & 0x10);
                            string relative = directory + Path.DirectorySeparatorChar + win32findData.cFileName;
                            if (isFile & (searchOptions & SearchOptions.File) != 0)
                                output.Add(factory.CreateFileWithProxy(this, relative, win32findData));
                            else if (!isFile)
                            {
                                if (searchLocation == SearchLocation.Recursive)
                                    directoriesToBeSearched.Add(relative);
                                if ((searchOptions & SearchOptions.Directory) != 0)
                                    output.Add(factory.CreateDirectoryWithProxy(this, relative));
                            }
                        }
                    }
                }
                SortListByTypeAndName(output);
                return new ReadOnlyCollection<IFileSystemInfo>(output);
            }
        }
Example #24
0
		void Add(SearchLocation loc, Key key) {
			var command = new RelayCommand(a => {
				this.vmSearch.SearchLocationVM.SelectedItem = loc;
				if (!this.searchControl.SearchTextBox.IsKeyboardFocusWithin)
					this.searchControl.SearchTextBox.SelectAll();
				this.searchControl.SearchTextBox.Focus();
			});
			this.searchControl.InputBindings.Add(new KeyBinding(command, new KeyGesture(key, ModifierKeys.Control)));
		}
Example #25
0
        private async void SelectLocation()
        {
            var location = new SearchLocation();
            location.LocationId = "123";

            var res = await _api.SelectLocation(location);
            if (res is SingleLocationResult)
            {
                // selected location
            }
            else
            {
                MultipleLocationResult mlr = (MultipleLocationResult) res;
                res = await mlr.RefineSelection(mlr.Locations.First());
            }
        }
Example #26
0
 // Almost entirely covered by integration tests
 public IEnumerable <Dependency> DependenciesFor(Dependency dependency, UpdateMode mode, SearchLocation location = SearchLocation.Remote)
 {
     return(_dependenciesCache[DependencyCacheKey.For(dependency, mode, location)]);
 }
Example #27
0
        private IEnumerable <Dependency> findDependenciesFor(Dependency dependency, UpdateMode mode, SearchLocation location)
        {
            var dependencies = new List <Dependency>();
            var task         = findDependenciesFor(dependency, mode, 0, location, dependencies);

            try
            {
                task.Wait();
                if (!task.Result.Found)
                {
                    RippleAssert.Fail("Could not find " + dependency.Name);
                }
            }
            catch (AggregateException ex)
            {
                var flat = ex.Flatten();
                if (flat.InnerException != null)
                {
                    RippleLog.Debug(flat.InnerException.Message);
                }
            }

            return(dependencies.OrderBy(x => x.Name));
        }
Example #28
0
        private Task <NugetResult> findDependenciesFor(Dependency dependency, UpdateMode mode, int depth, SearchLocation location, List <Dependency> dependencies)
        {
            var result = findLocal(dependency, location);

            return(Task.Factory.StartNew(() =>
            {
                if (result.Found)
                {
                    processNuget(result.Nuget, dependency, mode, depth, location, dependencies);
                    return result;
                }

                var search = NugetSearch.Find(_solution, dependency);

                search.ContinueWith(task =>
                {
                    if (!task.Result.Found)
                    {
                        return;
                    }

                    result.Import(task.Result);
                    var nuget = task.Result.Nuget;
                    processNuget(nuget, dependency, mode, depth, location, dependencies);
                }, TaskContinuationOptions.NotOnFaulted | TaskContinuationOptions.AttachedToParent);

                return result;
            }, TaskCreationOptions.AttachedToParent));
        }
Example #29
0
        private void processNuget(IRemoteNuget nuget, Dependency dependency, UpdateMode mode, int depth, SearchLocation location,
                                  List <Dependency> dependencies)
        {
            if (depth != 0)
            {
                var dep         = dependency;
                var markAsFixed = mode == UpdateMode.Fixed || !FeedRegistry.IsFloat(_solution, dependency);

                if (dep.IsFloat() && markAsFixed)
                {
                    dep = new Dependency(nuget.Name, nuget.Version, UpdateMode.Fixed);
                }

                dependencies.Add(dep);
            }

            nuget
            .Dependencies()
            .Each(x => findDependenciesFor(x, mode, depth + 1, location, dependencies));
        }
Example #30
0
        private IEnumerable <Dependency> findDependenciesFor(Dependency dependency, UpdateMode mode, int depth, SearchLocation location)
        {
            IRemoteNuget nuget = null;

            if (location == SearchLocation.Local && _solution.HasLocalCopy(dependency.Name))
            {
                try
                {
                    // Try to hit the local zip and read it. Mostly for testing but it'll detect a corrupted local package as well
                    nuget = _solution.LocalNuget(dependency.Name);
                    nuget.Dependencies().ToList();

                    RippleLog.Debug(dependency.Name + " already installed");
                }
                catch
                {
                    nuget = null;
                }
            }

            if (nuget == null)
            {
                nuget = NugetFor(dependency);
            }

            var dependencies = new List <Dependency>();

            if (depth != 0)
            {
                var dep         = dependency;
                var markAsFixed = mode == UpdateMode.Fixed || !isFloated(dependency);

                if (dep.IsFloat() && markAsFixed)
                {
                    dep = new Dependency(nuget.Name, nuget.Version, UpdateMode.Fixed);
                }

                dependencies.Add(dep);
            }

            nuget
            .Dependencies()
            .Each(x => dependencies.AddRange(findDependenciesFor(x, mode, depth + 1, location)));

            return(dependencies.OrderBy(x => x.Name));
        }
Example #31
0
        // Almost entirely covered by integration tests
        public IEnumerable <Dependency> DependenciesFor(Dependency dependency, UpdateMode mode, SearchLocation location = SearchLocation.Remote)
        {
            var cache = mode == UpdateMode.Fixed ? _dependenciesForFixedCache : _dependenciesForFloatCache;

            IEnumerable <Dependency> dependencies;

            if (cache.TryGetValue(dependency, out dependencies) == false)
            {
                dependencies      = findDependenciesFor(dependency, mode, 0, location);
                cache[dependency] = dependencies;
            }

            return(dependencies.ToArray());
        }
Example #32
0
        public async ValueTask <Result <Models.Locations.Location, ProblemDetails> > Get(SearchLocation searchLocation, string languageCode)
        {
            if (string.IsNullOrWhiteSpace(searchLocation.PredictionResult.Id))
            {
                return(Result.Success <Models.Locations.Location, ProblemDetails>(new Models.Locations.Location(searchLocation.Coordinates,
                                                                                                                searchLocation.DistanceInMeters)));
            }

            if (searchLocation.PredictionResult.Type == LocationTypes.Unknown)
            {
                return(ProblemDetailsBuilder.Fail <Models.Locations.Location>(
                           "Invalid prediction type. It looks like a prediction type was not specified in the request."));
            }

            var cacheKey = _flow.BuildKey(nameof(LocationService), GeoCoderKey, searchLocation.PredictionResult.Source.ToString(),
                                          searchLocation.PredictionResult.Id);

            if (_flow.TryGetValue(cacheKey, out Models.Locations.Location result, DefaultLocationCachingTime))
            {
                return(Result.Success <Models.Locations.Location, ProblemDetails>(result));
            }

            Result <Models.Locations.Location> locationResult;

            switch (searchLocation.PredictionResult.Source)
            {
            case PredictionSources.Google:
                locationResult = await _googleGeoCoder.GetLocation(searchLocation, languageCode);

                break;

            case PredictionSources.Interior:
                locationResult = await _interiorGeoCoder.GetLocation(searchLocation, languageCode);

                break;

            // ReSharper disable once RedundantCaseLabel
            case PredictionSources.NotSpecified:
            default:
                locationResult =
                    Result.Failure <Models.Locations.Location>(
                        $"'{nameof(searchLocation.PredictionResult.Source)}' is empty or wasn't specified in your request.");
                break;
            }

            if (locationResult.IsFailure)
            {
                return(ProblemDetailsBuilder.Fail <Models.Locations.Location>(locationResult.Error, HttpStatusCode.ServiceUnavailable));
            }

            result = locationResult.Value;
            await _flow.SetAsync(cacheKey, result, DefaultLocationCachingTime);

            return(Result.Success <Models.Locations.Location, ProblemDetails>(result));
        }
Example #33
0
        static void MovHandler(String file, SearchLocation config, Archive archive)
        {
            //DateTime createTime = File.GetCreationTime(file);

            //Archive(file, createTime, archive);
        }
Example #34
0
 /// <summary>
 /// This method will used to Get the List of Locations of the Florist
 /// </summary>
 public async Task <IEnumerable <Location> > GetLocations(SearchLocation searchLocation)
 {
     return(await _adminRepository.GetLocations(searchLocation));
 }
Example #35
0
 public async Task <IEnumerable <Location> > GetLocations(SearchLocation searchLocation)
 {
     return(await Query <Location>("Flo.GetLocations", searchLocation));
 }
Example #36
0
        private NugetResult findLocal(Dependency dependency, SearchLocation location)
        {
            var result = new NugetResult();
            if (location == SearchLocation.Local && _solution.HasLocalCopy(dependency.Name))
            {
                try
                {
                    // Try to hit the local zip and read it. Mostly for testing but it'll detect a corrupted local package as well
                    result.Nuget = _solution.LocalNuget(dependency.Name);
                    result.Nuget.Dependencies().ToList();

                    RippleLog.Debug(dependency.Name + " already installed");
                }
                catch
                {
                    result.Nuget = null;
                }
            }

            return result;
        }
Example #37
0
 private void Awake()
 {
     Instance = this;
 }
Example #38
0
 public static DependencyCacheKey For(Dependency dependency, UpdateMode mode, SearchLocation location)
 {
     return new DependencyCacheKey { Dependency = dependency, Mode = mode, Location = location};
 }
Example #39
0
 public async Task<LocationResult> SelectLocation(SearchLocation location)
 {
     return await _myLocationManager.SelectLocation(location);
 }
Example #40
0
 // Almost entirely covered by integration tests
 public IEnumerable<Dependency> DependenciesFor(Dependency dependency, UpdateMode mode, SearchLocation location = SearchLocation.Remote)
 {
     return _dependenciesCache[DependencyCacheKey.For(dependency, mode, location)];
 }
Example #41
0
        private IEnumerable<Dependency> findDependenciesFor(Dependency dependency, UpdateMode mode, int depth, SearchLocation location)
        {
            IRemoteNuget nuget = null;
            if (location == SearchLocation.Local && _solution.HasLocalCopy(dependency.Name))
            {
                try
                {
                    // Try to hit the local zip and read it. Mostly for testing but it'll detect a corrupted local package as well
                    nuget = _solution.LocalNuget(dependency.Name);
                    nuget.Dependencies().ToList();

                    RippleLog.Debug(dependency.Name + " already installed");
                }
                catch
                {
                    nuget = null;
                }

            }

            if(nuget == null)
            {
                nuget = NugetFor(dependency);
            }

            var dependencies = new List<Dependency>();

            if (depth != 0)
            {
                var dep = dependency;
                var markAsFixed = mode == UpdateMode.Fixed || !isFloated(dependency);

                if (dep.IsFloat() && markAsFixed)
                {
                    dep = new Dependency(nuget.Name, nuget.Version, UpdateMode.Fixed);
                }

                dependencies.Add(dep);
            }

            nuget
                .Dependencies()
                .Each(x => dependencies.AddRange(findDependenciesFor(x, mode, depth + 1, location)));

            return dependencies.OrderBy(x => x.Name);
        }
 public NugetAssemblyLocator AddLocation(SearchLocation location)
 {
     return(this.AddLocation(this.Locations.Count, location));
 }
        public async Task <ActionResult> Get([FromQuery] SearchLocation searchLocation)
        {
            var list = await _adminService.GetLocations(searchLocation);

            return(Ok(list));
        }
 public void TestPutIdentity()
 {
     string jsonRpcCallId = "2767c2bc-6e83-4cba-9b60-5b874dbadb2a";
     RogerthatSystem.PutIdentityRequest request = new RogerthatSystem.PutIdentityRequest();
     request.AppData = "{\"xmpp_room\": \"chatroom1\"}";
     Beacon beacon = new Beacon();
     beacon.Uuid = "110E8400-E29B-11D4-A716-446655440000";
     beacon.Major = "123";
     beacon.Minor = "987";
     beacon.Tag = "Meeting room 1";
     request.Beacons.Add(beacon);
     request.Description = "This is your personal fully customizable Rogerthat service identity.";
     request.DescriptionBranding = null;
     request.DescriptionBrandingUseDefault = false;
     request.EmailStatistics = false;
     request.EmailStatisticsUseDefault = false;
     request.Identifier = "i1";
     request.MenuBranding = null;
     request.MenuBrandingUseDefault = false;
     request.AdminEmails.Add("*****@*****.**");
     request.AdminEmails.Add("*****@*****.**");
     request.Name = "My cool service identity";
     request.PhoneCallPopup = null;
     request.PhoneCallPopupUseDefault = false;
     request.PhoneNumber = "+32 9 324 25 64";
     request.PhoneNumberUseDefault = false;
     request.QualifiedIdentifier = "*****@*****.**";
     request.RecommendEnabled = true;
     SearchConfig sc = new SearchConfig();
     sc.Enabled = true;
     sc.Keywords = "test example cool new";
     SearchLocation sl = new SearchLocation();
     sl.Address = "Antwerpsesteenweg 19, 9080 Lochristi";
     sl.Latitude = 51092000;
     sl.Longitude = 3820000;
     sc.Locations.Add(sl);
     request.SearchConfig = sc;
     request.SearchUseDefault = false;
     RogerthatSystem.PutIdentityResponse response = this.Api.PutIdentity(request, jsonRpcCallId);
     Assert.IsNotNull(response);
 }