예제 #1
0
		public void Build()
		{
			InitClientID.Value = this.ClientID;
			InitEnableEffects.Value = ((Master.DsiPage)Page).Url["Animate"].Exists ? "true" : "false";

			int musicTypeK = Prefs.Current["MusicPref"].IsNull ? 1 : (int)Prefs.Current["MusicPref"];

			EventPageStub data = new EventPageStub(ObjectType, ObjectK, TabType.Future, musicTypeK, 0, 0, null);

			EventSet es = Event.GetEventSetFromEventBoxKey(EventPageDetails.GetKeyStatic(data));

			EventPageDetails firstPage = new EventPageDetails(
				this.ClientID,
				es,
				data,
				false);

			
			firstPage.Selected = true;
			firstPage.Events[0].Selected = true;

			EventIconsHolder.Controls.Clear();
			EventIconsHolder.Controls.Add(new LiteralControl(firstPage.Html.ToHtml()));

			EventInfoHolderOuter.Controls.Clear();
			EventInfoHolderOuter.Controls.Add(new LiteralControl(firstPage.Events[0].Html.ToHtmlInfo()));

			InitFirstPage.Value = firstPage.Serialize();

		}
예제 #2
0
		public void GetEventPageSuccessCallback(EventPageStub page, object userContext, string methodName)
		{
			if (page != null)
			{
				if (GotEventPage != null)
					GotEventPage(page, null);
			}
		}
		public static string GetKeyStatic(EventPageStub data)
		{
			return
				((int)data.parentObjectType).ToString() + "_" +
				data.parentObjectK.ToString() + "_" +
				((int)data.tabType).ToString() + "_" +
				data.musicTypeK.ToString() + "_" +
				data.pageIndex.ToString();
		}
		//#region GetKeyStatic
		//public static string GetKeyStatic(
		//    ObjectType parentObjectType,
		//    int parentObjectK,
		//    DateType dateType,
		//    int musicTypeK,
		//    int pageIndex)
		//{
		//    return
		//        ((int)parentObjectType).ToString() + "_" +
		//        parentObjectK.ToString() + "_" +
		//        ((int)dateType).ToString() + "_" +
		//        musicTypeK.ToString() + "_" +
		//        pageIndex.ToString();
		//}
		//#endregion

		#region public EventPageDetails
		public EventPageDetails(
#if SCRIPTSHARP
Controller controller,
#else
			string parentClientID,
			Bobs.EventSet es,
#endif
			EventPageStub data,
			bool isLoading
			)
		{
			Data = data;
			IsLoading = isLoading;

#if SCRIPTSHARP
			Controller = controller;
			ParentClientID = Controller.ClientID;
#else
			ParentClientID = parentClientID;
#endif
			ClientID = ParentClientID + "_" + GetKey();
			
			Events = new EventDetails[8];
#if SCRIPTSHARP
#else
			Data.events = new EventStub[8];
#endif
			bool gotEvent = false;
			bool gotNullEvent = false;
			for (int i = 0; i < 8; i++)
			{
#if SCRIPTSHARP
				Events[i] = new EventDetails(i, this, Data.events != null && Data.events.Length > i && Data.events[i] != null ? Data.events[i] : null, isLoading);
				if (Data.events == null || Data.events.Length <= i || Data.events[i] == null)
					gotNullEvent = true;
				else
					gotEvent = true;
#else
				Events[i] = new EventDetails(i, this, es != null && es.Count > i && es[i] != null ? es[i] : null, isLoading);
				Data.events[i] = Events[i].Data;
				if (es == null || es.Count <= i || es[i] == null)
					gotNullEvent = true;
				else
					gotEvent = true;
#endif
			}
			HasIncompleteEventData = gotNullEvent;
			IsEmpty = !gotEvent;

			Html = new EventPageHtml(this);
		}
예제 #5
0
		public void gotEventPage(object o, EventArgs e)
		{
			if (o != null)
			{
				EventPageStub stub = (EventPageStub)o;
				{
					EventPageDetails newPage = new EventPageDetails(this, stub, false);

					updatePage(newPage);
				}

				if (stub.requestedPageIndex != stub.pageIndex)
				{
					//find requested page and mark it as empty...
					EventPageStub requestedStub = new EventPageStub(
						stub.parentObjectType,
						stub.parentObjectK,
						stub.tabType,
						stub.musicTypeK,
						stub.requestedPageIndex,
						stub.requestedPageIndex,
						null);
					EventPageDetails requestedPage = new EventPageDetails(this, requestedStub, false);

					updatePage(requestedPage);

				}

				


			}
		}