本文整理汇总了C#中Raven.Studio.Infrastructure.UrlParser.BuildUrl方法的典型用法代码示例。如果您正苦于以下问题:C# UrlParser.BuildUrl方法的具体用法?C# UrlParser.BuildUrl怎么用?C# UrlParser.BuildUrl使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Raven.Studio.Infrastructure.UrlParser
的用法示例。
在下文中一共展示了UrlParser.BuildUrl方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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());
}
}
示例2: TimerTickedAsync
protected override Task TimerTickedAsync()
{
return DatabaseCommands.GetTermsCount("Raven/DocumentsByEntityName", "Tag", "", 100)
.ContinueOnSuccess(Update)
.CatchIgnore<WebException>(() =>
{
var urlParser = new UrlParser(UrlUtil.Url);
if (urlParser.RemoveQueryParam("name"))
UrlUtil.Navigate(urlParser.BuildUrl());
ApplicationModel.Current.AddNotification(new Notification("Unable to retrieve collections from server.", NotificationLevel.Error));
});
}
示例3: 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());
}
示例4: 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());
}
}
示例5: 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());
}
示例6: 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());
}
示例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());
}
}
示例8: 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();
}
示例9: RefreshCollectionsList
private void RefreshCollectionsList()
{
DatabaseCommands.GetTermsCount(CollectionsIndex, "Tag", "", 100)
.ContinueOnSuccess(collections =>
{
var collectionModels = collections
.Where(x=>x.Count > 0)
.Select(col => new CollectionModel { Name = col.Name, Count = col.Count })
.ToArray();
Collections.Match(collectionModels, () => AfterUpdate(collections));
})
.Catch(ex =>
{
var urlParser = new UrlParser(UrlUtil.Url);
if (urlParser.RemoveQueryParam("name"))
UrlUtil.Navigate(urlParser.BuildUrl());
ApplicationModel.Current.AddErrorNotification(ex, "Unable to retrieve collections from server.");
});
}
示例10: 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());
}
}
示例11: RefreshCollectionsList
private void RefreshCollectionsList()
{
DatabaseCommands.GetTermsCount(CollectionsIndex, "Tag", "", 100)
.ContinueOnSuccess(collections =>
{
var collectionModels =
new CollectionModel[] { new AllDocumentsCollectionModel { Count = Database.Value.Statistics.Value == null ? 0 : (int)Database.Value.Statistics.Value.CountOfDocuments}, new RavenDocumentsCollectionModel()}
.Concat(
collections
.Where(x=>x.Count > 0)
.Select(col => new CollectionModel { Name = col.Name, Count = col.Count }))
.ToList();
Collections.Match(collectionModels, () => AfterUpdate(collectionModels));
})
.Catch(ex =>
{
var urlParser = new UrlParser(UrlUtil.Url);
if (urlParser.RemoveQueryParam("collection"))
UrlUtil.Navigate(urlParser.BuildUrl());
ApplicationModel.Current.AddErrorNotification(ex, "Unable to retrieve collections from server.");
});
}
示例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);
}
示例13: TimerTickedAsync
public override Task TimerTickedAsync()
{
return DatabaseCommands.GetTermsCount("Raven/DocumentsByEntityName", "Tag", "", 100)
.ContinueOnSuccess(collections =>
{
var collectionModels = collections.OrderByDescending(x => x.Count)
.Where(x=>x.Count > 0)
.Select(col => new CollectionModel { Name = col.Name, Count = col.Count })
.ToArray();
Collections.Match(collectionModels, AfterUpdate);
})
.CatchIgnore<WebException>(() =>
{
var urlParser = new UrlParser(UrlUtil.Url);
if (urlParser.RemoveQueryParam("name"))
UrlUtil.Navigate(urlParser.BuildUrl());
ApplicationModel.Current.AddNotification(new Notification("Unable to retrieve collections from server.", NotificationLevel.Error));
});
}