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

            return(result);
        }
        protected override bool IsEqualTo(ProjectedSlot right)
        {
            ViewCellSlot viewCellSlot = right as ViewCellSlot;

            if (viewCellSlot == null || this.m_slotNum != viewCellSlot.m_slotNum || !ProjectedSlot.EqualityComparer.Equals((ProjectedSlot)this.m_cSlot, (ProjectedSlot)viewCellSlot.m_cSlot))
            {
                return(false);
            }
            return(ProjectedSlot.EqualityComparer.Equals((ProjectedSlot)this.m_sSlot, (ProjectedSlot)viewCellSlot.m_sSlot));
        }
        internal static string SlotsToUserString(IEnumerable <ViewCellSlot> slots, bool isFromCside)
        {
            StringBuilder stringBuilder = new StringBuilder();
            bool          flag          = true;

            foreach (ViewCellSlot slot in slots)
            {
                if (!flag)
                {
                    stringBuilder.Append(", ");
                }
                stringBuilder.Append(ViewCellSlot.SlotToUserString(slot, isFromCside));
                flag = false;
            }
            return(stringBuilder.ToString());
        }
        internal ViewKeyConstraint Propagate()
        {
            ViewCellRelation    viewCellRelation = this.CellRelation.ViewCellRelation;
            List <ViewCellSlot> viewCellSlotList = new List <ViewCellSlot>();

            foreach (MemberProjectedSlot keySlot in this.KeySlots)
            {
                ViewCellSlot viewCellSlot = viewCellRelation.LookupViewSlot(keySlot);
                if (viewCellSlot == null)
                {
                    return((ViewKeyConstraint)null);
                }
                viewCellSlotList.Add(viewCellSlot);
            }
            return(new ViewKeyConstraint(viewCellRelation, (IEnumerable <ViewCellSlot>)viewCellSlotList));
        }
 internal static string SlotToUserString(ViewCellSlot slot, bool isFromCside)
 {
     return(StringUtil.FormatInvariant("{0}", (object)(isFromCside ? slot.CSlot : slot.SSlot)));
 }
Example #6
0
        private void GenerateCellRelations(int cellNumber)
        {
            // Generate the view cell relation
            var 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 (var i = 0; i < CQuery.NumProjectedSlots; i++)
            {
                var cSlot = CQuery.ProjectedSlotAt(i);
                var 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");

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

                var slot = new ViewCellSlot(i, cJoinSlot, sJoinSlot);
                projectedSlots.Add(slot);
            }
            m_viewCellRelation = new ViewCellRelation(this, projectedSlots, cellNumber);
        }
 internal static string SlotToUserString(ViewCellSlot slot, bool isFromCside)
 {
     var actualSlot = isFromCside ? slot.CSlot : slot.SSlot;
     var result = StringUtil.FormatInvariant("{0}", actualSlot);
     return result;
 }