protected override void OnGetSourceValuePointers(UInt32 taskId, EnumWebValueSources scope, List <ISourceValuePointer> list) { ISourceValuePointer p = this.ActionOwner as ISourceValuePointer; if (p != null) { if (scope == EnumWebValueSources.HasClientValues) { if (p.IsWebClientValue()) { list.Add(p); } } else if (scope == EnumWebValueSources.HasServerValues) { if (p.IsWebServerValue()) { list.Add(p); } } else { list.Add(p); } } }
public bool IsWebServerValue() { if (_runAt == EnumWebRunAt.Server) { return(true); } if (_value != null) { return(_value.IsWebServerValue()); } return(false); }
public IList <ISourceValuePointer> GetUploadProperties(UInt32 taskId) { if (_mathExp != null && _mathExp.MathExpression != null && _mathExp.MathExpression.OutputVariable != null) { ISourceValuePointer v = _mathExp.MathExpression.OutputVariable as ISourceValuePointer; if (v != null) { if (v.IsWebServerValue() && !v.IsWebClientValue()) { return(GetClientProperties(taskId)); } } } return(null); }
public IList <ISourceValuePointer> GetServerVariables(ClassPointer root) { Dictionary <UInt32, IAction> actions = root.GetActions(); SourceValuePointerList svs = new SourceValuePointerList(); foreach (TaskID tid in Sect0) //check client action return values { HandlerMethodID hmid = tid as HandlerMethodID; if (hmid != null) { WebClientEventHandlerMethod wceh = hmid.HandlerMethod as WebClientEventHandlerMethod; if (wceh != null) { hmid.HandlerMethod.SetActions(actions); List <IAction> acts = hmid.HandlerMethod.GetActions(); foreach (IAction act in acts) { if (act.ReturnReceiver != null) { ISourceValuePointer sv = act.ReturnReceiver as ISourceValuePointer; if (sv != null && sv.IsWebServerValue() && !sv.IsWebClientValue()) { svs.AddUnique(sv); } } } } } else { IAction a = tid.GetPublicAction(root); if (a != null) { if (a.ReturnReceiver != null) { ISourceValuePointer sv = a.ReturnReceiver as ISourceValuePointer; if (sv != null && sv.IsWebServerValue() && !sv.IsWebClientValue()) { svs.AddUnique(sv); } } } } } foreach (TaskID tid in Sect1) //check server action parameters { HandlerMethodID hmid = tid as HandlerMethodID; if (hmid != null) { WebClientEventHandlerMethod wceh = hmid.HandlerMethod as WebClientEventHandlerMethod; if (wceh != null) { hmid.HandlerMethod.SetActions(actions); hmid.HandlerMethod.CollectSourceValues(tid.TaskId); // svs.AddUnique(hmid.HandlerMethod.DownloadProperties); // List <MethodClass> ml = new List <MethodClass>(); hmid.HandlerMethod.GetCustomMethods(ml); foreach (MethodClass m in ml) { m.CollectSourceValues(tid.TaskId); svs.AddUnique(m.DownloadProperties); } } } else { IAction a = tid.GetPublicAction(root); if (a != null && a.ActionMethod != null && a.ActionMethod.Owner != null) { IFormSubmitter fs = a.ActionMethod.Owner.ObjectInstance as IFormSubmitter; if (fs != null && fs.IsSubmissionMethod(a.ActionMethod.MethodName)) { continue; } svs.AddUnique(a.GetServerProperties(tid.TaskId)); ISourceValuePointer p = a.ReturnReceiver as ISourceValuePointer; if (p != null) { if (p.IsWebServerValue()) { svs.AddUnique(p); } } } } } //collect download (server) variables from client actions foreach (TaskID tid in Sect2) { HandlerMethodID hmid = tid as HandlerMethodID; if (hmid != null) { WebClientEventHandlerMethod wceh = hmid.HandlerMethod as WebClientEventHandlerMethod; if (wceh != null) { hmid.HandlerMethod.SetActions(actions); hmid.HandlerMethod.CollectSourceValues(tid.TaskId); // svs.AddUnique(hmid.HandlerMethod.DownloadProperties); // List <MethodClass> ml = new List <MethodClass>(); hmid.HandlerMethod.GetCustomMethods(ml); foreach (MethodClass m in ml) { m.CollectSourceValues(tid.TaskId); svs.AddUnique(m.DownloadProperties); } } } else { IAction a = tid.GetPublicAction(root); if (a != null) { svs.AddUnique(a.GetServerProperties(tid.TaskId)); } } } return(svs); }