本文整理汇总了C#中System.Workflow.Activities.ConditionalEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# ConditionalEventArgs类的具体用法?C# ConditionalEventArgs怎么用?C# ConditionalEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ConditionalEventArgs类属于System.Workflow.Activities命名空间,在下文中一共展示了ConditionalEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: HasDataReferences
private void HasDataReferences(object sender, ConditionalEventArgs e)
{
IPage page = GetPage();
Type folderType = GetFolderType();
IEnumerable<IData> dataToDelete = page.GetFolderData(folderType);
var brokenReferences = new List<IData>();
foreach (var data in dataToDelete)
{
var references = DataReferenceFacade.GetNotOptionalReferences(data);
foreach (var reference in references)
{
DataSourceId dataSourceId = reference.DataSourceId;
if (brokenReferences.Any(brokenRef => brokenRef.DataSourceId.Equals(dataSourceId))
|| dataToDelete.Any(elem => elem.DataSourceId.Equals(dataSourceId)))
{
continue;
}
brokenReferences.Add(reference);
}
}
e.Result = brokenReferences.Count > 0;
if (brokenReferences.Count == 0)
{
return;
}
Bindings.Add("ReferencedData", DataReferenceFacade.GetBrokenReferencesReport(brokenReferences));
}
示例2: ValidateBindings
private void ValidateBindings(object sender, ConditionalEventArgs e)
{
IPageTypeMetaDataTypeLink pageTypeMetaDataTypeLink = this.GetDataItemFromEntityToken<IPageTypeMetaDataTypeLink>();
IPageMetaDataDefinition pageMetaDataDefinition = PageMetaDataFacade.GetMetaDataDefinition(pageTypeMetaDataTypeLink.PageTypeId, pageTypeMetaDataTypeLink.Name);
string metaDataDescriptionLabel = this.GetBinding<string>("CompositionDescriptionLabel");
Guid containerId = this.GetBinding<Guid>("CompositionContainerId");
e.Result = true;
if (pageMetaDataDefinition.Label != metaDataDescriptionLabel)
{
if (PageMetaDataFacade.IsDefinitionAllowed(pageTypeMetaDataTypeLink.PageTypeId, pageMetaDataDefinition.Name, metaDataDescriptionLabel, pageMetaDataDefinition.MetaDataTypeId) == false)
{
this.ShowFieldMessage("CompositionDescriptionLabel", GetText("PageType.EditPageTypeMetaDataFieldWorkflow.ValidationError.MetaDataFieldNameAlreadyUsed"));
SetSaveStatus(false);
e.Result = false;
}
}
if (pageMetaDataDefinition.MetaDataContainerId != containerId)
{
if (PageMetaDataFacade.IsNewContainerIdAllowed(pageTypeMetaDataTypeLink.PageTypeId, pageMetaDataDefinition.Name, containerId) == false)
{
this.ShowFieldMessage("CompositionContainerId", GetText("PageType.EditPageTypeMetaDataFieldWorkflow.ValidationError.MetaDataContainerChangeNotAllowed"));
SetSaveStatus(false);
e.Result = false;
}
}
}
示例3: ValidateReferencingProperties
private void ValidateReferencingProperties(object sender, ConditionalEventArgs e)
{
var dataEntityToken = (DataEntityToken)this.EntityToken;
var data = dataEntityToken.Data as ILocalizedControlled;
IEnumerable<ReferenceFailingPropertyInfo> referenceFailingProperties = DataLocalizationFacade.GetReferencingLocalizeFailingProperties(data).Evaluate();
if (referenceFailingProperties.Any(f => f.OptionalReferenceWithValue == false))
{
List<string> row = new List<string>();
row.Add(StringResourceSystemFacade.GetString("Composite.C1Console.Trees", "LocalizeData.ShowError.Description"));
foreach (ReferenceFailingPropertyInfo referenceFailingPropertyInfo in referenceFailingProperties.Where(f => f.OptionalReferenceWithValue == false))
{
row.Add(string.Format(StringResourceSystemFacade.GetString("Composite.C1Console.Trees", "LocalizeData.ShowError.FieldErrorFormat"), referenceFailingPropertyInfo.DataFieldDescriptor.Name, referenceFailingPropertyInfo.ReferencedType.GetTypeTitle(), referenceFailingPropertyInfo.OriginLocaleDataValue.GetLabel()));
}
List<List<string>> rows = new List<List<string>> { row };
this.UpdateBinding("ErrorHeader", new List<string> { "Fields" });
this.UpdateBinding("Errors", rows);
e.Result = false;
}
else
{
e.Result = true;
}
}
示例4: HasDataReferences
private void HasDataReferences(object sender, ConditionalEventArgs e)
{
IData data = ((DataEntityToken)this.EntityToken).Data;
this.Bindings.Add("Text", string.Format("{0}: {1}", Composite.Core.ResourceSystem.StringResourceSystemFacade.GetString("Composite.C1Console.Trees", "TreeGenericDeleteConfirm.Text"), data.GetLabel()));
var brokenReferences = new List<IData>();
List<IData> references = DataReferenceFacade.GetNotOptionalReferences(data);
foreach (IData reference in references)
{
DataSourceId dataSourceId = reference.DataSourceId;
if (brokenReferences.Any(brokenRef => brokenRef.DataSourceId == dataSourceId))
{
continue;
}
brokenReferences.Add(reference);
}
e.Result = brokenReferences.Count > 0;
if (brokenReferences.Count == 0)
{
return;
}
Bindings.Add("ReferencedData", DataReferenceFacade.GetBrokenReferencesReport(brokenReferences));
}
示例5: ValidateInputs
private void ValidateInputs(object sender, ConditionalEventArgs e)
{
IMediaFileFolder folder = this.GetDataItemFromEntityToken<IMediaFileFolder>();
string oldFolderPath = this.GetBinding<string>("OldFolderPath");
string folderPath = CreateFolderPath();
if (oldFolderPath != folderPath)
{
Guid folderId = folder.Id;
if (DataFacade.GetData<IMediaFileFolder>()
.Any(f => string.Compare(f.Path, folderPath, StringComparison.OrdinalIgnoreCase) == 0
&& f.Id != folderId))
{
ShowFieldMessage("FolderName", StringResourceSystemFacade.GetString("Composite.Management", "Website.Forms.Administrative.AddNewMediaFolder.FolderNameAlreadyUsed"));
e.Result = false;
return;
}
IEnumerable<string> filenames = DataFacade.GetData<IMediaFile>().Where(f => f.FolderPath == oldFolderPath).Select(f => f.FileName);
foreach (string filename in filenames)
{
string compositePath = IMediaFileExtensions.GetCompositePath(folder.StoreId, folderPath, filename);
if (compositePath.Length > 2048)
{
this.ShowFieldMessage("FolderName", "${Composite.Management, Website.Forms.Administrative.EditMediaFolder.TotalFilenameToLong.Message}");
e.Result = false;
return;
}
}
}
e.Result = true;
}
示例6: CheckDeposit
private void CheckDeposit(object sender, ConditionalEventArgs e)
{
// Go into the deposit activity if user selects 1.
e.Result = (serviceValue == 1);
}
示例7: ValidateLocalizeProcess
private void ValidateLocalizeProcess(object sender, ConditionalEventArgs e)
{
DataEntityToken dataEntityToken = (DataEntityToken)this.EntityToken;
ILocalizedControlled data = dataEntityToken.Data as ILocalizedControlled;
IEnumerable<ReferenceFailingPropertyInfo> referenceFailingPropertyInfos = DataLocalizationFacade.GetReferencingLocalizeFailingProperties(data).Evaluate();
if (referenceFailingPropertyInfos.Any(f => f.OptionalReferenceWithValue == false))
{
List<string> row = new List<string>();
row.Add(Texts.LocalizeDataWorkflow_ShowError_Description);
foreach (ReferenceFailingPropertyInfo referenceFailingPropertyInfo in referenceFailingPropertyInfos.Where(f => f.OptionalReferenceWithValue == false))
{
row.Add(Texts.LocalizeDataWorkflow_ShowError_FieldErrorFormat(
referenceFailingPropertyInfo.DataFieldDescriptor.Name,
referenceFailingPropertyInfo.ReferencedType.GetTypeTitle(),
referenceFailingPropertyInfo.OriginLocaleDataValue.GetLabel()));
}
List<List<string>> rows = new List<List<string>> { row };
this.UpdateBinding("ErrorHeader", new List<string> { "Fields" });
this.UpdateBinding("Errors", rows);
e.Result = false;
}
else
{
e.Result = true;
}
}
示例8: isKlientExist
private void isKlientExist(object sender, ConditionalEventArgs e)
{
if (klientIndex < aKlienci.Length)
e.Result = true;
else
e.Result = false;
}
示例9: Evaluate
public override bool Evaluate(Activity ownerActivity, IServiceProvider provider)
{
if (provider == null)
{
throw new ArgumentNullException("provider");
}
ConditionalEventArgs e = new ConditionalEventArgs();
EventHandler<ConditionalEventArgs>[] invocationList = base.GetInvocationList<EventHandler<ConditionalEventArgs>>(ConditionEvent);
IWorkflowDebuggerService service = provider.GetService(typeof(IWorkflowDebuggerService)) as IWorkflowDebuggerService;
if (invocationList != null)
{
foreach (EventHandler<ConditionalEventArgs> handler in invocationList)
{
if (service != null)
{
service.NotifyHandlerInvoking(handler);
}
handler(ownerActivity, e);
if (service != null)
{
service.NotifyHandlerInvoked();
}
}
}
return e.Result;
}
示例10: HasDataReferences
private void HasDataReferences(object sender, ConditionalEventArgs e)
{
IData data = ((DataEntityToken)this.EntityToken).Data;
var brokenReferences = new List<IData>();
var references = DataReferenceFacade.GetNotOptionalReferences(data);
foreach (var reference in references)
{
DataSourceId referenceDataSourceId = reference.DataSourceId;
if (brokenReferences.Any(brokenRef => brokenRef.DataSourceId == referenceDataSourceId))
{
continue;
}
brokenReferences.Add(reference);
}
e.Result = brokenReferences.Count > 0;
if (brokenReferences.Count == 0)
{
return;
}
Bindings.Add("ReferencedData", DataReferenceFacade.GetBrokenReferencesReport(brokenReferences));
}
示例11: IsTE
//#region public properties
//public string UserName
//{
// get { return userName; }
// set { userName = value; }
//}
//public string UserTE
//{
// get { return userTE; }
// set { userTE = value; }
//}
//public string ReclaimType
//{
// get { return reclaimType; }
// set { reclaimType = value; }
//}
//public string ReclaimObservations
//{
// get { return reclaimObservations; }
// set { reclaimObservations = value; }
//}
//#endregion
private void IsTE(object sender, ConditionalEventArgs e)
{
if (reclaimType == "TE")
e.Result = true;
else
e.Result = false;
}
示例12: CheckEmployeementHistory
private void CheckEmployeementHistory(object sender, ConditionalEventArgs e)
{
string sEmpHistory = "";
sEmpHistory = workflowProperties.Item["Employment History"].ToString();
if (sEmpHistory.Trim().ToLower() == "good")
e.Result = true;
}
示例13: Evaluate
public override bool Evaluate(Activity ownerActivity, IServiceProvider provider)
{
if (provider == null)
throw new ArgumentNullException("provider");
ConditionalEventArgs eventArgs = new ConditionalEventArgs();
EventHandler<ConditionalEventArgs>[] eventHandlers = base.GetInvocationList<EventHandler<ConditionalEventArgs>>(CodeCondition.ConditionEvent);
IWorkflowDebuggerService workflowDebuggerService = provider.GetService(typeof(IWorkflowDebuggerService)) as IWorkflowDebuggerService;
if (eventHandlers != null)
{
foreach (EventHandler<ConditionalEventArgs> eventHandler in eventHandlers)
{
if (workflowDebuggerService != null)
workflowDebuggerService.NotifyHandlerInvoking(eventHandler);
eventHandler(ownerActivity, eventArgs);
if (workflowDebuggerService != null)
workflowDebuggerService.NotifyHandlerInvoked();
}
}
return eventArgs.Result;
}
示例14: CultureHasChanged
private void CultureHasChanged(object sender, ConditionalEventArgs e)
{
string cultureName = this.GetBinding<string>("CultureName");
string c1ConsoleUiLanguageName = this.GetBinding<string>("C1ConsoleUiLanguageName");
e.Result = UserSettings.CultureInfo.Name != cultureName || UserSettings.C1ConsoleUiLanguage.Name != c1ConsoleUiLanguageName;
}
示例15: ValidateInputs
private void ValidateInputs(object sender, ConditionalEventArgs e)
{
IMediaFile file = this.GetDataItemFromEntityToken<IMediaFile>();
string filename = this.GetBinding<string>("FileDataFileName");
string compositePath = IMediaFileExtensions.GetCompositePath(file.StoreId, file.FolderPath, filename);
if (compositePath.Length > 2048)
{
this.ShowFieldMessage("FileDataFileName", "${Composite.Management, Website.Forms.Administrative.EditMediaFile.TotalFilenameToLong.Message}");
e.Result = false;
return;
}
Guid mediaFileId = file.Id;
if(DataFacade.GetData<IMediaFile>()
.Any(mediaFile => string.Compare(mediaFile.CompositePath, compositePath, StringComparison.InvariantCultureIgnoreCase) == 0
&& mediaFile.Id != mediaFileId))
{
this.ShowFieldMessage("FileDataFileName", "${Composite.Management, Website.Forms.Administrative.EditMediaFile.FileExists.Message}");
e.Result = false;
return;
}
e.Result = true;
}