public bool TryParseSubRoute(PathStack path, object controller, out MethodInfo method, out object[] args)
		{
			if (path.Current == "MVC")
			{
				
			}
			method = null;
			args = null;
			return false;
		}
Exemple #2
0
 public JsonParse(string match, string extentId = null)
 {
     pathStack      = new PathStack();
     this.pathMatch = new PathMatch(match);
     this.extentId  = extentId;
 }
Exemple #3
0
        public async Task StartDirectoryListing(ResourceInfo resourceInfoToExclude, string viewName = null)
        {
            // clear instantly, so the user will not see invalid listings
            FilesAndFolders.Clear();
            Folders.Clear();

            var client = await ClientService.GetClient();

            if (client == null || IsSelecting)
            {
                return;
            }

            _continueListing = true;

            if (PathStack.Count == 0)
            {
                PathStack.Add(new PathInfo
                {
                    ResourceInfo = new ResourceInfo()
                    {
                        Name = "Nextcloud",
                        Path = "/"
                    },
                    IsRoot = true
                });
            }

            var path = PathStack.Count > 0 ? PathStack[PathStack.Count - 1].ResourceInfo.Path : "/";
            List <ResourceInfo> list = null;

            try
            {
                if (viewName == "sharesIn" | viewName == "sharesOut" | viewName == "sharesLink")
                {
                    PathStack.Clear();
                    list = await client.GetSharesView(viewName);
                }
                else if (viewName == "favorites")
                {
                    PathStack.Clear();
                    list = await client.GetFavorites();
                }
                else
                {
                    list = await client.List(path);
                }
            }
            catch (ResponseError e)
            {
                ResponseErrorHandlerService.HandleException(e);
            }

            if (list != null)
            {
                foreach (var item in list)
                {
                    if (resourceInfoToExclude != null && item == resourceInfoToExclude)
                    {
                        continue;
                    }

                    FilesAndFolders.Add(new FileOrFolder(item));

                    if (!item.IsDirectory)
                    {
                        continue;
                    }
                    if (RemoveResourceInfos != null)
                    {
                        var index = RemoveResourceInfos.FindIndex(res => res.Path.Equals(item.Path, StringComparison.Ordinal));
                        if (index == -1)
                        {
                            Folders.Add(new FileOrFolder(item));
                        }
                    }
                    else
                    {
                        Folders.Add(new FileOrFolder(item));
                    }
                }
            }

            switch (SettingsService.Instance.LocalSettings.PreviewImageDownloadMode)
            {
            case PreviewImageDownloadMode.Always:
                DownloadPreviewImages();
                break;

            case PreviewImageDownloadMode.WiFiOnly:
                var connectionProfile = NetworkInformation.GetInternetConnectionProfile();
                // connectionProfile can be null (e.g. airplane mode)
                if (connectionProfile != null && connectionProfile.IsWlanConnectionProfile)
                {
                    DownloadPreviewImages();
                }
                break;

            case PreviewImageDownloadMode.Never:
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }

            SortList();
        }
Exemple #4
0
 public void Should_Initialize()
 {
     _ = new PathStack();
 }
Exemple #5
0
 internal WriteFormatContext(IBufferWriter <TWriter> bufferWriter, TWriter writer, string path, FormatOptions options = null) : this(bufferWriter, writer, new Stack <string>(), options)
 {
     PathStack.Push(path);
 }
		public IHttpHandler ParseRoute(PathStack path)
        {
			if (path.Current == "MVC")
				return new ControllerHandler { Stack = path, Engine = this };
			return null;
        }