示例#1
0
        internal static string SlotToUserString(ViewCellSlot slot, bool isFromCside)
        {
            MemberProjectedSlot actualSlot = isFromCside ? slot.CSlot : slot.SSlot;
            string result = StringUtil.FormatInvariant("{0}", actualSlot);

            return(result);
        }
示例#2
0
        protected override bool IsEqualTo(ProjectedSlot right)
        {
            ViewCellSlot rightSlot = right as ViewCellSlot;

            if (rightSlot == null)
            {
                return(false);
            }

            return(m_slotNum == rightSlot.m_slotNum &&
                   MemberProjectedSlot.EqualityComparer.Equals(m_cSlot, rightSlot.m_cSlot) &&
                   MemberProjectedSlot.EqualityComparer.Equals(m_sSlot, rightSlot.m_sSlot));
        }
示例#3
0
        // effects: Propagates this constraint from the basic cell relation
        // to the corresponding view cell relation and returns the new constraint
        // If all the key slots are not being projected, returns null
        internal ViewKeyConstraint Propagate()
        {
            ViewCellRelation viewCellRelation = CellRelation.ViewCellRelation;
            // If all slots appear in the projection, propagate key constraint
            List <ViewCellSlot> viewSlots = new List <ViewCellSlot>();

            foreach (MemberProjectedSlot keySlot in KeySlots)
            {
                ViewCellSlot viewCellSlot = viewCellRelation.LookupViewSlot(keySlot);
                if (viewCellSlot == null)
                {
                    // Slot is missing -- no key constraint on the view relation
                    return(null);
                }
                viewSlots.Add(viewCellSlot);
            }

            // Create a key on view relation
            ViewKeyConstraint viewKeyConstraint = new ViewKeyConstraint(viewCellRelation, viewSlots);

            return(viewKeyConstraint);
        }
 internal static string SlotToUserString(ViewCellSlot slot, bool isFromCside)
 {
     MemberProjectedSlot actualSlot = isFromCside ? slot.CSlot : slot.SSlot;
     string result = StringUtil.FormatInvariant("{0}", actualSlot);
     return result;
 }
示例#5
0
        private void GenerateCellRelations(int cellNumber)
        {
            // Generate the view cell relation
            List<ViewCellSlot> projectedSlots = new List<ViewCellSlot>();
            // construct a ViewCellSlot for each slot
            Debug.Assert(CQuery.NumProjectedSlots == SQuery.NumProjectedSlots,
                         "Cell queries in cell have a different number of slots");
            for (int i = 0; i < CQuery.NumProjectedSlots; i++)
            {
                ProjectedSlot cSlot = CQuery.ProjectedSlotAt(i);
                ProjectedSlot sSlot = SQuery.ProjectedSlotAt(i);
                Debug.Assert(cSlot != null, "Has cell query been normalized?");
                Debug.Assert(sSlot != null, "Has cell query been normalized?");

                // These slots better be MemberProjectedSlots. We do not have constants etc at this point.
                Debug.Assert(cSlot is MemberProjectedSlot, "cSlot is expected to be MemberProjectedSlot");
                Debug.Assert(sSlot is MemberProjectedSlot, "sSlot is expected to be MemberProjectedSlot");

                MemberProjectedSlot cJoinSlot = (MemberProjectedSlot)cSlot;
                MemberProjectedSlot sJoinSlot = (MemberProjectedSlot)sSlot;

                ViewCellSlot slot = new ViewCellSlot(i, cJoinSlot, sJoinSlot);
                projectedSlots.Add(slot);
            }
            m_viewCellRelation = new ViewCellRelation(this, projectedSlots, cellNumber);
        }