本文整理汇总了C#中IEnvironmentModel.UploadToDataList方法的典型用法代码示例。如果您正苦于以下问题:C# IEnvironmentModel.UploadToDataList方法的具体用法?C# IEnvironmentModel.UploadToDataList怎么用?C# IEnvironmentModel.UploadToDataList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IEnvironmentModel
的用法示例。
在下文中一共展示了IEnvironmentModel.UploadToDataList方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Navigate
protected override void Navigate(IEnvironmentModel environmentModel, string uri, dynamic jsonArgs, string returnUri)
{
if(environmentModel == null || environmentModel.Resources == null || jsonArgs == null)
{
return;
}
Guid dataListID;
var relativeUri = "/services/PluginSourceManagement";
var sourceName = jsonArgs.ResourceName.Value;
var contextualResource = string.IsNullOrEmpty(sourceName)
? null
: environmentModel.Resources.All().FirstOrDefault(r => r.ResourceName.Equals(sourceName, StringComparison.InvariantCultureIgnoreCase)) as IContextualResourceModel;
if(contextualResource == null)
{
relativeUri += "?Dev2ServiceType=Plugin";
dataListID = Guid.Empty;
}
else
{
ErrorResultTO errors;
var args = StudioToWizardBridge.BuildStudioEditPayload(contextualResource.ResourceType.ToString(), contextualResource);
dataListID = environmentModel.UploadToDataList(args, out errors);
}
Uri requestUri;
if(!Uri.TryCreate(environmentModel.WebServerAddress, relativeUri, out requestUri))
{
requestUri = new Uri(new Uri(StringResources.Uri_WebServer), relativeUri);
}
var uriString = Browser.FormatUrl(requestUri.AbsoluteUri, dataListID);
_isEditingSource = true;
_returnUri = returnUri;
Navigate(uriString);
}