本文整理汇总了C#中Composite.C1Console.Security.EntityToken类的典型用法代码示例。如果您正苦于以下问题:C# EntityToken类的具体用法?C# EntityToken怎么用?C# EntityToken使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
EntityToken类属于Composite.C1Console.Security命名空间,在下文中一共展示了EntityToken类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: GetActions
public IEnumerable<ElementAction> GetActions(EntityToken entityToken)
{
if (entityToken is DataEntityToken)
{
var token = entityToken as DataEntityToken;
if (token.Data.DataSourceId.InterfaceType == typeof(ApiKey))
{
if (!token.Data.GetProperty<bool>("Default"))
{
yield return new ElementAction(new ActionHandle(new SetDefaultActionToken()))
{
VisualData = new ActionVisualizedData
{
Label = "Set Default",
ToolTip = "Set Dafault",
Icon = new ResourceHandle("Composite.Icons", "accept"),
ActionLocation = new ActionLocation
{
ActionType = ActionType.Add,
IsInFolder = false,
IsInToolbar = true,
ActionGroup = _actionGroup
}
}
};
}
}
}
}
开发者ID:JustAndrei,项目名称:C1-Packages,代码行数:29,代码来源:IssuuElementActionProvider.cs
示例2: IsAttachingPoint
/// <exclude />
public static bool IsAttachingPoint(EntityToken leftEntityToken, EntityToken rightEntityToken)
{
return leftEntityToken.GetType() == rightEntityToken.GetType()
&& leftEntityToken.Id == rightEntityToken.Id
&& leftEntityToken.Type == rightEntityToken.Type
&& leftEntityToken.Source == rightEntityToken.Source;
}
开发者ID:DBailey635,项目名称:C1-CMS,代码行数:8,代码来源:ElementAttachingPointFacade.cs
示例3: OnAddAction
protected override void OnAddAction(Action<ElementAction> actionAdder, EntityToken entityToken, TreeNodeDynamicContext dynamicContext, DynamicValuesHelperReplaceContext dynamicValuesHelperReplaceContext)
{
actionAdder(new ElementAction(new ActionHandle(new WorkflowActionToken(WorkflowFacade.GetWorkflowType("Composite.C1Console.Trees.Workflows.GenericDeleteDataWorkflow"), this.PermissionTypes)))
{
VisualData = CreateActionVisualizedData(dynamicValuesHelperReplaceContext)
});
}
开发者ID:DBailey635,项目名称:C1-CMS,代码行数:7,代码来源:GenericDeleteDataActionNode.cs
示例4: Create
public static IEnumerable<IPackItem> Create(EntityToken entityToken)
{
if (entityToken is GeneratedDataTypesElementProviderTypeEntityToken)
{
yield return new PCDynamicDataTypesData(entityToken);
}
}
开发者ID:Orckestra,项目名称:C1-Packages,代码行数:7,代码来源:PCDynamicDataTypesData.cs
示例5: HaveCustomChildElements
public bool HaveCustomChildElements(EntityToken parentEntityToken,
Dictionary<string, string> piggybag)
{
if (ElementAttachingPointFacade.IsAttachingPoint(parentEntityToken,
AttachingPoint.ContentPerspective) == false) return false;
return true;
}
开发者ID:pksorensen,项目名称:Composite.Integration.Nuget,代码行数:7,代码来源:NugetElementAttachingProvider.cs
示例6: Execute
public FlowToken Execute(EntityToken entityToken, ActionToken actionToken, FlowControllerServicesContainer flowControllerServicesContainer)
{
var packageName = PackageCreatorFacade.ActivePackageName;
if (entityToken is PackageCreatorEntityToken)
{
packageName = (entityToken as PackageCreatorEntityToken).Source;
}
if (string.IsNullOrEmpty(packageName))
{
flowControllerServicesContainer.GetService<IManagementConsoleMessageService>();
var consoleServices = flowControllerServicesContainer.GetService<IManagementConsoleMessageService>();
consoleServices.ShowMessage(DialogType.Warning, PackageCreatorFacade.GetLocalization("NoPackages.Title"),
PackageCreatorFacade.GetLocalization("NoPackages.Message"));
return null;
}
if (actionToken is AddLocalizationActionToken)
{
var token = actionToken as AddLocalizationActionToken;
PackageCreatorFacade.AddItem(new PCLocalizations(token.CultureName), packageName);
}
var treeRefresher = new SpecificTreeRefresher(flowControllerServicesContainer);
treeRefresher.PostRefreshMesseges(new PackageCreatorElementProviderEntityToken());
return null;
}
开发者ID:JustAndrei,项目名称:C1-Packages,代码行数:27,代码来源:AddLocalizationActionToken.cs
示例7: Execute
public FlowToken Execute(EntityToken entityToken, ActionToken actionToken, FlowControllerServicesContainer flowControllerServicesContainer)
{
var packageName = PackageCreatorFacade.ActivePackageName;
if (entityToken is PackageCreatorEntityToken)
{
packageName = (entityToken as PackageCreatorEntityToken).Source;
}
if (string.IsNullOrEmpty(packageName))
{
flowControllerServicesContainer.GetService<IManagementConsoleMessageService>();
IManagementConsoleMessageService consoleServices = flowControllerServicesContainer.GetService<IManagementConsoleMessageService>();
consoleServices.ShowMessage(DialogType.Warning, PackageCreatorFacade.GetLocalization("NoPackages.Title"), PackageCreatorFacade.GetLocalization("NoPackages.Message"));
return null;
}
if (actionToken is PackageCreatorActionToken)
{
var token = actionToken as PackageCreatorActionToken;
foreach (var item in PackageCreatorActionFacade.GetPackageCreatorItems(entityToken))
{
if (item.CategoryName == token.CategoryName)
{
//if diffent item for one category and entitytoken
var itemActionToken = item as IPackItemActionToken;
if (itemActionToken != null)
{
if (token.Name != itemActionToken.ActionTokenName)
{
continue;
}
}
if (item is IPackToggle)
{
if ((item as IPackToggle).CheckedStatus == ActionCheckedStatus.Checked)
{
PackageCreatorFacade.RemoveItem(item, packageName);
}
else
{
PackageCreatorFacade.AddItem(item, packageName);
}
var parentTreeRefresher = new ParentTreeRefresher(flowControllerServicesContainer);
parentTreeRefresher.PostRefreshMesseges(entityToken);
}
else
{
PackageCreatorFacade.AddItem(item, packageName);
}
break;
}
}
}
SpecificTreeRefresher treeRefresher = new SpecificTreeRefresher(flowControllerServicesContainer);
treeRefresher.PostRefreshMesseges(new PackageCreatorElementProviderEntityToken());
return null;
}
开发者ID:JustAndrei,项目名称:C1-Packages,代码行数:60,代码来源:PackageCreatorElementProviderActionExecutor.cs
示例8: GetActions
public IEnumerable<ElementAction> GetActions(EntityToken entityToken)
{
if (entityToken is NugetPackageEntityToken)
{
var isRemote = ((NugetPackageEntityToken)entityToken).IsRemotePackage();
var isUpdate = ((NugetPackageEntityToken)entityToken).IsUpdatePackage();
ElementAction elementAction = new ElementAction(new ActionHandle(new NugetActionToken()))
{
VisualData = new ActionVisualizedData
{
Label = isRemote ? "Install Package" : isUpdate? "Update Package" : "Uninstall Package",
ToolTip = string.Empty,
Icon = isRemote ? CommonCommandIcons.AddNew : isUpdate? CommonCommandIcons.Refresh : CommonCommandIcons.Delete,
ActionLocation = new ActionLocation
{
ActionType = ActionType.Edit,
IsInToolbar = true,
ActionGroup = AppendedActionGroup
}
}
};
yield return elementAction;
}
}
开发者ID:pksorensen,项目名称:Composite.Integration.Nuget,代码行数:29,代码来源:NugetElementAttachingProvider.cs
示例9: CreateNewTasks
public TaskContainer CreateNewTasks(EntityToken entityToken, ActionToken actionToken, TaskManagerEvent taskManagerEvent)
{
List<Task> newTasks = new List<Task>();
lock (_lock)
{
foreach (Func<EntityToken, ActionToken, Task> taskCreator in _taskCreators)
{
try
{
Task task = taskCreator(entityToken, actionToken);
if (task == null) continue;
bool result = task.TaskManager.OnCreated(task.Id, taskManagerEvent);
if (result == false) continue;
_tasks.Add(task);
newTasks.Add(task);
}
catch (Exception ex)
{
Log.LogError("TaskManagerFacade", "Starting new task failed with following exception");
Log.LogError("TaskManagerFacade", ex);
}
}
}
return new TaskContainer(newTasks, null);
}
开发者ID:DBailey635,项目名称:C1-CMS,代码行数:29,代码来源:TaskManagerFacadeImpl.cs
示例10: PreparePiggybag
/// <exclude />
public static Dictionary<string, string> PreparePiggybag(this Dictionary<string, string> piggybag, TreeNode parentNode, EntityToken parentEntityToken)
{
var newPiggybag = new Dictionary<string, string>();
foreach (KeyValuePair<string, string> kvp in piggybag)
{
if (kvp.Key.StartsWith(ParentEntityTokenPiggybagString))
{
int generation = int.Parse(kvp.Key.Substring(ParentEntityTokenPiggybagString.Length));
generation += 1;
newPiggybag.Add(string.Format("{0}{1}", ParentEntityTokenPiggybagString, generation), kvp.Value);
}
else if (kvp.Key.StartsWith(ParentNodeIdPiggybagString))
{
int generation = int.Parse(kvp.Key.Substring(ParentNodeIdPiggybagString.Length));
generation += 1;
newPiggybag.Add(string.Format("{0}{1}", ParentNodeIdPiggybagString, generation), kvp.Value);
}
else
{
newPiggybag.Add(kvp.Key, kvp.Value);
}
}
newPiggybag.Add(string.Format("{0}1", ParentEntityTokenPiggybagString), EntityTokenSerializer.Serialize(parentEntityToken));
newPiggybag.Add(string.Format("{0}1", ParentNodeIdPiggybagString), parentNode.Id.ToString());
return newPiggybag;
}
开发者ID:Orckestra,项目名称:C1-CMS,代码行数:34,代码来源:PiggybagExtensionMethods.cs
示例11: GetChildren
public IEnumerable<Element> GetChildren(EntityToken entityToken, SearchToken seachToken)
{
if (entityToken.Id == DeveloperApplicationProviderEntityToken.TreeRootFolderId)
{
foreach (string treeDefinitionFilename in this.TreeDefinitionFilenames)
{
string filename = Path.GetFileName(treeDefinitionFilename);
Element treeDefintionElement = new Element(_context.CreateElementHandle(
new DeveloperApplicationProviderEntityToken(DeveloperApplicationProviderEntityToken.TreeDefinitionId, filename)))
{
VisualData = new ElementVisualizedData
{
Label = filename,
ToolTip = filename,
Icon = TreeDefinitionIcon
}
};
treeDefintionElement.AddAction(new ElementAction(new ActionHandle(new WorkflowActionToken(WorkflowFacade.GetWorkflowType("Composite.C1Console.Trees.Workflows.DeleteTreeDefinitionWorkflow"), PermissionTypePredefined.Delete)))
{
VisualData = new ActionVisualizedData
{
Label = StringResourceSystemFacade.GetString("Composite.C1Console.Trees", "TreeDeleteTreeDefinitionWorkflow.Delete.Label"),
ToolTip = StringResourceSystemFacade.GetString("Composite.C1Console.Trees", "TreeDeleteTreeDefinitionWorkflow.Delete.ToolTip"),
Icon = TreeDefinitionIconDelete,
Disabled = false,
ActionLocation = ActionLocation.DeletePrimaryActionLocation
}
});
treeDefintionElement.AddAction(new ElementAction(new ActionHandle(new WorkflowActionToken(WorkflowFacade.GetWorkflowType("Composite.C1Console.Trees.Workflows.EditTreeDefinitionWorkflow"), PermissionTypePredefined.Edit)))
{
VisualData = new ActionVisualizedData
{
Label = StringResourceSystemFacade.GetString("Composite.C1Console.Trees", "TreeDeleteTreeDefinitionWorkflow.Edit.Label"),
ToolTip = StringResourceSystemFacade.GetString("Composite.C1Console.Trees", "TreeDeleteTreeDefinitionWorkflow.Edit.ToolTip"),
Icon = TreeDefinitionIconEdit,
Disabled = false,
ActionLocation = ActionLocation.EditPrimaryActionLocation
}
});
yield return treeDefintionElement;
}
yield break;
}
else if (entityToken.Id == DeveloperApplicationProviderEntityToken.TreeDefinitionId)
{
//DeveloperApplicationProviderEntityToken castedEntityToken = (DeveloperApplicationProviderEntityToken)entityToken;
//foreach (Element element in TreeFacade.GetElementsByTreeId(castedEntityToken.Filename, entityToken, new Dictionary<string, string>()))
//{
// yield return element;
//}
}
yield break;
}
开发者ID:DBailey635,项目名称:C1-CMS,代码行数:60,代码来源:DeveloperApplicationProvider.cs
示例12: GetActions
public IEnumerable<ElementAction> GetActions(EntityToken entityToken)
{
if (entityToken is WebsiteFileElementProviderEntityToken)
{
if (Path.GetExtension(entityToken.Id).ToLower() == ".xml")
{
if (entityToken.Id.Replace("/", "\\").Contains(StoreHelper.StoringPath.Replace("/", "\\")))
{
yield return new ElementAction(new ActionHandle(new HandleActionToken()))
{
VisualData = new ActionVisualizedData
{
Label = "Export to Excel",
ToolTip = "Export to Excel",
Icon = new ResourceHandle("Composite.Icons", "mimetype-xls"),
ActionLocation = new ActionLocation
{
ActionType = ActionType.Other,
IsInFolder = false,
IsInToolbar = false,
ActionGroup = new ActionGroup("Export", ActionGroupPriority.PrimaryLow)
}
}
};
}
}
}
yield break;
}
开发者ID:JustAndrei,项目名称:C1-Packages,代码行数:29,代码来源:HandlerElementActionProvider.cs
示例13: Execute
public FlowToken Execute(EntityToken entityToken, ActionToken actionToken, FlowControllerServicesContainer flowControllerServicesContainer)
{
PackageCreatorFacade.DeletePackageInformation(entityToken.Source);
SpecificTreeRefresher treeRefresher = new SpecificTreeRefresher(flowControllerServicesContainer);
treeRefresher.PostRefreshMesseges(new PackageCreatorElementProviderEntityToken());
return null;
}
开发者ID:JustAndrei,项目名称:C1-Packages,代码行数:7,代码来源:DeletePackageCreatorActionToken.cs
示例14: GetActions
public IEnumerable<ElementAction> GetActions(EntityToken entityToken)
{
var dataEntityToken = entityToken as DataEntityToken;
if (dataEntityToken == null) return NoActions;
if (dataEntityToken.InterfaceType != typeof(IXsltFunction)) return NoActions;
var action = new ElementAction(new ActionHandle(new ConvertFunctionActionToken()))
{
VisualData = new ActionVisualizedData
{
Label = "Convert to Razor",
ToolTip = "Creates a new razor function with the same name and parameters while renaming the existing xsl function",
Icon = ActionIcon,
Disabled = false,
ActionLocation = new ActionLocation
{
ActionType = ActionType.Other,
IsInFolder = false,
IsInToolbar = true,
ActionGroup = PrimaryActionGroup
}
}
};
return new [] { action };
}
开发者ID:JustAndrei,项目名称:C1-Packages,代码行数:27,代码来源:XslToRazorFunctionConverter.cs
示例15: Execute
public FlowToken Execute(EntityToken entityToken, ActionToken actionToken, FlowControllerServicesContainer flowControllerServicesContainer)
{
//string documentTitle = "Unpublished Pages and Page Folder Data";
//string description = "The list below display pages and page data which are currently being edited or are ready to be approved / published.";
string documentTitle = StringResourceSystemFacade.GetString("Composite.Plugins.PageElementProvider", "PageElementProvider.ViewUnpublishedItems-document-title");
string description = StringResourceSystemFacade.GetString("Composite.Plugins.PageElementProvider", "PageElementProvider.ViewUnpublishedItems-document-description");
string emptyLabel = StringResourceSystemFacade.GetString("Composite.Plugins.GeneratedDataTypesElementProvider", "ViewUnpublishedItems-document-empty-label");
string url = string.Format("{0}?showpagedata=true&title={1}&description={2}&emptyLabel={3}",
UrlUtils.ResolveAdminUrl(string.Format("content/views/publishworkflowstatus/ViewUnpublishedItems.aspx")),
HttpUtility.UrlEncode(documentTitle, Encoding.UTF8),
HttpUtility.UrlEncode(description, Encoding.UTF8),
HttpUtility.UrlEncode(emptyLabel, Encoding.UTF8));
IManagementConsoleMessageService consoleServices = flowControllerServicesContainer.GetService<IManagementConsoleMessageService>();
OpenViewMessageQueueItem openViewMsg = new OpenViewMessageQueueItem
{
EntityToken = EntityTokenSerializer.Serialize(entityToken, true),
ViewId = "ViewUnpublishedPageItems",
Label = documentTitle,
Url = url,
ViewType = ViewType.Main
};
ConsoleMessageQueueFacade.Enqueue(openViewMsg, consoleServices.CurrentConsoleId);
return null;
}
开发者ID:DBailey635,项目名称:C1-CMS,代码行数:27,代码来源:ViewUnpublishedItemsActionToken.cs
示例16: Execute
public FlowToken Execute(EntityToken entityToken, ActionToken actionToken, FlowControllerServicesContainer flowControllerServicesContainer)
{
string currentConsoleId = flowControllerServicesContainer.GetService<IManagementConsoleMessageService>().CurrentConsoleId;
string serializedEntityToken = EntityTokenSerializer.Serialize(entityToken);
if (actionToken.Serialize() == "ShowGraph")
{
string url = string.Format("{0}?EntityToken={1}", UrlUtils.ResolveAdminUrl("content/views/relationshipgraph/Default.aspx"), System.Web.HttpUtility.UrlEncode(serializedEntityToken));
ConsoleMessageQueueFacade.Enqueue(new OpenViewMessageQueueItem { Url = url, ViewId = Guid.NewGuid().ToString(), ViewType = ViewType.Main, Label = "Show graph..." }, currentConsoleId);
}
else if (actionToken.Serialize() == "ShowOrientedGraph")
{
Guid id = Guid.NewGuid();
string filename = Path.Combine(PathUtil.Resolve(GlobalSettingsFacade.TempDirectory), string.Format("{0}.RelationshipGraph", id));
C1File.WriteAllLines(filename, new string[] { serializedEntityToken });
string url = string.Format("{0}?Id={1}", UrlUtils.ResolveAdminUrl("content/views/relationshipgraph/ShowRelationshipOrientedGraph.aspx"), id);
ConsoleMessageQueueFacade.Enqueue(new OpenViewMessageQueueItem { Url = url, ViewId = Guid.NewGuid().ToString(), ViewType = ViewType.Main, Label = "Show graph..." }, currentConsoleId);
}
return null;
}
开发者ID:DBailey635,项目名称:C1-CMS,代码行数:26,代码来源:ElementActionProviderFacade.cs
示例17: GetActions
public IEnumerable<ElementAction> GetActions(EntityToken entityToken)
{
if (entityToken == null || !(entityToken is PageElementProviderEntityToken))
{
return EmptyActionList;
}
return new[] {new ElementAction(new ActionHandle(new LinkCheckerActionToken()))
{
VisualData = new ActionVisualizedData
{
Label = GetResourceString("LinkCheckerActionToken.Label"),
ToolTip = GetResourceString("LinkCheckerActionToken.ToolTip"),
Icon = LinkIcon,
Disabled = false,
ActionLocation = new ActionLocation
{
ActionType = ActionType.Other,
IsInFolder = false,
IsInToolbar = true,
ActionGroup = ViewActionGroup
}
}
}};
}
开发者ID:JustAndrei,项目名称:C1-Packages,代码行数:25,代码来源:LinkCheckerActionProvider.cs
示例18: AttachingPoint
internal AttachingPoint(AttachingPoint attachingPoint)
{
_entityToken = attachingPoint._entityToken;
EntityTokenType = attachingPoint.EntityTokenType;
Id = attachingPoint.Id;
Source = attachingPoint.Source;
}
开发者ID:DBailey635,项目名称:C1-CMS,代码行数:7,代码来源:AttachingPoint.cs
示例19: OnAddAction
protected override void OnAddAction(Action<ElementAction> actionAdder, EntityToken entityToken, TreeNodeDynamicContext dynamicContext, DynamicValuesHelperReplaceContext dynamicValuesHelperReplaceContext)
{
string url = this.UrlDynamicValuesHelper.ReplaceValues(dynamicValuesHelperReplaceContext);
this.External = url.Contains("://");
if(!External)
{
url = UrlUtils.ResolvePublicUrl(url);
}
CustomUrlActionNodeActionToken actionToken = new CustomUrlActionNodeActionToken(
url,
this.External,
(this.External ? "externalview" : "documentview"),
this.ViewLabelDynamicValuesHelper.ReplaceValues(dynamicValuesHelperReplaceContext),
this.ViewToolTipDynamicValuesHelper.ReplaceValues(dynamicValuesHelperReplaceContext),
this.Serialize(),
this.PermissionTypes);
ElementAction elementAction = new ElementAction(new ActionHandle(actionToken))
{
VisualData = CreateActionVisualizedData(dynamicValuesHelperReplaceContext)
};
actionAdder(elementAction);
}
开发者ID:DBailey635,项目名称:C1-CMS,代码行数:27,代码来源:CustomUrlActionNode.cs
示例20: GetParents
public IEnumerable<EntityToken> GetParents(EntityToken entityToken)
{
if (entityToken is GeneratedDataTypesElementProviderRootEntityToken)
{
yield break;
}
else if (entityToken is GeneratedDataTypesElementProviderTypeEntityToken)
{
GeneratedDataTypesElementProviderTypeEntityToken castedToken = entityToken as GeneratedDataTypesElementProviderTypeEntityToken;
Type type = TypeManager.TryGetType(castedToken.SerializedTypeName);
if (type != null)
{
yield return new GeneratedDataTypesElementProviderRootEntityToken(entityToken.Source, castedToken.Id);
}
else
{
yield return null;
}
}
else
{
throw new NotImplementedException();
}
}
开发者ID:DBailey635,项目名称:C1-CMS,代码行数:26,代码来源:GeneratedDataTypesElementProviderSecurityAncestorProvider.cs
注:本文中的Composite.C1Console.Security.EntityToken类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论