本文整理汇总了C#中IData.GetDataEntityToken方法的典型用法代码示例。如果您正苦于以下问题:C# IData.GetDataEntityToken方法的具体用法?C# IData.GetDataEntityToken怎么用?C# IData.GetDataEntityToken使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IData
的用法示例。
在下文中一共展示了IData.GetDataEntityToken方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PublishIfNeeded
public static bool PublishIfNeeded(IData data, bool doPublish, IDictionary<string, object> binding, Action<DialogType, string, string> messageAction)
{
if (!(data is IPublishControlled))
{
return false;
}
WorkflowInstance publishWorkflowInstance = null;
WorkflowInstance unpublishWorkflowInstance = null;
var publishDate = binding.ContainsKey("PublishDate") ? (DateTime?)binding["PublishDate"] : null;
var unpublishDate = binding.ContainsKey("UnpublishDate") ? (DateTime?)binding["UnpublishDate"] : null;
string cultureName = UserSettings.ActiveLocaleCultureInfo.Name;
HandlePublishUnpublishWorkflows(data, cultureName, publishDate, unpublishDate, ref publishWorkflowInstance, ref unpublishWorkflowInstance);
if (publishWorkflowInstance != null)
{
publishWorkflowInstance.Start();
WorkflowFacade.RunWorkflow(publishWorkflowInstance);
}
if (unpublishWorkflowInstance != null)
{
unpublishWorkflowInstance.Start();
WorkflowFacade.RunWorkflow(unpublishWorkflowInstance);
}
if (!doPublish)
{
return false;
}
if (publishWorkflowInstance == null || publishDate < DateTime.Now)
{
var actionToken = new GenericPublishProcessController.PublishActionToken();
var serviceContainer = WorkflowFacade.GetFlowControllerServicesContainer(WorkflowEnvironment.WorkflowInstanceId);
ActionExecutorFacade.Execute(data.GetDataEntityToken(), actionToken, serviceContainer);
return true;
}
var title = Texts.Website_Forms_Administrative_EditPage_PublishDatePreventPublishTitle;
var message = Texts.Website_Forms_Administrative_EditPage_PublishDatePreventPublish;
messageAction(DialogType.Warning, title, message);
return false;
}
示例2: BuildElement
private Element BuildElement(IData data,
DynamicValuesHelperReplaceContext replaceContext,
TreeNodeDynamicContext dynamicContext,
bool localizationEnabled,
List<object> itemKeys,
ref IEnumerable<object> keysJoinedByParentFilters,
EntityToken parentEntityToken
)
{
replaceContext.CurrentDataItem = data;
object keyValue = this.KeyPropertyInfo.GetValue(data, null);
bool itemLocalizationEnabledAndForeign = localizationEnabled && !data.DataSourceId.LocaleScope.Equals(UserSettings.ActiveLocaleCultureInfo);
if (itemLocalizationEnabledAndForeign && itemKeys.Contains(keyValue)) return null;
var currentEntityToken = data.GetDataEntityToken();
var element = new Element(new ElementHandle
(
dynamicContext.ElementProviderName,
currentEntityToken,
dynamicContext.Piggybag.PreparePiggybag(this.ParentNode, parentEntityToken)
));
bool hasChildren;
bool isDisabled = false;
ResourceHandle icon, openedIcon;
if (itemLocalizationEnabledAndForeign)
{
hasChildren = false;
isDisabled = !data.IsTranslatable();
if (this.Icon != null)
{
icon = this.Icon;
openedIcon = this.OpenedIcon;
}
else
{
icon = data.GetForeignIcon();
openedIcon = icon;
}
}
else
{
if (this.Display != LeafDisplayMode.Auto)
{
hasChildren = ChildNodes.Any();
}
else
{
hasChildren = ChildNodes.OfType<SimpleElementTreeNode>().Any();
if (!hasChildren)
{
if (keysJoinedByParentFilters != null)
{
keysJoinedByParentFilters = keysJoinedByParentFilters.Evaluate();
hasChildren = keysJoinedByParentFilters.Contains(keyValue);
}
}
// Checking children filtered by FunctionFilters
if (!hasChildren)
{
foreach (var childNode in this.ChildNodes.OfType<DataElementsTreeNode>()
.Where(n => n.FilterNodes.OfType<FunctionFilterNode>().Any()))
{
var newDynamicContext = new TreeNodeDynamicContext(TreeNodeDynamicContextDirection.Down)
{
ElementProviderName = dynamicContext.ElementProviderName,
Piggybag = dynamicContext.Piggybag.PreparePiggybag(this.ParentNode, parentEntityToken),
CurrentEntityToken = currentEntityToken
};
if (childNode.GetDataset(newDynamicContext, false).DataItems.Any())
{
hasChildren = true;
break;
}
}
}
}
if (this.Icon != null)
{
icon = this.Icon;
openedIcon = this.OpenedIcon;
}
else
{
openedIcon = icon = data.GetIcon();
}
}
//.........这里部分代码省略.........