本文整理汇总了C#中IContextualResourceModel类的典型用法代码示例。如果您正苦于以下问题:C# IContextualResourceModel类的具体用法?C# IContextualResourceModel怎么用?C# IContextualResourceModel使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IContextualResourceModel类属于命名空间,在下文中一共展示了IContextualResourceModel类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SaveUnsavedWorkflowMessage
public SaveUnsavedWorkflowMessage(IContextualResourceModel resourceModel, string resourceName, string resourceCategory, bool keepTabOpen)
{
ResourceModel = resourceModel;
ResourceName = resourceName;
ResourceCategory = resourceCategory;
KeepTabOpen = keepTabOpen;
}
示例2: CreateDsfActivity
public static DsfActivity CreateDsfActivity(IContextualResourceModel resource, DsfActivity activity,
bool ifNullCreateNew, IEnvironmentRepository environmentRepository, bool isDesignerLocalhost)
{
var activityToUpdate = activity;
if(activityToUpdate == null)
{
if(ifNullCreateNew)
{
activityToUpdate = new DsfActivity();
}
else
{
return null;
}
}
if(resource != null)
{
var activeEnvironment = environmentRepository.ActiveEnvironment;
activityToUpdate.ResourceID = resource.ID;
SetCorrectEnvironmentId(resource, activityToUpdate, isDesignerLocalhost, activeEnvironment);
activityToUpdate = SetActivityProperties(resource, activityToUpdate);
}
activityToUpdate.ExplicitDataList = null;
return activityToUpdate;
}
示例3: ShowResourceChanged
public void ShowResourceChanged(IContextualResourceModel resource, IList<string> numberOfDependants, IResourceChangedDialog resourceChangedDialog = null)
{
if(resource == null)
{
throw new ArgumentNullException("resource");
}
if(numberOfDependants == null)
{
throw new ArgumentNullException("numberOfDependants");
}
if(resourceChangedDialog == null)
{
resourceChangedDialog = new ResourceChangedDialog(resource, numberOfDependants.Count);
}
resourceChangedDialog.ShowDialog();
if(resourceChangedDialog.OpenDependencyGraph)
{
if(numberOfDependants.Count == 1)
{
var resourceModel = resource.Environment.ResourceRepository.FindSingle(model => model.ResourceName == numberOfDependants[0]);
if(resourceModel != null)
{
WorkflowDesignerUtils.EditResource(resourceModel, _eventPublisher);
}
}
else
{
Dev2Logger.Log.Info("Publish message of type - " + typeof(ShowReverseDependencyVisualizer));
_eventPublisher.Publish(new ShowReverseDependencyVisualizer(resource));
}
}
}
示例4: SetActivityProperties
public static void SetActivityProperties(IContextualResourceModel resource, ref DsfActivity activity)
{
if(resource.WorkflowXaml != null && resource.WorkflowXaml.Length > 0)
{
var startIdx = resource.WorkflowXaml.IndexOf("<HelpLink>", 0, true);
if(startIdx >= 0)
{
var endIdx = resource.WorkflowXaml.IndexOf("</HelpLink>", startIdx, true);
if(endIdx > 0)
{
startIdx += 10;
var len = (endIdx - startIdx);
activity.HelpLink = resource.WorkflowXaml.Substring(startIdx, len);
}
}
}
if(resource.Environment != null) activity.FriendlySourceName = resource.Environment.Name;
activity.IsWorkflow = true;
activity.Type = "Workflow";
}
示例5: SetAttachedProperties
public static void SetAttachedProperties(WorkflowDesignerWindow workflowDesignerWindow,
IContextualResourceModel resource, string iconPath)
{
UIElementTitleProperty.SetTitle(workflowDesignerWindow, resource.ResourceName);
UIElementTabActionContext.SetTabActionContext(workflowDesignerWindow, WorkSurfaceContext.Workflow);
UIElementImageProperty.SetImage(workflowDesignerWindow, iconPath);
}
示例6: GetWorkflowUri
public static Uri GetWorkflowUri(IContextualResourceModel resourceModel, string xmlData, UrlType urlType)
{
if(resourceModel == null || resourceModel.Environment == null || resourceModel.Environment.Connection == null || !resourceModel.Environment.IsConnected)
{
return null;
}
var environmentConnection = resourceModel.Environment.Connection;
string urlExtension = "xml";
switch(urlType)
{
case UrlType.XML:
break;
case UrlType.JSON:
urlExtension = "json";
break;
default:
throw new ArgumentOutOfRangeException("urlType");
}
var relativeUrl = string.Format("/secure/{0}.{1}?", resourceModel.Category, urlExtension);
relativeUrl += xmlData;
relativeUrl += "&wid=" + environmentConnection.WorkspaceID;
Uri url;
Uri.TryCreate(environmentConnection.WebServerUri, relativeUrl, out url);
return url;
}
示例7: RenameResourceDialog
public RenameResourceDialog(IContextualResourceModel model, string newName, Window owner)
{
InitializeComponent();
Owner = owner ?? Application.Current.MainWindow;
Title = string.Format(StringResources.DialogTitle_HasDuplicateName, newName);
tbDisplay.Text = string.Format(StringResources.DialogBody_HasDuplicateName,
model.ResourceType.GetDescription(), model.ResourceName);
}
示例8: DeleteResourceDialog
public DeleteResourceDialog(IContextualResourceModel model)
{
InitializeComponent();
Owner = Application.Current.MainWindow;
Title = String.Format(StringResources.DialogTitle_HasDependencies, model.ResourceType.GetDescription());
tbDisplay.Text = String.Format(StringResources.DialogBody_HasDependencies, model.ResourceName,
model.ResourceType.GetDescription());
}
示例9: OpenInBrowser
public static void OpenInBrowser(WebServerMethod post, IContextualResourceModel resourceModel, string xmlData)
{
Uri url = GetWorkflowUri(resourceModel, xmlData, UrlType.XML);
if(url != null)
{
Process.Start(url.ToString());
}
}
示例10: OpenInBrowser
public static void OpenInBrowser(IContextualResourceModel resourceModel, string xmlData)
{
Uri url = GetWorkflowUri(resourceModel, xmlData, UrlType.XML);
if(url != null)
{
Process.Start("explorer.exe", "\"" + url+ "\"");
}
}
示例11: CreateWebActivity
public static IWebActivity CreateWebActivity(object webActivityWrappingObject, IContextualResourceModel resourceModel, string serviceName)
{
IWebActivity activity = CreateWebActivity();
activity.WebActivityObject = webActivityWrappingObject;
activity.ResourceModel = resourceModel;
activity.ServiceName = serviceName;
return activity;
}
示例12: WorkflowDesignerViewModelMock
public WorkflowDesignerViewModelMock(IContextualResourceModel resource, IWorkflowHelper workflowHelper, IPopupController popupController, bool createDesigner = false)
: base(new Mock<IEventAggregator>().Object,
resource, workflowHelper,
popupController, new TestAsyncWorker(), createDesigner, false, false)
{
_moq.SetupAllProperties();
_wd = _moq.Object;
}
示例13: GetDependenciesXml
/// <summary>
/// Gets the dependencies XML for the given <see cref="IResourceModel"/>.
/// </summary>
/// <param name="resourceModel">The resource model to be queried.</param>
/// <returns>The dependencies XML.</returns>
public string GetDependenciesXml(IContextualResourceModel resourceModel)
{
if(resourceModel == null)
{
return string.Empty;
}
return resourceModel.Environment.ResourceRepository.GetDependenciesXml(resourceModel);
}
示例14: CreateServiceDebugInfoModel
public static IServiceDebugInfoModel CreateServiceDebugInfoModel(IContextualResourceModel resourceModel, string serviceInputData, DebugMode debugSetting)
{
IServiceDebugInfoModel serviceDebugInfoModel = new ServiceDebugInfoModel();
serviceDebugInfoModel.ResourceModel = resourceModel;
serviceDebugInfoModel.DebugModeSetting = debugSetting;
serviceDebugInfoModel.ServiceInputData = serviceInputData;
serviceDebugInfoModel.RememberInputs = true;
return serviceDebugInfoModel;
}
示例15: SetActivityProperties
public static void SetActivityProperties(IContextualResourceModel resource, ref DsfActivity activity, IResourceRepository resourceRepository)
{
activity.IsWorkflow = false;
if(resource.WorkflowXaml != null && resource.WorkflowXaml.Length > 0)
{
var startIdx = resource.WorkflowXaml.IndexOf("<Action ", 0, true);
if(startIdx >= 0)
{
var endIdx = resource.WorkflowXaml.IndexOf(">", startIdx, true);
if(endIdx > 0)
{
var len = endIdx - startIdx + 1;
var fragment = resource.WorkflowXaml.Substring(startIdx, len);
fragment += "</Action>";
fragment = fragment.Replace("&", "&");
XmlDocument document = new XmlDocument();
document.LoadXml(fragment);
if(document.DocumentElement != null)
{
XmlNode node = document.SelectSingleNode("//Action");
if(node != null)
{
if(node.Attributes != null)
{
var attr = node.Attributes["SourceName"];
if(attr != null)
{
if (resourceRepository != null && node.Attributes["SourceID"] != null)
{
Guid sourceId;
Guid.TryParse( node.Attributes["SourceID"].Value, out sourceId);
activity.FriendlySourceName = resourceRepository.FindSingle(a => !(a.ID.ToString() != sourceId.ToString()),false).DisplayName;
}
else
activity.FriendlySourceName = attr.Value;
}
attr = node.Attributes["SourceMethod"];
if(attr != null)
{
activity.ActionName = attr.Value;
}
}
}
}
}
}
}
activity.Type = resource.ServerResourceType;
}