public void CheckWebActionType()
        {
            loadEventAction();
            _webActType = EnumWebActionType.Unknown;
            EnumWebValueSources sources = EnumWebValueSources.Unknown;

            if (_condition != null)
            {
                IList <ISourceValuePointer> conditionSource = _condition.MathExp.GetValueSources();
                if (conditionSource != null)
                {
                    sources = WebBuilderUtil.GetActionTypeFromSources(conditionSource);
                }
            }
            EnumWebRunAt sr = ScopeRunAt;

            if (sr == EnumWebRunAt.Client)
            {
                if (sources == EnumWebValueSources.HasBothValues || sources == EnumWebValueSources.HasServerValues)
                {
                    _webActType = EnumWebActionType.Download;
                }
                else
                {
                    _webActType = EnumWebActionType.Client;
                }
            }
            else if (sr == EnumWebRunAt.Server)
            {
                if (sources == EnumWebValueSources.HasBothValues || sources == EnumWebValueSources.HasClientValues)
                {
                    _webActType = EnumWebActionType.Upload;
                }
                else
                {
                    _webActType = EnumWebActionType.Server;
                }
            }
        }
Esempio n. 2
0
        public void CheckWebActionType()
        {
            _webActType = EnumWebActionType.Unknown;
            EnumWebValueSources         sources         = EnumWebValueSources.Unknown;
            IList <ISourceValuePointer> conditionSource = null;

            if (_condition != null)
            {
                conditionSource = _condition.MathExp.GetValueSources();
                if (conditionSource != null)
                {
                    sources = WebBuilderUtil.GetActionTypeFromSources(conditionSource);
                }
            }
            bool        executerIsClient = false;
            MethodClass mc = ScopeMethod as MethodClass;

            if (mc != null)
            {
                if (mc.WebUsage == EnumMethodWebUsage.Client)
                {
                    executerIsClient = true;
                }
                if (executerIsClient)
                {
                    if (sources == EnumWebValueSources.HasBothValues || sources == EnumWebValueSources.HasServerValues)
                    {
                        _webActType = EnumWebActionType.Download;
                    }
                }
                else
                {
                    if (sources == EnumWebValueSources.HasBothValues || sources == EnumWebValueSources.HasClientValues)
                    {
                        _webActType = EnumWebActionType.Upload;
                    }
                }
                if (_webActType == EnumWebActionType.Unknown)
                {
                    if (_val != null)
                    {
                        List <ISourceValuePointer> list = new List <ISourceValuePointer>();
                        _val.GetValueSources(list);
                        sources = WebBuilderUtil.GetActionTypeFromSources(list, sources);
                        if (executerIsClient)
                        {
                            if (sources == EnumWebValueSources.HasBothValues || sources == EnumWebValueSources.HasServerValues)
                            {
                                _webActType = EnumWebActionType.Download;
                            }
                        }
                        else
                        {
                            if (sources == EnumWebValueSources.HasBothValues || sources == EnumWebValueSources.HasClientValues)
                            {
                                _webActType = EnumWebActionType.Upload;
                            }
                        }
                    }
                }
            }
        }
Esempio n. 3
0
        public void CheckWebActionType()
        {
            _webActType = EnumWebActionType.Unknown;
            EnumWebValueSources         sources         = EnumWebValueSources.Unknown;
            IList <ISourceValuePointer> conditionSource = null;

            if (_condition != null)
            {
                conditionSource = _condition.MathExp.GetValueSources();
                if (conditionSource != null)
                {
                    sources = WebBuilderUtil.GetActionTypeFromSources(conditionSource);
                }
            }
            if (_mathExp != null)
            {
                if (_mathExp.MathExpression != null)
                {
                    IList <ISourceValuePointer> lst = _mathExp.MathExpression.GetValueSources();
                    if (lst != null && lst.Count > 0)
                    {
                        sources = WebBuilderUtil.GetActionTypeFromSources(lst, sources);
                    }
                }
            }
            bool        executerIsClient = false;
            MethodClass mc = ScopeMethod as MethodClass;

            if (mc != null)
            {
                if (mc.WebUsage == EnumMethodWebUsage.Client)
                {
                    executerIsClient = true;
                }
            }
            else
            {
                if (_mathExp != null && _mathExp.Owner != null)
                {
                    if (DesignUtil.IsWebClientObject(_mathExp.Owner))
                    {
                        executerIsClient = true;
                    }
                }
                else
                {
                    if (_reader != null)
                    {
                        if (DesignUtil.IsWebClientObject(_reader.ObjectList.RootPointer as IClass))
                        {
                            executerIsClient = true;
                        }
                    }
                }
            }
            switch (sources)
            {
            case EnumWebValueSources.HasBothValues:
                if (executerIsClient)
                {
                    _webActType = EnumWebActionType.Download;
                }
                else
                {
                    _webActType = EnumWebActionType.Upload;
                }
                break;

            case EnumWebValueSources.HasClientValues:
                _webActType = EnumWebActionType.Client;
                break;

            case EnumWebValueSources.HasServerValues:
                _webActType = EnumWebActionType.Server;
                break;
            }
        }