コード例 #1
0
        private IList <ISourceValuePointer> getProperties(UInt32 taskId, bool client)
        {
            List <ISourceValuePointer> list = new List <ISourceValuePointer>();

            if (_condition != null)
            {
                IList <ISourceValuePointer> l1 = _condition.GetValueSources();
                if (l1 != null && l1.Count > 0)
                {
                    foreach (ISourceValuePointer p in l1)
                    {
                        if (taskId != 0)
                        {
                            p.SetTaskId(taskId);
                        }
                        if (p.IsWebClientValue())
                        {
                            if (client)
                            {
                                list.Add(p);
                            }
                        }
                        else
                        {
                            if (!client)
                            {
                                list.Add(p);
                            }
                        }
                    }
                }
            }
            if (_val != null)
            {
                List <ISourceValuePointer> l2 = new List <ISourceValuePointer>();
                _val.GetValueSources(l2);
                if (l2.Count > 0)
                {
                    foreach (ISourceValuePointer p in l2)
                    {
                        if (taskId != 0)
                        {
                            p.SetTaskId(taskId);
                        }
                        bool found = false;
                        foreach (ISourceValuePointer p2 in list)
                        {
                            if (p2.IsSameProperty(p))
                            {
                                found = true;
                                break;
                            }
                        }
                        if (!found)
                        {
                            if (p.IsWebClientValue())
                            {
                                if (client)
                                {
                                    list.Add(p);
                                }
                            }
                            else
                            {
                                if (!client)
                                {
                                    list.Add(p);
                                }
                            }
                        }
                    }
                }
            }
            return(list);
        }
コード例 #2
0
        private IList <ISourceValuePointer> getSourceValuePointers(UInt32 taskId, EnumWebValueSources scope)
        {
            List <ISourceValuePointer> list = new List <ISourceValuePointer>();

            if (_condition != null)
            {
                IList <ISourceValuePointer> l1 = _condition.GetValueSources();
                if (l1 != null && l1.Count > 0)
                {
                    foreach (ISourceValuePointer p in l1)
                    {
                        if (taskId != 0)
                        {
                            p.SetTaskId(taskId);
                        }

                        if (scope == EnumWebValueSources.HasClientValues)
                        {
                            if (p.IsWebClientValue())
                            {
                                list.Add(p);
                            }
                        }
                        else if (scope == EnumWebValueSources.HasServerValues)
                        {
                            if (!p.IsWebClientValue())
                            {
                                list.Add(p);
                            }
                        }
                        else
                        {
                            list.Add(p);
                        }
                    }
                }
            }
            ParameterValueCollection pvs = ParameterValues;

            if (pvs != null && pvs.Count > 0)
            {
                foreach (ParameterValue pv in pvs)
                {
                    IList <ISourceValuePointer> l = pv.GetValueSources();
                    if (l != null && l.Count > 0)
                    {
                        foreach (ISourceValuePointer p in l)
                        {
                            if (scope == EnumWebValueSources.HasClientValues)
                            {
                                if (p.IsWebClientValue())
                                {
                                    list.Add(p);
                                }
                            }
                            else if (scope == EnumWebValueSources.HasServerValues)
                            {
                                if (!p.IsWebClientValue())
                                {
                                    list.Add(p);
                                }
                            }
                            else
                            {
                                list.Add(p);
                            }
                        }
                    }
                }
            }
            OnGetSourceValuePointers(taskId, scope, list);
            return(list);
        }