/// <summary>
 /// Sets the event to be displayed in the event tooltip.
 /// </summary>
 /// <param name="tooltipEvent">The event to display in the tooltip.</param>
 public void SetEvent(Event tooltipEvent)
 {
     this.currentEvent = tooltipEvent;
 }
Exemplo n.º 2
0
        /// <summary>
        /// Determines whether this instance of the module can display the given event (based on the Categories setting).
        /// </summary>
        /// <param name="event">The event to check.</param>
        /// <returns>
        /// <c>true</c> if this instance can show the event; otherwise, <c>false</c>.
        /// </returns>
        protected bool CanShowEvent(Event @event)
        {
            if (@event == null)
            {
                throw new ArgumentNullException("event");
            }

            return !this.CategoryIds.Any() || this.CategoryIds.Contains(@event.CategoryId);
        }
        /// <summary>
        /// Sets up the <see cref="EventToolTip"/> control and displays it
        /// </summary>
        /// <param name="event">The event being displayed</param>
        /// <param name="occurrenceDate">The occurrence date of the event, or <c>null</c> if it's not a recurring event.</param>
        /// <param name="panel">The panel in which the tool-tip is displayed.</param>
        private void ShowToolTip(Event @event, DateTime? occurrenceDate, UpdatePanel panel)
        {
            if (!this.CanShowEvent(@event))
            {
                return;
            }

            Debug.Assert(occurrenceDate.HasValue == @event.IsRecurring, "Recurring events need occurrence dates");
            if (occurrenceDate != null)
            {
                @event = @event.CreateOccurrence(DateTime.SpecifyKind(occurrenceDate.Value, DateTimeKind.Unspecified));
            }

            var toolTip = (EventToolTip)(panel.ContentTemplateContainer.FindControl("EventToolTip") ?? this.LoadControl("EventToolTip.ascx"));

            toolTip.ID = "EventToolTip";
            toolTip.ModuleConfiguration = this.ModuleConfiguration;
            toolTip.SetEvent(@event);
            toolTip.ShowEvent();

            if (!panel.ContentTemplateContainer.Controls.Contains(toolTip))
            {
                panel.ContentTemplateContainer.Controls.Add(toolTip);
            }
        }
        /// <summary>
        /// Processes the tokens that are common between the listing and details views
        /// </summary>
        /// <param name="container">The container into which created controls should be added</param>
        /// <param name="tag">The tag to process</param>
        /// <param name="currentEvent">The current event.</param>
        /// <param name="resourceFile">The resource file to use to find get localized text.</param>
        /// <returns>
        /// Whether to process the tag's ChildTags collection
        /// </returns>
        protected bool ProcessCommonTag(Control container, Tag tag, Event currentEvent, string resourceFile)
        {
            if (container == null)
            {
                throw new ArgumentNullException("container");
            }

            if (tag == null)
            {
                throw new ArgumentNullException("tag");
            }

            if (currentEvent != null && currentEvent != this.lastEventProcessed)
            {
                this.isAlternatingEvent = !this.isAlternatingEvent;
                this.lastEventProcessed = currentEvent;
            }

            if (tag.TagType == TagType.Open)
            {
                TokenProcessor process;
                if (TokenImplementations.TryGetValue(tag.LocalName.ToUpperInvariant(), out process))
                {
                    return process(this, container, tag, currentEvent, resourceFile);
                }

                return false;
            }
            
            if (tag.TagType == TagType.Close && tag.LocalName.Equals("EVENTWRAPPER", StringComparison.OrdinalIgnoreCase))
            {
                container.Controls.Add(new LiteralControl("</div>"));
            }

            return false;
        }
Exemplo n.º 5
0
 /// <summary>
 /// Shows the <see cref="EventFullView"/>.
 /// </summary>
 /// <param name="eventBeingRespondedTo">The event being responded to.</param>
 private void ShowEventFullView(Event eventBeingRespondedTo)
 {
     this.ResponseMultiview.SetActiveView(this.EventFullView);
     if (string.IsNullOrEmpty(eventBeingRespondedTo.CapacityMetMessage))
     {
         this.EventFullMessage.TextResourceKey = "EventFullMessage.Text";
     }
     else
     {
         this.EventFullMessage.Text = eventBeingRespondedTo.CapacityMetMessage;
     }
 }