当前位置: 首页>>代码示例>>C#>>正文


C# UrlParser.SetQueryParam方法代码示例

本文整理汇总了C#中Raven.Studio.Infrastructure.UrlParser.SetQueryParam方法的典型用法代码示例。如果您正苦于以下问题:C# UrlParser.SetQueryParam方法的具体用法?C# UrlParser.SetQueryParam怎么用?C# UrlParser.SetQueryParam使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Raven.Studio.Infrastructure.UrlParser的用法示例。


在下文中一共展示了UrlParser.SetQueryParam方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Execute

		public override void Execute(object parameter)
		{
			var urlParser = new UrlParser("/edit");
			var friendly = (parameter as FriendlyDocument);
			if (friendly != null)
			{
				urlParser.SetQueryParam(friendly.IsProjection ? "projection" : "id", friendly.Id);
				
				if (friendly.NeighborsIds != null)
					urlParser.SetQueryParam("neighbors", string.Join(",", friendly.NeighborsIds));
			}

			UrlUtil.Navigate(urlParser.BuildUrl());
		}
开发者ID:925coder,项目名称:ravendb,代码行数:14,代码来源:EditNeighboringDocumentCommand.cs

示例2: Execute

		public override void Execute(object parameter)
		{
			var urlParser = new UrlParser("/edit");

			if (string.IsNullOrEmpty(viewableDocument.Id))
			{
				var key = ProjectionData.Projections.First(x => x.Value == viewableDocument).Key;
				urlParser.SetQueryParam("projection", key);
			}
			else
			{
				urlParser.SetQueryParam("id", viewableDocument.Id);
			}

			UrlUtil.Navigate(urlParser.BuildUrl());
		}
开发者ID:925coder,项目名称:ravendb,代码行数:16,代码来源:EditDocumentCommand.cs

示例3: Execute

		public override void Execute(object parameter)
		{
			var urlParser = new UrlParser("/edit");

			if (string.IsNullOrEmpty(viewableDocument.Id))
			{
				var projection = viewableDocument.InnerDocument.ToJson().ToString(Formatting.None);
				urlParser.SetQueryParam("projection", projection);
			}
			else
			{
				urlParser.SetQueryParam("id", viewableDocument.Id);
			}

			UrlUtil.Navigate(urlParser.BuildUrl());
		}
开发者ID:enslam,项目名称:ravendb,代码行数:16,代码来源:EditDocumentCommand.cs

示例4: Execute

		public override void Execute(object parameter)
		{
			bool shouldRedirect = true;

			var urlParser = new UrlParser(UrlUtil.Url);
			if (urlParser.GetQueryParam("database") == databaseName)
				shouldRedirect = false;

			urlParser.SetQueryParam("database", databaseName);

			var server = ApplicationModel.Current.Server.Value;
			server.SetCurrentDatabase(urlParser);
			server.SelectedDatabase.Value.AsyncDatabaseCommands
				.EnsureSilverlightStartUpAsync()
				.Catch();

			var updateAllFromServer = View.UpdateAllFromServer();
			refreshStaticModels
				.Except(updateAllFromServer.Select(x=>x.GetType()))
				.Select(model => (Model) Activator.CreateInstance(model))
				.ForEach(model => model.ForceTimerTicked());
			
			
			if (shouldRedirect)
			{
				UrlUtil.Navigate(urlParser.BuildUrl());
			}
		}
开发者ID:jtmueller,项目名称:ravendb,代码行数:28,代码来源:ChangeDatabaseCommand.cs

示例5: PutCollectionNameInTheUrl

		private void PutCollectionNameInTheUrl()
		{
			var urlParser = new UrlParser(UrlUtil.Url);
			var collection = SelectedCollection.Value;
			if (collection == null)
				return;
			var name = collection.Name;
			initialSelectedDatabaseName = name;
			if (urlParser.GetQueryParam("name") != name)
			{
				urlParser.SetQueryParam("name", name);
				UrlUtil.Navigate(urlParser.BuildUrl());
			}
		}
开发者ID:nberardi,项目名称:ravendb,代码行数:14,代码来源:CollectionsModel.cs

示例6: ContentFrame_Navigating

        // EnsureDatabaseParameterIncluded
        private void ContentFrame_Navigating(object sender, NavigatingCancelEventArgs e)
        {
            if (navigationMode != NavigationMode.New) return;

            var urlParser = new UrlParser(e.Uri.ToString());
            if (urlParser.GetQueryParam("database") != null)
                return;

            e.Cancel = true;
            navigationMode = NavigationMode.Refresh;
            urlParser.SetQueryParam("database", ApplicationModel.Current.Server.Value.SelectedDatabase.Value.Name);
            urlParser.NavigateTo();
            navigationMode = NavigationMode.New;
        }
开发者ID:kyanha,项目名称:studio,代码行数:15,代码来源:MainPage.xaml.cs

示例7: Execute

		public override void Execute(object parameter)
		{
			bool shouldRedirect = true;

			var urlParser = new UrlParser(UrlUtil.Url);
			if (urlParser.GetQueryParam("database") == databaseName)
				shouldRedirect = false;

			urlParser.SetQueryParam("database", databaseName);

			var server = ApplicationModel.Current.Server.Value;
			server.SetCurrentDatabase(urlParser);
			server.SelectedDatabase.Value.AsyncDatabaseCommands
				.EnsureSilverlightStartUpAsync()
				.Catch();

			if (shouldRedirect)
			{
				UrlUtil.Navigate(urlParser.BuildUrl());
			}
		}
开发者ID:maurodx,项目名称:ravendb,代码行数:21,代码来源:ChangeDatabaseCommand.cs

示例8: PutCollectionNameInTheUrl

	    private void PutCollectionNameInTheUrl()
		{
			var urlParser = new UrlParser(UrlUtil.Url);
			var collection = SelectedCollection.Value;
			if (collection == null)
				return;
			var name = collection.Name;
			initialSelectedCollectionName = name;
			if (urlParser.GetQueryParam("collection") != name)
			{
			    if (name != "")
			    {
			        urlParser.SetQueryParam("collection", name);
			    }
			    else
			    {
			        urlParser.RemoveQueryParam("collection");
			    }

			    UrlUtil.Navigate(urlParser.BuildUrl());
			}
		}
开发者ID:robashton,项目名称:ravendb,代码行数:22,代码来源:DocumentsPageModel.cs

示例9: SelectDatabase

 private void SelectDatabase(DatabaseModel database)
 {
     var urlParser = new UrlParser(UrlUtil.Url);
     urlParser.SetQueryParam("database", database.Name);
     urlParser.NavigateTo();
 }
开发者ID:kyanha,项目名称:studio,代码行数:6,代码来源:ServerModel.cs

示例10: NavigateToPage

		private void NavigateToPage(int pageOffset)
		{
			var skip1 = Skip + pageOffset*PageSize;
			Skip = (short) skip1;

			if (IsSkipBasedOnTheUrl)
			{
				var urlParser = new UrlParser(UrlUtil.Url);
				urlParser.SetQueryParam("skip", Skip);
				UrlUtil.Navigate(urlParser.BuildUrl());
			}

			OnPagerChanged();
		}
开发者ID:925coder,项目名称:ravendb,代码行数:14,代码来源:PagerModel.cs

示例11: TimerTickedAsync

		public override Task TimerTickedAsync()
		{
			return documentStore.AsyncDatabaseCommands.GetDatabaseNamesAsync(1024)
				.ContinueOnSuccess(names =>
									{
										Databases.Match(defaultDatabase.Concat(names).ToArray());
										if (firstTick == false)
											return;

										firstTick = false;
										if (UserInfoSet == false)
											UpdateUserInfo();

										if (UserInfo != null && UserInfo.IsAdminGlobal)
										{
											ApplicationModel.Current.Server.Value.DocumentStore
															.AsyncDatabaseCommands
															.ForSystemDatabase()
															.GetAsync("Raven/StudioConfig")
															.ContinueOnSuccessInTheUIThread(doc =>
															{
																if (doc != null && doc.DataAsJson.ContainsKey("WarnWhenUsingSystemDatabase"))
																{
																	if (doc.DataAsJson.Value<bool>("WarnWhenUsingSystemDatabase") == false)
																		UrlUtil.Navigate("/documents");
																}
															});
										}

										var url = new UrlParser(UrlUtil.Url);

										if (url.QueryParams.ContainsKey("database") == false && (names.Length == 0 || (names.Length == 1 && names[0] == Constants.SystemDatabase)))
											CreateNewDatabase = true;

										if (string.IsNullOrEmpty(Settings.Instance.SelectedDatabase))
											return;

										if (Settings.Instance.SelectedDatabase != null && names.Contains(Settings.Instance.SelectedDatabase))
										{
											if (url.QueryParams.ContainsKey("database") == false)
											{
												url.SetQueryParam("database", Settings.Instance.SelectedDatabase);
												SetCurrentDatabase(url);
											}

											if (string.IsNullOrWhiteSpace(url.Path))
												UrlUtil.Navigate(Settings.Instance.LastUrl);
										}
									})
				.Catch();
		}
开发者ID:Nakro,项目名称:ravendb,代码行数:51,代码来源:ServerModel.cs

示例12: NavigateToPage

		private void NavigateToPage(int pageOffset)
		{
			var skip1 = Skip + pageOffset*PageSize;
			Skip = (ushort) skip1;
			var urlParser = new UrlParser(UrlUtil.Url);
			urlParser.SetQueryParam("skip", Skip);
			UrlUtil.Navigate(urlParser.BuildUrl());

			if (Navigated != null)
				Navigated(this, EventArgs.Empty);
		}
开发者ID:maurodx,项目名称:ravendb,代码行数:11,代码来源:PagerModel.cs

示例13: NavigateToPage

 private void NavigateToPage(int pageOffset)
 {
     var urlParser = new UrlParser(UrlUtil.Url);
     urlParser.SetQueryParam("skip", skip + pageOffset * PageSize);
     urlParser.NavigateTo();
 }
开发者ID:kyanha,项目名称:studio,代码行数:6,代码来源:PagerModel.cs

示例14: TimerTickedAsync

		public override Task TimerTickedAsync()
		{
			return documentStore.AsyncDatabaseCommands.GetDatabaseNamesAsync(1024)
				.ContinueOnSuccess(names =>
				                   	{
				                   		Databases.Match(defaultDatabase.Concat(names).ToArray());
				                   		if (firstTick == false)
				                   			return;

				                   		firstTick = false;

				                   		ApplicationModel.Current.Server.Value.DocumentStore
				                   		                .AsyncDatabaseCommands
				                   		                .ForSystemDatabase()
				                   		                .GetAsync("Raven/StudioConfig")
				                   		                .ContinueWith(task =>
				                   		                {
					                   		                if (task.IsFaulted == false)
					                   		                {
						                   		                Execute.OnTheUI(() =>
						                   		                {
							                   		                if (task.Result != null &&
							                   		                    task.Result.DataAsJson.ContainsKey("WarnWhenUsingSystemDatabase"))
							                   		                {
								                   		                if (task.Result.DataAsJson.Value<bool>("WarnWhenUsingSystemDatabase") ==
								                   		                    false)
									                   		                UrlUtil.Navigate("/documents");
							                   		                }
						                   		                });

					                   		                }
					                   		                else
					                   		                {
						                   		                GC.KeepAlive(task.Exception); // ignoring the exeption
					                   		                }
				                   		                });
				                  

				                   		var url = new UrlParser(UrlUtil.Url);

				                   		if (url.QueryParams.ContainsKey("database") == false && (names.Length == 0 || (names.Length == 1 && names[0] == Constants.SystemDatabase)))
				                   			CreateNewDatabase = true;

				                   		if (string.IsNullOrEmpty(Settings.Instance.SelectedDatabase)) 
											return;

										if (Settings.Instance.SelectedDatabase != null && names.Contains(Settings.Instance.SelectedDatabase))
										{
											if (url.QueryParams.ContainsKey("database") == false)
											{
												url.SetQueryParam("database", Settings.Instance.SelectedDatabase);
												SetCurrentDatabase(url);
											}

											if(string.IsNullOrWhiteSpace(url.Path))
												UrlUtil.Navigate(Settings.Instance.LastUrl);
										}
				                   	})
				.Catch();
		}
开发者ID:nberardi,项目名称:ravendb,代码行数:60,代码来源:ServerModel.cs

示例15: TimerTickedAsync

		public override Task TimerTickedAsync()
		{
            if(IsConnected.Value == false)
            {
                DocumentStore.AsyncDatabaseCommands
                    .GetStatisticsAsync()
                    .ContinueOnSuccess(stats =>
                    {
                        IsConnected.Value = true;
                        var url = UrlUtil.Url;
                        SelectedDatabase.Value = new DatabaseModel(Constants.SystemDatabase, documentStore);
                        Initialize();
                        SetCurrentDatabase(new UrlParser(url));
                    });
            }

			if (singleTenant)
				return null;

            //if (SelectedDatabase.Value.HasReplication)
            //    SelectedDatabase.Value.UpdateReplicationOnlineStatus();

			return documentStore.AsyncDatabaseCommands.GetDatabaseNamesAsync(1024)
				.ContinueOnSuccess(names =>
				                   	{
				                   		Databases.Match(defaultDatabase.Concat(names).ToArray());
				                   		if (firstTick == false)
				                   			return;

				                   		firstTick = false;

				                   	    ApplicationModel.Current.Server.Value.DocumentStore
				                   	        .AsyncDatabaseCommands
				                   	        .ForDefaultDatabase()
				                   	        .GetAsync("Raven/StudioConfig")
				                   	        .ContinueOnSuccessInTheUIThread(doc =>
				                   	        {
				                   	            if (doc != null && doc.DataAsJson.ContainsKey("WarnWhenUsingSystemDatabase"))
				                   	            {
				                   	                if (doc.DataAsJson.Value<bool>("WarnWhenUsingSystemDatabase") == false)
				                   	                    UrlUtil.Navigate("/documents");
				                   	            }
				                   	        });

				                   		if (names.Length == 0 || (names.Length == 1 && names[0] == Constants.SystemDatabase))
				                   			CreateNewDatabase = true;

				                   		if (string.IsNullOrEmpty(Settings.Instance.SelectedDatabase)) 
											return;

				                   		var url = new UrlParser(UrlUtil.Url);

										if (Settings.Instance.SelectedDatabase != null && names.Contains(Settings.Instance.SelectedDatabase))
										{
											if (url.QueryParams.ContainsKey("database") == false)
											{
												url.SetQueryParam("database", Settings.Instance.SelectedDatabase);
												SetCurrentDatabase(url);
											}

											if(string.IsNullOrWhiteSpace(url.Path))
												UrlUtil.Navigate(Settings.Instance.LastUrl);
										}
				                   	})
				.Catch();
		}
开发者ID:arelee,项目名称:ravendb,代码行数:66,代码来源:ServerModel.cs


注:本文中的Raven.Studio.Infrastructure.UrlParser.SetQueryParam方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。