示例#1
0
        protected override IBranch GetExpandedBranch(int index)
        {
            if (index < ElementCount)
            {
                var mset = GetElement(index) as MappingStorageEntityType;
                if (mset != null)
                {
                    var branchList = new ArrayList(2);
                    branchList.Add(new ConditionBranch(mset, GetColumns()));
                    branchList.Add(new ColumnMappingsBranch(mset, GetColumns()));
                    var aggBranch = new AggregateBranch(branchList, 0);
                    if (_expandedBranches.Count <= index)
                    {
                        Debug.Assert
                            (
                                _expandedBranches.Count == index,
                                "_expandedBranches.Count (" + _expandedBranches.Count + ") should equal index (" + index + ")");
                        _expandedBranches.Add(aggBranch);
                    }
                    else
                    {
                        _expandedBranches[index] = aggBranch;
                    }
                    return aggBranch;
                }
            }

            return null;
        }
        protected override IBranch GetExpandedBranch(int index)
        {
            if (index < ElementCount)
            {
                var mfm = GetElement(index) as MappingModificationFunctionMapping;
                if (mfm != null)
                {
                    if (mfm.ModificationFunctionType == ModificationFunctionType.Delete)
                    {
                        _expandedBranches[index] = new ParametersBranch(mfm, GetColumns());
                    }
                    else
                    {
                        var branchList = new ArrayList(2);
                        branchList.Add(new ParametersBranch(mfm, GetColumns()));
                        branchList.Add(new ResultBindingsBranch(mfm, GetColumns()));
                        _expandedBranches[index] = new AggregateBranch(branchList, 0);
                    }
                    return _expandedBranches[index];
                }
            }

            return null;
        }