public Randstr( IFunctionData functionData ) : base(functionData) { // do nothing. }
public void Populate(IFunctionBuilder functionBuilder, IFunctionData functionData) { InputAuthenticationType = functionData.TryGetPropertyValue(Common.PropertyNames.InputAuthenticationType, AuthenticationType.None); InputCertificateSource = functionData.TryGetPropertyValue(Common.PropertyNames.InputCertificateSource, CertificateSource.File); InputCertificate = functionData.TryGetPropertyValue <StoredCertificate>(Common.PropertyNames.InputCertificate, null); SignCertificateSource = functionData.TryGetPropertyValue(PropertyNames.CertificateSource, CertificateSource.File); SignCertificate = functionData.TryGetPropertyValue <StoredCertificate>(PropertyNames.Certificate, null); SignPlacement = functionData.TryGetPropertyValue(PropertyNames.Placement, SignaturePosition.Hidden); SignLockAfterSigning = functionData.TryGetPropertyValue(PropertyNames.LockAfterSigning, false); InputFilePathParameterName = functionBuilder.GetParamName(Common.PropertyNames.InputFilePath); InputPasswordParameterName = functionBuilder.GetParamName(Common.PropertyNames.InputPassword); InputCertificateFilePathParameterName = functionBuilder.GetParamName(Common.PropertyNames.InputCertificateFilePath); InputCertificateFilePasswordParameterName = functionBuilder.GetParamName(Common.PropertyNames.InputCertificateFilePassword); SignSignedAtParameterName = functionBuilder.GetParamName(PropertyNames.SignedAt); SignReasonParameterName = functionBuilder.GetParamName(PropertyNames.Reason); SignCertificateFilePathParameterName = functionBuilder.GetParamName(PropertyNames.CertificateFilePath); SignCertificateFilePasswordParameterName = functionBuilder.GetParamName(PropertyNames.CertificateFilePassword); SignFieldNameParameterName = functionBuilder.GetParamName(PropertyNames.FieldName); SignBackgroundImageParameterName = functionBuilder.GetParamName(PropertyNames.BackgroundImage); SignPositionXParameterName = functionBuilder.GetParamName(PropertyNames.PositionX); SignPositionYParameterName = functionBuilder.GetParamName(PropertyNames.PositionY); SignWidthParameterName = functionBuilder.GetParamName(PropertyNames.Width); SignHeightParameterName = functionBuilder.GetParamName(PropertyNames.Height); SignPageParameterName = functionBuilder.GetParamName(PropertyNames.Page); OutputFilePathParameterName = functionBuilder.GetParamName(Common.PropertyNames.OutputFilePath); ContextParameterName = functionBuilder.ContextParamName; }
/// <summary> /// 检查function return /// 1. 检查是否为null:静态方法可以为null,不然报错 /// 2. 在arr里面寻找对应的variable,调用CheckPropertyType /// </summary> /// <param name="function"> function信息 </param> /// <param name="arr"> 要检查的Sequence/SequenceGroup集合 </param> /// <returns> warnList (注:虽只会有一条错误信息,但为了上级代码整洁与一致性,返回List)</returns> public IWarningInfo CheckReturn(ISequenceStep Step, ISequenceFlowContainer[] arr, bool overwriteType) { IFunctionData function = Step.Function; //先判断返回类型是不是void, void则不检查 if (function.ReturnType == null) { if (!string.IsNullOrEmpty(function.Return)) { return(new WarningInfo() { //todo I18n WarnCode = WarnCode.ReturnNotEmpty, Infomation = $"\"{Step.Name}\" function Return Type is void, but value not empty" }); } return(null); } //空值也不检查 else if (string.IsNullOrEmpty(function.Return)) { return(null); } return(FindVariablesCheckPropertyType(arr, function.Return, function.ReturnType.Type, overwriteType)); }
public Bool( IFunctionData functionData ) : base(functionData) { // do nothing. }
public _TimeSpan( IFunctionData functionData ) : base(functionData) { // do nothing. }
public Logx( IFunctionData functionData ) : base(functionData) { // do nothing. }
//发送CallBackMessage至queue,让CallBackProcessor接受 private void SendCallBackMessage() { CallBackId = Context.CallBackEventManager.GetCallBackId(); IFunctionData function = Function; FullName = function.ClassType.Namespace + "." + function.ClassType.Name + "." + function.MethodName; CallBackMessage callBackMessage; //无参数 if (function.Parameters == null || function.Parameters.Count == 0) { callBackMessage = new CallBackMessage(FullName, Context.SessionId, CallBackId) { Type = MessageType.CallBack, CallBackType = this.callBackType }; } else { //运行前实时获取参数信息 SetVariableParamValue(); callBackMessage = new CallBackMessage(FullName, Context.SessionId, CallBackId, getStringParams(function)) { Type = MessageType.CallBack, CallBackType = this.callBackType }; } Context.UplinkMsgProcessor.SendMessage(callBackMessage, false); }
public Atan2( IFunctionData functionData ) : base(functionData) { // do nothing. }
public static void CompileExpression(IFunctionBuilder functionBuilder, IFunctionData data, string parameterName, string expressionName) { var propertyValue = data.Properties[parameterName].Value; var expressionString = (propertyValue is string) ? propertyValue as string : string.Empty; SqlStringHandler stringHandler = SqlStringHandler.GetSqlStringHandler(expressionString); var parameterValues = new string[stringHandler.Expressions.Count]; for (int i = 0; i < parameterValues.Length; i++) { parameterValues[i] = functionBuilder.GetParamName(expressionName + i) + ".ToString()"; } if (parameterValues.Length > 0) { functionBuilder.AddCode(string.Format(@"{0} = Twenty57.Linx.Components.Database.Mongo.MongoStringHandler.GetExecutableQuery( {0}, {1}, new [] {{ {2} }});" , functionBuilder.GetParamName(parameterName), CSharpUtilities.ArrayAsString(stringHandler.Expressions.Select(x => x.MatchText)), parameterValues.Aggregate((a, b) => a + ",\n" + b) )); } }
public ExecuteStoredProcedureDesigner(IFunctionData data, IDesignerContext context) : base(data, context) { foreach (var nextResultSet in ResultSets.Where(r => r.CustomType != null)) { nextResultSet.CustomType = context.CustomTypes.FirstOrDefault(t => t.Id == nextResultSet.CustomType.Id); } }
public Decimal( IFunctionData functionData ) : base(functionData) { // do nothing. }
/// <summary> /// Compiles the fragment. /// </summary> /// <param name="queryBuilder">The query builder.</param> /// <param name="engine">The engine.</param> public override void Compile(QueryBuilder queryBuilder, IEngine engine) { IFunctionData funcData = engine.GetFunction(Name); if (engine.Options.FunctionsOnlyRegistered && funcData == null) { throw new InvalidConfigurationException($"Function \"{Name}\" is not registered."); } if (funcData?.Compile != null) { funcData.Compile(queryBuilder, engine, funcData.Name ?? Name, this); } else { queryBuilder.Write(funcData?.Name ?? Name).Write("("); if (BeforeArgs != null) { queryBuilder.WriteFragment(BeforeArgs).Write(" "); } if (Values.Count > 0) { base.Compile(queryBuilder, engine); } queryBuilder.Write(")"); } }
public ConstructorInfo GetConstructor(IFunctionData function) { BindingFlags bindingFlags = BindingFlags.Public; ConstructorInfo constructor; Type[] parameterTypes; ParameterModifier[] modifiers = null; Type classType = _typeDataMapping[ModuleUtils.GetTypeFullName(function.ClassType)]; switch (function.Type) { case FunctionType.Constructor: bindingFlags |= BindingFlags.Instance; parameterTypes = new Type[function.ParameterType.Count]; if (function.ParameterType.Count > 0) { modifiers = new ParameterModifier[] { new ParameterModifier(function.ParameterType.Count) }; for (int i = 0; i < parameterTypes.Length; i++) { parameterTypes[i] = _typeDataMapping[ModuleUtils.GetTypeFullName(function.ParameterType[i].Type)]; if (function.ParameterType[i].Modifier != ArgumentModifier.None && !parameterTypes[i].IsByRef) { modifiers[0][i] = true; parameterTypes[i] = parameterTypes[i].MakeByRefType(); } } } constructor = classType.GetConstructor(bindingFlags, null, parameterTypes, modifiers); break; default: throw new InvalidOperationException(); } return(constructor); }
public Wide( IFunctionData functionData ) : base(functionData) { // do nothing. }
public Round3( IFunctionData functionData ) : base(functionData) { // do nothing. }
public Typeof( IFunctionData functionData ) : base(functionData) { // do nothing. }
private IFunctionData UpdateToVersion1(IFunctionData data) { PdfOperationsDesigner designer = new PdfOperationsProvider().CreateDesigner(null) as PdfOperationsDesigner; Operation operation = UpdateOperationProperties(designer, data); switch (operation) { case Operation.FillForm: UpdateFillFormProperties(designer, data); break; case Operation.Protect: UpdateProtectProperties(designer, data); break; case Operation.Split: UpdateSplitProperties(designer, data); break; case Operation.Concatenate: UpdateConcatenateProperties(designer, data); break; case Operation.AddWatermark: UpdateAddWatermarkProperties(designer, data); break; case Operation.Sign: UpdateSignProperties(designer, data); break; } return(designer.GetFunctionData()); }
private void UpdateInputFileProperties(ReadDesigner designer, IFunctionData data) { designer.Properties[PropertyNames.PdfFilePath].Value = data.Properties["Pdf filename"].Value; AuthenticationType authenticationType = data.Properties["Authentication type"].GetValue <AuthenticationType>(); designer.Properties[PropertyNames.AuthenticationType].Value = authenticationType; switch (authenticationType) { case AuthenticationType.Password: designer.Properties[PropertyNames.PdfPassword].Value = data.Properties["Pdf password"].Value; break; case AuthenticationType.Certificate: CertificateSource certificateSource = data.Properties["Certificate source"].GetValue <CertificateSource>(); designer.Properties[PropertyNames.CertificateSource].Value = certificateSource; switch (certificateSource) { case CertificateSource.File: designer.Properties[PropertyNames.CertificateFilePath].Value = data.Properties["Certificate file path"].Value; designer.Properties[PropertyNames.CertificateFilePassword].Value = data.Properties["Certificate file password"].Value; break; case CertificateSource.Store: designer.Properties[PropertyNames.Certificate].Value = data.Properties["Certificate"].Value; break; } break; } }
public void Populate(IFunctionBuilder functionBuilder, IFunctionData functionData) { InputAuthenticationType = functionData.TryGetPropertyValue(PropertyNames.InputAuthenticationType, AuthenticationType.None); InputCertificateSource = functionData.TryGetPropertyValue(PropertyNames.InputCertificateSource, CertificateSource.File); InputCertificate = functionData.TryGetPropertyValue <StoredCertificate>(PropertyNames.InputCertificate, null); ProtectProtection = functionData.TryGetPropertyValue(PropertyNames.ProtectProtection, AuthenticationType.None); ProtectCertificateSource = functionData.TryGetPropertyValue(PropertyNames.ProtectCertificateSource, CertificateSource.File); ProtectCertificate = functionData.TryGetPropertyValue <StoredCertificate>(PropertyNames.ProtectCertificate, null); ProtectAddDocumentRestrictions = functionData.TryGetPropertyValue(PropertyNames.ProtectAddDocumentRestrictions, false); ProtectAllowPrinting = functionData.TryGetPropertyValue(PropertyNames.ProtectAllowPrinting, Printing.None); ProtectAllowChanges = functionData.TryGetPropertyValue(PropertyNames.ProtectAllowChanges, Changes.None); ProtectAllowCopying = functionData.TryGetPropertyValue(PropertyNames.ProtectAllowCopying, false); ProtectAllowScreenReaders = functionData.TryGetPropertyValue(PropertyNames.ProtectAllowScreenReaders, false); ProtectEncryption = functionData.TryGetPropertyValue(PropertyNames.ProtectEncryption, Encryption.AES128); ProtectDontEncryptMetadata = functionData.TryGetPropertyValue(PropertyNames.ProtectDontEncryptMetadata, false); InputFilePathParameterName = functionBuilder.GetParamName(PropertyNames.InputFilePath); InputPasswordParameterName = functionBuilder.GetParamName(PropertyNames.InputPassword); InputCertificateFilePathParameterName = functionBuilder.GetParamName(PropertyNames.InputCertificateFilePath); InputCertificateFilePasswordParameterName = functionBuilder.GetParamName(PropertyNames.InputCertificateFilePassword); ProtectDocumentOpenPasswordParameterName = functionBuilder.GetParamName(PropertyNames.ProtectDocumentOpenPassword); ProtectPermissionsPasswordParameterName = functionBuilder.GetParamName(PropertyNames.ProtectPermissionsPassword); ProtectCertificateFilePathParameterName = functionBuilder.GetParamName(PropertyNames.ProtectCertificateFilePath); ProtectCertificateFilePasswordParameterName = functionBuilder.GetParamName(PropertyNames.ProtectCertificateFilePassword); OutputFilePathParameterName = functionBuilder.GetParamName(PropertyNames.OutputFilePath); ContextParameterName = functionBuilder.ContextParamName; }
public _Random( IFunctionData functionData ) : base(functionData) { // do nothing. }
public void Initialize(ISequenceFlowContainer parent) { ISequenceStep sequenceStep = parent as ISequenceStep; if (null != sequenceStep.SubSteps && sequenceStep.SubSteps.Count > 0) { this.SubStepParameters = new SequenceStepParameterCollection(); foreach (ISequenceStep subStep in sequenceStep.SubSteps) { SequenceStepParameter stepParameter = new SequenceStepParameter(); stepParameter.Initialize(subStep); this.SubStepParameters.Add(stepParameter); } } else { this.SubStepParameters = null; } IFunctionData functionData = sequenceStep.Function; if (functionData?.Parameters != null && functionData.Parameters.Count > 0) { this.Parameters = functionData.Parameters; } else { this.Parameters = null; } if (null != functionData) { this.Return = functionData.Return; this.Instance = functionData.Instance; } }
public Fmod( IFunctionData functionData ) : base(functionData) { // do nothing. }
public Epsilon( IFunctionData functionData ) : base(functionData) { // do nothing. }
public Asin( IFunctionData functionData ) : base(functionData) { // do nothing. }
public Srand( IFunctionData functionData ) : base(functionData) { // do nothing. }
public Cosh( IFunctionData functionData ) : base(functionData) { // do nothing. }
public Int( IFunctionData functionData ) : base(functionData) { // do nothing. }
public MethodInfo GetMethod(IFunctionData function) { BindingFlags bindingFlags = BindingFlags.Public | BindingFlags.Static; MethodInfo methodInfo; Type[] parameterTypes; ParameterModifier[] modifiers = null; Type classType = _typeDataMapping[ModuleUtils.GetTypeFullName(function.ClassType)]; parameterTypes = new Type[function.ParameterType.Count]; if (function.ParameterType.Count > 0) { modifiers = new ParameterModifier[] { new ParameterModifier(function.ParameterType.Count) }; for (int i = 0; i < parameterTypes.Length; i++) { parameterTypes[i] = _typeDataMapping[ModuleUtils.GetTypeFullName(function.ParameterType[i].Type)]; if (function.ParameterType[i].Modifier != ArgumentModifier.None && !parameterTypes[i].IsByRef) { modifiers[0][i] = true; parameterTypes[i] = parameterTypes[i].MakeByRefType(); } } } methodInfo = classType.GetMethod(function.MethodName, bindingFlags, null, parameterTypes, modifiers); return(methodInfo); }
private IFunctionData UpdateToVersion1(IFunctionData data) { IPropertyData filePathProperty = data.FindPropertyById(FileShared.FilePathPropertyName); object value; if (filePathProperty.Value is IExpression) { value = filePathProperty.Value; } else if (filePathProperty.Value is string) { value = (TextFileHandle)filePathProperty.Value.ToString(); } else { value = filePathProperty.Value; } return(data .ReplaceProperty(filePathProperty, new Property(FileShared.FilePathPropertyName, typeof(TextFileHandle), ValueUseOption.RuntimeRead, null) { Value = value }) .UpdateOutput(TypeReference.Create(typeof(string))) .UpdateVersion("1")); }
public _DateTime( IFunctionData functionData ) : base(functionData) { // do nothing. }
public void Setup() { function = CreationUtilities.CreateFunction(); }