You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(9) |
Jun
(7) |
Jul
|
Aug
(2) |
Sep
(1) |
Oct
|
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
|
Feb
(4) |
Mar
(13) |
Apr
(10) |
May
|
Jun
|
Jul
(2) |
Aug
|
Sep
(3) |
Oct
(1) |
Nov
(1) |
Dec
|
2008 |
Jan
(2) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <mas...@us...> - 2008-01-07 09:18:25
|
Revision: 55 http://mp-webinterface.svn.sourceforge.net/mp-webinterface/?rev=55&view=rev Author: maschine Date: 2008-01-07 01:18:23 -0800 (Mon, 07 Jan 2008) Log Message: ----------- Fixed page titles; templates for new pages; search works (basic) for date searches; updated dlls. Modified Paths: -------------- trunk/Version2/Web App/MPW/Bin/DirectShowLib.dll trunk/Version2/Web App/MPW/Bin/TVDatabase.dll trunk/Version2/Web App/MPW/Bin/TVLibrary.dll trunk/Version2/Web App/MPW/Bin/TvBusinessLayer.dll trunk/Version2/Web App/MPW/Bin/TvControl.dll trunk/Version2/Web App/MPW/Bin/TvLibrary.Interfaces.dll trunk/Version2/Web App/MPW/Default.aspx trunk/Version2/Web App/MPW/Default.aspx.cs trunk/Version2/Web App/MPW/MPW.master trunk/Version2/Web App/MPW/NowNext.aspx trunk/Version2/Web App/MPW/NowNext.aspx.cs trunk/Version2/Web App/MPW/Schedules.aspx trunk/Version2/Web App/MPW/Schedules.aspx.cs trunk/Version2/Web App/MPW/Search.aspx trunk/Version2/Web App/MPW/Search.aspx.cs trunk/Version2/Web App/MPW/css/mpw_style.css Added Paths: ----------- trunk/Version2/Web App/MPW/LiveTV.aspx trunk/Version2/Web App/MPW/LiveTV.aspx.cs trunk/Version2/Web App/MPW/Recordings.aspx trunk/Version2/Web App/MPW/Recordings.aspx.cs Modified: trunk/Version2/Web App/MPW/Bin/DirectShowLib.dll =================================================================== (Binary files differ) Modified: trunk/Version2/Web App/MPW/Bin/TVDatabase.dll =================================================================== (Binary files differ) Modified: trunk/Version2/Web App/MPW/Bin/TVLibrary.dll =================================================================== (Binary files differ) Modified: trunk/Version2/Web App/MPW/Bin/TvBusinessLayer.dll =================================================================== (Binary files differ) Modified: trunk/Version2/Web App/MPW/Bin/TvControl.dll =================================================================== (Binary files differ) Modified: trunk/Version2/Web App/MPW/Bin/TvLibrary.Interfaces.dll =================================================================== (Binary files differ) Modified: trunk/Version2/Web App/MPW/Default.aspx =================================================================== --- trunk/Version2/Web App/MPW/Default.aspx 2008-01-04 14:35:55 UTC (rev 54) +++ trunk/Version2/Web App/MPW/Default.aspx 2008-01-07 09:18:23 UTC (rev 55) @@ -1,5 +1,5 @@ <%@ Page Language="C#" MasterPageFile="~/MPW.master" AutoEventWireup="true" CodeFile="Default.aspx.cs" - Inherits="_Default" Title="Untitled Page" %> + Inherits="Default" Title="Guide" %> <asp:Content ID="Content1" ContentPlaceHolderID="MPWContent" runat="Server"> <asp:UpdatePanel ID="GuideUpdatePanel" runat="server" UpdateMode="Conditional"> Modified: trunk/Version2/Web App/MPW/Default.aspx.cs =================================================================== --- trunk/Version2/Web App/MPW/Default.aspx.cs 2008-01-04 14:35:55 UTC (rev 54) +++ trunk/Version2/Web App/MPW/Default.aspx.cs 2008-01-07 09:18:23 UTC (rev 55) @@ -12,7 +12,7 @@ using MPW; using TvDatabase; -public partial class _Default : System.Web.UI.Page +public partial class Default : System.Web.UI.Page { DateTime guideStart; DateTime guideEnd; @@ -27,6 +27,10 @@ protected void Page_Load(object sender, EventArgs e) { + //Set localized page title + MPWMaster m = (MPWMaster)Page.Master; + m.Sectiontitle = Resources.Resource.Guide; + //Establish the connection to the TV Server and the DB. MPWUtils.SetupConnection(); Added: trunk/Version2/Web App/MPW/LiveTV.aspx =================================================================== --- trunk/Version2/Web App/MPW/LiveTV.aspx (rev 0) +++ trunk/Version2/Web App/MPW/LiveTV.aspx 2008-01-07 09:18:23 UTC (rev 55) @@ -0,0 +1,15 @@ +<%@ Page Language="C#" MasterPageFile="~/MPW.master" AutoEventWireup="true" CodeFile="LiveTV.aspx.cs" + Inherits="LiveTV" Title="Live TV" %> + +<asp:Content ID="Content_search" ContentPlaceHolderID="MPWContent" runat="Server"> + <h1> + <asp:Label ID="label_searchresults" runat="server" Text="<%$ Resources:Resource, LiveTV %>"></asp:Label></h1> + <asp:UpdatePanel ID="GuideUpdatePanel" runat="server" UpdateMode="Conditional"> + <contenttemplate> + <asp:Table ID="Guide" runat="server" CssClass="guidetable"> + </asp:Table> + </contenttemplate> + <triggers> + </triggers> + </asp:UpdatePanel> +</asp:Content> Added: trunk/Version2/Web App/MPW/LiveTV.aspx.cs =================================================================== --- trunk/Version2/Web App/MPW/LiveTV.aspx.cs (rev 0) +++ trunk/Version2/Web App/MPW/LiveTV.aspx.cs 2008-01-07 09:18:23 UTC (rev 55) @@ -0,0 +1,25 @@ +using System; +using System.Data; +using System.Configuration; +using System.Collections; +using System.Web; +using System.Web.Security; +using System.Web.UI; +using System.Web.UI.WebControls; +using System.Web.UI.WebControls.WebParts; +using System.Web.UI.HtmlControls; + +using MPW; +using TvDatabase; + +public partial class LiveTV : System.Web.UI.Page +{ + + protected void Page_Load(object sender, EventArgs e) + { + //Set localized page title + MPWMaster m = (MPWMaster)Page.Master; + m.Sectiontitle = Resources.Resource.LiveTV; + } + +} Modified: trunk/Version2/Web App/MPW/MPW.master =================================================================== --- trunk/Version2/Web App/MPW/MPW.master 2008-01-04 14:35:55 UTC (rev 54) +++ trunk/Version2/Web App/MPW/MPW.master 2008-01-07 09:18:23 UTC (rev 55) @@ -62,14 +62,14 @@ </td> <td id="nav_rec" class="navcell"> <asp:HyperLink ID="LinkRecordings" runat="server" Text="<%$ Resources:Resource, Recordings %>" - NavigateUrl="~/Default.aspx" CssClass="navilink"></asp:HyperLink> + NavigateUrl="~/Recordings.aspx" CssClass="navilink"></asp:HyperLink> </td> <td id="bar5"> | </td> <td id="nav_live" class="navcell"> <asp:HyperLink ID="LinkLiveTV" runat="server" Text="<%$ Resources:Resource, LiveTV %>" - NavigateUrl="~/Default.aspx" CssClass="navilink"></asp:HyperLink> + NavigateUrl="~/LiveTV.aspx" CssClass="navilink"></asp:HyperLink> </td> </tr> </table> Modified: trunk/Version2/Web App/MPW/NowNext.aspx =================================================================== --- trunk/Version2/Web App/MPW/NowNext.aspx 2008-01-04 14:35:55 UTC (rev 54) +++ trunk/Version2/Web App/MPW/NowNext.aspx 2008-01-07 09:18:23 UTC (rev 55) @@ -1,4 +1,4 @@ -<%@ Page Language="C#" MasterPageFile="~/MPW.master" AutoEventWireup="true" CodeFile="NowNext.aspx.cs" Inherits="Default2" Title="Untitled Page" %> +<%@ Page Language="C#" MasterPageFile="~/MPW.master" AutoEventWireup="true" CodeFile="NowNext.aspx.cs" Inherits="NowNext" Title="Untitled Page" %> <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %> Modified: trunk/Version2/Web App/MPW/NowNext.aspx.cs =================================================================== --- trunk/Version2/Web App/MPW/NowNext.aspx.cs 2008-01-04 14:35:55 UTC (rev 54) +++ trunk/Version2/Web App/MPW/NowNext.aspx.cs 2008-01-07 09:18:23 UTC (rev 55) @@ -13,11 +13,10 @@ using MPW; using System.Collections.Generic; -public partial class Default2 : System.Web.UI.Page +public partial class NowNext : System.Web.UI.Page { IList _schedules; IList groups; - IList channels; private int chosengroup = 0; @@ -43,13 +42,14 @@ protected void Page_Load(object sender, EventArgs e) { + //Set localized page title + MPWMaster m = (MPWMaster)Page.Master; + m.Sectiontitle = Resources.Resource.NowNext; + //Establish the connection to the TV Server and the DB. MPWUtils.SetupConnection(); if (!IsPostBack) { - MPWMaster m = (MPWMaster)Page.Master; - //Set language resources - m.Sectiontitle = Resources.Resource.NowNext; LabelChannelGroup.Text = Resources.Resource.ChannelGroup; groups = ChannelGroup.ListAll(); Added: trunk/Version2/Web App/MPW/Recordings.aspx =================================================================== --- trunk/Version2/Web App/MPW/Recordings.aspx (rev 0) +++ trunk/Version2/Web App/MPW/Recordings.aspx 2008-01-07 09:18:23 UTC (rev 55) @@ -0,0 +1,13 @@ +<%@ Page Language="C#" MasterPageFile="~/MPW.master" AutoEventWireup="true" CodeFile="Recordings.aspx.cs" + Inherits="Recordings" Title="Recordings" %> + +<asp:Content ID="Content_recordings" ContentPlaceHolderID="MPWContent" runat="Server"> + <h1> + <asp:Label ID="label_recordings" runat="server" Text="<%$ Resources:Resource, Recordings %>"></asp:Label></h1> + <asp:UpdatePanel ID="GuideUpdatePanel" runat="server" UpdateMode="Conditional"> + <ContentTemplate> + </ContentTemplate> + <Triggers> + </Triggers> + </asp:UpdatePanel> +</asp:Content> Added: trunk/Version2/Web App/MPW/Recordings.aspx.cs =================================================================== --- trunk/Version2/Web App/MPW/Recordings.aspx.cs (rev 0) +++ trunk/Version2/Web App/MPW/Recordings.aspx.cs 2008-01-07 09:18:23 UTC (rev 55) @@ -0,0 +1,24 @@ +using System; +using System.Data; +using System.Configuration; +using System.Collections; +using System.Web; +using System.Web.Security; +using System.Web.UI; +using System.Web.UI.WebControls; +using System.Web.UI.WebControls.WebParts; +using System.Web.UI.HtmlControls; + +using MPW; +using TvDatabase; + +public partial class Recordings : System.Web.UI.Page +{ + + protected void Page_Load(object sender, EventArgs e) + { + //Set localized page title + MPWMaster m = (MPWMaster)Page.Master; + m.Sectiontitle = Resources.Resource.Recordings; + } +} Modified: trunk/Version2/Web App/MPW/Schedules.aspx =================================================================== --- trunk/Version2/Web App/MPW/Schedules.aspx 2008-01-04 14:35:55 UTC (rev 54) +++ trunk/Version2/Web App/MPW/Schedules.aspx 2008-01-07 09:18:23 UTC (rev 55) @@ -1,5 +1,7 @@ -<%@ Page Language="C#" MasterPageFile="~/MPW.master" AutoEventWireup="true" CodeFile="Schedules.aspx.cs" Inherits="Default2" Title="Untitled Page" %> -<asp:Content ID="Schedules" ContentPlaceHolderID="MPWContent" Runat="Server"> +<%@ Page Language="C#" MasterPageFile="~/MPW.master" AutoEventWireup="true" CodeFile="Schedules.aspx.cs" + Inherits="Schedules" Title="Schedules" %> + +<asp:Content ID="Schedules" ContentPlaceHolderID="MPWContent" runat="Server"> <asp:UpdatePanel ID="ContentUpdatePanel" runat="server" UpdateMode="Always"> <ContentTemplate> <asp:Panel ID="SchedulesPanel" runat="server"> @@ -7,4 +9,3 @@ </ContentTemplate> </asp:UpdatePanel> </asp:Content> - Modified: trunk/Version2/Web App/MPW/Schedules.aspx.cs =================================================================== --- trunk/Version2/Web App/MPW/Schedules.aspx.cs 2008-01-04 14:35:55 UTC (rev 54) +++ trunk/Version2/Web App/MPW/Schedules.aspx.cs 2008-01-07 09:18:23 UTC (rev 55) @@ -12,13 +12,15 @@ using TvDatabase; using MPW; -public partial class Default2 : System.Web.UI.Page +public partial class Schedules : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { - MPWMaster m = (MPWMaster)Page.Master; - m.Sectiontitle = Resources.Resource.Schedules; - updateContents(); + //Set localized page title + MPWMaster m = (MPWMaster)Page.Master; + m.Sectiontitle = Resources.Resource.Schedules; + + updateContents(); } /// <summary> @@ -29,10 +31,10 @@ /// <param name="e"></param> protected void deleteSchedule(object sender, ImageClickEventArgs e) { - ImageButton b = (ImageButton)sender; - int idSchedule = int.Parse(b.CommandArgument); - MPWUtils.deleteSchedule(idSchedule); - updateContents(); + ImageButton b = (ImageButton)sender; + int idSchedule = int.Parse(b.CommandArgument); + MPWUtils.deleteSchedule(idSchedule); + updateContents(); } /// <summary> @@ -40,129 +42,129 @@ /// </summary> protected void updateContents() { - //Clear everything - SchedulesPanel.Controls.Clear(); + //Clear everything + SchedulesPanel.Controls.Clear(); - //Establish the connection to the TV Server and the DB. - MPWUtils.SetupConnection(); + //Establish the connection to the TV Server and the DB. + MPWUtils.SetupConnection(); - //A new Businesslayer - TvBusinessLayer layer = new TvBusinessLayer(); + //A new Businesslayer + TvBusinessLayer layer = new TvBusinessLayer(); - //Get all schedules - IList schedules = Schedule.ListAll(); - IList single = Schedule.ListAll(); - IList series = Schedule.ListAll(); + //Get all schedules + IList schedules = Schedule.ListAll(); + IList single = Schedule.ListAll(); + IList series = Schedule.ListAll(); - single.Clear(); - series.Clear(); + single.Clear(); + series.Clear(); - foreach (Schedule schedule in schedules) - { - if (schedule.ScheduleType > 0) - series.Add(schedule); - else - single.Add(schedule); - } + foreach (Schedule schedule in schedules) + { + if (schedule.ScheduleType > 0) + series.Add(schedule); + else + single.Add(schedule); + } - if (single.Count > 0) - { - addTable("single", single); - } + if (single.Count > 0) + { + addTable("single", single); + } - if (series.Count > 0) - { - addTable("series", series); - } + if (series.Count > 0) + { + addTable("series", series); + } } protected void addTable(String type, IList schedules) { - Table singleTable = new Table(); - singleTable.CellPadding = 0; - singleTable.CellSpacing = 0; - singleTable.CssClass = "grouptable"; + Table singleTable = new Table(); + singleTable.CellPadding = 0; + singleTable.CellSpacing = 0; + singleTable.CssClass = "grouptable"; - TableRow SeperatorRow = new TableRow(); - TableCell SeperatorCell = new TableCell(); - SeperatorCell.CssClass = "seperatorcell"; - SeperatorCell.ColumnSpan = 3; - Label l = new Label(); - if (type == "single") - l.Text = Resources.Resource.RecSingle; - else - l.Text = Resources.Resource.RecSeries; - SeperatorCell.Controls.Add(l); - SeperatorRow.Cells.Add(SeperatorCell); - singleTable.Rows.Add(SeperatorRow); + TableRow SeperatorRow = new TableRow(); + TableCell SeperatorCell = new TableCell(); + SeperatorCell.CssClass = "seperatorcell"; + SeperatorCell.ColumnSpan = 3; + Label l = new Label(); + if (type == "single") + l.Text = Resources.Resource.RecSingle; + else + l.Text = Resources.Resource.RecSeries; + SeperatorCell.Controls.Add(l); + SeperatorRow.Cells.Add(SeperatorCell); + singleTable.Rows.Add(SeperatorRow); - //Iterate through all the schedules - foreach (Schedule schedule in schedules) - { - TableRow scheduleNameRow = new TableRow(); + //Iterate through all the schedules + foreach (Schedule schedule in schedules) + { + TableRow scheduleNameRow = new TableRow(); - TableCell spacer = new TableCell(); - spacer.CssClass = "spacer"; - scheduleNameRow.Controls.Add(spacer); + TableCell spacer = new TableCell(); + spacer.CssClass = "spacer"; + scheduleNameRow.Controls.Add(spacer); - TableCell scheduleNameCell = new TableCell(); - scheduleNameCell.CssClass = "namecell"; - scheduleNameCell.ColumnSpan = 2; - Label channelName = new Label(); - channelName.Text = schedule.ProgramName; - scheduleNameCell.Controls.Add(channelName); + TableCell scheduleNameCell = new TableCell(); + scheduleNameCell.CssClass = "namecell"; + scheduleNameCell.ColumnSpan = 2; + Label channelName = new Label(); + channelName.Text = schedule.ProgramName; + scheduleNameCell.Controls.Add(channelName); - ImageButton deleteScheduleButton = new ImageButton(); - deleteScheduleButton.ImageUrl = "Images/redx.gif"; - deleteScheduleButton.CssClass = "deleteschedule"; - deleteScheduleButton.CommandArgument = schedule.IdSchedule.ToString(); - deleteScheduleButton.Click += new ImageClickEventHandler(deleteSchedule); - scheduleNameCell.Controls.Add(deleteScheduleButton); + ImageButton deleteScheduleButton = new ImageButton(); + deleteScheduleButton.ImageUrl = "Images/redx.gif"; + deleteScheduleButton.CssClass = "deleteschedule"; + deleteScheduleButton.CommandArgument = schedule.IdSchedule.ToString(); + deleteScheduleButton.Click += new ImageClickEventHandler(deleteSchedule); + scheduleNameCell.Controls.Add(deleteScheduleButton); - scheduleNameRow.Cells.Add(scheduleNameCell); - singleTable.Rows.Add(scheduleNameRow); + scheduleNameRow.Cells.Add(scheduleNameCell); + singleTable.Rows.Add(scheduleNameRow); - TableRow logoRow = new TableRow(); + TableRow logoRow = new TableRow(); - TableCell spacer2 = new TableCell(); - spacer2.CssClass = "spacer2"; - logoRow.Controls.Add(spacer2); + TableCell spacer2 = new TableCell(); + spacer2.CssClass = "spacer2"; + logoRow.Controls.Add(spacer2); - TableCell cell_logo = new TableCell(); - cell_logo.CssClass = "logocell"; + TableCell cell_logo = new TableCell(); + cell_logo.CssClass = "logocell"; - Image channelLogo = new Image(); - channelLogo.CssClass = "channellogo"; - Channel channel = Channel.Retrieve(schedule.IdChannel); - channelLogo.ImageUrl = MPWUtils.getChannelLogoPath(this.Server.MapPath("~/TVLogos/"), channel.Name); + Image channelLogo = new Image(); + channelLogo.CssClass = "channellogo"; + Channel channel = Channel.Retrieve(schedule.IdChannel); + channelLogo.ImageUrl = MPWUtils.getChannelLogoPath(this.Server.MapPath("~/TVLogos/"), channel.Name); - if (channelLogo.ImageUrl != "") - cell_logo.Controls.Add(channelLogo); + if (channelLogo.ImageUrl != "") + cell_logo.Controls.Add(channelLogo); - TableCell cell_description = new TableCell(); - cell_description.CssClass = "detailscell"; + TableCell cell_description = new TableCell(); + cell_description.CssClass = "detailscell"; - Label description = new Label(); + Label description = new Label(); - try - { - Channel c = Channel.Retrieve(schedule.IdChannel); - Program p = c.GetProgramAt(schedule.StartTime); - description.Text = p.Description; - cell_description.Controls.Add(description); - } - catch - { - description.Text = Resources.Resource.NoEPGInfo; - cell_description.Controls.Add(description); - } + try + { + Channel c = Channel.Retrieve(schedule.IdChannel); + Program p = c.GetProgramAt(schedule.StartTime); + description.Text = p.Description; + cell_description.Controls.Add(description); + } + catch + { + description.Text = Resources.Resource.NoEPGInfo; + cell_description.Controls.Add(description); + } - logoRow.Cells.Add(cell_logo); - logoRow.Cells.Add(cell_description); + logoRow.Cells.Add(cell_logo); + logoRow.Cells.Add(cell_description); - singleTable.Rows.Add(logoRow); + singleTable.Rows.Add(logoRow); - SchedulesPanel.Controls.Add(singleTable); - } + SchedulesPanel.Controls.Add(singleTable); + } } - } +} Modified: trunk/Version2/Web App/MPW/Search.aspx =================================================================== --- trunk/Version2/Web App/MPW/Search.aspx 2008-01-04 14:35:55 UTC (rev 54) +++ trunk/Version2/Web App/MPW/Search.aspx 2008-01-07 09:18:23 UTC (rev 55) @@ -8,30 +8,33 @@ <strong> <asp:Label ID="label_searchbydate" runat="server" Text="<%$ Resources:Resource, searchbydate %>"></asp:Label></strong> <br /> - <asp:RadioButton ID="radio_searchbydate1" runat="server" Checked="True" /> - <asp:Label ID="label_searchbydate1" runat="server" Text="<%$ Resources:Resource, primetimeshows %>"></asp:Label> + <asp:RadioButton ID="radio_searchbydate1" runat="server" Checked="True" Text="<%$ Resources:Resource, primetimeshows %>" + GroupName="date" /> <br /> - <asp:RadioButton ID="radio_searchbydate2" runat="server" /> - <asp:Label ID="label_searchbydate2" runat="server" Text="<%$ Resources:Resource, nowontv %>"></asp:Label> + <asp:RadioButton ID="radio_searchbydate2" runat="server" Text="<%$ Resources:Resource, nowontv %>" + GroupName="date" /> <br /> - <asp:RadioButton ID="radio_searchbydate3" runat="server" /> - <asp:Label ID="label_searchbydate3" runat="server" Text="<%$ Resources:Resource, customtime %>"></asp:Label> + <asp:RadioButton ID="radio_searchbydate3" runat="server" Text="<%$ Resources:Resource, customtime %>" + GroupName="date" />: + <asp:TextBox ID="customtime_h" runat="server" CssClass="customtime"></asp:TextBox> + : + <asp:TextBox ID="customtime_m" runat="server" CssClass="customtime"></asp:TextBox> <br /> - <asp:Button ID="button_searchbydate" runat="server" Text="<%$ Resources:Resource, Search %>" /> + <asp:Button ID="button_searchbydate" runat="server" Text="<%$ Resources:Resource, Search %>" + OnClick="button_searchbydate_Click" /> </div> <div style="line-height: 25px; float: left; width: 250px;"> <strong> <asp:Label ID="label_searchtext" runat="server" Text="<%$ Resources:Resource, searchbytext %>"></asp:Label></strong> <br /> - <asp:CheckBox ID="check_searchintitle" runat="server" Checked="True" /> - <asp:Label ID="label_searchintitle" runat="server" Text="<%$ Resources:Resource, searchintitle %>">"></asp:Label> + <asp:CheckBox ID="check_searchintitle" runat="server" Checked="True" Text="<%$ Resources:Resource, searchintitle %>" /> <br /> - <asp:CheckBox ID="check_searchindescription" runat="server" Checked="True" /> - <asp:Label ID="label_searchindescription" runat="server" Text="<%$ Resources:Resource, searchindescription %>">"></asp:Label> + <asp:CheckBox ID="check_searchindescription" runat="server" Checked="True" Text="<%$ Resources:Resource, searchindescription %>" /> <br /> <asp:TextBox ID="field_searchtext" runat="server"></asp:TextBox> <br /> - <asp:Button ID="button_searchtext" runat="server" Text="<%$ Resources:Resource, Search %>" /> + <asp:Button ID="button_searchtext" runat="server" Text="<%$ Resources:Resource, Search %>" + OnClick="button_searchtext_Click" /> </div> <div style="line-height: 25px; float: left; width: 250px;"> <strong> @@ -40,16 +43,19 @@ <asp:DropDownList ID="dropdown_searchbygenre" runat="server"> </asp:DropDownList> <br /> - <asp:Button ID="button_searchbygenre" runat="server" Text="<%$ Resources:Resource, Search %>" /> + <asp:Button ID="button_searchbygenre" runat="server" Text="<%$ Resources:Resource, Search %>" + OnClick="button_searchbygenre_Click" /> </div> - <div style="clear: both;"></div> + <div style="clear: both;"> + </div> <h1> <asp:Label ID="label_searchresults" runat="server" Text="<%$ Resources:Resource, searchresults %>"></asp:Label></h1> <asp:UpdatePanel ID="GuideUpdatePanel" runat="server" UpdateMode="Conditional"> - <contenttemplate> - 123 - </contenttemplate> - <triggers> - </triggers> + <ContentTemplate> + <asp:Table ID="Guide" runat="server" CssClass="guidetable"> + </asp:Table> + </ContentTemplate> + <Triggers> + </Triggers> </asp:UpdatePanel> </asp:Content> Modified: trunk/Version2/Web App/MPW/Search.aspx.cs =================================================================== --- trunk/Version2/Web App/MPW/Search.aspx.cs 2008-01-04 14:35:55 UTC (rev 54) +++ trunk/Version2/Web App/MPW/Search.aspx.cs 2008-01-07 09:18:23 UTC (rev 55) @@ -17,6 +17,108 @@ protected void Page_Load(object sender, EventArgs e) { - + //Set localized page title + MPWMaster m = (MPWMaster)Page.Master; + m.Sectiontitle = Resources.Resource.Search; } + + /// <summary> + /// Method to update all visible content. + /// </summary> + protected void updateContents(IList searchresults) + { + + //Iterate through all the channels + foreach (Program program in searchresults) + { + Channel channel = Channel.Retrieve(program.IdChannel); + if (!channel.IsTv) + continue; + TableRow r = new TableRow(); + TableCell cell_channel = new TableCell(); + TableCell cell_program = new TableCell(); + cell_program.Height = 80; + + cell_channel.CssClass = "logocell"; + + Image channelLogo = new Image(); + channelLogo.CssClass = "channellogo"; + channelLogo.ImageUrl = MPWUtils.getChannelLogoPath(this.Server.MapPath("~/TVLogos/"), channel.Name); + + if (channelLogo.ImageUrl != "") + { + cell_channel.Controls.Add(channelLogo); + Label br = new Label(); + br.Text = "<br />"; + cell_channel.Controls.Add(br); + } + + Label lbl_channel = new Label(); + lbl_channel.Text = "<strong>" + channel.Name + "</strong>"; + + cell_channel.Controls.Add(lbl_channel); + cell_channel.CssClass = "guideChannel"; + + Label resultdetails = new Label(); + resultdetails.Text = program.Description; + cell_program.Controls.Add(resultdetails); + + r.Cells.Add(cell_channel); + r.Cells.Add(cell_program); + + Guide.Rows.Add(r); + } + } + + /// <summary> + /// User chose to search by date and clicked the corresponding button. + /// </summary> + /// <param name="sender"></param> + /// <param name="e"></param> + protected void button_searchbydate_Click(object sender, EventArgs e) + { + // Primetime shows + if (radio_searchbydate1.Checked) + { + } + // On air now + else if (radio_searchbydate2.Checked) + { + TvBusinessLayer layer = new TvBusinessLayer(); + IList searchresults = layer.GetOnairNow(); + updateContents(searchresults); + } + // Custom time + else if (radio_searchbydate3.Checked) + { + DateTime now = DateTime.Now; + int h = Int32.Parse(customtime_h.Text); + int m = Int32.Parse(customtime_m.Text); + DateTime start = new DateTime(now.Year, now.Month, now.Day, h, m, 0); + DateTime end = new DateTime(now.Year, now.Month, now.Day, h, m, 0); + TvBusinessLayer layer = new TvBusinessLayer(); + IList searchresults = layer.GetPrograms(start, end); + updateContents(searchresults); + } + } + + /// <summary> + /// User chose to search by text and clicked the corresponding button. + /// </summary> + /// <param name="sender"></param> + /// <param name="e"></param> + protected void button_searchtext_Click(object sender, EventArgs e) + { + + } + + /// <summary> + /// User chose to search by genre and clicked the corresponding button. + /// </summary> + /// <param name="sender"></param> + /// <param name="e"></param> + protected void button_searchbygenre_Click(object sender, EventArgs e) + { + + } } Modified: trunk/Version2/Web App/MPW/css/mpw_style.css =================================================================== --- trunk/Version2/Web App/MPW/css/mpw_style.css 2008-01-04 14:35:55 UTC (rev 54) +++ trunk/Version2/Web App/MPW/css/mpw_style.css 2008-01-07 09:18:23 UTC (rev 55) @@ -121,8 +121,8 @@ table.guidetable { - table-layout:fixed; - overflow:hidden + table-layout: fixed; + overflow: hidden; } td.seperatorcell @@ -243,14 +243,19 @@ table.guidetable { - overflow:hidden; - width:90%; + overflow: hidden; + width: 90%; } td.guidecell { - overflow:hidden; - height:50px; - background-color:#D4D3D3; + overflow: hidden; + height: 50px; + background-color: #D4D3D3; border: 1px solid #000000; } + +input.customtime +{ + width: 20px; +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mas...@us...> - 2008-01-04 14:36:16
|
Revision: 54 http://mp-webinterface.svn.sourceforge.net/mp-webinterface/?rev=54&view=rev Author: maschine Date: 2008-01-04 06:35:55 -0800 (Fri, 04 Jan 2008) Log Message: ----------- Adding the search page (currently design only, no function behind it). Modified Paths: -------------- trunk/Version2/Web App/MPW/App_GlobalResources/Resource.de.resx trunk/Version2/Web App/MPW/App_GlobalResources/Resource.resx trunk/Version2/Web App/MPW/MPW.master trunk/Version2/Web App/MPW/css/mpw_style.css Added Paths: ----------- trunk/Version2/Web App/MPW/Search.aspx trunk/Version2/Web App/MPW/Search.aspx.cs Property Changed: ---------------- trunk/Version2/Web App/MPW/TVLogos/ trunk/Version2/Windows Apps/ Modified: trunk/Version2/Web App/MPW/App_GlobalResources/Resource.de.resx =================================================================== --- trunk/Version2/Web App/MPW/App_GlobalResources/Resource.de.resx 2007-11-20 21:45:20 UTC (rev 53) +++ trunk/Version2/Web App/MPW/App_GlobalResources/Resource.de.resx 2008-01-04 14:35:55 UTC (rev 54) @@ -120,6 +120,10 @@ <data name="ChannelGroup" xml:space="preserve"> <value>Programmgruppe</value> </data> + <data name="customtime" xml:space="preserve"> + <value>Zeit angeben</value> + <comment>Search by date options</comment> + </data> <data name="Daily" xml:space="preserve"> <value>Täglich</value> <comment>ScheduleType</comment> @@ -154,10 +158,18 @@ <value>Jetzt & Gleich</value> <comment>Navigation</comment> </data> + <data name="nowontv" xml:space="preserve"> + <value>Jetzt im TV</value> + <comment>Search by date options</comment> + </data> <data name="Once" xml:space="preserve"> <value>Einmalig</value> <comment>ScheduleType</comment> </data> + <data name="primetimeshows" xml:space="preserve"> + <value>Heute zur Primetime</value> + <comment>Search by date options</comment> + </data> <data name="Record" xml:space="preserve"> <value>Aufnehmen!</value> </data> @@ -185,6 +197,29 @@ <value>Suchen</value> <comment>Navigation</comment> </data> + <data name="searchbydate" xml:space="preserve"> + <value>nach Datum</value> + <comment>Search Type</comment> + </data> + <data name="searchbygenre" xml:space="preserve"> + <value>nach Genre</value> + <comment>Search Type</comment> + </data> + <data name="searchbytext" xml:space="preserve"> + <value>nach Text</value> + <comment>Search Type</comment> + </data> + <data name="searchindescription" xml:space="preserve"> + <value>Im Titel suchen</value> + <comment>Search by text options</comment> + </data> + <data name="searchintitle" xml:space="preserve"> + <value>In der Beschreibung suchen</value> + <comment>Search by text options</comment> + </data> + <data name="searchresults" xml:space="preserve"> + <value>Suchergebnisse</value> + </data> <data name="Update" xml:space="preserve"> <value>Aktualisieren</value> </data> Modified: trunk/Version2/Web App/MPW/App_GlobalResources/Resource.resx =================================================================== --- trunk/Version2/Web App/MPW/App_GlobalResources/Resource.resx 2007-11-20 21:45:20 UTC (rev 53) +++ trunk/Version2/Web App/MPW/App_GlobalResources/Resource.resx 2008-01-04 14:35:55 UTC (rev 54) @@ -120,6 +120,10 @@ <data name="ChannelGroup" xml:space="preserve"> <value>Programmgruppe</value> </data> + <data name="customtime" xml:space="preserve"> + <value>Custom time</value> + <comment>Search by date options</comment> + </data> <data name="Daily" xml:space="preserve"> <value>Daily</value> <comment>ScheduleType</comment> @@ -157,6 +161,10 @@ <value>Now & Next</value> <comment>Navigation</comment> </data> + <data name="nowontv" xml:space="preserve"> + <value>What's now on TV</value> + <comment>Search by date options</comment> + </data> <data name="Once" xml:space="preserve"> <value>Once</value> <comment>ScheduleType</comment> @@ -164,6 +172,10 @@ <data name="PageTitle" xml:space="preserve"> <value>MPW - The MediaPortal Webinterface</value> </data> + <data name="primetimeshows" xml:space="preserve"> + <value>Today's primetime shows</value> + <comment>Search by date options</comment> + </data> <data name="Record" xml:space="preserve"> <value>Record!</value> </data> @@ -191,6 +203,29 @@ <value>Search</value> <comment>Navigation</comment> </data> + <data name="searchbydate" xml:space="preserve"> + <value>by date</value> + <comment>Search Type</comment> + </data> + <data name="searchbygenre" xml:space="preserve"> + <value>by genre</value> + <comment>Search Type</comment> + </data> + <data name="searchbytext" xml:space="preserve"> + <value>by text</value> + <comment>Search Type</comment> + </data> + <data name="searchindescription" xml:space="preserve"> + <value>Search in title</value> + <comment>Search by text options</comment> + </data> + <data name="searchintitle" xml:space="preserve"> + <value>Search in description</value> + <comment>Search by text options</comment> + </data> + <data name="searchresults" xml:space="preserve"> + <value>Search results</value> + </data> <data name="Update" xml:space="preserve"> <value>Update</value> </data> Modified: trunk/Version2/Web App/MPW/MPW.master =================================================================== --- trunk/Version2/Web App/MPW/MPW.master 2007-11-20 21:45:20 UTC (rev 53) +++ trunk/Version2/Web App/MPW/MPW.master 2008-01-04 14:35:55 UTC (rev 54) @@ -36,22 +36,37 @@ <asp:HyperLink ID="LinkGuide" runat="server" Text="<%$ Resources:Resource, Guide %>" NavigateUrl="~/Default.aspx" CssClass="navilink"></asp:HyperLink> </td> + <td id="bar1"> + | + </td> <td id="nav_now" class="navcell"> <asp:HyperLink ID="LinkNowNext" runat="server" Text="<%$ Resources:Resource, NowNext %>" NavigateUrl="~/NowNext.aspx" CssClass="navilink"></asp:HyperLink> </td> + <td id="bar2"> + | + </td> <td id="nav_search" class="navcell"> <asp:HyperLink ID="LinkSearch" runat="server" Text="<%$ Resources:Resource, Search %>" - NavigateUrl="~/Default.aspx" CssClass="navilink"></asp:HyperLink> + NavigateUrl="~/Search.aspx" CssClass="navilink"></asp:HyperLink> </td> + <td id="bar3"> + | + </td> <td id="nav_sched" class="navcell"> <asp:HyperLink ID="LinkSchedules" runat="server" Text="<%$ Resources:Resource, Schedules %>" NavigateUrl="~/Schedules.aspx" CssClass="navilink"></asp:HyperLink> </td> + <td id="bar4"> + | + </td> <td id="nav_rec" class="navcell"> <asp:HyperLink ID="LinkRecordings" runat="server" Text="<%$ Resources:Resource, Recordings %>" NavigateUrl="~/Default.aspx" CssClass="navilink"></asp:HyperLink> </td> + <td id="bar5"> + | + </td> <td id="nav_live" class="navcell"> <asp:HyperLink ID="LinkLiveTV" runat="server" Text="<%$ Resources:Resource, LiveTV %>" NavigateUrl="~/Default.aspx" CssClass="navilink"></asp:HyperLink> Added: trunk/Version2/Web App/MPW/Search.aspx =================================================================== --- trunk/Version2/Web App/MPW/Search.aspx (rev 0) +++ trunk/Version2/Web App/MPW/Search.aspx 2008-01-04 14:35:55 UTC (rev 54) @@ -0,0 +1,55 @@ +<%@ Page Language="C#" MasterPageFile="~/MPW.master" AutoEventWireup="true" CodeFile="Search.aspx.cs" + Inherits="_Default" Title="Search" %> + +<asp:Content ID="Content_search" ContentPlaceHolderID="MPWContent" runat="Server"> + <h1> + <asp:Label ID="label_search" runat="server" Text="<%$ Resources:Resource, Search %>"></asp:Label></h1> + <div style="line-height: 25px; float: left; width: 250px;"> + <strong> + <asp:Label ID="label_searchbydate" runat="server" Text="<%$ Resources:Resource, searchbydate %>"></asp:Label></strong> + <br /> + <asp:RadioButton ID="radio_searchbydate1" runat="server" Checked="True" /> + <asp:Label ID="label_searchbydate1" runat="server" Text="<%$ Resources:Resource, primetimeshows %>"></asp:Label> + <br /> + <asp:RadioButton ID="radio_searchbydate2" runat="server" /> + <asp:Label ID="label_searchbydate2" runat="server" Text="<%$ Resources:Resource, nowontv %>"></asp:Label> + <br /> + <asp:RadioButton ID="radio_searchbydate3" runat="server" /> + <asp:Label ID="label_searchbydate3" runat="server" Text="<%$ Resources:Resource, customtime %>"></asp:Label> + <br /> + <asp:Button ID="button_searchbydate" runat="server" Text="<%$ Resources:Resource, Search %>" /> + </div> + <div style="line-height: 25px; float: left; width: 250px;"> + <strong> + <asp:Label ID="label_searchtext" runat="server" Text="<%$ Resources:Resource, searchbytext %>"></asp:Label></strong> + <br /> + <asp:CheckBox ID="check_searchintitle" runat="server" Checked="True" /> + <asp:Label ID="label_searchintitle" runat="server" Text="<%$ Resources:Resource, searchintitle %>">"></asp:Label> + <br /> + <asp:CheckBox ID="check_searchindescription" runat="server" Checked="True" /> + <asp:Label ID="label_searchindescription" runat="server" Text="<%$ Resources:Resource, searchindescription %>">"></asp:Label> + <br /> + <asp:TextBox ID="field_searchtext" runat="server"></asp:TextBox> + <br /> + <asp:Button ID="button_searchtext" runat="server" Text="<%$ Resources:Resource, Search %>" /> + </div> + <div style="line-height: 25px; float: left; width: 250px;"> + <strong> + <asp:Label ID="label_searchbygenre" runat="server" Text="<%$ Resources:Resource, searchbygenre %>"></asp:Label></strong> + <br /> + <asp:DropDownList ID="dropdown_searchbygenre" runat="server"> + </asp:DropDownList> + <br /> + <asp:Button ID="button_searchbygenre" runat="server" Text="<%$ Resources:Resource, Search %>" /> + </div> + <div style="clear: both;"></div> + <h1> + <asp:Label ID="label_searchresults" runat="server" Text="<%$ Resources:Resource, searchresults %>"></asp:Label></h1> + <asp:UpdatePanel ID="GuideUpdatePanel" runat="server" UpdateMode="Conditional"> + <contenttemplate> + 123 + </contenttemplate> + <triggers> + </triggers> + </asp:UpdatePanel> +</asp:Content> Added: trunk/Version2/Web App/MPW/Search.aspx.cs =================================================================== --- trunk/Version2/Web App/MPW/Search.aspx.cs (rev 0) +++ trunk/Version2/Web App/MPW/Search.aspx.cs 2008-01-04 14:35:55 UTC (rev 54) @@ -0,0 +1,22 @@ +using System; +using System.Data; +using System.Configuration; +using System.Collections; +using System.Web; +using System.Web.Security; +using System.Web.UI; +using System.Web.UI.WebControls; +using System.Web.UI.WebControls.WebParts; +using System.Web.UI.HtmlControls; + +using MPW; +using TvDatabase; + +public partial class _Default : System.Web.UI.Page +{ + + protected void Page_Load(object sender, EventArgs e) + { + + } +} Property changes on: trunk/Version2/Web App/MPW/TVLogos ___________________________________________________________________ Name: svn:ignore + *.png *.PNG Modified: trunk/Version2/Web App/MPW/css/mpw_style.css =================================================================== --- trunk/Version2/Web App/MPW/css/mpw_style.css 2007-11-20 21:45:20 UTC (rev 53) +++ trunk/Version2/Web App/MPW/css/mpw_style.css 2008-01-04 14:35:55 UTC (rev 54) @@ -103,10 +103,10 @@ td.navcell { - width: 159px; height: 31px; text-align: center; - background-image: url(../Images/button_unselected.png); + padding-left: 7px; + padding-right: 7px; } table.grouptable @@ -206,7 +206,7 @@ a.navilink { - font-size: 11px; + font-size: 15px; text-decoration: none; color: #000000; } @@ -214,7 +214,7 @@ a.navilink:hover { color: Red; - text-decoration: blink; + text-decoration: underline overline; } a.navilink:visited @@ -234,6 +234,7 @@ left: 300px; z-index: 2; } + input.deleteschedule { margin-left: 10px; @@ -246,7 +247,6 @@ width:90%; } - td.guidecell { overflow:hidden; Property changes on: trunk/Version2/Windows Apps ___________________________________________________________________ Name: svn:ignore + MPW.suo This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mas...@us...> - 2007-11-20 21:45:42
|
Revision: 53 http://mp-webinterface.svn.sourceforge.net/mp-webinterface/?rev=53&view=rev Author: maschine Date: 2007-11-20 13:45:20 -0800 (Tue, 20 Nov 2007) Log Message: ----------- First version of browsing the guide by selecting time and date. Modified Paths: -------------- trunk/Version2/Web App/MPW/Default.aspx trunk/Version2/Web App/MPW/Default.aspx.cs Modified: trunk/Version2/Web App/MPW/Default.aspx =================================================================== --- trunk/Version2/Web App/MPW/Default.aspx 2007-10-04 16:07:13 UTC (rev 52) +++ trunk/Version2/Web App/MPW/Default.aspx 2007-11-20 21:45:20 UTC (rev 53) @@ -10,9 +10,9 @@ </asp:DropDownList> <asp:Button ID="ButtonPrev" runat="server" Text="<" OnClick="buttonminusclick" /> <asp:Button ID="ButtonNext" runat="server" Text=">" OnClick="buttonplusclick" /> - <asp:DropDownList ID="DateDropDown" runat="server"> + <asp:DropDownList ID="DateDropDown" runat="server" OnSelectedIndexChanged="dateDropDownChanged" AutoPostBack="True"> </asp:DropDownList> - <asp:DropDownList ID="TimeDropDown" runat="server"> + <asp:DropDownList ID="TimeDropDown" runat="server" OnSelectedIndexChanged="timeDropDownChanged" AutoPostBack="True"> </asp:DropDownList> <br /> <asp:Table ID="Guide" runat="server" CssClass="guidetable"> Modified: trunk/Version2/Web App/MPW/Default.aspx.cs =================================================================== --- trunk/Version2/Web App/MPW/Default.aspx.cs 2007-10-04 16:07:13 UTC (rev 52) +++ trunk/Version2/Web App/MPW/Default.aspx.cs 2007-11-20 21:45:20 UTC (rev 53) @@ -36,6 +36,24 @@ // List all groups groups = ChannelGroup.ListAll(); + //Prepare DropDown for Days + DateTime day = DateTime.Today; + day = day.AddDays(-1); + for (int i = 0; i < 14; i++) + { + day = day.AddDays(1); + DateDropDown.Items.Add(new ListItem(day.ToLongDateString(), day.Ticks.ToString())); + } + + //Prepare DropDown for times + DateTime time = DateTime.Today; + time = time.AddHours(-1); + for (int i = 0; i < 24; i++) + { + time = time.AddHours(1); + TimeDropDown.Items.Add(new ListItem(time.ToShortTimeString(), time.Ticks.ToString())); + } + // Prepare DropDown list for channel groups. LabelChannelGroup.Text = Resources.Resource.ChannelGroup; DropDownListChannelGroups.Items.Clear(); @@ -233,4 +251,38 @@ Guide.Controls.Clear(); updateContents(); } + + /// <summary> + /// User changed the value of the Date DropDown + /// </summary> + /// <param name="sender"></param> + /// <param name="e"></param> + protected void dateDropDownChanged(object sender, EventArgs e) + { + DateTime guidestart = (DateTime)Session["guideStart"]; + long oldticks; + long.TryParse(DateDropDown.SelectedItem.Value, out oldticks); + DateTime selected = new DateTime(oldticks); + TimeSpan datespan = selected - guideStart; + Session["guideStart"] = guideStart.AddDays(datespan.Days); + Guide.Controls.Clear(); + updateContents(); + } + + /// <summary> + /// User changed the value of the Time DropDown + /// </summary> + /// <param name="sender"></param> + /// <param name="e"></param> + protected void timeDropDownChanged(object sender, EventArgs e) + { + DateTime guidestart = (DateTime)Session["guideStart"]; + long oldticks; + long.TryParse(TimeDropDown.SelectedItem.Value, out oldticks); + DateTime selected = new DateTime(oldticks); + int timespan = selected.Hour - guideStart.Hour; + Session["guideStart"] = guideStart.AddHours(timespan); + Guide.Controls.Clear(); + updateContents(); + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mas...@us...> - 2007-10-04 16:07:15
|
Revision: 52 http://mp-webinterface.svn.sourceforge.net/mp-webinterface/?rev=52&view=rev Author: maschine Date: 2007-10-04 09:07:13 -0700 (Thu, 04 Oct 2007) Log Message: ----------- Navigation through the guide is now possible +3h -3h. Modified Paths: -------------- trunk/Version2/Web App/MPW/Default.aspx trunk/Version2/Web App/MPW/Default.aspx.cs trunk/Version2/Web App/MPW/css/mpw_style.css trunk/Version2/Web App/MPW/web.config Modified: trunk/Version2/Web App/MPW/Default.aspx =================================================================== --- trunk/Version2/Web App/MPW/Default.aspx 2007-09-17 20:36:37 UTC (rev 51) +++ trunk/Version2/Web App/MPW/Default.aspx 2007-10-04 16:07:13 UTC (rev 52) @@ -8,16 +8,14 @@ <asp:Label ID="LabelChannelGroup" runat="server" Text="Label"></asp:Label> <asp:DropDownList ID="DropDownListChannelGroups" runat="server" OnSelectedIndexChanged="groupChosen" AutoPostBack="True"> </asp:DropDownList> - <asp:Button ID="ButtonPrev" runat="server" Text="<" /> - <asp:Button ID="ButtonNext" runat="server" Text=">" /> - <asp:DropDownList ID="GroupDropDown" runat="server"> + <asp:Button ID="ButtonPrev" runat="server" Text="<" OnClick="buttonminusclick" /> + <asp:Button ID="ButtonNext" runat="server" Text=">" OnClick="buttonplusclick" /> + <asp:DropDownList ID="DateDropDown" runat="server"> </asp:DropDownList> <asp:DropDownList ID="TimeDropDown" runat="server"> </asp:DropDownList> - <asp:DropDownList ID="DateDropDown" runat="server"> - </asp:DropDownList> <br /> - <asp:Table ID="Guide" runat="server" Width="90%"> + <asp:Table ID="Guide" runat="server" CssClass="guidetable"> </asp:Table> </ContentTemplate> <Triggers> Modified: trunk/Version2/Web App/MPW/Default.aspx.cs =================================================================== --- trunk/Version2/Web App/MPW/Default.aspx.cs 2007-09-17 20:36:37 UTC (rev 51) +++ trunk/Version2/Web App/MPW/Default.aspx.cs 2007-10-04 16:07:13 UTC (rev 52) @@ -14,10 +14,10 @@ public partial class _Default : System.Web.UI.Page { - private DateTime guideStart; - private DateTime guideEnd; + DateTime guideStart; + DateTime guideEnd; - private int chosengroup = 0; + int chosengroup = 0; IList groups; IList channels; @@ -44,6 +44,7 @@ DropDownListChannelGroups.SelectedIndex = chosengroup; } + Guide.Controls.Clear(); updateContents(); } @@ -52,19 +53,27 @@ /// </summary> protected void updateContents() { + if (Session["guideStart"] == null) + { + int mins = DateTime.Now.Minute; + guideStart = DateTime.Now.Subtract(new TimeSpan(0, mins, 0)); + if (mins >= 30) + { + guideStart = guideStart.AddMinutes(30); + } + guideEnd = guideStart.AddHours(3); + Session["guideStart"] = guideStart; + } + else + { + guideStart = (DateTime)Session["guideStart"]; + guideEnd = guideStart.AddHours(3); + } + chosengroup = Int32.Parse(DropDownListChannelGroups.SelectedValue); ChannelGroup group = ChannelGroup.Retrieve(chosengroup); channels = layer.GetTVGuideChannelsForGroup(group.IdGroup); - int mins = DateTime.Now.Minute; - guideStart = DateTime.Now.Subtract(new TimeSpan(0, mins, 0)); - if (mins >= 30) - { - guideStart = guideStart.AddMinutes(30); - } - - guideEnd = guideStart.AddHours(3); - //The Time TableRow timerow = new TableRow(); TableCell spacer = new TableCell(); @@ -126,7 +135,12 @@ int width = Int32.Parse(widthTime.Hours.ToString()) * 60; width += Int32.Parse(widthTime.Minutes.ToString()); firstcell.ColumnSpan = width / 2; - firstcell.Text = "<a href=\"ProgramDetail.aspx?idProgram=" + current.IdProgram + "\">" + current.Title + "</a>"; + String cuttitle; + if (current.Title.Length > width) + cuttitle = current.Title.Substring(0, width); + else + cuttitle = current.Title; + firstcell.Text = "<a href=\"ProgramDetail.aspx?idProgram=" + current.IdProgram + "\">" + cuttitle + "</a>"; programsRow.Cells.Add(firstcell); bool more = true; @@ -195,4 +209,28 @@ Guide.Controls.Clear(); updateContents(); } + + /// <summary> + /// User pressed the time plus button + /// </summary> + /// <param name="sender"></param> + /// <param name="e"></param> + protected void buttonplusclick(object sender, EventArgs e) + { + Session["guideStart"] = guideStart.AddHours(3); + Guide.Controls.Clear(); + updateContents(); + } + + /// <summary> + /// User pressed the time minus button + /// </summary> + /// <param name="sender"></param> + /// <param name="e"></param> + protected void buttonminusclick(object sender, EventArgs e) + { + Session["guideStart"] = guideStart.AddHours(-3); + Guide.Controls.Clear(); + updateContents(); + } } Modified: trunk/Version2/Web App/MPW/css/mpw_style.css =================================================================== --- trunk/Version2/Web App/MPW/css/mpw_style.css 2007-09-17 20:36:37 UTC (rev 51) +++ trunk/Version2/Web App/MPW/css/mpw_style.css 2007-10-04 16:07:13 UTC (rev 52) @@ -240,9 +240,17 @@ vertical-align: middle; } +table.guidetable +{ + overflow:hidden; + width:90%; +} + + td.guidecell { - height:64px; overflow:hidden; - background-color:Lime; + height:50px; + background-color:#D4D3D3; + border: 1px solid #000000; } Modified: trunk/Version2/Web App/MPW/web.config =================================================================== --- trunk/Version2/Web App/MPW/web.config 2007-09-17 20:36:37 UTC (rev 51) +++ trunk/Version2/Web App/MPW/web.config 2007-10-04 16:07:13 UTC (rev 52) @@ -13,12 +13,12 @@ </sectionGroup> </configSections> <system.web> - <pages> - <controls> - <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/> - </controls> - </pages> - <!-- + <pages enableSessionState="true"> + <controls> + <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/> + </controls> + </pages> + <!-- Set compilation debug="true" to insert debugging symbols into the compiled page. Because this affects performance, set this value to true only This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mas...@us...> - 2007-09-17 20:36:45
|
Revision: 51 http://mp-webinterface.svn.sourceforge.net/mp-webinterface/?rev=51&view=rev Author: maschine Date: 2007-09-17 13:36:37 -0700 (Mon, 17 Sep 2007) Log Message: ----------- New graphics - thanks mofux :-) Design improvements Modified Paths: -------------- trunk/Version2/Web App/MPW/Default.aspx.cs trunk/Version2/Web App/MPW/Images/loading.gif trunk/Version2/Web App/MPW/Images/osd_play_nofocus.png trunk/Version2/Web App/MPW/Images/play_enabled.png trunk/Version2/Web App/MPW/Images/rec_series.png trunk/Version2/Web App/MPW/Images/rec_single.png trunk/Version2/Web App/MPW/MPW.master trunk/Version2/Web App/MPW/css/mpw_style.css Modified: trunk/Version2/Web App/MPW/Default.aspx.cs =================================================================== --- trunk/Version2/Web App/MPW/Default.aspx.cs 2007-09-17 17:58:15 UTC (rev 50) +++ trunk/Version2/Web App/MPW/Default.aspx.cs 2007-09-17 20:36:37 UTC (rev 51) @@ -143,6 +143,7 @@ width = Int32.Parse(widthTime.Hours.ToString()) * 60; width += Int32.Parse(widthTime.Minutes.ToString()); nextcell.ColumnSpan = width / 2; + nextcell.Height = 64; nextcell.Text = "<a href=\"ProgramDetail.aspx?idProgram=" + next.IdProgram + "\">" + next.Title + "</a>"; programsRow.Cells.Add(nextcell); current = next; Modified: trunk/Version2/Web App/MPW/Images/loading.gif =================================================================== (Binary files differ) Modified: trunk/Version2/Web App/MPW/Images/osd_play_nofocus.png =================================================================== (Binary files differ) Modified: trunk/Version2/Web App/MPW/Images/play_enabled.png =================================================================== (Binary files differ) Modified: trunk/Version2/Web App/MPW/Images/rec_series.png =================================================================== (Binary files differ) Modified: trunk/Version2/Web App/MPW/Images/rec_single.png =================================================================== (Binary files differ) Modified: trunk/Version2/Web App/MPW/MPW.master =================================================================== --- trunk/Version2/Web App/MPW/MPW.master 2007-09-17 17:58:15 UTC (rev 50) +++ trunk/Version2/Web App/MPW/MPW.master 2007-09-17 20:36:37 UTC (rev 51) @@ -15,17 +15,18 @@ <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> <div class="logodiv"> - <div style="width: 700px; float: left;"> - <!-- <img src="../Images/mp_logo_header.png" alt="MP logo" /> --> + <div style="width: 266px; float: left;"> + <img src="Images/banner-left.png" alt="MP logo" /> </div> - <div style="width: 200px; float: right;"> + <div style="width: 50px; float: right; padding-top: 10px; background-image: url(Images/banner-right.png)"> <asp:UpdateProgress ID="GlobalUpdateProgress" runat="server" DisplayAfter="10"> <ProgressTemplate> - <img src="../Images/loading.gif" alt="Loading..." /> <br /> - <!-- Getting data... Please wait! --> + <img src="Images/loading.gif" alt="Loading..." /> + <br /> </ProgressTemplate> </asp:UpdateProgress> + </div> </div> <div class="navidiv"> @@ -41,7 +42,7 @@ </td> <td id="nav_search" class="navcell"> <asp:HyperLink ID="LinkSearch" runat="server" Text="<%$ Resources:Resource, Search %>" - NavigateUrl="~/Search.aspx" CssClass="navilink"></asp:HyperLink> + NavigateUrl="~/Default.aspx" CssClass="navilink"></asp:HyperLink> </td> <td id="nav_sched" class="navcell"> <asp:HyperLink ID="LinkSchedules" runat="server" Text="<%$ Resources:Resource, Schedules %>" @@ -49,11 +50,11 @@ </td> <td id="nav_rec" class="navcell"> <asp:HyperLink ID="LinkRecordings" runat="server" Text="<%$ Resources:Resource, Recordings %>" - NavigateUrl="~/Recordings.aspx" CssClass="navilink"></asp:HyperLink> + NavigateUrl="~/Default.aspx" CssClass="navilink"></asp:HyperLink> </td> <td id="nav_live" class="navcell"> <asp:HyperLink ID="LinkLiveTV" runat="server" Text="<%$ Resources:Resource, LiveTV %>" - NavigateUrl="~/LiveTV.aspx" CssClass="navilink"></asp:HyperLink> + NavigateUrl="~/Default.aspx" CssClass="navilink"></asp:HyperLink> </td> </tr> </table> Modified: trunk/Version2/Web App/MPW/css/mpw_style.css =================================================================== --- trunk/Version2/Web App/MPW/css/mpw_style.css 2007-09-17 17:58:15 UTC (rev 50) +++ trunk/Version2/Web App/MPW/css/mpw_style.css 2007-09-17 20:36:37 UTC (rev 51) @@ -30,9 +30,11 @@ div.logodiv { width: 100%; - height: 79px; - background-image: url(../Images/bg_logo.jpg); - background-repeat: no-repeat; + height: 81px; + background-image: url(../Images/banner-mid.png); + border-width: 1px; + border-style: solid; + border-color: #6491A8; } div.navidiv @@ -158,9 +160,10 @@ { height: 85px; width: 86px; - padding: 0px 0px 0px 22px; + padding: 10px 0px 0px 22px; background-image: url(../Images/bg_channel_logo.png); background-repeat: no-repeat; + vertical-align: top; } td.detailscell @@ -239,7 +242,7 @@ td.guidecell { - height:20px; + height:64px; overflow:hidden; background-color:Lime; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mas...@us...> - 2007-09-17 17:58:18
|
Revision: 50 http://mp-webinterface.svn.sourceforge.net/mp-webinterface/?rev=50&view=rev Author: maschine Date: 2007-09-17 10:58:15 -0700 (Mon, 17 Sep 2007) Log Message: ----------- Change channel group on index change. Modified Paths: -------------- trunk/Version2/Web App/MPW/NowNext.aspx trunk/Version2/Web App/MPW/NowNext.aspx.cs Modified: trunk/Version2/Web App/MPW/NowNext.aspx =================================================================== --- trunk/Version2/Web App/MPW/NowNext.aspx 2007-09-17 16:29:53 UTC (rev 49) +++ trunk/Version2/Web App/MPW/NowNext.aspx 2007-09-17 17:58:15 UTC (rev 50) @@ -8,9 +8,8 @@ <ContentTemplate> <div> <asp:Label ID="LabelChannelGroup" runat="server" Text="Label"></asp:Label> - <asp:DropDownList ID="DropDownListChannelGroups" runat="server"> - </asp:DropDownList> - <asp:Button ID="btnUpdate" runat="server" OnClick="btnUpdate_Click" Text="Button" /> + <asp:DropDownList ID="DropDownListChannelGroups" runat="server" OnSelectedIndexChanged="groupChosen" AutoPostBack="True"> + </asp:DropDownList> <asp:Panel ID="NowNextPanel" runat="server"> </asp:Panel> Modified: trunk/Version2/Web App/MPW/NowNext.aspx.cs =================================================================== --- trunk/Version2/Web App/MPW/NowNext.aspx.cs 2007-09-17 16:29:53 UTC (rev 49) +++ trunk/Version2/Web App/MPW/NowNext.aspx.cs 2007-09-17 17:58:15 UTC (rev 50) @@ -16,7 +16,11 @@ public partial class Default2 : System.Web.UI.Page { IList _schedules; + IList groups; + IList channels; + private int chosengroup = 0; + /// <summary> /// Checks if a program is scheduled as single / series recording /// </summary> @@ -24,204 +28,210 @@ /// <returns>A bool array with meaning [isScheduled, isSeries]</returns> protected bool[] IsRecording(Program program) { - bool[] result = { false, false }; - foreach (Schedule schedule in _schedules) - { - if (schedule.IsRecordingProgram(program, true)) + bool[] result = { false, false }; + foreach (Schedule schedule in _schedules) { - result[0] = true; - if (schedule.ScheduleType != 0) - result[1] = true; ; + if (schedule.IsRecordingProgram(program, true)) + { + result[0] = true; + if (schedule.ScheduleType != 0) + result[1] = true; ; + } } - } - return result; + return result; } protected void Page_Load(object sender, EventArgs e) { - //Establish the connection to the TV Server and the DB. - MPWUtils.SetupConnection(); - if (!IsPostBack) - { - MPWMaster m = (MPWMaster)Page.Master; - //Set language resources - m.Sectiontitle = Resources.Resource.NowNext; - LabelChannelGroup.Text = Resources.Resource.ChannelGroup; - btnUpdate.Text = Resources.Resource.Update; + //Establish the connection to the TV Server and the DB. + MPWUtils.SetupConnection(); + if (!IsPostBack) + { + MPWMaster m = (MPWMaster)Page.Master; + //Set language resources + m.Sectiontitle = Resources.Resource.NowNext; + LabelChannelGroup.Text = Resources.Resource.ChannelGroup; - IList groups = ChannelGroup.ListAll(); - DropDownListChannelGroups.Items.Clear(); - foreach (ChannelGroup group in groups) - DropDownListChannelGroups.Items.Add(new ListItem(group.GroupName,group.IdGroup.ToString())); - DropDownListChannelGroups.SelectedIndex = 0; - } - updateContents(); + groups = ChannelGroup.ListAll(); + DropDownListChannelGroups.Items.Clear(); + foreach (ChannelGroup group in groups) + DropDownListChannelGroups.Items.Add(new ListItem(group.GroupName, group.IdGroup.ToString())); + DropDownListChannelGroups.SelectedIndex = chosengroup; + } + updateContents(); } - /// <summary> + /// <summary> /// Updates the now and next program rows. /// </summary> protected void updateContents() { - //Clear everything - NowNextPanel.Controls.Clear(); + //Clear everything + NowNextPanel.Controls.Clear(); - //A new Businesslayer - TvBusinessLayer layer = new TvBusinessLayer(); + //A new Businesslayer + TvBusinessLayer layer = new TvBusinessLayer(); - //Get all schedules - _schedules = Schedule.ListAll(); + //Get all schedules + _schedules = Schedule.ListAll(); - ChannelGroup group=ChannelGroup.Retrieve(Int32.Parse(DropDownListChannelGroups.SelectedValue)); + chosengroup = Int32.Parse(DropDownListChannelGroups.SelectedValue); + ChannelGroup group = ChannelGroup.Retrieve(chosengroup); - Table groupTable = new Table(); - groupTable.CellPadding = 0; - groupTable.CellSpacing = 0; - groupTable.CssClass = "grouptable"; + Table groupTable = new Table(); + groupTable.CellPadding = 0; + groupTable.CellSpacing = 0; + groupTable.CssClass = "grouptable"; - // Seperator with group name - TableRow groupSeperatorRow = new TableRow(); - TableCell groupSeperatorCell = new TableCell(); - groupSeperatorCell.CssClass = "seperatorcell"; - groupSeperatorCell.ColumnSpan = 3; - Label groupName = new Label(); - groupName.Text = group.GroupName; - groupSeperatorCell.Controls.Add(groupName); - groupSeperatorRow.Cells.Add(groupSeperatorCell); - groupTable.Rows.Add(groupSeperatorRow); + // Seperator with group name + TableRow groupSeperatorRow = new TableRow(); + TableCell groupSeperatorCell = new TableCell(); + groupSeperatorCell.CssClass = "seperatorcell"; + groupSeperatorCell.ColumnSpan = 3; + Label groupName = new Label(); + groupName.Text = group.GroupName; + groupSeperatorCell.Controls.Add(groupName); + groupSeperatorRow.Cells.Add(groupSeperatorCell); + groupTable.Rows.Add(groupSeperatorRow); - // Get a list of all tv-channels - IList channels = layer.GetTVGuideChannelsForGroup(group.IdGroup); - List<Channel> channelstv = new List<Channel>(); + // Get a list of all tv-channels + IList channels = layer.GetTVGuideChannelsForGroup(group.IdGroup); + List<Channel> channelstv = new List<Channel>(); // Remove non TV channels foreach (Channel channel in channels) { - if (channel.IsTv) - channelstv.Add(channel); + if (channel.IsTv) + channelstv.Add(channel); } //Iterate through all the channels foreach (Channel channel in channelstv) { - TableRow channelNameRow = new TableRow(); + TableRow channelNameRow = new TableRow(); - TableCell spacer = new TableCell(); - spacer.CssClass = "spacer"; - channelNameRow.Controls.Add(spacer); + TableCell spacer = new TableCell(); + spacer.CssClass = "spacer"; + channelNameRow.Controls.Add(spacer); - TableCell channelNameCell = new TableCell(); - channelNameCell.CssClass = "namecell"; - channelNameCell.ColumnSpan = 2; - ImageButton btnStartTimeShift = new ImageButton(); - btnStartTimeShift.ImageUrl = "Images/osd_play_nofocus.png"; - btnStartTimeShift.Width = 20; - btnStartTimeShift.Height = 20; - btnStartTimeShift.ToolTip = Resources.Resource.WatchThisChannel; - btnStartTimeShift.CommandName = "StartTimeshifting"; - btnStartTimeShift.CommandArgument = channel.IdChannel.ToString(); - btnStartTimeShift.Command += new CommandEventHandler(btnStartTimeShift_Command); - channelNameCell.Controls.Add(btnStartTimeShift); - Label channelName = new Label(); - channelName.Text = " "+channel.DisplayName; - channelNameCell.Controls.Add(channelName); - channelNameRow.Cells.Add(channelNameCell); - groupTable.Rows.Add(channelNameRow); + TableCell channelNameCell = new TableCell(); + channelNameCell.CssClass = "namecell"; + channelNameCell.ColumnSpan = 2; + ImageButton btnStartTimeShift = new ImageButton(); + btnStartTimeShift.ImageUrl = "Images/osd_play_nofocus.png"; + btnStartTimeShift.Width = 20; + btnStartTimeShift.Height = 20; + btnStartTimeShift.ToolTip = Resources.Resource.WatchThisChannel; + btnStartTimeShift.CommandName = "StartTimeshifting"; + btnStartTimeShift.CommandArgument = channel.IdChannel.ToString(); + btnStartTimeShift.Command += new CommandEventHandler(btnStartTimeShift_Command); + channelNameCell.Controls.Add(btnStartTimeShift); + Label channelName = new Label(); + channelName.Text = " " + channel.DisplayName; + channelNameCell.Controls.Add(channelName); + channelNameRow.Cells.Add(channelNameCell); + groupTable.Rows.Add(channelNameRow); - TableRow channelRow = new TableRow(); + TableRow channelRow = new TableRow(); - TableCell spacer2 = new TableCell(); - spacer2.CssClass = "spacer2"; - channelRow.Controls.Add(spacer2); + TableCell spacer2 = new TableCell(); + spacer2.CssClass = "spacer2"; + channelRow.Controls.Add(spacer2); - TableCell cell_channel = new TableCell(); - cell_channel.CssClass = "logocell"; + TableCell cell_channel = new TableCell(); + cell_channel.CssClass = "logocell"; - Image channelLogo = new Image(); - channelLogo.CssClass = "channellogo"; - channelLogo.ImageUrl = MPWUtils.getChannelLogoPath(this.Server.MapPath("~/TVLogos/"), channel.Name); + Image channelLogo = new Image(); + channelLogo.CssClass = "channellogo"; + channelLogo.ImageUrl = MPWUtils.getChannelLogoPath(this.Server.MapPath("~/TVLogos/"), channel.Name); - if (channelLogo.ImageUrl != "") - cell_channel.Controls.Add(channelLogo); + if (channelLogo.ImageUrl != "") + cell_channel.Controls.Add(channelLogo); - TableCell cell_program = new TableCell(); - cell_program.CssClass = "detailscell"; + TableCell cell_program = new TableCell(); + cell_program.CssClass = "detailscell"; - Label lbl_program_now = new Label(); - Label lbl_program_next = new Label(); + Label lbl_program_now = new Label(); + Label lbl_program_next = new Label(); - try - { - Program now = channel.GetProgramAt(DateTime.Now); - bool[] nowRec = IsRecording(now); - Program next = channel.GetProgramAt(now.EndTime.AddMinutes(2)); - bool[] nextRec = IsRecording(next); + try + { + Program now = channel.GetProgramAt(DateTime.Now); + bool[] nowRec = IsRecording(now); + Program next = channel.GetProgramAt(now.EndTime.AddMinutes(2)); + bool[] nextRec = IsRecording(next); - lbl_program_now.Text = "<a style href=\"ProgramDetail.aspx?idProgram=" + now.IdProgram.ToString() + "\"><img border=0 src=\"Images/rec_single.png\" alt=\""+Resources.Resource.ScheduleThisProgram+"\" width=12px height=12px/></a> <span class=\"nownext\">" + Resources.Resource.Now + ": </span>"; - lbl_program_now.Text += "<div style=\"display:inline\" TITLE=\"header=["+now.Title+"] body=["+now.Description+"] fade=[on]\">" + now.Title; - lbl_program_now.Text += " (" + now.StartTime.ToShortTimeString() + " - "; - lbl_program_now.Text += now.EndTime.ToShortTimeString() + ")</div>"; - cell_program.Controls.Add(lbl_program_now); + lbl_program_now.Text = "<a style href=\"ProgramDetail.aspx?idProgram=" + now.IdProgram.ToString() + "\"><img border=0 src=\"Images/rec_single.png\" alt=\"" + Resources.Resource.ScheduleThisProgram + "\" width=12px height=12px/></a> <span class=\"nownext\">" + Resources.Resource.Now + ": </span>"; + lbl_program_now.Text += "<div style=\"display:inline\" TITLE=\"header=[" + now.Title + "] body=[" + now.Description + "] fade=[on]\">" + now.Title; + lbl_program_now.Text += " (" + now.StartTime.ToShortTimeString() + " - "; + lbl_program_now.Text += now.EndTime.ToShortTimeString() + ")</div>"; + cell_program.Controls.Add(lbl_program_now); - if (nowRec[0]) - { - Image recIcon = new Image(); - if (nowRec[1]) - recIcon.ImageUrl = "Images/rec_series.png"; - else - recIcon.ImageUrl = "Images/rec_single.png"; - recIcon.ImageAlign = ImageAlign.Middle; - cell_program.Controls.Add(recIcon); - } + if (nowRec[0]) + { + Image recIcon = new Image(); + if (nowRec[1]) + recIcon.ImageUrl = "Images/rec_series.png"; + else + recIcon.ImageUrl = "Images/rec_single.png"; + recIcon.ImageAlign = ImageAlign.Middle; + cell_program.Controls.Add(recIcon); + } - lbl_program_next.Text = "<br /> <br />"; + lbl_program_next.Text = "<br /> <br />"; - lbl_program_next.Text += "<a style href=\"ProgramDetail.aspx?idProgram=" + now.IdProgram.ToString() + "\"><img border=0 src=\"Images/rec_single.png\" alt=\""+Resources.Resource.ScheduleThisProgram+"\" width=12px height=12px/></a> <span class=\"nownext\">" + Resources.Resource.Next + ": </span>"; - lbl_program_next.Text += "<div style=\"display:inline\" TITLE=\"header=[" + next.Title + "] body=[" + next.Description + "] fade=[on]\">" + next.Title; - lbl_program_next.Text += " (" + next.StartTime.ToShortTimeString() + " - "; - lbl_program_next.Text += next.EndTime.ToShortTimeString() + ")</div>"; - cell_program.Controls.Add(lbl_program_next); + lbl_program_next.Text += "<a style href=\"ProgramDetail.aspx?idProgram=" + now.IdProgram.ToString() + "\"><img border=0 src=\"Images/rec_single.png\" alt=\"" + Resources.Resource.ScheduleThisProgram + "\" width=12px height=12px/></a> <span class=\"nownext\">" + Resources.Resource.Next + ": </span>"; + lbl_program_next.Text += "<div style=\"display:inline\" TITLE=\"header=[" + next.Title + "] body=[" + next.Description + "] fade=[on]\">" + next.Title; + lbl_program_next.Text += " (" + next.StartTime.ToShortTimeString() + " - "; + lbl_program_next.Text += next.EndTime.ToShortTimeString() + ")</div>"; + cell_program.Controls.Add(lbl_program_next); - if (nextRec[0]) + if (nextRec[0]) + { + Image recIcon = new Image(); + if (nextRec[1]) + recIcon.ImageUrl = "Images/rec_series.png"; + else + recIcon.ImageUrl = "Images/rec_single.png"; + recIcon.ImageAlign = ImageAlign.Middle; + cell_program.Controls.Add(recIcon); + } + + } + catch { - Image recIcon = new Image(); - if (nextRec[1]) - recIcon.ImageUrl = "Images/rec_series.png"; - else - recIcon.ImageUrl = "Images/rec_single.png"; - recIcon.ImageAlign = ImageAlign.Middle; - cell_program.Controls.Add(recIcon); + lbl_program_now.Text = Resources.Resource.NoEPGInfo; + cell_program.Controls.Add(lbl_program_now); } - } - catch - { - lbl_program_now.Text = Resources.Resource.NoEPGInfo; - cell_program.Controls.Add(lbl_program_now); - } + channelRow.Cells.Add(cell_channel); + channelRow.Cells.Add(cell_program); - channelRow.Cells.Add(cell_channel); - channelRow.Cells.Add(cell_program); + groupTable.Rows.Add(channelRow); - groupTable.Rows.Add(channelRow); + NowNextPanel.Controls.Add(groupTable); - NowNextPanel.Controls.Add(groupTable); + } + } - } + void btnStartTimeShift_Command(object sender, CommandEventArgs e) + { + string rtspURL = ""; + TvResult result = MPWUtils.StartTimeShift(Int32.Parse((string)e.CommandArgument), ref rtspURL); + if (result == TvResult.Succeeded) + ScriptManager.RegisterStartupScript(this, typeof(NowAndNext), "timeshift", "window.open('" + rtspURL + "');", true); + else + ScriptManager.RegisterStartupScript(this, typeof(NowAndNext), "timeshift", "alert('Failed to start timeshifting." + Environment.NewLine + "Reason: " + result.ToString() + "');", true); } - void btnStartTimeShift_Command(object sender, CommandEventArgs e) - { - string rtspURL = ""; - TvResult result=MPWUtils.StartTimeShift(Int32.Parse((string)e.CommandArgument), ref rtspURL); - if (result==TvResult.Succeeded) - ScriptManager.RegisterStartupScript(this, typeof(NowAndNext), "timeshift", "window.open('" + rtspURL + "');",true); - else - ScriptManager.RegisterStartupScript(this, typeof(NowAndNext), "timeshift", "alert('Failed to start timeshifting."+Environment.NewLine+"Reason: "+result.ToString()+"');", true); - } - protected void btnUpdate_Click(object sender, EventArgs e) - { - updateContents(); - } + /// <summary> + /// Is called if another channel group is chosen. + /// </summary> + /// <param name="sender"></param> + /// <param name="e"></param> + protected void groupChosen(object sender, EventArgs e) + { + updateContents(); + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mas...@us...> - 2007-09-17 16:30:03
|
Revision: 49 http://mp-webinterface.svn.sourceforge.net/mp-webinterface/?rev=49&view=rev Author: maschine Date: 2007-09-17 09:29:53 -0700 (Mon, 17 Sep 2007) Log Message: ----------- Changes by gemx and my improvements to guide channel group chosing. Modified Paths: -------------- trunk/Version2/Web App/MPW/App_Code/Utils.cs trunk/Version2/Web App/MPW/App_GlobalResources/Resource.de.resx trunk/Version2/Web App/MPW/App_GlobalResources/Resource.resx trunk/Version2/Web App/MPW/Bin/DirectShowLib.dll trunk/Version2/Web App/MPW/Bin/TVDatabase.dll trunk/Version2/Web App/MPW/Bin/TVLibrary.dll trunk/Version2/Web App/MPW/Bin/TvBusinessLayer.dll trunk/Version2/Web App/MPW/Bin/TvControl.dll trunk/Version2/Web App/MPW/Bin/TvLibrary.Interfaces.dll trunk/Version2/Web App/MPW/Default.aspx trunk/Version2/Web App/MPW/Default.aspx.cs trunk/Version2/Web App/MPW/NowNext.aspx trunk/Version2/Web App/MPW/NowNext.aspx.cs trunk/Version2/Web App/MPW/web.config Added Paths: ----------- trunk/Version2/Web App/MPW/Images/osd_play_nofocus.png trunk/Version2/Web App/MPW/Images/play_enabled.png trunk/Version2/Web App/MPW/JS/boxover.js Modified: trunk/Version2/Web App/MPW/App_Code/Utils.cs =================================================================== --- trunk/Version2/Web App/MPW/App_Code/Utils.cs 2007-07-24 13:26:50 UTC (rev 48) +++ trunk/Version2/Web App/MPW/App_Code/Utils.cs 2007-09-17 16:29:53 UTC (rev 49) @@ -138,5 +138,26 @@ ScheduleType.Items.Add(new ListItem(Resources.Resource.WorkingDays, ((int)ScheduleRecordingType.WorkingDays).ToString())); } + public static TvResult StartTimeShift(int idChannel,ref string rtspURL) + { + VirtualCard vcard; + TvResult result; + User me = new User(); + if (RemoteControl.Instance.IsTimeShifting(ref me)) + RemoteControl.Instance.StopTimeShifting(ref me); + try + { + result = RemoteControl.Instance.StartTimeShifting(ref me, idChannel, out vcard); + } + catch (Exception) + { + return TvResult.UnknownError; + } + if (result == TvResult.Succeeded) + { + rtspURL = vcard.RTSPUrl; + } + return result; + } } } \ No newline at end of file Modified: trunk/Version2/Web App/MPW/App_GlobalResources/Resource.de.resx =================================================================== --- trunk/Version2/Web App/MPW/App_GlobalResources/Resource.de.resx 2007-07-24 13:26:50 UTC (rev 48) +++ trunk/Version2/Web App/MPW/App_GlobalResources/Resource.de.resx 2007-09-17 16:29:53 UTC (rev 49) @@ -117,6 +117,9 @@ <resheader name="writer"> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> + <data name="ChannelGroup" xml:space="preserve"> + <value>Programmgruppe</value> + </data> <data name="Daily" xml:space="preserve"> <value>Täglich</value> <comment>ScheduleType</comment> @@ -175,10 +178,19 @@ <value>Timer</value> <comment>Navigation</comment> </data> + <data name="ScheduleThisProgram" xml:space="preserve"> + <value>Diese Sendung aufzeichnen</value> + </data> <data name="Search" xml:space="preserve"> <value>Suchen</value> <comment>Navigation</comment> </data> + <data name="Update" xml:space="preserve"> + <value>Aktualisieren</value> + </data> + <data name="WatchThisChannel" xml:space="preserve"> + <value>Diesen Kanal anschauen</value> + </data> <data name="Weekends" xml:space="preserve"> <value>Weekends</value> <comment>ScheduleType</comment> Modified: trunk/Version2/Web App/MPW/App_GlobalResources/Resource.resx =================================================================== --- trunk/Version2/Web App/MPW/App_GlobalResources/Resource.resx 2007-07-24 13:26:50 UTC (rev 48) +++ trunk/Version2/Web App/MPW/App_GlobalResources/Resource.resx 2007-09-17 16:29:53 UTC (rev 49) @@ -117,6 +117,9 @@ <resheader name="writer"> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> + <data name="ChannelGroup" xml:space="preserve"> + <value>Programmgruppe</value> + </data> <data name="Daily" xml:space="preserve"> <value>Daily</value> <comment>ScheduleType</comment> @@ -181,10 +184,19 @@ <value>Schedules</value> <comment>Navigation</comment> </data> + <data name="ScheduleThisProgram" xml:space="preserve"> + <value>ScheduleThisProgram</value> + </data> <data name="Search" xml:space="preserve"> <value>Search</value> <comment>Navigation</comment> </data> + <data name="Update" xml:space="preserve"> + <value>Update</value> + </data> + <data name="WatchThisChannel" xml:space="preserve"> + <value>Watch this channel</value> + </data> <data name="Weekends" xml:space="preserve"> <value>Weekends</value> <comment>ScheduleType</comment> Modified: trunk/Version2/Web App/MPW/Bin/DirectShowLib.dll =================================================================== (Binary files differ) Modified: trunk/Version2/Web App/MPW/Bin/TVDatabase.dll =================================================================== (Binary files differ) Modified: trunk/Version2/Web App/MPW/Bin/TVLibrary.dll =================================================================== (Binary files differ) Modified: trunk/Version2/Web App/MPW/Bin/TvBusinessLayer.dll =================================================================== (Binary files differ) Modified: trunk/Version2/Web App/MPW/Bin/TvControl.dll =================================================================== (Binary files differ) Modified: trunk/Version2/Web App/MPW/Bin/TvLibrary.Interfaces.dll =================================================================== (Binary files differ) Modified: trunk/Version2/Web App/MPW/Default.aspx =================================================================== --- trunk/Version2/Web App/MPW/Default.aspx 2007-07-24 13:26:50 UTC (rev 48) +++ trunk/Version2/Web App/MPW/Default.aspx 2007-09-17 16:29:53 UTC (rev 49) @@ -1,17 +1,22 @@ -<%@ Page Language="C#" MasterPageFile="~/MPW.master" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" Title="Untitled Page" %> -<asp:Content ID="Content1" ContentPlaceHolderID="MPWContent" Runat="Server"> - <br /> - <asp:Button ID="ButtonPrev" runat="server" Text="<" /> - <asp:Button ID="ButtonNext" runat="server" Text=">" /> - <asp:DropDownList ID="GroupDropDown" runat="server"> - </asp:DropDownList> - <asp:DropDownList ID="TimeDropDown" runat="server"> - </asp:DropDownList> - <asp:DropDownList ID="DateDropDown" runat="server"> - </asp:DropDownList> - <br /> +<%@ Page Language="C#" MasterPageFile="~/MPW.master" AutoEventWireup="true" CodeFile="Default.aspx.cs" + Inherits="_Default" Title="Untitled Page" %> + +<asp:Content ID="Content1" ContentPlaceHolderID="MPWContent" runat="Server"> <asp:UpdatePanel ID="GuideUpdatePanel" runat="server" UpdateMode="Conditional"> <ContentTemplate> + <br /> + <asp:Label ID="LabelChannelGroup" runat="server" Text="Label"></asp:Label> + <asp:DropDownList ID="DropDownListChannelGroups" runat="server" OnSelectedIndexChanged="groupChosen" AutoPostBack="True"> + </asp:DropDownList> + <asp:Button ID="ButtonPrev" runat="server" Text="<" /> + <asp:Button ID="ButtonNext" runat="server" Text=">" /> + <asp:DropDownList ID="GroupDropDown" runat="server"> + </asp:DropDownList> + <asp:DropDownList ID="TimeDropDown" runat="server"> + </asp:DropDownList> + <asp:DropDownList ID="DateDropDown" runat="server"> + </asp:DropDownList> + <br /> <asp:Table ID="Guide" runat="server" Width="90%"> </asp:Table> </ContentTemplate> @@ -19,4 +24,3 @@ </Triggers> </asp:UpdatePanel> </asp:Content> - Modified: trunk/Version2/Web App/MPW/Default.aspx.cs =================================================================== --- trunk/Version2/Web App/MPW/Default.aspx.cs 2007-07-24 13:26:50 UTC (rev 48) +++ trunk/Version2/Web App/MPW/Default.aspx.cs 2007-09-17 16:29:53 UTC (rev 49) @@ -17,8 +17,45 @@ private DateTime guideStart; private DateTime guideEnd; + private int chosengroup = 0; + + IList groups; + IList channels; + + //A new Businesslayer + TvBusinessLayer layer = new TvBusinessLayer(); + protected void Page_Load(object sender, EventArgs e) { + //Establish the connection to the TV Server and the DB. + MPWUtils.SetupConnection(); + + // Get a list of all tv-channels + if (!IsPostBack) + { + // List all groups + groups = ChannelGroup.ListAll(); + + // Prepare DropDown list for channel groups. + LabelChannelGroup.Text = Resources.Resource.ChannelGroup; + DropDownListChannelGroups.Items.Clear(); + foreach (ChannelGroup group in groups) + DropDownListChannelGroups.Items.Add(new ListItem(group.GroupName, group.IdGroup.ToString())); + DropDownListChannelGroups.SelectedIndex = chosengroup; + } + + updateContents(); + } + + /// <summary> + /// Method to update all visible content. + /// </summary> + protected void updateContents() + { + chosengroup = Int32.Parse(DropDownListChannelGroups.SelectedValue); + ChannelGroup group = ChannelGroup.Retrieve(chosengroup); + channels = layer.GetTVGuideChannelsForGroup(group.IdGroup); + int mins = DateTime.Now.Minute; guideStart = DateTime.Now.Subtract(new TimeSpan(0, mins, 0)); if (mins >= 30) @@ -28,22 +65,6 @@ guideEnd = guideStart.AddHours(3); - //Establish the connection to the TV Server and the DB. - MPWUtils.SetupConnection(); - - // Get a list of all tv-channels - IList channels = Channel.ListAll(); - - // List all groups - IList groups = ChannelGroup.ListAll(); - - // Remove non-TV channels - foreach (Channel channel in channels) - { - if (!channel.IsTv) - channels.Remove(channel); - } - //The Time TableRow timerow = new TableRow(); TableCell spacer = new TableCell(); @@ -61,6 +82,8 @@ //Iterate through all the channels foreach (Channel channel in channels) { + if (!channel.IsTv) + continue; TableRow r = new TableRow(); TableCell cell_channel = new TableCell(); TableCell cell_program = new TableCell(); @@ -160,4 +183,15 @@ Guide.Rows.Add(r); } } + + /// <summary> + /// Is called if another channel group is chosen. + /// </summary> + /// <param name="sender"></param> + /// <param name="e"></param> + protected void groupChosen(object sender, EventArgs e) + { + Guide.Controls.Clear(); + updateContents(); + } } Added: trunk/Version2/Web App/MPW/Images/osd_play_nofocus.png =================================================================== (Binary files differ) Property changes on: trunk/Version2/Web App/MPW/Images/osd_play_nofocus.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/Version2/Web App/MPW/Images/play_enabled.png =================================================================== (Binary files differ) Property changes on: trunk/Version2/Web App/MPW/Images/play_enabled.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/Version2/Web App/MPW/JS/boxover.js =================================================================== --- trunk/Version2/Web App/MPW/JS/boxover.js (rev 0) +++ trunk/Version2/Web App/MPW/JS/boxover.js 2007-09-17 16:29:53 UTC (rev 49) @@ -0,0 +1,372 @@ +/* --- BoxOver --- +/* --- v 2.1 17th June 2006 +By Oliver Bryant with help of Matthew Tagg +http://boxover.swazz.org */ + +if (typeof document.attachEvent!='undefined') { + window.attachEvent('onload',init); + document.attachEvent('onmousemove',moveMouse); + document.attachEvent('onclick',checkMove); } +else { + window.addEventListener('load',init,false); + document.addEventListener('mousemove',moveMouse,false); + document.addEventListener('click',checkMove,false); +} + +var oDv=document.createElement("div"); +var dvHdr=document.createElement("div"); +var dvBdy=document.createElement("div"); +var windowlock,boxMove,fixposx,fixposy,lockX,lockY,fixx,fixy,ox,oy,boxLeft,boxRight,boxTop,boxBottom,evt,mouseX,mouseY,boxOpen,totalScrollTop,totalScrollLeft; +boxOpen=false; +ox=10; +oy=10; +lockX=0; +lockY=0; + +function init() { + oDv.appendChild(dvHdr); + oDv.appendChild(dvBdy); + oDv.style.position="absolute"; + oDv.style.visibility='hidden'; + document.body.appendChild(oDv); +} + +function defHdrStyle() { + dvHdr.innerHTML='<img style="vertical-align:middle" src="info.gif"> '+dvHdr.innerHTML; + dvHdr.style.fontWeight='bold'; + dvHdr.style.width='200px'; + dvHdr.style.fontFamily='arial'; + dvHdr.style.border='1px solid #A5CFE9'; + dvHdr.style.padding='3'; + dvHdr.style.fontSize='11'; + dvHdr.style.color='#4B7A98'; + dvHdr.style.background='#D5EBF9'; + dvHdr.style.filter='alpha(opacity=90)'; // IE + dvHdr.style.opacity='0.85'; // FF +} + +function defBdyStyle() { + dvBdy.style.borderBottom='1px solid #A5CFE9'; + dvBdy.style.borderLeft='1px solid #A5CFE9'; + dvBdy.style.borderRight='1px solid #A5CFE9'; + dvBdy.style.width='200px'; + dvBdy.style.fontFamily='arial'; + dvBdy.style.fontSize='11'; + dvBdy.style.padding='3'; + dvBdy.style.color='#1B4966'; + dvBdy.style.background='#FFFFFF'; + dvBdy.style.filter='alpha(opacity=90)'; // IE + dvBdy.style.opacity='0.85'; // FF +} + +function checkElemBO(txt) { +if (!txt || typeof(txt) != 'string') return false; +if ((txt.indexOf('header')>-1)&&(txt.indexOf('body')>-1)&&(txt.indexOf('[')>-1)&&(txt.indexOf('[')>-1)) + return true; +else + return false; +} + +function scanBO(curNode) { + if (checkElemBO(curNode.title)) { + curNode.boHDR=getParam('header',curNode.title); + curNode.boBDY=getParam('body',curNode.title); + curNode.boCSSBDY=getParam('cssbody',curNode.title); + curNode.boCSSHDR=getParam('cssheader',curNode.title); + curNode.IEbugfix=(getParam('hideselects',curNode.title)=='on')?true:false; + curNode.fixX=parseInt(getParam('fixedrelx',curNode.title)); + curNode.fixY=parseInt(getParam('fixedrely',curNode.title)); + curNode.absX=parseInt(getParam('fixedabsx',curNode.title)); + curNode.absY=parseInt(getParam('fixedabsy',curNode.title)); + curNode.offY=(getParam('offsety',curNode.title)!='')?parseInt(getParam('offsety',curNode.title)):10; + curNode.offX=(getParam('offsetx',curNode.title)!='')?parseInt(getParam('offsetx',curNode.title)):10; + curNode.fade=(getParam('fade',curNode.title)=='on')?true:false; + curNode.fadespeed=(getParam('fadespeed',curNode.title)!='')?getParam('fadespeed',curNode.title):0.04; + curNode.delay=(getParam('delay',curNode.title)!='')?parseInt(getParam('delay',curNode.title)):0; + if (getParam('requireclick',curNode.title)=='on') { + curNode.requireclick=true; + document.all?curNode.attachEvent('onclick',showHideBox):curNode.addEventListener('click',showHideBox,false); + document.all?curNode.attachEvent('onmouseover',hideBox):curNode.addEventListener('mouseover',hideBox,false); + } + else {// Note : if requireclick is on the stop clicks are ignored + if (getParam('doubleclickstop',curNode.title)!='off') { + document.all?curNode.attachEvent('ondblclick',pauseBox):curNode.addEventListener('dblclick',pauseBox,false); + } + if (getParam('singleclickstop',curNode.title)=='on') { + document.all?curNode.attachEvent('onclick',pauseBox):curNode.addEventListener('click',pauseBox,false); + } + } + curNode.windowLock=getParam('windowlock',curNode.title).toLowerCase()=='off'?false:true; + curNode.title=''; + curNode.hasbox=1; + } + else + curNode.hasbox=2; +} + + +function getParam(param,list) { + var reg = new RegExp('([^a-zA-Z]' + param + '|^' + param + ')\\s*=\\s*\\[\\s*(((\\[\\[)|(\\]\\])|([^\\]\\[]))*)\\s*\\]'); + var res = reg.exec(list); + var returnvar; + if(res) + return res[2].replace('[[','[').replace(']]',']'); + else + return ''; +} + +function Left(elem){ + var x=0; + if (elem.calcLeft) + return elem.calcLeft; + var oElem=elem; + while(elem){ + if ((elem.currentStyle)&& (!isNaN(parseInt(elem.currentStyle.borderLeftWidth)))&&(x!=0)) + x+=parseInt(elem.currentStyle.borderLeftWidth); + x+=elem.offsetLeft; + elem=elem.offsetParent; + } + oElem.calcLeft=x; + return x; + } + +function Top(elem){ + var x=0; + if (elem.calcTop) + return elem.calcTop; + var oElem=elem; + while(elem){ + if ((elem.currentStyle)&& (!isNaN(parseInt(elem.currentStyle.borderTopWidth)))&&(x!=0)) + x+=parseInt(elem.currentStyle.borderTopWidth); + x+=elem.offsetTop; + elem=elem.offsetParent; + } + oElem.calcTop=x; + return x; + +} + +var ah,ab; +function applyStyles() { + if(ab) + oDv.removeChild(dvBdy); + if (ah) + oDv.removeChild(dvHdr); + dvHdr=document.createElement("div"); + dvBdy=document.createElement("div"); + CBE.boCSSBDY?dvBdy.className=CBE.boCSSBDY:defBdyStyle(); + CBE.boCSSHDR?dvHdr.className=CBE.boCSSHDR:defHdrStyle(); + dvHdr.innerHTML=CBE.boHDR; + dvBdy.innerHTML=CBE.boBDY; + ah=false; + ab=false; + if (CBE.boHDR!='') { + oDv.appendChild(dvHdr); + ah=true; + } + if (CBE.boBDY!=''){ + oDv.appendChild(dvBdy); + ab=true; + } +} + +var CSE,iterElem,LSE,CBE,LBE, totalScrollLeft, totalScrollTop, width, height ; +var ini=false; + +// Customised function for inner window dimension +function SHW() { + if (document.body && (document.body.clientWidth !=0)) { + width=document.body.clientWidth; + height=document.body.clientHeight; + } + if (document.documentElement && (document.documentElement.clientWidth!=0) && (document.body.clientWidth + 20 >= document.documentElement.clientWidth)) { + width=document.documentElement.clientWidth; + height=document.documentElement.clientHeight; + } + return [width,height]; +} + + +var ID=null; +function moveMouse(e) { + //boxMove=true; + e?evt=e:evt=event; + + CSE=evt.target?evt.target:evt.srcElement; + + if (!CSE.hasbox) { + // Note we need to scan up DOM here, some elements like TR don't get triggered as srcElement + iElem=CSE; + while ((iElem.parentNode) && (!iElem.hasbox)) { + scanBO(iElem); + iElem=iElem.parentNode; + } + } + + if ((CSE!=LSE)&&(!isChild(CSE,dvHdr))&&(!isChild(CSE,dvBdy))){ + if (!CSE.boxItem) { + iterElem=CSE; + while ((iterElem.hasbox==2)&&(iterElem.parentNode)) + iterElem=iterElem.parentNode; + CSE.boxItem=iterElem; + } + iterElem=CSE.boxItem; + if (CSE.boxItem&&(CSE.boxItem.hasbox==1)) { + LBE=CBE; + CBE=iterElem; + if (CBE!=LBE) { + applyStyles(); + if (!CBE.requireclick) + if (CBE.fade) { + if (ID!=null) + clearTimeout(ID); + ID=setTimeout("fadeIn("+CBE.fadespeed+")",CBE.delay); + } + else { + if (ID!=null) + clearTimeout(ID); + COL=1; + ID=setTimeout("oDv.style.visibility='visible';ID=null;",CBE.delay); + } + if (CBE.IEbugfix) {hideSelects();} + fixposx=!isNaN(CBE.fixX)?Left(CBE)+CBE.fixX:CBE.absX; + fixposy=!isNaN(CBE.fixY)?Top(CBE)+CBE.fixY:CBE.absY; + lockX=0; + lockY=0; + boxMove=true; + ox=CBE.offX?CBE.offX:10; + oy=CBE.offY?CBE.offY:10; + } + } + else if (!isChild(CSE,dvHdr) && !isChild(CSE,dvBdy) && (boxMove)) { + // The conditional here fixes flickering between tables cells. + if ((!isChild(CBE,CSE)) || (CSE.tagName!='TABLE')) { + CBE=null; + if (ID!=null) + clearTimeout(ID); + fadeOut(); + showSelects(); + } + } + LSE=CSE; + } + else if (((isChild(CSE,dvHdr) || isChild(CSE,dvBdy))&&(boxMove))) { + totalScrollLeft=0; + totalScrollTop=0; + + iterElem=CSE; + while(iterElem) { + if(!isNaN(parseInt(iterElem.scrollTop))) + totalScrollTop+=parseInt(iterElem.scrollTop); + if(!isNaN(parseInt(iterElem.scrollLeft))) + totalScrollLeft+=parseInt(iterElem.scrollLeft); + iterElem=iterElem.parentNode; + } + if (CBE!=null) { + boxLeft=Left(CBE)-totalScrollLeft; + boxRight=parseInt(Left(CBE)+CBE.offsetWidth)-totalScrollLeft; + boxTop=Top(CBE)-totalScrollTop; + boxBottom=parseInt(Top(CBE)+CBE.offsetHeight)-totalScrollTop; + doCheck(); + } + } + + if (boxMove&&CBE) { + // This added to alleviate bug in IE6 w.r.t DOCTYPE + bodyScrollTop=document.documentElement&&document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop; + bodyScrollLet=document.documentElement&&document.documentElement.scrollLeft?document.documentElement.scrollLeft:document.body.scrollLeft; + mouseX=evt.pageX?evt.pageX-bodyScrollLet:evt.clientX-document.body.clientLeft; + mouseY=evt.pageY?evt.pageY-bodyScrollTop:evt.clientY-document.body.clientTop; + if ((CBE)&&(CBE.windowLock)) { + mouseY < -oy?lockY=-mouseY-oy:lockY=0; + mouseX < -ox?lockX=-mouseX-ox:lockX=0; + mouseY > (SHW()[1]-oDv.offsetHeight-oy)?lockY=-mouseY+SHW()[1]-oDv.offsetHeight-oy:lockY=lockY; + mouseX > (SHW()[0]-dvBdy.offsetWidth-ox)?lockX=-mouseX-ox+SHW()[0]-dvBdy.offsetWidth:lockX=lockX; + } + oDv.style.left=((fixposx)||(fixposx==0))?fixposx:bodyScrollLet+mouseX+ox+lockX+"px"; + oDv.style.top=((fixposy)||(fixposy==0))?fixposy:bodyScrollTop+mouseY+oy+lockY+"px"; + + } +} + +function doCheck() { + if ( (mouseX < boxLeft) || (mouseX >boxRight) || (mouseY < boxTop) || (mouseY > boxBottom)) { + if (!CBE.requireclick) + fadeOut(); + if (CBE.IEbugfix) {showSelects();} + CBE=null; + } +} + +function pauseBox(e) { + e?evt=e:evt=event; + boxMove=false; + evt.cancelBubble=true; +} + +function showHideBox(e) { + oDv.style.visibility=(oDv.style.visibility!='visible')?'visible':'hidden'; +} + +function hideBox(e) { + oDv.style.visibility='hidden'; +} + +var COL=0; +var stopfade=false; +function fadeIn(fs) { + ID=null; + COL=0; + oDv.style.visibility='visible'; + fadeIn2(fs); +} + +function fadeIn2(fs) { + COL=COL+fs; + COL=(COL>1)?1:COL; + oDv.style.filter='alpha(opacity='+parseInt(100*COL)+')'; + oDv.style.opacity=COL; + if (COL<1) + setTimeout("fadeIn2("+fs+")",20); +} + + +function fadeOut() { + oDv.style.visibility='hidden'; + +} + +function isChild(s,d) { + while(s) { + if (s==d) + return true; + s=s.parentNode; + } + return false; +} + +var cSrc; +function checkMove(e) { + e?evt=e:evt=event; + cSrc=evt.target?evt.target:evt.srcElement; + if ((!boxMove)&&(!isChild(cSrc,oDv))) { + fadeOut(); + if (CBE&&CBE.IEbugfix) {showSelects();} + boxMove=true; + CBE=null; + } +} + +function showSelects(){ + var elements = document.getElementsByTagName("select"); + for (i=0;i< elements.length;i++){ + elements[i].style.visibility='visible'; + } +} + +function hideSelects(){ + var elements = document.getElementsByTagName("select"); + for (i=0;i< elements.length;i++){ + elements[i].style.visibility='hidden'; + } +} \ No newline at end of file Modified: trunk/Version2/Web App/MPW/NowNext.aspx =================================================================== --- trunk/Version2/Web App/MPW/NowNext.aspx 2007-07-24 13:26:50 UTC (rev 48) +++ trunk/Version2/Web App/MPW/NowNext.aspx 2007-09-17 16:29:53 UTC (rev 49) @@ -1,12 +1,21 @@ <%@ Page Language="C#" MasterPageFile="~/MPW.master" AutoEventWireup="true" CodeFile="NowNext.aspx.cs" Inherits="Default2" Title="Untitled Page" %> +<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %> + <asp:Content ID="NowNext" ContentPlaceHolderID="MPWContent" runat="Server"> - <asp:UpdatePanel ID="ContentUpdatePanel" runat="server" UpdateMode="Always"> +<script type="text/javascript" src="JS/boxover.js"></script> + <asp:UpdatePanel ID="ContentUpdatePanel" runat="server" UpdateMode="Always" > <ContentTemplate> <div> + <asp:Label ID="LabelChannelGroup" runat="server" Text="Label"></asp:Label> + <asp:DropDownList ID="DropDownListChannelGroups" runat="server"> + </asp:DropDownList> + <asp:Button ID="btnUpdate" runat="server" OnClick="btnUpdate_Click" Text="Button" /> <asp:Panel ID="NowNextPanel" runat="server"> </asp:Panel> - </div> + + </div> + </ContentTemplate> </asp:UpdatePanel> </asp:Content> Modified: trunk/Version2/Web App/MPW/NowNext.aspx.cs =================================================================== --- trunk/Version2/Web App/MPW/NowNext.aspx.cs 2007-07-24 13:26:50 UTC (rev 48) +++ trunk/Version2/Web App/MPW/NowNext.aspx.cs 2007-09-17 16:29:53 UTC (rev 49) @@ -8,7 +8,7 @@ using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; - +using TvControl; using TvDatabase; using MPW; using System.Collections.Generic; @@ -39,8 +39,22 @@ protected void Page_Load(object sender, EventArgs e) { - MPWMaster m = (MPWMaster)Page.Master; - m.Sectiontitle = Resources.Resource.NowNext; + //Establish the connection to the TV Server and the DB. + MPWUtils.SetupConnection(); + if (!IsPostBack) + { + MPWMaster m = (MPWMaster)Page.Master; + //Set language resources + m.Sectiontitle = Resources.Resource.NowNext; + LabelChannelGroup.Text = Resources.Resource.ChannelGroup; + btnUpdate.Text = Resources.Resource.Update; + + IList groups = ChannelGroup.ListAll(); + DropDownListChannelGroups.Items.Clear(); + foreach (ChannelGroup group in groups) + DropDownListChannelGroups.Items.Add(new ListItem(group.GroupName,group.IdGroup.ToString())); + DropDownListChannelGroups.SelectedIndex = 0; + } updateContents(); } @@ -52,39 +66,33 @@ //Clear everything NowNextPanel.Controls.Clear(); - //Establish the connection to the TV Server and the DB. - MPWUtils.SetupConnection(); - //A new Businesslayer TvBusinessLayer layer = new TvBusinessLayer(); //Get all schedules _schedules = Schedule.ListAll(); - //Get all groups - IList groups = ChannelGroup.ListAll(); + ChannelGroup group=ChannelGroup.Retrieve(Int32.Parse(DropDownListChannelGroups.SelectedValue)); - foreach (ChannelGroup group in groups) - { - Table groupTable = new Table(); - groupTable.CellPadding = 0; - groupTable.CellSpacing = 0; - groupTable.CssClass = "grouptable"; + Table groupTable = new Table(); + groupTable.CellPadding = 0; + groupTable.CellSpacing = 0; + groupTable.CssClass = "grouptable"; - // Seperator with group name - TableRow groupSeperatorRow = new TableRow(); - TableCell groupSeperatorCell = new TableCell(); - groupSeperatorCell.CssClass = "seperatorcell"; - groupSeperatorCell.ColumnSpan = 3; - Label groupName = new Label(); - groupName.Text = group.GroupName; - groupSeperatorCell.Controls.Add(groupName); - groupSeperatorRow.Cells.Add(groupSeperatorCell); - groupTable.Rows.Add(groupSeperatorRow); + // Seperator with group name + TableRow groupSeperatorRow = new TableRow(); + TableCell groupSeperatorCell = new TableCell(); + groupSeperatorCell.CssClass = "seperatorcell"; + groupSeperatorCell.ColumnSpan = 3; + Label groupName = new Label(); + groupName.Text = group.GroupName; + groupSeperatorCell.Controls.Add(groupName); + groupSeperatorRow.Cells.Add(groupSeperatorCell); + groupTable.Rows.Add(groupSeperatorRow); - // Get a list of all tv-channels - IList channels = layer.GetTVGuideChannelsForGroup(group.IdGroup); - List<Channel> channelstv = new List<Channel>(); + // Get a list of all tv-channels + IList channels = layer.GetTVGuideChannelsForGroup(group.IdGroup); + List<Channel> channelstv = new List<Channel>(); // Remove non TV channels foreach (Channel channel in channels) @@ -105,8 +113,17 @@ TableCell channelNameCell = new TableCell(); channelNameCell.CssClass = "namecell"; channelNameCell.ColumnSpan = 2; + ImageButton btnStartTimeShift = new ImageButton(); + btnStartTimeShift.ImageUrl = "Images/osd_play_nofocus.png"; + btnStartTimeShift.Width = 20; + btnStartTimeShift.Height = 20; + btnStartTimeShift.ToolTip = Resources.Resource.WatchThisChannel; + btnStartTimeShift.CommandName = "StartTimeshifting"; + btnStartTimeShift.CommandArgument = channel.IdChannel.ToString(); + btnStartTimeShift.Command += new CommandEventHandler(btnStartTimeShift_Command); + channelNameCell.Controls.Add(btnStartTimeShift); Label channelName = new Label(); - channelName.Text = channel.Name; + channelName.Text = " "+channel.DisplayName; channelNameCell.Controls.Add(channelName); channelNameRow.Cells.Add(channelNameCell); groupTable.Rows.Add(channelNameRow); @@ -140,10 +157,10 @@ Program next = channel.GetProgramAt(now.EndTime.AddMinutes(2)); bool[] nextRec = IsRecording(next); - lbl_program_now.Text = "<span class=\"nownext\">" + Resources.Resource.Now + ": </span>"; - lbl_program_now.Text += "<a href=\"ProgramDetail.aspx?idProgram=" + now.IdProgram + "\">" + now.Title + "</a>"; ; + lbl_program_now.Text = "<a style href=\"ProgramDetail.aspx?idProgram=" + now.IdProgram.ToString() + "\"><img border=0 src=\"Images/rec_single.png\" alt=\""+Resources.Resource.ScheduleThisProgram+"\" width=12px height=12px/></a> <span class=\"nownext\">" + Resources.Resource.Now + ": </span>"; + lbl_program_now.Text += "<div style=\"display:inline\" TITLE=\"header=["+now.Title+"] body=["+now.Description+"] fade=[on]\">" + now.Title; lbl_program_now.Text += " (" + now.StartTime.ToShortTimeString() + " - "; - lbl_program_now.Text += now.EndTime.ToShortTimeString() + ")"; + lbl_program_now.Text += now.EndTime.ToShortTimeString() + ")</div>"; cell_program.Controls.Add(lbl_program_now); if (nowRec[0]) @@ -159,10 +176,10 @@ lbl_program_next.Text = "<br /> <br />"; - lbl_program_next.Text += "<span class=\"nownext\">" + Resources.Resource.Next + ": </span>"; - lbl_program_next.Text += next.Title; + lbl_program_next.Text += "<a style href=\"ProgramDetail.aspx?idProgram=" + now.IdProgram.ToString() + "\"><img border=0 src=\"Images/rec_single.png\" alt=\""+Resources.Resource.ScheduleThisProgram+"\" width=12px height=12px/></a> <span class=\"nownext\">" + Resources.Resource.Next + ": </span>"; + lbl_program_next.Text += "<div style=\"display:inline\" TITLE=\"header=[" + next.Title + "] body=[" + next.Description + "] fade=[on]\">" + next.Title; lbl_program_next.Text += " (" + next.StartTime.ToShortTimeString() + " - "; - lbl_program_next.Text += next.EndTime.ToShortTimeString() + ")"; + lbl_program_next.Text += next.EndTime.ToShortTimeString() + ")</div>"; cell_program.Controls.Add(lbl_program_next); if (nextRec[0]) @@ -189,8 +206,22 @@ groupTable.Rows.Add(channelRow); NowNextPanel.Controls.Add(groupTable); - } + } } + + void btnStartTimeShift_Command(object sender, CommandEventArgs e) + { + string rtspURL = ""; + TvResult result=MPWUtils.StartTimeShift(Int32.Parse((string)e.CommandArgument), ref rtspURL); + if (result==TvResult.Succeeded) + ScriptManager.RegisterStartupScript(this, typeof(NowAndNext), "timeshift", "window.open('" + rtspURL + "');",true); + else + ScriptManager.RegisterStartupScript(this, typeof(NowAndNext), "timeshift", "alert('Failed to start timeshifting."+Environment.NewLine+"Reason: "+result.ToString()+"');", true); } + protected void btnUpdate_Click(object sender, EventArgs e) + { + updateContents(); + } +} Modified: trunk/Version2/Web App/MPW/web.config =================================================================== --- trunk/Version2/Web App/MPW/web.config 2007-07-24 13:26:50 UTC (rev 48) +++ trunk/Version2/Web App/MPW/web.config 2007-09-17 16:29:53 UTC (rev 49) @@ -27,7 +27,8 @@ <compilation debug="true"> <assemblies> <add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/> - </assemblies> + <add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/> + <add assembly="System.Web.Extensions.Design, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/></assemblies> </compilation> <httpHandlers> <remove verb="*" path="*.asmx"/> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mas...@us...> - 2007-07-24 13:26:55
|
Revision: 48 http://svn.sourceforge.net/mp-webinterface/?rev=48&view=rev Author: maschine Date: 2007-07-24 06:26:50 -0700 (Tue, 24 Jul 2007) Log Message: ----------- Adding ProgramDetail page and improvements to guide and now/next. Modified Paths: -------------- trunk/Version2/Web App/MPW/Default.aspx.cs trunk/Version2/Web App/MPW/NowNext.aspx trunk/Version2/Web App/MPW/NowNext.aspx.cs Added Paths: ----------- trunk/Version2/Web App/MPW/ProgramDetail.aspx trunk/Version2/Web App/MPW/ProgramDetail.aspx.cs Modified: trunk/Version2/Web App/MPW/Default.aspx.cs =================================================================== --- trunk/Version2/Web App/MPW/Default.aspx.cs 2007-07-17 17:25:09 UTC (rev 47) +++ trunk/Version2/Web App/MPW/Default.aspx.cs 2007-07-24 13:26:50 UTC (rev 48) @@ -65,6 +65,7 @@ TableCell cell_channel = new TableCell(); TableCell cell_program = new TableCell(); cell_program.ColumnSpan = 3; + cell_program.Height = 80; cell_channel.CssClass = "logocell"; @@ -102,7 +103,7 @@ int width = Int32.Parse(widthTime.Hours.ToString()) * 60; width += Int32.Parse(widthTime.Minutes.ToString()); firstcell.ColumnSpan = width / 2; - firstcell.Text = current.Title + " " + width.ToString(); + firstcell.Text = "<a href=\"ProgramDetail.aspx?idProgram=" + current.IdProgram + "\">" + current.Title + "</a>"; programsRow.Cells.Add(firstcell); bool more = true; @@ -119,7 +120,7 @@ width = Int32.Parse(widthTime.Hours.ToString()) * 60; width += Int32.Parse(widthTime.Minutes.ToString()); nextcell.ColumnSpan = width / 2; - nextcell.Text = next.Title + " " + width.ToString(); + nextcell.Text = "<a href=\"ProgramDetail.aspx?idProgram=" + next.IdProgram + "\">" + next.Title + "</a>"; programsRow.Cells.Add(nextcell); current = next; if (next.EndTime == guideEnd) @@ -136,7 +137,7 @@ width = Int32.Parse(widthTime.Hours.ToString()) * 60; width += Int32.Parse(widthTime.Minutes.ToString()); nextcell.ColumnSpan = width / 2; - nextcell.Text = next.Title + " " + width.ToString(); + nextcell.Text = "<a href=\"ProgramDetail.aspx?idProgram=" + next.IdProgram + "\">" + next.Title + "</a>"; programsRow.Cells.Add(nextcell); more = false; } Modified: trunk/Version2/Web App/MPW/NowNext.aspx =================================================================== --- trunk/Version2/Web App/MPW/NowNext.aspx 2007-07-17 17:25:09 UTC (rev 47) +++ trunk/Version2/Web App/MPW/NowNext.aspx 2007-07-24 13:26:50 UTC (rev 48) @@ -7,31 +7,6 @@ <asp:Panel ID="NowNextPanel" runat="server"> </asp:Panel> </div> - <asp:Panel ID="DetailsPanel" runat="server" Visible="false" CssClass="detailsPanel"> - <div> - <div style="width: 75px; height: 85px; float: left;"> - <asp:Image ID="detailChannelLogo" runat="server" /> - <br /> - <asp:Label ID="detailChannelName" runat="server" Text="Channel Name"></asp:Label></div> - <div style="float: left;"> - <asp:Label ID="detailShowName" runat="server" Text="Show Name" CssClass="detailShowTitle"></asp:Label> - <br /> - <asp:Label ID="detailShowTime" runat="server" Text="Time"></asp:Label> - </div> - <div style="float:right;width:20px;"> - <asp:ImageButton ID="CloseDetails" runat="server" CausesValidation="False" ImageAlign="Middle" ImageUrl="~/Images/redx.gif" OnClick="closeDetails" PostBackUrl="~/NowNext.aspx" /> - </div> - </div> - <div class="recordingoptions"> - <asp:Label ID="Label1" runat="server" Text="<%$ Resources:Resource, RecordThis %>"></asp:Label> - <asp:DropDownList ID="ScheduleType" runat="server"> - </asp:DropDownList> - <asp:HiddenField ID="HiddenFieldProgramID" runat="server" /> - <asp:Button ID="Button1" runat="server" Text="Button" OnClick="addSchedule" /></div> - <div class="description"> - <asp:Label ID="detailShowDesc" runat="server" Text="Show Description"></asp:Label> - </div> - </asp:Panel> </ContentTemplate> </asp:UpdatePanel> </asp:Content> Modified: trunk/Version2/Web App/MPW/NowNext.aspx.cs =================================================================== --- trunk/Version2/Web App/MPW/NowNext.aspx.cs 2007-07-17 17:25:09 UTC (rev 47) +++ trunk/Version2/Web App/MPW/NowNext.aspx.cs 2007-07-24 13:26:50 UTC (rev 48) @@ -44,65 +44,7 @@ updateContents(); } - /// <summary> - /// Opens the popup with details for a show. - /// </summary> - /// <param name="sender"></param> - /// <param name="e"></param> - protected void openDetails(object sender, CommandEventArgs e) - { - int idProgram = int.Parse(e.CommandArgument.ToString()); - prepareDetails(idProgram); - DetailsPanel.Visible = true; - } - - /// <summary> - /// Adds a new Schedule from the details panel. - /// </summary> - /// <param name="sender"></param> - /// <param name="e"></param> - protected void addSchedule(object sender, EventArgs e) - { - int idProgram = int.Parse(HiddenFieldProgramID.Value); - int recTypeNr = int.Parse(ScheduleType.SelectedValue); - ScheduleRecordingType recType = (ScheduleRecordingType)recTypeNr; - if (MPWUtils.addSchedule(idProgram, recType)) - { - DetailsPanel.Visible = false; - updateContents(); - } - //TODO: Implement error handling - } - - /// <summary> - /// Closes the popup with details for a show. - /// </summary> - /// <param name="sender"></param> - /// <param name="e"></param> - protected void closeDetails(object sender, ImageClickEventArgs e) - { - DetailsPanel.Visible = false; - } - - /// <summary> - /// Prepares the contents of the Details panel - /// </summary> - /// <param name="idProgram">The program ID of the selected show.</param> - protected void prepareDetails(int idProgram) - { - - Program p = Program.Retrieve(idProgram); - Channel c = Channel.Retrieve(p.IdChannel); - detailChannelName.Text = c.Name; - detailChannelLogo.ImageUrl = MPWUtils.getChannelLogoPath(this.Server.MapPath("~/TVLogos/"), c.Name); - detailShowName.Text = p.Title; - detailShowTime.Text = "(" + p.StartTime.ToShortTimeString() + " - " + p.EndTime.ToShortTimeString() + ")"; - detailShowDesc.Text = p.Description; - HiddenFieldProgramID.Value = idProgram.ToString(); - MPWUtils.prepareScheduleTypeDropDown(ScheduleType); - } - - /// <summary> + /// <summary> /// Updates the now and next program rows. /// </summary> protected void updateContents() @@ -188,10 +130,8 @@ TableCell cell_program = new TableCell(); cell_program.CssClass = "detailscell"; - Label lbl_program_now_1 = new Label(); - Label lbl_program_now_2 = new Label(); - Label lbl_program_next_1 = new Label(); - Label lbl_program_next_2 = new Label(); + Label lbl_program_now = new Label(); + Label lbl_program_next = new Label(); try { @@ -200,19 +140,12 @@ Program next = channel.GetProgramAt(now.EndTime.AddMinutes(2)); bool[] nextRec = IsRecording(next); - lbl_program_now_1.Text = "<span class=\"nownext\">" + Resources.Resource.Now + ": </span>"; - cell_program.Controls.Add(lbl_program_now_1); + lbl_program_now.Text = "<span class=\"nownext\">" + Resources.Resource.Now + ": </span>"; + lbl_program_now.Text += "<a href=\"ProgramDetail.aspx?idProgram=" + now.IdProgram + "\">" + now.Title + "</a>"; ; + lbl_program_now.Text += " (" + now.StartTime.ToShortTimeString() + " - "; + lbl_program_now.Text += now.EndTime.ToShortTimeString() + ")"; + cell_program.Controls.Add(lbl_program_now); - LinkButton nowLink = new LinkButton(); - nowLink.Text = now.Title; - nowLink.CommandArgument = now.IdProgram.ToString(); - nowLink.Command += new CommandEventHandler(openDetails); - cell_program.Controls.Add(nowLink); - - lbl_program_now_2.Text = " (" + now.StartTime.ToShortTimeString() + " - "; - lbl_program_now_2.Text += now.EndTime.ToShortTimeString() + ")"; - cell_program.Controls.Add(lbl_program_now_2); - if (nowRec[0]) { Image recIcon = new Image(); @@ -224,13 +157,13 @@ cell_program.Controls.Add(recIcon); } - lbl_program_next_1.Text = "<br /> <br />"; + lbl_program_next.Text = "<br /> <br />"; - lbl_program_next_1.Text += "<span class=\"nownext\">" + Resources.Resource.Next + ": </span>"; - lbl_program_next_1.Text += next.Title; - lbl_program_next_1.Text += " (" + next.StartTime.ToShortTimeString() + " - "; - lbl_program_next_1.Text += next.EndTime.ToShortTimeString() + ")"; - cell_program.Controls.Add(lbl_program_next_1); + lbl_program_next.Text += "<span class=\"nownext\">" + Resources.Resource.Next + ": </span>"; + lbl_program_next.Text += next.Title; + lbl_program_next.Text += " (" + next.StartTime.ToShortTimeString() + " - "; + lbl_program_next.Text += next.EndTime.ToShortTimeString() + ")"; + cell_program.Controls.Add(lbl_program_next); if (nextRec[0]) { @@ -246,8 +179,8 @@ } catch { - lbl_program_now_1.Text = Resources.Resource.NoEPGInfo; - cell_program.Controls.Add(lbl_program_now_1); + lbl_program_now.Text = Resources.Resource.NoEPGInfo; + cell_program.Controls.Add(lbl_program_now); } channelRow.Cells.Add(cell_channel); Added: trunk/Version2/Web App/MPW/ProgramDetail.aspx =================================================================== --- trunk/Version2/Web App/MPW/ProgramDetail.aspx (rev 0) +++ trunk/Version2/Web App/MPW/ProgramDetail.aspx 2007-07-24 13:26:50 UTC (rev 48) @@ -0,0 +1,35 @@ +<%@ Page Language="C#" MasterPageFile="~/MPW.master" AutoEventWireup="true" CodeFile="ProgramDetail.aspx.cs" Inherits="Default2" Title="Untitled Page" %> + +<asp:Content ID="ProgramDetail" ContentPlaceHolderID="MPWContent" runat="Server"> + <asp:UpdatePanel ID="ContentUpdatePanel" runat="server" UpdateMode="Always"> + <ContentTemplate> + <div> + <asp:Panel ID="DetailsPanel" runat="server"> + <div> + <div style="width: 75px; height: 100px; float: left; text-align:center"> + <asp:Image ID="detailChannelLogo" runat="server" /> + <br /> + <asp:Label ID="detailChannelName" runat="server" Text="Channel Name"></asp:Label></div> + <div style="float: left; padding-left:20px"> + <asp:Label ID="detailShowName" runat="server" Text="Show Name" CssClass="detailShowTitle"></asp:Label> + <br /> <br /> + <asp:Label ID="detailShowTime" runat="server" Text="Time"></asp:Label> + </div> + <div style="float:right;width:20px;"> + <asp:Image ID="Dots" runat="server" /> + </div> + </div> + <div class="recordingoptions"> + <asp:Label ID="Label1" runat="server" Text="<%$ Resources:Resource, RecordThis %>"></asp:Label> + <asp:DropDownList ID="ScheduleType" runat="server"> + </asp:DropDownList> + <asp:HiddenField ID="HiddenFieldProgramID" runat="server" /> + <asp:Button ID="Button1" runat="server" Text="Button" OnClick="addSchedule" /></div> + <div class="description"> + <asp:Label ID="detailShowDesc" runat="server" Text="Show Description"></asp:Label> + </div> + </asp:Panel> + </ContentTemplate> + </asp:UpdatePanel> +</asp:Content> + Added: trunk/Version2/Web App/MPW/ProgramDetail.aspx.cs =================================================================== --- trunk/Version2/Web App/MPW/ProgramDetail.aspx.cs (rev 0) +++ trunk/Version2/Web App/MPW/ProgramDetail.aspx.cs 2007-07-24 13:26:50 UTC (rev 48) @@ -0,0 +1,127 @@ +using System; +using System.Data; +using System.Configuration; +using System.Collections; +using System.Web; +using System.Web.Security; +using System.Web.UI; +using System.Web.UI.WebControls; +using System.Web.UI.WebControls.WebParts; +using System.Web.UI.HtmlControls; + +using TvDatabase; +using MPW; +using System.Collections.Generic; + +public partial class Default2 : System.Web.UI.Page +{ + IList _schedules; + int idProgram; + + /// <summary> + /// Checks if a program is scheduled as single / series recording + /// </summary> + /// <param name="program">The program to check</param> + /// <returns>A bool array with meaning [isScheduled, isSeries]</returns> + protected bool[] IsRecording(Program program) + { + bool[] result = { false, false }; + foreach (Schedule schedule in _schedules) + { + if (schedule.IsRecordingProgram(program, true)) + { + result[0] = true; + if (schedule.ScheduleType != 0) + result[1] = true; ; + } + } + return result; + } + + protected void Page_Load(object sender, EventArgs e) + { + MPWMaster m = (MPWMaster)Page.Master; + m.Sectiontitle = Resources.Resource.NowNext; + updateContents(); + } + + + /// <summary> + /// Adds a new Schedule from the details panel. + /// </summary> + /// <param name="sender"></param> + /// <param name="e"></param> + protected void addSchedule(object sender, EventArgs e) + { + int idProgram = int.Parse(HiddenFieldProgramID.Value); + int recTypeNr = int.Parse(ScheduleType.SelectedValue); + ScheduleRecordingType recType = (ScheduleRecordingType)recTypeNr; + if (MPWUtils.addSchedule(idProgram, recType)) + { + DetailsPanel.Visible = false; + updateContents(); + } + //TODO: Implement error handling + } + + + /// <summary> + /// Updates the now and next program rows. + /// </summary> + protected void updateContents() + { + + //Establish the connection to the TV Server and the DB. + MPWUtils.SetupConnection(); + + //A new Businesslayer + TvBusinessLayer layer = new TvBusinessLayer(); + + //Get all schedules + _schedules = Schedule.ListAll(); + + //Get the program ID from teh URL + try + { + idProgram = int.Parse(Request.QueryString.Get("idProgram")); + } + catch (Exception) + { + //Ung\xFCltige idProgram + } + + try + { + Program p = Program.Retrieve(idProgram); + Channel c = Channel.Retrieve(p.IdChannel); + detailChannelName.Text = c.Name; + bool[] isRec = IsRecording(p); + + if (isRec[0]) + { + if (isRec[1]) + Dots.ImageUrl = "Images/rec_series.png"; + else + Dots.ImageUrl = "Images/rec_single.png"; + } + else + { + Dots = null; + } + + detailChannelLogo.ImageUrl = MPWUtils.getChannelLogoPath(this.Server.MapPath("~/TVLogos/"), c.Name); + detailShowName.Text = p.Title; + detailShowTime.Text = "(" + p.StartTime.ToShortTimeString() + " - " + p.EndTime.ToShortTimeString() + ")"; + detailShowDesc.Text = p.Description; + HiddenFieldProgramID.Value = idProgram.ToString(); + MPWUtils.prepareScheduleTypeDropDown(ScheduleType); + } + catch (Exception) + { + //Fehler beim detailShowDesc holen. + } + + + } +} + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mas...@us...> - 2007-07-17 17:25:14
|
Revision: 47 http://svn.sourceforge.net/mp-webinterface/?rev=47&view=rev Author: maschine Date: 2007-07-17 10:25:09 -0700 (Tue, 17 Jul 2007) Log Message: ----------- Guide changes. Modified Paths: -------------- trunk/Version2/Web App/MPW/Default.aspx.cs trunk/Version2/Web App/MPW/css/mpw_style.css Modified: trunk/Version2/Web App/MPW/Default.aspx.cs =================================================================== --- trunk/Version2/Web App/MPW/Default.aspx.cs 2007-04-25 20:34:27 UTC (rev 46) +++ trunk/Version2/Web App/MPW/Default.aspx.cs 2007-07-17 17:25:09 UTC (rev 47) @@ -14,111 +14,149 @@ public partial class _Default : System.Web.UI.Page { - private DateTime guideStart = DateTime.Now; + private DateTime guideStart; private DateTime guideEnd; protected void Page_Load(object sender, EventArgs e) { - guideEnd = guideStart.AddHours(3); + int mins = DateTime.Now.Minute; + guideStart = DateTime.Now.Subtract(new TimeSpan(0, mins, 0)); + if (mins >= 30) + { + guideStart = guideStart.AddMinutes(30); + } - //Establish the connection to the TV Server and the DB. - MPWUtils.SetupConnection(); + guideEnd = guideStart.AddHours(3); - // Get a list of all tv-channels - IList channels = Channel.ListAll(); + //Establish the connection to the TV Server and the DB. + MPWUtils.SetupConnection(); - // List all groups - IList groups = ChannelGroup.ListAll(); + // Get a list of all tv-channels + IList channels = Channel.ListAll(); - // Remove non-TV channels - foreach (Channel channel in channels) - { - if (!channel.IsTv) - channels.Remove(channel); - } + // List all groups + IList groups = ChannelGroup.ListAll(); - //The Time - TableRow timerow = new TableRow(); - TableCell spacer = new TableCell(); - timerow.Cells.Add(spacer); + // Remove non-TV channels + foreach (Channel channel in channels) + { + if (!channel.IsTv) + channels.Remove(channel); + } - for (int i = 0; i < 3; i++) - { - TableCell cell = new TableCell(); - cell.Text = "| " + guideStart.AddHours(i).ToShortTimeString(); - cell.Width = 180; - timerow.Cells.Add(cell); - } - Guide.Rows.Add(timerow); + //The Time + TableRow timerow = new TableRow(); + TableCell spacer = new TableCell(); + timerow.Cells.Add(spacer); - //Iterate through all the channels - foreach (Channel channel in channels) - { - TableRow r = new TableRow(); - TableCell cell_channel = new TableCell(); - TableCell cell_program = new TableCell(); - cell_program.ColumnSpan = 3; + for (int i = 0; i < 3; i++) + { + TableCell cell = new TableCell(); + cell.Text = "| " + guideStart.AddHours(i).ToShortTimeString(); + cell.Width = Unit.Percentage(30); + timerow.Cells.Add(cell); + } + Guide.Rows.Add(timerow); - Label lbl_channel = new Label(); - lbl_channel.Text = "<strong>" + channel.Name + "</strong>"; + //Iterate through all the channels + foreach (Channel channel in channels) + { + TableRow r = new TableRow(); + TableCell cell_channel = new TableCell(); + TableCell cell_program = new TableCell(); + cell_program.ColumnSpan = 3; - cell_channel.Controls.Add(lbl_channel); - cell_channel.CssClass = "guideChannel"; + cell_channel.CssClass = "logocell"; - try - { - Program current = channel.GetProgramAt(guideStart); + Image channelLogo = new Image(); + channelLogo.CssClass = "channellogo"; + channelLogo.ImageUrl = MPWUtils.getChannelLogoPath(this.Server.MapPath("~/TVLogos/"), channel.Name); - Table programsTable = new Table(); - TableRow programsRow = new TableRow(); + if (channelLogo.ImageUrl != "") + { + cell_channel.Controls.Add(channelLogo); + Label br = new Label(); + br.Text = "<br />"; + cell_channel.Controls.Add(br); + } - TableCell firstcell = new TableCell(); - firstcell.CssClass = "guidecell"; + Label lbl_channel = new Label(); + lbl_channel.Text = "<strong>" + channel.Name + "</strong>"; - TimeSpan widthTime = current.EndTime - guideStart; - Unit widthPixel = new Unit(widthTime.Minutes.ToString()); - firstcell.Width = widthPixel; - firstcell.Text = current.Title; - programsRow.Cells.Add(firstcell); + cell_channel.Controls.Add(lbl_channel); + cell_channel.CssClass = "guideChannel"; - bool more = true; - - while (more == true) - { - Program next = channel.GetProgramAt(current.EndTime.AddMinutes(1)); - if (next.EndTime <= guideEnd) + try { - TableCell nextcell = new TableCell(); - nextcell.CssClass = "guidecell"; + Program current = channel.GetProgramAt(guideStart); - widthTime = next.EndTime - next.StartTime; - widthPixel = new Unit(widthTime.Minutes.ToString()); - nextcell.Width = widthPixel; - nextcell.Text = next.Title; - programsRow.Cells.Add(nextcell); - current = next; + Table programsTable = new Table(); + programsTable.CssClass = "guidetable"; + programsTable.Width = Unit.Percentage(100); + TableRow programsRow = new TableRow(); + + TableCell firstcell = new TableCell(); + firstcell.CssClass = "guidecell"; + + TimeSpan widthTime = current.EndTime - guideStart; + int width = Int32.Parse(widthTime.Hours.ToString()) * 60; + width += Int32.Parse(widthTime.Minutes.ToString()); + firstcell.ColumnSpan = width / 2; + firstcell.Text = current.Title + " " + width.ToString(); + programsRow.Cells.Add(firstcell); + + bool more = true; + + while (more == true) + { + Program next = channel.GetProgramAt(current.EndTime.AddMinutes(1)); + if (next.EndTime <= guideEnd) + { + TableCell nextcell = new TableCell(); + nextcell.CssClass = "guidecell"; + + widthTime = next.EndTime - next.StartTime; + width = Int32.Parse(widthTime.Hours.ToString()) * 60; + width += Int32.Parse(widthTime.Minutes.ToString()); + nextcell.ColumnSpan = width / 2; + nextcell.Text = next.Title + " " + width.ToString(); + programsRow.Cells.Add(nextcell); + current = next; + if (next.EndTime == guideEnd) + { + more = false; + } + } + else + { + TableCell nextcell = new TableCell(); + nextcell.CssClass = "guidecell"; + + widthTime = guideEnd - next.StartTime; + width = Int32.Parse(widthTime.Hours.ToString()) * 60; + width += Int32.Parse(widthTime.Minutes.ToString()); + nextcell.ColumnSpan = width / 2; + nextcell.Text = next.Title + " " + width.ToString(); + programsRow.Cells.Add(nextcell); + more = false; + } + } + + programsTable.Rows.Add(programsRow); + cell_program.Controls.Add(programsTable); + } - else + catch { - more = false; + Label noEPG = new Label(); + noEPG.Text = Resources.Resource.NoEPGInfo; + cell_program.Controls.Add(noEPG); } - } - programsTable.Rows.Add(programsRow); - cell_program.Controls.Add(programsTable); + r.Cells.Add(cell_channel); + r.Cells.Add(cell_program); + Guide.Rows.Add(r); } - catch - { - Label noEPG = new Label(); - noEPG.Text = Resources.Resource.NoEPGInfo; - cell_program.Controls.Add(noEPG); - } - - r.Cells.Add(cell_channel); - r.Cells.Add(cell_program); - - Guide.Rows.Add(r); - } } - } +} Modified: trunk/Version2/Web App/MPW/css/mpw_style.css =================================================================== --- trunk/Version2/Web App/MPW/css/mpw_style.css 2007-04-25 20:34:27 UTC (rev 46) +++ trunk/Version2/Web App/MPW/css/mpw_style.css 2007-07-17 17:25:09 UTC (rev 47) @@ -67,6 +67,7 @@ table.content { + width: 95%; } td.leftcontent @@ -116,6 +117,12 @@ background-repeat: no-repeat; } +table.guidetable +{ + table-layout:fixed; + overflow:hidden +} + td.seperatorcell { height: 35px; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mas...@us...> - 2007-04-25 20:34:32
|
Revision: 46 http://svn.sourceforge.net/mp-webinterface/?rev=46&view=rev Author: maschine Date: 2007-04-25 13:34:27 -0700 (Wed, 25 Apr 2007) Log Message: ----------- Gentle.config to ignore list. Please use the version of your installed TV server. Property Changed: ---------------- trunk/Version2/Web App/MPW/ Property changes on: trunk/Version2/Web App/MPW ___________________________________________________________________ Name: svn:ignore + Gentle.config This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mas...@us...> - 2007-04-25 20:29:42
|
Revision: 45 http://svn.sourceforge.net/mp-webinterface/?rev=45&view=rev Author: maschine Date: 2007-04-25 13:29:27 -0700 (Wed, 25 Apr 2007) Log Message: ----------- Adding cleaned version. Added Paths: ----------- trunk/Version2/Web App/MPW/ trunk/Version2/Web App/MPW/App_Code/ trunk/Version2/Web App/MPW/App_Code/Utils.cs trunk/Version2/Web App/MPW/App_Data/ trunk/Version2/Web App/MPW/App_GlobalResources/ trunk/Version2/Web App/MPW/App_GlobalResources/Resource.de.resx trunk/Version2/Web App/MPW/App_GlobalResources/Resource.resx trunk/Version2/Web App/MPW/Bin/ trunk/Version2/Web App/MPW/Bin/DirectShowLib.dll trunk/Version2/Web App/MPW/Bin/Gentle.Common.dll trunk/Version2/Web App/MPW/Bin/Gentle.Framework.dll trunk/Version2/Web App/MPW/Bin/Gentle.Provider.MySQL.dll trunk/Version2/Web App/MPW/Bin/Gentle.Provider.MySQL.dll.refresh trunk/Version2/Web App/MPW/Bin/Gentle.Provider.SQLServer.dll trunk/Version2/Web App/MPW/Bin/Gentle.Provider.SQLServer.dll.refresh trunk/Version2/Web App/MPW/Bin/MySql.Data.dll trunk/Version2/Web App/MPW/Bin/TVDatabase.dll trunk/Version2/Web App/MPW/Bin/TVDatabase.dll.refresh trunk/Version2/Web App/MPW/Bin/TVLibrary.dll trunk/Version2/Web App/MPW/Bin/TVLibrary.dll.refresh trunk/Version2/Web App/MPW/Bin/TvBusinessLayer.dll trunk/Version2/Web App/MPW/Bin/TvControl.dll trunk/Version2/Web App/MPW/Bin/TvControl.dll.refresh trunk/Version2/Web App/MPW/Bin/TvLibrary.Interfaces.dll trunk/Version2/Web App/MPW/Bin/log4net.dll trunk/Version2/Web App/MPW/Default.aspx trunk/Version2/Web App/MPW/Default.aspx.cs trunk/Version2/Web App/MPW/Images/ trunk/Version2/Web App/MPW/Images/bg_channel.jpg trunk/Version2/Web App/MPW/Images/bg_channel_logo.png trunk/Version2/Web App/MPW/Images/bg_channel_name.jpg trunk/Version2/Web App/MPW/Images/bg_channel_program.png trunk/Version2/Web App/MPW/Images/bg_channelgroup.jpg trunk/Version2/Web App/MPW/Images/bg_content.jpg trunk/Version2/Web App/MPW/Images/bg_logo.jpg trunk/Version2/Web App/MPW/Images/bg_navi.jpg trunk/Version2/Web App/MPW/Images/button_selected.png trunk/Version2/Web App/MPW/Images/button_unselected.png trunk/Version2/Web App/MPW/Images/favicon.ico trunk/Version2/Web App/MPW/Images/icon_bg.png trunk/Version2/Web App/MPW/Images/loading.gif trunk/Version2/Web App/MPW/Images/mp_logo_header.png trunk/Version2/Web App/MPW/Images/rec_series.png trunk/Version2/Web App/MPW/Images/rec_single.png trunk/Version2/Web App/MPW/Images/redx.gif trunk/Version2/Web App/MPW/Images/shadow_left.png trunk/Version2/Web App/MPW/Images/shadow_right.png trunk/Version2/Web App/MPW/Images/tvguide_notify_button.png trunk/Version2/Web App/MPW/Images/tvguide_recordconflict_button.png trunk/Version2/Web App/MPW/Images/tvguide_recordserie_conflict_button.png trunk/Version2/Web App/MPW/JS/ trunk/Version2/Web App/MPW/JS/mpw.js trunk/Version2/Web App/MPW/Login.aspx trunk/Version2/Web App/MPW/Login.aspx.cs trunk/Version2/Web App/MPW/MPW.master trunk/Version2/Web App/MPW/MPW.master.cs trunk/Version2/Web App/MPW/NowNext.aspx trunk/Version2/Web App/MPW/NowNext.aspx.cs trunk/Version2/Web App/MPW/Schedules.aspx trunk/Version2/Web App/MPW/Schedules.aspx.cs trunk/Version2/Web App/MPW/TVLogos/ trunk/Version2/Web App/MPW/css/ trunk/Version2/Web App/MPW/css/mpw_style.css trunk/Version2/Web App/MPW/web.config trunk/Version2/Web App/MPW.sln Added: trunk/Version2/Web App/MPW/App_Code/Utils.cs =================================================================== --- trunk/Version2/Web App/MPW/App_Code/Utils.cs (rev 0) +++ trunk/Version2/Web App/MPW/App_Code/Utils.cs 2007-04-25 20:29:27 UTC (rev 45) @@ -0,0 +1,142 @@ +using System; +using System.Data; +using System.Configuration; +using System.Collections; +using System.Web.UI; +using System.Web.UI.WebControls; +using System.Web.UI.WebControls.WebParts; +using System.Web.UI.HtmlControls; + +using TvDatabase; +using TvControl; + +using Gentle.Common; +using Gentle.Framework; + +namespace MPW +{ + public static class MPWUtils + { + private static bool isConnected = false; + + /// <summary> + /// Setup the DB connection. + /// </summary> + public static void SetupConnection() + { + if (!isConnected) + { + RemoteControl.Clear(); + //Set the hostname of the TV Server computer. + RemoteControl.HostName = "localhost"; + + //Retrieve the connection string. + string connStr, provider; + RemoteControl.Instance.GetDatabaseConnectionString(out connStr, out provider); + + //Set the connection string. + Gentle.Framework.ProviderFactory.SetDefaultProviderConnectionString(connStr); + + isConnected = true; + } + } + + /// <summary> + /// Gets the channel logo for a channel. + /// </summary> + /// <param name="path">The physical path of the TVLogos directory</param> + /// <param name="name">The channel's name</param> + /// <returns>URL of the channel logo if there is one</returns> + public static String getChannelLogoPath(String pysicalpath, String name) + { + if (System.IO.File.Exists(pysicalpath + name + ".png")) + { + String channelLogo; + channelLogo = "~/TVLogos/" + name + ".png"; + return channelLogo; + } + else if (System.IO.File.Exists(pysicalpath + name + ".jpg")) + { + String channelLogo; + channelLogo = "~/TVLogos/" + name + ".jpg"; + return channelLogo; + } + else if (System.IO.File.Exists(pysicalpath + name + ".gif")) + { + String channelLogo; + channelLogo = "~/TVLogos/" + name + ".gif"; + return channelLogo; + } + else + return null; + } + + /// <summary> + /// Adds a new recording to the list of schedules. + /// </summary> + /// <param name="idProgram">The program ID</param> + /// <param name="recType">The ScheduleRecordingType</param> + public static bool addSchedule(int idProgram, ScheduleRecordingType recType) + { + try + { + TvBusinessLayer layer = new TvBusinessLayer(); + Program p = Program.Retrieve(idProgram); + int rT = (int)recType; + Schedule newSchedule = new Schedule(p.IdChannel, p.Title, p.StartTime, p.EndTime); + newSchedule.ScheduleType = rT; + newSchedule.Persist(); + //Notify TVserver of new schedule + RemoteControl.Instance.OnNewSchedule(); + return true; + } + catch + { + return false; + } + } + + /// <summary> + /// Deletes a schedule from the database. + /// </summary> + /// <param name="idProgram">The schedule ID</param> + public static bool deleteSchedule(int idSchedule) + { + try + { + Schedule s = Schedule.Retrieve(idSchedule); + s.Delete(); + //Notify TVserver of new schedule + RemoteControl.Instance.OnNewSchedule(); + return true; + } + catch + { + return false; + } + } + + /// <summary> + /// Prepares a DropDownList with all possible recording schedule types MP offers + /// </summary> + /// <param name="ScheduleType">The DropDownlist to fill</param> + public static void prepareScheduleTypeDropDown(DropDownList ScheduleType) + { + ScheduleType.Items.Clear(); + ScheduleType.Items.Add(new ListItem(Resources.Resource.Once, + ((int)ScheduleRecordingType.Once).ToString())); + ScheduleType.Items.Add(new ListItem(Resources.Resource.Daily, + ((int)ScheduleRecordingType.Daily).ToString())); + ScheduleType.Items.Add(new ListItem(Resources.Resource.Weekly, + ((int)ScheduleRecordingType.Weekly).ToString())); + ScheduleType.Items.Add(new ListItem(Resources.Resource.EveryTimeOnThisChannel, + ((int)ScheduleRecordingType.EveryTimeOnThisChannel).ToString())); + ScheduleType.Items.Add(new ListItem(Resources.Resource.EveryTimeOnEveryChannel, + ((int)ScheduleRecordingType.EveryTimeOnEveryChannel).ToString())); + ScheduleType.Items.Add(new ListItem(Resources.Resource.Weekends, + ((int)ScheduleRecordingType.Weekends).ToString())); + ScheduleType.Items.Add(new ListItem(Resources.Resource.WorkingDays, + ((int)ScheduleRecordingType.WorkingDays).ToString())); + } + } +} \ No newline at end of file Added: trunk/Version2/Web App/MPW/App_GlobalResources/Resource.de.resx =================================================================== --- trunk/Version2/Web App/MPW/App_GlobalResources/Resource.de.resx (rev 0) +++ trunk/Version2/Web App/MPW/App_GlobalResources/Resource.de.resx 2007-04-25 20:29:27 UTC (rev 45) @@ -0,0 +1,194 @@ +<?xml version="1.0" encoding="utf-8"?> +<root> + <!-- + Microsoft ResX Schema + + Version 2.0 + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes + associated with the data types. + + Example: + + ... ado.net/XML headers & schema ... + <resheader name="resmimetype">text/microsoft-resx</resheader> + <resheader name="version">2.0</resheader> + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> + <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> + <value>[base64 mime encoded serialized .NET Framework object]</value> + </data> + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> + <comment>This is a comment</comment> + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="metadata"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" /> + </xsd:sequence> + <xsd:attribute name="name" use="required" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string" /> + <xsd:attribute name="name" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="data"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="resheader"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + </xsd:schema> + <resheader name="resmimetype"> + <value>text/microsoft-resx</value> + </resheader> + <resheader name="version"> + <value>2.0</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <data name="Daily" xml:space="preserve"> + <value>Täglich</value> + <comment>ScheduleType</comment> + </data> + <data name="EveryTimeOnEveryChannel" xml:space="preserve"> + <value>Immer auf jedem Sender</value> + <comment>ScheduleType</comment> + </data> + <data name="EveryTimeOnThisChannel" xml:space="preserve"> + <value>Immer auf diesem Sender</value> + <comment>ScheduleType</comment> + </data> + <data name="Guide" xml:space="preserve"> + <value>Programmführer</value> + <comment>Navigation</comment> + </data> + <data name="LiveTV" xml:space="preserve"> + <value>Live TV</value> + <comment>Navigation</comment> + </data> + <data name="Next" xml:space="preserve"> + <value>Gleich</value> + </data> + <data name="NoEPGInfo" xml:space="preserve"> + <value>Leider keine Informationen verfügbar...</value> + <comment>Guide</comment> + </data> + <data name="Now" xml:space="preserve"> + <value>Jetzt</value> + </data> + <data name="NowNext" xml:space="preserve"> + <value>Jetzt & Gleich</value> + <comment>Navigation</comment> + </data> + <data name="Once" xml:space="preserve"> + <value>Einmalig</value> + <comment>ScheduleType</comment> + </data> + <data name="Record" xml:space="preserve"> + <value>Aufnehmen!</value> + </data> + <data name="Recordings" xml:space="preserve"> + <value>Aufnahmen</value> + <comment>Navigation</comment> + </data> + <data name="RecordThis" xml:space="preserve"> + <value>Diese Sendung aufnehmen</value> + </data> + <data name="RecSeries" xml:space="preserve"> + <value>Serienaufnahmen</value> + </data> + <data name="RecSingle" xml:space="preserve"> + <value>Einfache Aufnahmen</value> + </data> + <data name="Schedules" xml:space="preserve"> + <value>Timer</value> + <comment>Navigation</comment> + </data> + <data name="Search" xml:space="preserve"> + <value>Suchen</value> + <comment>Navigation</comment> + </data> + <data name="Weekends" xml:space="preserve"> + <value>Weekends</value> + <comment>ScheduleType</comment> + </data> + <data name="Weekly" xml:space="preserve"> + <value>Wöchentlich</value> + <comment>ScheduleType</comment> + </data> + <data name="WorkingDays" xml:space="preserve"> + <value>Workingdays</value> + <comment>ScheduleType</comment> + </data> +</root> \ No newline at end of file Added: trunk/Version2/Web App/MPW/App_GlobalResources/Resource.resx =================================================================== --- trunk/Version2/Web App/MPW/App_GlobalResources/Resource.resx (rev 0) +++ trunk/Version2/Web App/MPW/App_GlobalResources/Resource.resx 2007-04-25 20:29:27 UTC (rev 45) @@ -0,0 +1,200 @@ +<?xml version="1.0" encoding="utf-8"?> +<root> + <!-- + Microsoft ResX Schema + + Version 2.0 + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes + associated with the data types. + + Example: + + ... ado.net/XML headers & schema ... + <resheader name="resmimetype">text/microsoft-resx</resheader> + <resheader name="version">2.0</resheader> + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> + <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> + <value>[base64 mime encoded serialized .NET Framework object]</value> + </data> + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> + <comment>This is a comment</comment> + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="metadata"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" /> + </xsd:sequence> + <xsd:attribute name="name" use="required" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string" /> + <xsd:attribute name="name" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="data"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="resheader"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + </xsd:schema> + <resheader name="resmimetype"> + <value>text/microsoft-resx</value> + </resheader> + <resheader name="version"> + <value>2.0</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <data name="Daily" xml:space="preserve"> + <value>Daily</value> + <comment>ScheduleType</comment> + </data> + <data name="EveryTimeOnEveryChannel" xml:space="preserve"> + <value>Everytime on every channel</value> + <comment>ScheduleType</comment> + </data> + <data name="EveryTimeOnThisChannel" xml:space="preserve"> + <value>Everytime on this channel</value> + <comment>ScheduleType</comment> + </data> + <data name="Guide" xml:space="preserve"> + <value>Guide</value> + <comment>Navigation</comment> + </data> + <data name="LiveTV" xml:space="preserve"> + <value>Live TV</value> + <comment>Navigation</comment> + </data> + <data name="Login" xml:space="preserve"> + <value>Login</value> + </data> + <data name="Next" xml:space="preserve"> + <value>Next</value> + </data> + <data name="NoEPGInfo" xml:space="preserve"> + <value>Sorry, no information available...</value> + <comment>Guide</comment> + </data> + <data name="Now" xml:space="preserve"> + <value>Now</value> + </data> + <data name="NowNext" xml:space="preserve"> + <value>Now & Next</value> + <comment>Navigation</comment> + </data> + <data name="Once" xml:space="preserve"> + <value>Once</value> + <comment>ScheduleType</comment> + </data> + <data name="PageTitle" xml:space="preserve"> + <value>MPW - The MediaPortal Webinterface</value> + </data> + <data name="Record" xml:space="preserve"> + <value>Record!</value> + </data> + <data name="Recordings" xml:space="preserve"> + <value>Recordings</value> + <comment>Navigation</comment> + </data> + <data name="RecordThis" xml:space="preserve"> + <value>Record this program</value> + </data> + <data name="RecSeries" xml:space="preserve"> + <value>Series recordings</value> + </data> + <data name="RecSingle" xml:space="preserve"> + <value>Single recordings</value> + </data> + <data name="Schedules" xml:space="preserve"> + <value>Schedules</value> + <comment>Navigation</comment> + </data> + <data name="Search" xml:space="preserve"> + <value>Search</value> + <comment>Navigation</comment> + </data> + <data name="Weekends" xml:space="preserve"> + <value>Weekends</value> + <comment>ScheduleType</comment> + </data> + <data name="Weekly" xml:space="preserve"> + <value>Weekly</value> + <comment>ScheduleType</comment> + </data> + <data name="WorkingDays" xml:space="preserve"> + <value>Workingdays</value> + <comment>ScheduleType</comment> + </data> +</root> \ No newline at end of file Added: trunk/Version2/Web App/MPW/Bin/DirectShowLib.dll =================================================================== (Binary files differ) Property changes on: trunk/Version2/Web App/MPW/Bin/DirectShowLib.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/Version2/Web App/MPW/Bin/Gentle.Common.dll =================================================================== (Binary files differ) Property changes on: trunk/Version2/Web App/MPW/Bin/Gentle.Common.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/Version2/Web App/MPW/Bin/Gentle.Framework.dll =================================================================== (Binary files differ) Property changes on: trunk/Version2/Web App/MPW/Bin/Gentle.Framework.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/Version2/Web App/MPW/Bin/Gentle.Provider.MySQL.dll =================================================================== (Binary files differ) Property changes on: trunk/Version2/Web App/MPW/Bin/Gentle.Provider.MySQL.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/Version2/Web App/MPW/Bin/Gentle.Provider.MySQL.dll.refresh =================================================================== (Binary files differ) Property changes on: trunk/Version2/Web App/MPW/Bin/Gentle.Provider.MySQL.dll.refresh ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/Version2/Web App/MPW/Bin/Gentle.Provider.SQLServer.dll =================================================================== (Binary files differ) Property changes on: trunk/Version2/Web App/MPW/Bin/Gentle.Provider.SQLServer.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/Version2/Web App/MPW/Bin/Gentle.Provider.SQLServer.dll.refresh =================================================================== (Binary files differ) Property changes on: trunk/Version2/Web App/MPW/Bin/Gentle.Provider.SQLServer.dll.refresh ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/Version2/Web App/MPW/Bin/MySql.Data.dll =================================================================== (Binary files differ) Property changes on: trunk/Version2/Web App/MPW/Bin/MySql.Data.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/Version2/Web App/MPW/Bin/TVDatabase.dll =================================================================== (Binary files differ) Property changes on: trunk/Version2/Web App/MPW/Bin/TVDatabase.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/Version2/Web App/MPW/Bin/TVDatabase.dll.refresh =================================================================== (Binary files differ) Property changes on: trunk/Version2/Web App/MPW/Bin/TVDatabase.dll.refresh ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/Version2/Web App/MPW/Bin/TVLibrary.dll =================================================================== (Binary files differ) Property changes on: trunk/Version2/Web App/MPW/Bin/TVLibrary.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/Version2/Web App/MPW/Bin/TVLibrary.dll.refresh =================================================================== (Binary files differ) Property changes on: trunk/Version2/Web App/MPW/Bin/TVLibrary.dll.refresh ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/Version2/Web App/MPW/Bin/TvBusinessLayer.dll =================================================================== (Binary files differ) Property changes on: trunk/Version2/Web App/MPW/Bin/TvBusinessLayer.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/Version2/Web App/MPW/Bin/TvControl.dll =================================================================== (Binary files differ) Property changes on: trunk/Version2/Web App/MPW/Bin/TvControl.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/Version2/Web App/MPW/Bin/TvControl.dll.refresh =================================================================== (Binary files differ) Property changes on: trunk/Version2/Web App/MPW/Bin/TvControl.dll.refresh ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/Version2/Web App/MPW/Bin/TvLibrary.Interfaces.dll =================================================================== (Binary files differ) Property changes on: trunk/Version2/Web App/MPW/Bin/TvLibrary.Interfaces.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/Version2/Web App/MPW/Bin/log4net.dll =================================================================== (Binary files differ) Property changes on: trunk/Version2/Web App/MPW/Bin/log4net.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/Version2/Web App/MPW/Default.aspx =================================================================== --- trunk/Version2/Web App/MPW/Default.aspx (rev 0) +++ trunk/Version2/Web App/MPW/Default.aspx 2007-04-25 20:29:27 UTC (rev 45) @@ -0,0 +1,22 @@ +<%@ Page Language="C#" MasterPageFile="~/MPW.master" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" Title="Untitled Page" %> +<asp:Content ID="Content1" ContentPlaceHolderID="MPWContent" Runat="Server"> + <br /> + <asp:Button ID="ButtonPrev" runat="server" Text="<" /> + <asp:Button ID="ButtonNext" runat="server" Text=">" /> + <asp:DropDownList ID="GroupDropDown" runat="server"> + </asp:DropDownList> + <asp:DropDownList ID="TimeDropDown" runat="server"> + </asp:DropDownList> + <asp:DropDownList ID="DateDropDown" runat="server"> + </asp:DropDownList> + <br /> + <asp:UpdatePanel ID="GuideUpdatePanel" runat="server" UpdateMode="Conditional"> + <ContentTemplate> + <asp:Table ID="Guide" runat="server" Width="90%"> + </asp:Table> + </ContentTemplate> + <Triggers> + </Triggers> + </asp:UpdatePanel> +</asp:Content> + Added: trunk/Version2/Web App/MPW/Default.aspx.cs =================================================================== --- trunk/Version2/Web App/MPW/Default.aspx.cs (rev 0) +++ trunk/Version2/Web App/MPW/Default.aspx.cs 2007-04-25 20:29:27 UTC (rev 45) @@ -0,0 +1,124 @@ +using System; +using System.Data; +using System.Configuration; +using System.Collections; +using System.Web; +using System.Web.Security; +using System.Web.UI; +using System.Web.UI.WebControls; +using System.Web.UI.WebControls.WebParts; +using System.Web.UI.HtmlControls; + +using MPW; +using TvDatabase; + +public partial class _Default : System.Web.UI.Page +{ + private DateTime guideStart = DateTime.Now; + private DateTime guideEnd; + + protected void Page_Load(object sender, EventArgs e) + { + guideEnd = guideStart.AddHours(3); + + //Establish the connection to the TV Server and the DB. + MPWUtils.SetupConnection(); + + // Get a list of all tv-channels + IList channels = Channel.ListAll(); + + // List all groups + IList groups = ChannelGroup.ListAll(); + + // Remove non-TV channels + foreach (Channel channel in channels) + { + if (!channel.IsTv) + channels.Remove(channel); + } + + //The Time + TableRow timerow = new TableRow(); + TableCell spacer = new TableCell(); + timerow.Cells.Add(spacer); + + for (int i = 0; i < 3; i++) + { + TableCell cell = new TableCell(); + cell.Text = "| " + guideStart.AddHours(i).ToShortTimeString(); + cell.Width = 180; + timerow.Cells.Add(cell); + } + Guide.Rows.Add(timerow); + + //Iterate through all the channels + foreach (Channel channel in channels) + { + TableRow r = new TableRow(); + TableCell cell_channel = new TableCell(); + TableCell cell_program = new TableCell(); + cell_program.ColumnSpan = 3; + + Label lbl_channel = new Label(); + lbl_channel.Text = "<strong>" + channel.Name + "</strong>"; + + cell_channel.Controls.Add(lbl_channel); + cell_channel.CssClass = "guideChannel"; + + try + { + Program current = channel.GetProgramAt(guideStart); + + Table programsTable = new Table(); + TableRow programsRow = new TableRow(); + + TableCell firstcell = new TableCell(); + firstcell.CssClass = "guidecell"; + + TimeSpan widthTime = current.EndTime - guideStart; + Unit widthPixel = new Unit(widthTime.Minutes.ToString()); + firstcell.Width = widthPixel; + firstcell.Text = current.Title; + programsRow.Cells.Add(firstcell); + + bool more = true; + + while (more == true) + { + Program next = channel.GetProgramAt(current.EndTime.AddMinutes(1)); + if (next.EndTime <= guideEnd) + { + TableCell nextcell = new TableCell(); + nextcell.CssClass = "guidecell"; + + widthTime = next.EndTime - next.StartTime; + widthPixel = new Unit(widthTime.Minutes.ToString()); + nextcell.Width = widthPixel; + nextcell.Text = next.Title; + programsRow.Cells.Add(nextcell); + current = next; + } + else + { + more = false; + } + } + + programsTable.Rows.Add(programsRow); + cell_program.Controls.Add(programsTable); + + } + catch + { + Label noEPG = new Label(); + noEPG.Text = Resources.Resource.NoEPGInfo; + cell_program.Controls.Add(noEPG); + } + + r.Cells.Add(cell_channel); + r.Cells.Add(cell_program); + + Guide.Rows.Add(r); + } + } + } Added: trunk/Version2/Web App/MPW/Images/bg_channel.jpg =================================================================== (Binary files differ) Property changes on: trunk/Version2/Web App/MPW/Images/bg_channel.jpg ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/Version2/Web App/MPW/Images/bg_channel_logo.png =================================================================== (Binary files differ) Property changes on: trunk/Version2/Web App/MPW/Images/bg_channel_logo.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/Version2/Web App/MPW/Images/bg_channel_name.jpg =================================================================== (Binary files differ) Property changes on: trunk/Version2/Web App/MPW/Images/bg_channel_name.jpg ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/Version2/Web App/MPW/Images/bg_channel_program.png =================================================================== (Binary files differ) Property changes on: trunk/Version2/Web App/MPW/Images/bg_channel_program.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/Version2/Web App/MPW/Images/bg_channelgroup.jpg =================================================================== (Binary files differ) Property changes on: trunk/Version2/Web App/MPW/Images/bg_channelgroup.jpg ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/Version2/Web App/MPW/Images/bg_content.jpg =================================================================== (Binary files differ) Property changes on: trunk/Version2/Web App/MPW/Images/bg_content.jpg ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/Version2/Web App/MPW/Images/bg_logo.jpg =================================================================== (Binary files differ) Property changes on: trunk/Version2/Web App/MPW/Images/bg_logo.jpg ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/Version2/Web App/MPW/Images/bg_navi.jpg =================================================================== (Binary files differ) Property changes on: trunk/Version2/Web App/MPW/Images/bg_navi.jpg ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/Version2/Web App/MPW/Images/button_selected.png =================================================================== (Binary files differ) Property changes on: trunk/Version2/Web App/MPW/Images/button_selected.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/Version2/Web App/MPW/Images/button_unselected.png =================================================================== (Binary files differ) Property changes on: trunk/Version2/Web App/MPW/Images/button_unselected.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/Version2/Web App/MPW/Images/favicon.ico =================================================================== (Binary files differ) Property changes on: trunk/Version2/Web App/MPW/Images/favicon.ico ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/Version2/Web App/MPW/Images/icon_bg.png =================================================================== (Binary files differ) Property changes on: trunk/Version2/Web App/MPW/Images/icon_bg.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/Version2/Web App/MPW/Images/loading.gif =================================================================== (Binary files differ) Property changes on: trunk/Version2/Web App/MPW/Images/loading.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/Version2/Web App/MPW/Images/mp_logo_header.png =================================================================== (Binary files differ) Property changes on: trunk/Version2/Web App/MPW/Images/mp_logo_header.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/Version2/Web App/MPW/Images/rec_series.png =================================================================== (Binary files differ) Property changes on: trunk/Version2/Web App/MPW/Images/rec_series.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/Version2/Web App/MPW/Images/rec_single.png =================================================================== (Binary files differ) Property changes on: trunk/Version2/Web App/MPW/Images/rec_single.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/Version2/Web App/MPW/Images/redx.gif =================================================================== (Binary files differ) Property changes on: trunk/Version2/Web App/MPW/Images/redx.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/Version2/Web App/MPW/Images/shadow_left.png =================================================================== (Binary files differ) Property changes on: trunk/Version2/Web App/MPW/Images/shadow_left.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/Version2/Web App/MPW/Images/shadow_right.png =================================================================== (Binary files differ) Property changes on: trunk/Version2/Web App/MPW/Images/shadow_right.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/Version2/Web App/MPW/Images/tvguide_notify_button.png =================================================================== (Binary files differ) Property changes on: trunk/Version2/Web App/MPW/Images/tvguide_notify_button.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/Version2/Web App/MPW/Images/tvguide_recordconflict_button.png =================================================================== (Binary files differ) Property changes on: trunk/Version2/Web App/MPW/Images/tvguide_recordconflict_button.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/Version2/Web App/MPW/Images/tvguide_recordserie_conflict_button.png =================================================================== (Binary files differ) Property changes on: trunk/Version2/Web App/MPW/Images/tvguide_recordserie_conflict_button.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/Version2/Web App/MPW/JS/mpw.js =================================================================== --- trunk/Version2/Web App/MPW/JS/mpw.js (rev 0) +++ trunk/Version2/Web App/MPW/JS/mpw.js 2007-04-25 20:29:27 UTC (rev 45) @@ -0,0 +1,13 @@ +function showProgramDetails(IdProgram) { +document.getElementById("showDetails").value = "true"; +document.getElementById("idDetails").value = IdProgram; +document.getElementById("programInfo").style.display = "block"; +document.getElementById("programInfo").style.visibility = "visible"; +document.aspnetForm.submit(); +} + +function hideProgramDetails() { +$(showDetail).value = "false"; +$(idDetail).value = ""; +MPW_main.submit(); +} \ No newline at end of file Added: trunk/Version2/Web App/MPW/Login.aspx =================================================================== --- trunk/Version2/Web App/MPW/Login.aspx (rev 0) +++ trunk/Version2/Web App/MPW/Login.aspx 2007-04-25 20:29:27 UTC (rev 45) @@ -0,0 +1,10 @@ +<%@ Page Language="C#" MasterPageFile="~/MPW.master" AutoEventWireup="true" CodeFile="Login.aspx.cs" + Inherits="Default2" Title="Untitled Page" %> + +<asp:Content ID="Login" ContentPlaceHolderID="MPWContent" runat="Server"> + <br /> + <br /> + <asp:Login ID="MPWLogin" runat="server" Height="185px" OnAuthenticate="MPWLogin_Authenticate" + Width="359px"> + </asp:Login> +</asp:Content> Added: trunk/Version2/Web App/MPW/Login.aspx.cs =================================================================== --- trunk/Version2/Web App/MPW/Login.aspx.cs (rev 0) +++ trunk/Version2/Web App/MPW/Login.aspx.cs 2007-04-25 20:29:27 UTC (rev 45) @@ -0,0 +1,29 @@ +using System; +using System.Data; +using System.Configuration; +using System.Collections; +using System.Web; +using System.Web.Security; +using System.Web.UI; +using System.Web.UI.WebControls; +using System.Web.UI.WebControls.WebParts; +using System.Web.UI.HtmlControls; + +public partial class Default2 : System.Web.UI.Page +{ + protected void Page_Load(object sender, EventArgs e) + { + MPWMaster m = (MPWMaster)Page.Master; + m.Sectiontitle = Resources.Resource.Login; + } + + protected void MPWLogin_Authenticate(object sender, AuthenticateEventArgs e) + { + //ToDo: Add authentication Logic here! + if (MPWLogin.Password == "mpw" && MPWLogin.UserName == "mpw") + e.Authenticated = true; + else + e.Authenticated = false; + } + +} Added: trunk/Version2/Web App/MPW/MPW.master =================================================================== --- trunk/Version2/Web App/MPW/MPW.master (rev 0) +++ trunk/Version2/Web App/MPW/MPW.master 2007-04-25 20:29:27 UTC (rev 45) @@ -0,0 +1,80 @@ +<%@ Master Language="C#" AutoEventWireup="true" CodeFile="MPW.master.cs" Inherits="MPWMaster" %> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head id="Head1" runat="server"> + <title>MPW - The MediaPortal Webinterface</title> + <meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> + <link rel="shortcut icon" href="Images/favicon.ico" /> + <link href="css/mpw_style.css" rel="stylesheet" type="text/css" /> + + <script src="JS/mpw.js" type="text/javascript"></script> + +</head> +<body> + <form id="MPW_main" runat="server"> + <asp:ScriptManager ID="ScriptManager1" runat="server"> + </asp:ScriptManager> + <div class="logodiv"> + <div style="width: 700px; float: left;"> + <!-- <img src="../Images/mp_logo_header.png" alt="MP logo" /> --> + </div> + <div style="width: 200px; float: right;"> + <asp:UpdateProgress ID="GlobalUpdateProgress" runat="server" DisplayAfter="10"> + <ProgressTemplate> + <img src="../Images/loading.gif" alt="Loading..." /> + <br /> + <!-- Getting data... Please wait! --> + </ProgressTemplate> + </asp:UpdateProgress> + </div> + </div> + <div class="navidiv"> + <table class="navBar"> + <tr> + <td id="nav_guide" class="navcell"> + <asp:HyperLink ID="LinkGuide" runat="server" Text="<%$ Resources:Resource, Guide %>" + NavigateUrl="~/Default.aspx" CssClass="navilink"></asp:HyperLink> + </td> + <td id="nav_now" class="navcell"> + <asp:HyperLink ID="LinkNowNext" runat="server" Text="<%$ Resources:Resource, NowNext %>" + NavigateUrl="~/NowNext.aspx" CssClass="navilink"></asp:HyperLink> + </td> + <td id="nav_search" class="navcell"> + <asp:HyperLink ID="LinkSearch" runat="server" Text="<%$ Resources:Resource, Search %>" + NavigateUrl="~/Search.aspx" CssClass="navilink"></asp:HyperLink> + </td> + <td id="nav_sched" class="navcell"> + <asp:HyperLink ID="LinkSchedules" runat="server" Text="<%$ Resources:Resource, Schedules %>" + NavigateUrl="~/Schedules.aspx" CssClass="navilink"></asp:HyperLink> + </td> + <td id="nav_rec" class="navcell"> + <asp:HyperLink ID="LinkRecordings" runat="server" Text="<%$ Resources:Resource, Recordings %>" + NavigateUrl="~/Recordings.aspx" CssClass="navilink"></asp:HyperLink> + </td> + <td id="nav_live" class="navcell"> + <asp:HyperLink ID="LinkLiveTV" runat="server" Text="<%$ Resources:Resource, LiveTV %>" + NavigateUrl="~/LiveTV.aspx" CssClass="navilink"></asp:HyperLink> + </td> + </tr> + </table> + <div class="datediv"> + <asp:Label ID="dateLabel" runat="server" Text=""></asp:Label> + </div> + </div> + <div class="contentdiv"> + <table class="content"> + <tr> + <td class="leftcontent"> + </td> + <td class="maincontent"> + <asp:ContentPlaceHolder ID="MPWContent" runat="server"> + </asp:ContentPlaceHolder> + </td> + <td class="rightcontent"> + </td> + </tr> + </table> + </div> + </form> +</body> +</html> Added: trunk/Version2/Web App/MPW/MPW.master.cs =================================================================== --- trunk/Version2/Web App/MPW/MPW.master.cs (rev 0) +++ trunk/Version2/Web App/MPW/MPW.master.cs 2007-04-25 20:29:27 UTC (rev 45) @@ -0,0 +1,42 @@ +using System; +using System.Data; +using System.Configuration; +using System.Collections; +using System.Web; +using System.Web.Security; +using System.Web.UI; +using System.Web.UI.WebControls; +using System.Web.UI.WebControls.WebParts; +using System.Web.UI.HtmlControls; + +public partial class MPWMaster : System.Web.UI.MasterPage +{ + String sectiontitle; + + public string Sectiontitle + { + get + { + return sectiontitle; + } + + set + { + sectiontitle = value; + } + } + + protected void Page_Load(object sender, EventArgs e) + { + dateLabel.Text = DateTime.Now.ToLongDateString() + " " + DateTime.Now.ToShortTimeString(); + } + + protected override void OnLoad(EventArgs e) + { + string title = String.Format(@"{0} > {1}", Resources.Resource.PageTitle, sectiontitle); + + Page.Header.Title = title; + + base.OnLoad(e); + } +} Added: trunk/Version2/Web App/MPW/NowNext.aspx =================================================================== --- trunk/Version2/Web App/MPW/NowNext.aspx (rev 0) +++ trunk/Version2/Web App/MPW/NowNext.aspx 2007-04-25 20:29:27 UTC (rev 45) @@ -0,0 +1,38 @@ +<%@ Page Language="C#" MasterPageFile="~/MPW.master" AutoEventWireup="true" CodeFile="NowNext.aspx.cs" Inherits="Default2" Title="Untitled Page" %> + +<asp:Content ID="NowNext" ContentPlaceHolderID="MPWContent" runat="Server"> + <asp:UpdatePanel ID="ContentUpdatePanel" runat="server" UpdateMode="Always"> + <ContentTemplate> + <div> + <asp:Panel ID="NowNextPanel" runat="server"> + </asp:Panel> + </div> + <asp:Panel ID="DetailsPanel" runat="server" Visible="false" CssClass="detailsPanel"> + <div> + <div style="width: 75px; height: 85px; float: left;"> + <asp:Image ID="detailChannelLogo" runat="server" /> + <br /> + <asp:Label ID="detailChannelName" runat="server" Text="Channel Name"></asp:Label></div> + <div style="float: left;"> + <asp:Label ID="detailShowName" runat="server" Text="Show Name" CssClass="detailShowTitle"></asp:Label> + <br /> + <asp:Label ID="detailShowTime" runat="server" Text="Time"></asp:Label> + </div> + <div style="float:right;width:20px;"> + <asp:ImageButton ID="CloseDetails" runat="server" CausesValidation="False" ImageAlign="Middle" ImageUrl="~/Images/redx.gif" OnClick="closeDetails" PostBackUrl="~/NowNext.aspx" /> + </div> + </div> + <div class="recordingoptions"> + <asp:Label ID="Label1" runat="server" Text="<%$ Resources:Resource, RecordThis %>"></asp:Label> + <asp:DropDownList ID="ScheduleType" runat="server"> + </asp:DropDownList> + <asp:HiddenField ID="HiddenFieldProgramID" runat="server" /> + <asp:Button ID="Button1" runat="server" Text="Button" OnClick="addSchedule" /></div> + <div class="description"> + <asp:Label ID="detailShowDesc" runat="server" Text="Show Description"></asp:Label> + </div> + </asp:Panel> + </ContentTemplate> + </asp:UpdatePanel> +</asp:Content> + Added: trunk/Version2/Web App/MPW/NowNext.aspx.cs =================================================================== --- trunk/Version2/Web App/MPW/NowNext.aspx.cs (rev 0) +++ trunk/Version2/Web App/MPW/NowNext.aspx.cs 2007-04-25 20:29:27 UTC (rev 45) @@ -0,0 +1,263 @@ +using System; +using System.Data; +using System.Configuration; +using System.Collections; +using System.Web; +using System.Web.Security; +using System.Web.UI; +using System.Web.UI.WebControls; +using System.Web.UI.WebControls.WebParts; +using System.Web.UI.HtmlControls; + +using TvDatabase; +using MPW; +using System.Collections.Generic; + +public partial class Default2 : System.Web.UI.Page +{ + IList _schedules; + + /// <summary> + /// Checks if a program is scheduled as single / series recording + /// </summary> + /// <param name="program">The program to check</param> + /// <returns>A bool array with meaning [isScheduled, isSeries]</returns> + protected bool[] IsRecording(Program program) + { + bool[] result = { false, false }; + foreach (Schedule schedule in _schedules) + { + if (schedule.IsRecordingProgram(program, true)) + { + result[0] = true; + if (schedule.ScheduleType != 0) + result[1] = true; ; + } + } + return result; + } + + protected void Page_Load(object sender, EventArgs e) + { + MPWMaster m = (MPWMaster)Page.Master; + m.Sectiontitle = Resources.Resource.NowNext; + updateContents(); + } + + /// <summary> + /// Opens the popup with details for a show. + /// </summary> + /// <param name="sender"></param> + /// <param name="e"></param> + protected void openDetails(object sender, CommandEventArgs e) + { + int idProgram = int.Parse(e.CommandArgument.ToString()); + prepareDetails(idProgram); + DetailsPanel.Visible = true; + } + + /// <summary> + /// Adds a new Schedule from the details panel. + /// </summary> + /// <param name="sender"></param> + /// <param name="e"></param> + protected void addSchedule(object sender, EventArgs e) + { + int idProgram = int.Parse(HiddenFieldProgramID.Value); + int recTypeNr = int.Parse(ScheduleType.SelectedValue); + ScheduleRecordingType recType = (ScheduleRecordingType)recTypeNr; + if (MPWUtils.addSchedule(idProgram, recType)) + { + DetailsPanel.Visible = false; + updateContents(); + } + //TODO: Implement error handling + } + + /// <summary> + /// Closes the popup with details for a show. + /// </summary> + /// <param name="sender"></param> + /// <param name="e"></param> + protected void closeDetails(object sender, ImageClickEventArgs e) + { + DetailsPanel.Visible = false; + } + + /// <summary> + /// Prepares the contents of the Details panel + /// </summary> + /// <param name="idProgram">The program ID of the selected show.</param> + protected void prepareDetails(int idProgram) + { + + Program p = Program.Retrieve(idProgram); + Channel c = Channel.Retrieve(p.IdChannel); + detailChannelName.Text = c.Name; + detailChannelLogo.ImageUrl = MPWUtils.getChannelLogoPath(this.Server.MapPath("~/TVLogos/"), c.Name); + detailShowName.Text = p.Title; + detailShowTime.Text = "(" + p.StartTime.ToShortTimeString() + " - " + p.EndTime.ToShortTimeString() + ")"; + detailShowDesc.Text = p.Description; + HiddenFieldProgramID.Value = idProgram.ToString(); + MPWUtils.prepareScheduleTypeDropDown(ScheduleType); + } + + /// <summary> + /// Updates the now and next program rows. + /// </summary> + protected void updateContents() + { + //Clear everything + NowNextPanel.Controls.Clear(); + + //Establish the connection to the TV Server and the DB. + MPWUtils.SetupConnection(); + + //A new Businesslayer + TvBusinessLayer layer = new TvBusinessLayer(); + + //Get all schedules + _schedules = Schedule.ListAll(); + + //Get all groups + IList groups = ChannelGroup.ListAll(); + + foreach (ChannelGroup group in groups) + { + Table groupTable = new Table(); + groupTable.CellPadding = 0; + groupTable.CellSpacing = 0; + groupTable.CssClass = "grouptable"; + + // Seperator with group name + TableRow groupSeperatorRow = new TableRow(); + TableCell groupSeperatorCell = new TableCell(); + groupSeperatorCell.CssClass = "seperatorcell"; + groupSeperatorCell.ColumnSpan = 3; + Label groupName = new Label(); + groupName.Text = group.GroupName; + groupSeperatorCell.Controls.Add(groupName); + groupSeperatorRow.Cells.Add(groupSeperatorCell); + groupTable.Rows.Add(groupSeperatorRow); + + // Get a list of all tv-channels + IList channels = layer.GetTVGuideChannelsForGroup(group.IdGroup); + List<Channel> channelstv = new List<Channel>(); + + // Remove non TV channels + foreach (Channel channel in channels) + { + if (channel.IsTv) + channelstv.Add(channel); + } + + //Iterate through all the channels + foreach (Channel channel in channelstv) + { + TableRow channelNameRow = new TableRow(); + + TableCell spacer = new TableCell(); + spacer.CssClass = "spacer"; + channelNameRow.Controls.Add(spacer); + + TableCell channelNameCell = new TableCell(); + channelNameCell.CssClass = "namecell"; + channelNameCell.ColumnSpan = 2; + Label channelName = new Label(); + channelName.Tex... [truncated message content] |
From: <mas...@us...> - 2007-04-25 19:57:14
|
Revision: 44 http://svn.sourceforge.net/mp-webinterface/?rev=44&view=rev Author: maschine Date: 2007-04-25 12:56:22 -0700 (Wed, 25 Apr 2007) Log Message: ----------- Preparation for complete new solution & project files (old were broken, couldn't open them after a reinstall). Removed Paths: ------------- trunk/Version2/Web App/MPW/ trunk/Version2/Web App/MPW.sln Deleted: trunk/Version2/Web App/MPW.sln =================================================================== --- trunk/Version2/Web App/MPW.sln 2007-04-18 16:38:04 UTC (rev 43) +++ trunk/Version2/Web App/MPW.sln 2007-04-25 19:56:22 UTC (rev 44) @@ -1,24 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MPW", "MPW\MPW.csproj", "{F6320A65-7715-4D93-BAF6-360C1FF8D963}" - ProjectSection(WebsiteProperties) = preProject - Debug.AspNetCompiler.Debug = "True" - Release.AspNetCompiler.Debug = "False" - EndProjectSection -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {F6320A65-7715-4D93-BAF6-360C1FF8D963}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F6320A65-7715-4D93-BAF6-360C1FF8D963}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F6320A65-7715-4D93-BAF6-360C1FF8D963}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F6320A65-7715-4D93-BAF6-360C1FF8D963}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mas...@us...> - 2007-04-18 16:38:09
|
Revision: 43 http://svn.sourceforge.net/mp-webinterface/?rev=43&view=rev Author: maschine Date: 2007-04-18 09:38:04 -0700 (Wed, 18 Apr 2007) Log Message: ----------- First version of the guide view. Modified Paths: -------------- trunk/Version2/Web App/MPW/Default.aspx trunk/Version2/Web App/MPW/Default.aspx.cs trunk/Version2/Web App/MPW/Default.aspx.designer.cs trunk/Version2/Web App/MPW/css/mpw_style.css Modified: trunk/Version2/Web App/MPW/Default.aspx =================================================================== --- trunk/Version2/Web App/MPW/Default.aspx 2007-04-16 13:22:05 UTC (rev 42) +++ trunk/Version2/Web App/MPW/Default.aspx 2007-04-18 16:38:04 UTC (rev 43) @@ -1,10 +1,12 @@ -<%@ Page Language="C#" MasterPageFile="~/MPW.Master" AutoEventWireup="true" - Codebehind="Default.aspx.cs" Inherits="MPW.MasterPages.WebForm11" Title="Untitled Page" %> +<%@ Page Language="C#" MasterPageFile="~/MPW.Master" AutoEventWireup="true" Codebehind="Default.aspx.cs" + Inherits="MPW.MasterPages.WebForm11" Title="Untitled Page" %> <asp:Content ID="Content1" ContentPlaceHolderID="MPWContent" runat="server"> <br /> <asp:Button ID="ButtonPrev" runat="server" Text="<" /> <asp:Button ID="ButtonNext" runat="server" Text=">" /> + <asp:DropDownList ID="GroupDropDown" runat="server"> + </asp:DropDownList> <asp:DropDownList ID="TimeDropDown" runat="server"> </asp:DropDownList> <asp:DropDownList ID="DateDropDown" runat="server"> @@ -12,7 +14,7 @@ <br /> <asp:UpdatePanel ID="GuideUpdatePanel" runat="server" UpdateMode="Conditional"> <ContentTemplate> - <asp:Table ID="Guide" runat="server" HorizontalAlign="Left"> + <asp:Table ID="Guide" runat="server" Width="90%"> </asp:Table> </ContentTemplate> <Triggers> Modified: trunk/Version2/Web App/MPW/Default.aspx.cs =================================================================== --- trunk/Version2/Web App/MPW/Default.aspx.cs 2007-04-16 13:22:05 UTC (rev 42) +++ trunk/Version2/Web App/MPW/Default.aspx.cs 2007-04-18 16:38:04 UTC (rev 43) @@ -40,24 +40,84 @@ channels.Remove(channel); } + //The Time + TableRow timerow = new TableRow(); + TableCell spacer = new TableCell(); + timerow.Cells.Add(spacer); + + for (int i = 0; i < 3; i++) + { + TableCell cell = new TableCell(); + cell.Text = "| " + guideStart.AddHours(i).ToShortTimeString(); + cell.Width = 180; + timerow.Cells.Add(cell); + } + Guide.Rows.Add(timerow); + //Iterate through all the channels foreach (Channel channel in channels) { TableRow r = new TableRow(); TableCell cell_channel = new TableCell(); TableCell cell_program = new TableCell(); + cell_program.ColumnSpan = 3; Label lbl_channel = new Label(); lbl_channel.Text = "<strong>" + channel.Name + "</strong>"; - Label lbl_program = new Label(); - lbl_program.Text = "EPG"; - cell_channel.Controls.Add(lbl_channel); cell_channel.CssClass = "guideChannel"; - cell_program.Controls.Add(lbl_program); + try + { + Program current = channel.GetProgramAt(guideStart); + Table programsTable = new Table(); + TableRow programsRow = new TableRow(); + + TableCell firstcell = new TableCell(); + firstcell.CssClass = "guidecell"; + + TimeSpan widthTime = current.EndTime - guideStart; + Unit widthPixel = new Unit(widthTime.Minutes.ToString()); + firstcell.Width = widthPixel; + firstcell.Text = current.Title; + programsRow.Cells.Add(firstcell); + + bool more = true; + + while (more == true) + { + Program next = channel.GetProgramAt(current.EndTime.AddMinutes(1)); + if (next.EndTime <= guideEnd) + { + TableCell nextcell = new TableCell(); + nextcell.CssClass = "guidecell"; + + widthTime = next.EndTime - next.StartTime; + widthPixel = new Unit(widthTime.Minutes.ToString()); + nextcell.Width = widthPixel; + nextcell.Text = next.Title; + programsRow.Cells.Add(nextcell); + current = next; + } + else + { + more = false; + } + } + + programsTable.Rows.Add(programsRow); + cell_program.Controls.Add(programsTable); + + } + catch + { + Label noEPG = new Label(); + noEPG.Text = Resources.Resource.NoEPGInfo; + cell_program.Controls.Add(noEPG); + } + r.Cells.Add(cell_channel); r.Cells.Add(cell_program); Modified: trunk/Version2/Web App/MPW/Default.aspx.designer.cs =================================================================== --- trunk/Version2/Web App/MPW/Default.aspx.designer.cs 2007-04-16 13:22:05 UTC (rev 42) +++ trunk/Version2/Web App/MPW/Default.aspx.designer.cs 2007-04-18 16:38:04 UTC (rev 43) @@ -38,6 +38,15 @@ protected global::System.Web.UI.WebControls.Button ButtonNext; /// <summary> + /// GroupDropDown control. + /// </summary> + /// <remarks> + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// </remarks> + protected global::System.Web.UI.WebControls.DropDownList GroupDropDown; + + /// <summary> /// TimeDropDown control. /// </summary> /// <remarks> Modified: trunk/Version2/Web App/MPW/css/mpw_style.css =================================================================== --- trunk/Version2/Web App/MPW/css/mpw_style.css 2007-04-16 13:22:05 UTC (rev 42) +++ trunk/Version2/Web App/MPW/css/mpw_style.css 2007-04-18 16:38:04 UTC (rev 43) @@ -226,6 +226,13 @@ } input.deleteschedule { - margin-left:10px; - vertical-align:middle; + margin-left: 10px; + vertical-align: middle; } + +td.guidecell +{ + height:20px; + overflow:hidden; + background-color:Lime; +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mas...@us...> - 2007-04-16 13:22:28
|
Revision: 42 http://svn.sourceforge.net/mp-webinterface/?rev=42&view=rev Author: maschine Date: 2007-04-16 06:22:05 -0700 (Mon, 16 Apr 2007) Log Message: ----------- Fixing exception generated while modifying a collection at runtime. Modified Paths: -------------- trunk/Version2/Web App/MPW/NowNext.aspx.cs Modified: trunk/Version2/Web App/MPW/NowNext.aspx.cs =================================================================== --- trunk/Version2/Web App/MPW/NowNext.aspx.cs 2007-04-09 21:27:33 UTC (rev 41) +++ trunk/Version2/Web App/MPW/NowNext.aspx.cs 2007-04-16 13:22:05 UTC (rev 42) @@ -12,6 +12,7 @@ using TvDatabase; using TvControl; using MPW.Utils; +using System.Collections.Generic; namespace MPW { @@ -144,16 +145,17 @@ // Get a list of all tv-channels IList channels = layer.GetTVGuideChannelsForGroup(group.IdGroup); + List<Channel> channelstv = new List<Channel>(); // Remove non TV channels foreach (Channel channel in channels) { - if (!channel.IsTv) - channels.Remove(channel); + if (channel.IsTv) + channelstv.Add(channel); } //Iterate through all the channels - foreach (Channel channel in channels) + foreach (Channel channel in channelstv) { TableRow channelNameRow = new TableRow(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mas...@us...> - 2007-04-09 21:27:35
|
Revision: 41 http://svn.sourceforge.net/mp-webinterface/?rev=41&view=rev Author: maschine Date: 2007-04-09 14:27:33 -0700 (Mon, 09 Apr 2007) Log Message: ----------- Cleanup. Property Changed: ---------------- trunk/Version2/Web App/ trunk/Version2/Web App/MPW/ Property changes on: trunk/Version2/Web App ___________________________________________________________________ Name: svn:ignore + MPW.suo Property changes on: trunk/Version2/Web App/MPW ___________________________________________________________________ Name: svn:ignore + Gentle.config bin obj This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mas...@us...> - 2007-04-09 21:23:46
|
Revision: 40 http://svn.sourceforge.net/mp-webinterface/?rev=40&view=rev Author: maschine Date: 2007-04-09 14:23:43 -0700 (Mon, 09 Apr 2007) Log Message: ----------- Adding missing reference. Added Paths: ----------- trunk/Version2/Web App/references/System.Web.Extensions.Design.dll Added: trunk/Version2/Web App/references/System.Web.Extensions.Design.dll =================================================================== (Binary files differ) Property changes on: trunk/Version2/Web App/references/System.Web.Extensions.Design.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mas...@us...> - 2007-04-09 20:45:17
|
Revision: 39 http://svn.sourceforge.net/mp-webinterface/?rev=39&view=rev Author: maschine Date: 2007-04-09 13:45:06 -0700 (Mon, 09 Apr 2007) Log Message: ----------- Initial commit of the MPW web app part. Added Paths: ----------- trunk/Version2/Web App/ trunk/Version2/Web App/MPW/ trunk/Version2/Web App/MPW/App_GlobalResources/ trunk/Version2/Web App/MPW/App_GlobalResources/Resource.Designer.cs trunk/Version2/Web App/MPW/App_GlobalResources/Resource.de.designer.cs trunk/Version2/Web App/MPW/App_GlobalResources/Resource.de.resx trunk/Version2/Web App/MPW/App_GlobalResources/Resource.resx trunk/Version2/Web App/MPW/Default.aspx trunk/Version2/Web App/MPW/Default.aspx.cs trunk/Version2/Web App/MPW/Default.aspx.designer.cs trunk/Version2/Web App/MPW/Images/ trunk/Version2/Web App/MPW/Images/bg_channel.jpg trunk/Version2/Web App/MPW/Images/bg_channel_logo.png trunk/Version2/Web App/MPW/Images/bg_channel_name.jpg trunk/Version2/Web App/MPW/Images/bg_channel_program.png trunk/Version2/Web App/MPW/Images/bg_channelgroup.jpg trunk/Version2/Web App/MPW/Images/bg_content.jpg trunk/Version2/Web App/MPW/Images/bg_logo.jpg trunk/Version2/Web App/MPW/Images/bg_navi.jpg trunk/Version2/Web App/MPW/Images/button_selected.png trunk/Version2/Web App/MPW/Images/button_unselected.png trunk/Version2/Web App/MPW/Images/favicon.ico trunk/Version2/Web App/MPW/Images/icon_bg.png trunk/Version2/Web App/MPW/Images/loading.gif trunk/Version2/Web App/MPW/Images/mp_logo_header.png trunk/Version2/Web App/MPW/Images/rec_series.png trunk/Version2/Web App/MPW/Images/rec_single.png trunk/Version2/Web App/MPW/Images/redx.gif trunk/Version2/Web App/MPW/Images/shadow_left.png trunk/Version2/Web App/MPW/Images/shadow_right.png trunk/Version2/Web App/MPW/Images/tvguide_notify_button.png trunk/Version2/Web App/MPW/Images/tvguide_recordconflict_button.png trunk/Version2/Web App/MPW/Images/tvguide_recordserie_conflict_button.png trunk/Version2/Web App/MPW/Includes/ trunk/Version2/Web App/MPW/Includes/Head.ascx trunk/Version2/Web App/MPW/Includes/Head.ascx.cs trunk/Version2/Web App/MPW/Includes/Head.ascx.designer.cs trunk/Version2/Web App/MPW/Includes/Navigation.ascx trunk/Version2/Web App/MPW/Includes/Navigation.ascx.cs trunk/Version2/Web App/MPW/Includes/Navigation.ascx.designer.cs trunk/Version2/Web App/MPW/JS/ trunk/Version2/Web App/MPW/JS/mpw.js trunk/Version2/Web App/MPW/LiveTV.aspx trunk/Version2/Web App/MPW/LiveTV.aspx.cs trunk/Version2/Web App/MPW/LiveTV.aspx.designer.cs trunk/Version2/Web App/MPW/Login.aspx trunk/Version2/Web App/MPW/Login.aspx.cs trunk/Version2/Web App/MPW/Login.aspx.designer.cs trunk/Version2/Web App/MPW/MPW.Master trunk/Version2/Web App/MPW/MPW.Master.cs trunk/Version2/Web App/MPW/MPW.Master.designer.cs trunk/Version2/Web App/MPW/MPW.Publish.xml trunk/Version2/Web App/MPW/MPW.csproj trunk/Version2/Web App/MPW/MPW.csproj.user trunk/Version2/Web App/MPW/NowNext.aspx trunk/Version2/Web App/MPW/NowNext.aspx.cs trunk/Version2/Web App/MPW/NowNext.aspx.designer.cs trunk/Version2/Web App/MPW/Properties/ trunk/Version2/Web App/MPW/Properties/AssemblyInfo.cs trunk/Version2/Web App/MPW/Recordings.aspx trunk/Version2/Web App/MPW/Recordings.aspx.cs trunk/Version2/Web App/MPW/Recordings.aspx.designer.cs trunk/Version2/Web App/MPW/Schedules.aspx trunk/Version2/Web App/MPW/Schedules.aspx.cs trunk/Version2/Web App/MPW/Schedules.aspx.designer.cs trunk/Version2/Web App/MPW/Search.aspx trunk/Version2/Web App/MPW/Search.aspx.cs trunk/Version2/Web App/MPW/Search.aspx.designer.cs trunk/Version2/Web App/MPW/TVLogos/ trunk/Version2/Web App/MPW/Utils/ trunk/Version2/Web App/MPW/Utils/Utils.cs trunk/Version2/Web App/MPW/Web.config trunk/Version2/Web App/MPW/css/ trunk/Version2/Web App/MPW/css/mpw_style.css trunk/Version2/Web App/MPW.sln trunk/Version2/Web App/references/ trunk/Version2/Web App/references/AjaxControlToolkit.dll trunk/Version2/Web App/references/Gentle.Common.dll trunk/Version2/Web App/references/Gentle.Framework.dll trunk/Version2/Web App/references/Gentle.Provider.MySQL.dll trunk/Version2/Web App/references/Gentle.Provider.SQLServer.dll trunk/Version2/Web App/references/MySql.Data.dll trunk/Version2/Web App/references/System.Web.Extensions.dll trunk/Version2/Web App/references/ar/ trunk/Version2/Web App/references/ar/AjaxControlToolkit.resources.dll trunk/Version2/Web App/references/de/ trunk/Version2/Web App/references/de/AjaxControlToolkit.resources.dll trunk/Version2/Web App/references/es/ trunk/Version2/Web App/references/es/AjaxControlToolkit.resources.dll trunk/Version2/Web App/references/fr/ trunk/Version2/Web App/references/fr/AjaxControlToolkit.resources.dll trunk/Version2/Web App/references/he/ trunk/Version2/Web App/references/he/AjaxControlToolkit.resources.dll trunk/Version2/Web App/references/hi/ trunk/Version2/Web App/references/hi/AjaxControlToolkit.resources.dll trunk/Version2/Web App/references/it/ trunk/Version2/Web App/references/it/AjaxControlToolkit.resources.dll trunk/Version2/Web App/references/ja/ trunk/Version2/Web App/references/ja/AjaxControlToolkit.resources.dll trunk/Version2/Web App/references/ko/ trunk/Version2/Web App/references/ko/AjaxControlToolkit.resources.dll trunk/Version2/Web App/references/log4net.dll trunk/Version2/Web App/references/pt/ trunk/Version2/Web App/references/pt/AjaxControlToolkit.resources.dll trunk/Version2/Web App/references/ru/ trunk/Version2/Web App/references/ru/AjaxControlToolkit.resources.dll trunk/Version2/Web App/references/zh-CHS/ trunk/Version2/Web App/references/zh-CHS/AjaxControlToolkit.resources.dll trunk/Version2/Web App/references/zh-CHT/ trunk/Version2/Web App/references/zh-CHT/AjaxControlToolkit.resources.dll Added: trunk/Version2/Web App/MPW/App_GlobalResources/Resource.Designer.cs =================================================================== --- trunk/Version2/Web App/MPW/App_GlobalResources/Resource.Designer.cs (rev 0) +++ trunk/Version2/Web App/MPW/App_GlobalResources/Resource.Designer.cs 2007-04-09 20:45:06 UTC (rev 39) @@ -0,0 +1,261 @@ +//------------------------------------------------------------------------------ +// <auto-generated> +// This code was generated by a tool. +// Runtime Version:2.0.50727.42 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// </auto-generated> +//------------------------------------------------------------------------------ + +namespace Resources { + using System; + + + /// <summary> + /// A strongly-typed resource class, for looking up localized strings, etc. + /// </summary> + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Web.Application.StronglyTypedResourceProxyBuilder", "8.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resource { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resource() { + } + + /// <summary> + /// Returns the cached ResourceManager instance used by this class. + /// </summary> + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Resources.Resource", global::System.Reflection.Assembly.Load("App_GlobalResources")); + resourceMan = temp; + } + return resourceMan; + } + } + + /// <summary> + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// </summary> + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// <summary> + /// Looks up a localized string similar to Daily. + /// </summary> + internal static string Daily { + get { + return ResourceManager.GetString("Daily", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to Everytime on every channel. + /// </summary> + internal static string EveryTimeOnEveryChannel { + get { + return ResourceManager.GetString("EveryTimeOnEveryChannel", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to Everytime on this channel. + /// </summary> + internal static string EveryTimeOnThisChannel { + get { + return ResourceManager.GetString("EveryTimeOnThisChannel", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to Guide. + /// </summary> + internal static string Guide { + get { + return ResourceManager.GetString("Guide", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to Live TV. + /// </summary> + internal static string LiveTV { + get { + return ResourceManager.GetString("LiveTV", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to Login. + /// </summary> + internal static string Login { + get { + return ResourceManager.GetString("Login", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to Next. + /// </summary> + internal static string Next { + get { + return ResourceManager.GetString("Next", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to Sorry, no information available.... + /// </summary> + internal static string NoEPGInfo { + get { + return ResourceManager.GetString("NoEPGInfo", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to Now. + /// </summary> + internal static string Now { + get { + return ResourceManager.GetString("Now", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to Now & Next. + /// </summary> + internal static string NowNext { + get { + return ResourceManager.GetString("NowNext", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to Once. + /// </summary> + internal static string Once { + get { + return ResourceManager.GetString("Once", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to MPW - The MediaPortal Webinterface. + /// </summary> + internal static string PageTitle { + get { + return ResourceManager.GetString("PageTitle", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to Record!. + /// </summary> + internal static string Record { + get { + return ResourceManager.GetString("Record", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to Recordings. + /// </summary> + internal static string Recordings { + get { + return ResourceManager.GetString("Recordings", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to Record this program. + /// </summary> + internal static string RecordThis { + get { + return ResourceManager.GetString("RecordThis", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to Series recordings. + /// </summary> + internal static string RecSeries { + get { + return ResourceManager.GetString("RecSeries", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to Single recordings. + /// </summary> + internal static string RecSingle { + get { + return ResourceManager.GetString("RecSingle", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to Schedules. + /// </summary> + internal static string Schedules { + get { + return ResourceManager.GetString("Schedules", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to Search. + /// </summary> + internal static string Search { + get { + return ResourceManager.GetString("Search", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to Weekends. + /// </summary> + internal static string Weekends { + get { + return ResourceManager.GetString("Weekends", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to Weekly. + /// </summary> + internal static string Weekly { + get { + return ResourceManager.GetString("Weekly", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to Workingdays. + /// </summary> + internal static string WorkingDays { + get { + return ResourceManager.GetString("WorkingDays", resourceCulture); + } + } + } +} Added: trunk/Version2/Web App/MPW/App_GlobalResources/Resource.de.designer.cs =================================================================== Added: trunk/Version2/Web App/MPW/App_GlobalResources/Resource.de.resx =================================================================== --- trunk/Version2/Web App/MPW/App_GlobalResources/Resource.de.resx (rev 0) +++ trunk/Version2/Web App/MPW/App_GlobalResources/Resource.de.resx 2007-04-09 20:45:06 UTC (rev 39) @@ -0,0 +1,194 @@ +<?xml version="1.0" encoding="utf-8"?> +<root> + <!-- + Microsoft ResX Schema + + Version 2.0 + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes + associated with the data types. + + Example: + + ... ado.net/XML headers & schema ... + <resheader name="resmimetype">text/microsoft-resx</resheader> + <resheader name="version">2.0</resheader> + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> + <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> + <value>[base64 mime encoded serialized .NET Framework object]</value> + </data> + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> + <comment>This is a comment</comment> + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="metadata"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" /> + </xsd:sequence> + <xsd:attribute name="name" use="required" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string" /> + <xsd:attribute name="name" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="data"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="resheader"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + </xsd:schema> + <resheader name="resmimetype"> + <value>text/microsoft-resx</value> + </resheader> + <resheader name="version"> + <value>2.0</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <data name="Daily" xml:space="preserve"> + <value>Täglich</value> + <comment>ScheduleType</comment> + </data> + <data name="EveryTimeOnEveryChannel" xml:space="preserve"> + <value>Immer auf jedem Sender</value> + <comment>ScheduleType</comment> + </data> + <data name="EveryTimeOnThisChannel" xml:space="preserve"> + <value>Immer auf diesem Sender</value> + <comment>ScheduleType</comment> + </data> + <data name="Guide" xml:space="preserve"> + <value>Programmführer</value> + <comment>Navigation</comment> + </data> + <data name="LiveTV" xml:space="preserve"> + <value>Live TV</value> + <comment>Navigation</comment> + </data> + <data name="Next" xml:space="preserve"> + <value>Gleich</value> + </data> + <data name="NoEPGInfo" xml:space="preserve"> + <value>Leider keine Informationen verfügbar...</value> + <comment>Guide</comment> + </data> + <data name="Now" xml:space="preserve"> + <value>Jetzt</value> + </data> + <data name="NowNext" xml:space="preserve"> + <value>Jetzt & Gleich</value> + <comment>Navigation</comment> + </data> + <data name="Once" xml:space="preserve"> + <value>Einmalig</value> + <comment>ScheduleType</comment> + </data> + <data name="Record" xml:space="preserve"> + <value>Aufnehmen!</value> + </data> + <data name="Recordings" xml:space="preserve"> + <value>Aufnahmen</value> + <comment>Navigation</comment> + </data> + <data name="RecordThis" xml:space="preserve"> + <value>Diese Sendung aufnehmen</value> + </data> + <data name="RecSeries" xml:space="preserve"> + <value>Serienaufnahmen</value> + </data> + <data name="RecSingle" xml:space="preserve"> + <value>Einfache Aufnahmen</value> + </data> + <data name="Schedules" xml:space="preserve"> + <value>Timer</value> + <comment>Navigation</comment> + </data> + <data name="Search" xml:space="preserve"> + <value>Suchen</value> + <comment>Navigation</comment> + </data> + <data name="Weekends" xml:space="preserve"> + <value>Weekends</value> + <comment>ScheduleType</comment> + </data> + <data name="Weekly" xml:space="preserve"> + <value>Wöchentlich</value> + <comment>ScheduleType</comment> + </data> + <data name="WorkingDays" xml:space="preserve"> + <value>Workingdays</value> + <comment>ScheduleType</comment> + </data> +</root> \ No newline at end of file Added: trunk/Version2/Web App/MPW/App_GlobalResources/Resource.resx =================================================================== --- trunk/Version2/Web App/MPW/App_GlobalResources/Resource.resx (rev 0) +++ trunk/Version2/Web App/MPW/App_GlobalResources/Resource.resx 2007-04-09 20:45:06 UTC (rev 39) @@ -0,0 +1,200 @@ +<?xml version="1.0" encoding="utf-8"?> +<root> + <!-- + Microsoft ResX Schema + + Version 2.0 + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes + associated with the data types. + + Example: + + ... ado.net/XML headers & schema ... + <resheader name="resmimetype">text/microsoft-resx</resheader> + <resheader name="version">2.0</resheader> + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> + <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> + <value>[base64 mime encoded serialized .NET Framework object]</value> + </data> + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> + <comment>This is a comment</comment> + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="metadata"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" /> + </xsd:sequence> + <xsd:attribute name="name" use="required" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string" /> + <xsd:attribute name="name" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="data"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="resheader"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + </xsd:schema> + <resheader name="resmimetype"> + <value>text/microsoft-resx</value> + </resheader> + <resheader name="version"> + <value>2.0</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <data name="Daily" xml:space="preserve"> + <value>Daily</value> + <comment>ScheduleType</comment> + </data> + <data name="EveryTimeOnEveryChannel" xml:space="preserve"> + <value>Everytime on every channel</value> + <comment>ScheduleType</comment> + </data> + <data name="EveryTimeOnThisChannel" xml:space="preserve"> + <value>Everytime on this channel</value> + <comment>ScheduleType</comment> + </data> + <data name="Guide" xml:space="preserve"> + <value>Guide</value> + <comment>Navigation</comment> + </data> + <data name="LiveTV" xml:space="preserve"> + <value>Live TV</value> + <comment>Navigation</comment> + </data> + <data name="Login" xml:space="preserve"> + <value>Login</value> + </data> + <data name="Next" xml:space="preserve"> + <value>Next</value> + </data> + <data name="NoEPGInfo" xml:space="preserve"> + <value>Sorry, no information available...</value> + <comment>Guide</comment> + </data> + <data name="Now" xml:space="preserve"> + <value>Now</value> + </data> + <data name="NowNext" xml:space="preserve"> + <value>Now & Next</value> + <comment>Navigation</comment> + </data> + <data name="Once" xml:space="preserve"> + <value>Once</value> + <comment>ScheduleType</comment> + </data> + <data name="PageTitle" xml:space="preserve"> + <value>MPW - The MediaPortal Webinterface</value> + </data> + <data name="Record" xml:space="preserve"> + <value>Record!</value> + </data> + <data name="Recordings" xml:space="preserve"> + <value>Recordings</value> + <comment>Navigation</comment> + </data> + <data name="RecordThis" xml:space="preserve"> + <value>Record this program</value> + </data> + <data name="RecSeries" xml:space="preserve"> + <value>Series recordings</value> + </data> + <data name="RecSingle" xml:space="preserve"> + <value>Single recordings</value> + </data> + <data name="Schedules" xml:space="preserve"> + <value>Schedules</value> + <comment>Navigation</comment> + </data> + <data name="Search" xml:space="preserve"> + <value>Search</value> + <comment>Navigation</comment> + </data> + <data name="Weekends" xml:space="preserve"> + <value>Weekends</value> + <comment>ScheduleType</comment> + </data> + <data name="Weekly" xml:space="preserve"> + <value>Weekly</value> + <comment>ScheduleType</comment> + </data> + <data name="WorkingDays" xml:space="preserve"> + <value>Workingdays</value> + <comment>ScheduleType</comment> + </data> +</root> \ No newline at end of file Added: trunk/Version2/Web App/MPW/Default.aspx =================================================================== --- trunk/Version2/Web App/MPW/Default.aspx (rev 0) +++ trunk/Version2/Web App/MPW/Default.aspx 2007-04-09 20:45:06 UTC (rev 39) @@ -0,0 +1,21 @@ +<%@ Page Language="C#" MasterPageFile="~/MPW.Master" AutoEventWireup="true" + Codebehind="Default.aspx.cs" Inherits="MPW.MasterPages.WebForm11" Title="Untitled Page" %> + +<asp:Content ID="Content1" ContentPlaceHolderID="MPWContent" runat="server"> + <br /> + <asp:Button ID="ButtonPrev" runat="server" Text="<" /> + <asp:Button ID="ButtonNext" runat="server" Text=">" /> + <asp:DropDownList ID="TimeDropDown" runat="server"> + </asp:DropDownList> + <asp:DropDownList ID="DateDropDown" runat="server"> + </asp:DropDownList> + <br /> + <asp:UpdatePanel ID="GuideUpdatePanel" runat="server" UpdateMode="Conditional"> + <ContentTemplate> + <asp:Table ID="Guide" runat="server" HorizontalAlign="Left"> + </asp:Table> + </ContentTemplate> + <Triggers> + </Triggers> + </asp:UpdatePanel> +</asp:Content> Added: trunk/Version2/Web App/MPW/Default.aspx.cs =================================================================== --- trunk/Version2/Web App/MPW/Default.aspx.cs (rev 0) +++ trunk/Version2/Web App/MPW/Default.aspx.cs 2007-04-09 20:45:06 UTC (rev 39) @@ -0,0 +1,68 @@ +using System; +using System.Data; +using System.Configuration; +using System.Collections; +using System.Web; +using System.Web.Security; +using System.Web.UI; +using System.Web.UI.WebControls; +using System.Web.UI.WebControls.WebParts; +using System.Web.UI.HtmlControls; + +using TvDatabase; +using TvControl; +using MPW.Utils; + +namespace MPW.MasterPages +{ + public partial class WebForm11 : System.Web.UI.Page + { + private DateTime guideStart = DateTime.Now; + private DateTime guideEnd; + + protected void Page_Load(object sender, EventArgs e) + { + guideEnd = guideStart.AddHours(3); + + //Establish the connection to the TV Server and the DB. + MPWUtils.SetupConnection(); + + // Get a list of all tv-channels + IList channels = Channel.ListAll(); + + // List all groups + IList groups = ChannelGroup.ListAll(); + + // Remove non-TV channels + foreach (Channel channel in channels) + { + if (!channel.IsTv) + channels.Remove(channel); + } + + //Iterate through all the channels + foreach (Channel channel in channels) + { + TableRow r = new TableRow(); + TableCell cell_channel = new TableCell(); + TableCell cell_program = new TableCell(); + + Label lbl_channel = new Label(); + lbl_channel.Text = "<strong>" + channel.Name + "</strong>"; + + Label lbl_program = new Label(); + lbl_program.Text = "EPG"; + + cell_channel.Controls.Add(lbl_channel); + cell_channel.CssClass = "guideChannel"; + + cell_program.Controls.Add(lbl_program); + + r.Cells.Add(cell_channel); + r.Cells.Add(cell_program); + + Guide.Rows.Add(r); + } + } + } +} Added: trunk/Version2/Web App/MPW/Default.aspx.designer.cs =================================================================== --- trunk/Version2/Web App/MPW/Default.aspx.designer.cs (rev 0) +++ trunk/Version2/Web App/MPW/Default.aspx.designer.cs 2007-04-09 20:45:06 UTC (rev 39) @@ -0,0 +1,76 @@ +//------------------------------------------------------------------------------ +// <auto-generated> +// This code was generated by a tool. +// Runtime Version:2.0.50727.42 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// </auto-generated> +//------------------------------------------------------------------------------ + +namespace MPW.MasterPages { + + + /// <summary> + /// WebForm11 class. + /// </summary> + /// <remarks> + /// Auto-generated class. + /// </remarks> + public partial class WebForm11 { + + /// <summary> + /// ButtonPrev control. + /// </summary> + /// <remarks> + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// </remarks> + protected global::System.Web.UI.WebControls.Button ButtonPrev; + + /// <summary> + /// ButtonNext control. + /// </summary> + /// <remarks> + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// </remarks> + protected global::System.Web.UI.WebControls.Button ButtonNext; + + /// <summary> + /// TimeDropDown control. + /// </summary> + /// <remarks> + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// </remarks> + protected global::System.Web.UI.WebControls.DropDownList TimeDropDown; + + /// <summary> + /// DateDropDown control. + /// </summary> + /// <remarks> + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// </remarks> + protected global::System.Web.UI.WebControls.DropDownList DateDropDown; + + /// <summary> + /// GuideUpdatePanel control. + /// </summary> + /// <remarks> + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// </remarks> + protected global::System.Web.UI.UpdatePanel GuideUpdatePanel; + + /// <summary> + /// Guide control. + /// </summary> + /// <remarks> + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// </remarks> + protected global::System.Web.UI.WebControls.Table Guide; + } +} Added: trunk/Version2/Web App/MPW/Images/bg_channel.jpg =================================================================== (Binary files differ) Property changes on: trunk/Version2/Web App/MPW/Images/bg_channel.jpg ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/Version2/Web App/MPW/Images/bg_channel_logo.png =================================================================== (Binary files differ) Property changes on: trunk/Version2/Web App/MPW/Images/bg_channel_logo.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/Version2/Web App/MPW/Images/bg_channel_name.jpg =================================================================== (Binary files differ) Property changes on: trunk/Version2/Web App/MPW/Images/bg_channel_name.jpg ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/Version2/Web App/MPW/Images/bg_channel_program.png =================================================================== (Binary files differ) Property changes on: trunk/Version2/Web App/MPW/Images/bg_channel_program.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/Version2/Web App/MPW/Images/bg_channelgroup.jpg =================================================================== (Binary files differ) Property changes on: trunk/Version2/Web App/MPW/Images/bg_channelgroup.jpg ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/Version2/Web App/MPW/Images/bg_content.jpg =================================================================== (Binary files differ) Property changes on: trunk/Version2/Web App/MPW/Images/bg_content.jpg ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/Version2/Web App/MPW/Images/bg_logo.jpg =================================================================== (Binary files differ) Property changes on: trunk/Version2/Web App/MPW/Images/bg_logo.jpg ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/Version2/Web App/MPW/Images/bg_navi.jpg =================================================================== (Binary files differ) Property changes on: trunk/Version2/Web App/MPW/Images/bg_navi.jpg ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/Version2/Web App/MPW/Images/button_selected.png =================================================================== (Binary files differ) Property changes on: trunk/Version2/Web App/MPW/Images/button_selected.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/Version2/Web App/MPW/Images/button_unselected.png =================================================================== (Binary files differ) Property changes on: trunk/Version2/Web App/MPW/Images/button_unselected.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/Version2/Web App/MPW/Images/favicon.ico =================================================================== (Binary files differ) Property changes on: trunk/Version2/Web App/MPW/Images/favicon.ico ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/Version2/Web App/MPW/Images/icon_bg.png =================================================================== (Binary files differ) Property changes on: trunk/Version2/Web App/MPW/Images/icon_bg.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/Version2/Web App/MPW/Images/loading.gif =================================================================== (Binary files differ) Property changes on: trunk/Version2/Web App/MPW/Images/loading.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/Version2/Web App/MPW/Images/mp_logo_header.png =================================================================== (Binary files differ) Property changes on: trunk/Version2/Web App/MPW/Images/mp_logo_header.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/Version2/Web App/MPW/Images/rec_series.png =================================================================== (Binary files differ) Property changes on: trunk/Version2/Web App/MPW/Images/rec_series.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/Version2/Web App/MPW/Images/rec_single.png =================================================================== (Binary files differ) Property changes on: trunk/Version2/Web App/MPW/Images/rec_single.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/Version2/Web App/MPW/Images/redx.gif =================================================================== (Binary files differ) Property changes on: trunk/Version2/Web App/MPW/Images/redx.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/Version2/Web App/MPW/Images/shadow_left.png =================================================================== (Binary files differ) Property changes on: trunk/Version2/Web App/MPW/Images/shadow_left.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/Version2/Web App/MPW/Images/shadow_right.png =================================================================== (Binary files differ) Property changes on: trunk/Version2/Web App/MPW/Images/shadow_right.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/Version2/Web App/MPW/Images/tvguide_notify_button.png =================================================================== (Binary files differ) Property changes on: trunk/Version2/Web App/MPW/Images/tvguide_notify_button.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/Version2/Web App/MPW/Images/tvguide_recordconflict_button.png =================================================================== (Binary files differ) Property changes on: trunk/Version2/Web App/MPW/Images/tvguide_recordconflict_button.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/Version2/Web App/MPW/Images/tvguide_recordserie_conflict_button.png =================================================================== (Binary files differ) Property changes on: trunk/Version2/Web App/MPW/Images/tvguide_recordserie_conflict_button.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/Version2/Web App/MPW/Includes/Head.ascx =================================================================== --- trunk/Version2/Web App/MPW/Includes/Head.ascx (rev 0) +++ trunk/Version2/Web App/MPW/Includes/Head.ascx 2007-04-09 20:45:06 UTC (rev 39) @@ -0,0 +1,15 @@ +<%@ Control Language="C#" AutoEventWireup="true" Codebehind="Head.ascx.cs" Inherits="MPW.Head" %> +<div class="logodiv"> + <div style="width: 700px; float: left;"> + <!-- <img src="../Images/mp_logo_header.png" alt="MP logo" /> --> + </div> + <div style="width: 200px; float: right;"> + <asp:UpdateProgress ID="GlobalUpdateProgress" runat="server" DisplayAfter="10"> + <ProgressTemplate> + <img src="../Images/loading.gif" alt="Loading..." /> + <br /> + <!-- Getting data... Please wait! --> + </ProgressTemplate> + </asp:UpdateProgress> + </div> +</div> Added: trunk/Version2/Web App/MPW/Includes/Head.ascx.cs =================================================================== --- trunk/Version2/Web App/MPW/Includes/Head.ascx.cs (rev 0) +++ trunk/Version2/Web App/MPW/Includes/Head.ascx.cs 2007-04-09 20:45:06 UTC (rev 39) @@ -0,0 +1,21 @@ +using System; +using System.Data; +using System.Configuration; +using System.Collections; +using System.Web; +using System.Web.Security; +using System.Web.UI; +using System.Web.UI.WebControls; +using System.Web.UI.WebControls.WebParts; +using System.Web.UI.HtmlControls; + +namespace MPW +{ + public partial class Head : System.Web.UI.UserControl + { + protected void Page_Load(object sender, EventArgs e) + { + + } + } +} \ No newline at end of file Added: trunk/Version2/Web App/MPW/Includes/Head.ascx.designer.cs =================================================================== --- trunk/Version2/Web App/MPW/Includes/Head.ascx.designer.cs (rev 0) +++ trunk/Version2/Web App/MPW/Includes/Head.ascx.designer.cs 2007-04-09 20:45:06 UTC (rev 39) @@ -0,0 +1,31 @@ +//------------------------------------------------------------------------------ +// <auto-generated> +// This code was generated by a tool. +// Runtime Version:2.0.50727.42 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// </auto-generated> +//------------------------------------------------------------------------------ + +namespace MPW { + + + /// <summary> + /// Head class. + /// </summary> + /// <remarks> + /// Auto-generated class. + /// </remarks> + public partial class Head { + + /// <summary> + /// GlobalUpdateProgress control. + /// </summary> + /// <remarks> + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// </remarks> + protected global::System.Web.UI.UpdateProgress GlobalUpdateProgress; + } +} Added: trunk/Version2/Web App/MPW/Includes/Navigation.ascx =================================================================== --- trunk/Version2/Web App/MPW/Includes/Navigation.ascx (rev 0) +++ trunk/Version2/Web App/MPW/Includes/Navigation.ascx 2007-04-09 20:45:06 UTC (rev 39) @@ -0,0 +1,35 @@ +<%@ Control Language="C#" AutoEventWireup="true" Codebehind="Navigation.ascx.cs" + Inherits="MPW.WebUserControl1" %> +<div class="navidiv"> + <table class="navBar"> + <tr> + <td id="nav_guide" class="navcell"> + <asp:HyperLink ID="LinkGuide" runat="server" Text="<%$ Resources:Resource, Guide %>" + NavigateUrl="~/Default.aspx" CssClass="navilink"></asp:HyperLink> + </td> + <td id="nav_now" class="navcell"> + <asp:HyperLink ID="LinkNowNext" runat="server" Text="<%$ Resources:Resource, NowNext %>" + NavigateUrl="~/NowNext.aspx" CssClass="navilink"></asp:HyperLink> + </td> + <td id="nav_search" class="navcell"> + <asp:HyperLink ID="LinkSearch" runat="server" Text="<%$ Resources:Resource, Search %>" + NavigateUrl="~/Search.aspx" CssClass="navilink"></asp:HyperLink> + </td> + <td id="nav_sched" class="navcell"> + <asp:HyperLink ID="LinkSchedules" runat="server" Text="<%$ Resources:Resource, Schedules %>" + NavigateUrl="~/Schedules.aspx" CssClass="navilink"></asp:HyperLink> + </td> + <td id="nav_rec" class="navcell"> + <asp:HyperLink ID="LinkRecordings" runat="server" Text="<%$ Resources:Resource, Recordings %>" + NavigateUrl="~/Recordings.aspx" CssClass="navilink"></asp:HyperLink> + </td> + <td id="nav_live" class="navcell"> + <asp:HyperLink ID="LinkLiveTV" runat="server" Text="<%$ Resources:Resource, LiveTV %>" + NavigateUrl="~/LiveTV.aspx" CssClass="navilink"></asp:HyperLink> + </td> + </tr> + </table> + <div class="datediv"> + <asp:Label ID="dateLabel" runat="server" Text=""></asp:Label> + </div> +</div> Added: trunk/Version2/Web App/MPW/Includes/Navigation.ascx.cs =================================================================== --- trunk/Version2/Web App/MPW/Includes/Navigation.ascx.cs (rev 0) +++ trunk/Version2/Web App/MPW/Includes/Navigation.ascx.cs 2007-04-09 20:45:06 UTC (rev 39) @@ -0,0 +1,21 @@ +using System; +using System.Data; +using System.Configuration; +using System.Collections; +using System.Web; +using System.Web.Security; +using System.Web.UI; +using System.Web.UI.WebControls; +using System.Web.UI.WebControls.WebParts; +using System.Web.UI.HtmlControls; + +namespace MPW +{ + public partial class WebUserControl1 : System.Web.UI.UserControl + { + protected void Page_Load(object sender, EventArgs e) + { + dateLabel.Text = DateTime.Now.ToLongDateString() + " " + DateTime.Now.ToShortTimeString(); + } + } +} \ No newline at end of file Added: trunk/Version2/Web App/MPW/Includes/Navigation.ascx.designer.cs =================================================================== --- trunk/Version2/Web App/MPW/Includes/Navigation.ascx.designer.cs (rev 0) +++ trunk/Version2/Web App/MPW/Includes/Navigation.ascx.designer.cs 2007-04-09 20:45:06 UTC (rev 39) @@ -0,0 +1,85 @@ +//------------------------------------------------------------------------------ +// <auto-generated> +// This code was generated by a tool. +// Runtime Version:2.0.50727.42 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// </auto-generated> +//------------------------------------------------------------------------------ + +namespace MPW { + + + /// <summary> + /// WebUserControl1 class. + /// </summary> + /// <remarks> + /// Auto-generated class. + /// </remarks> + public partial class WebUserControl1 { + + /// <summary> + /// LinkGuide control. + /// </summary> + /// <remarks> + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// </remarks> + protected global::System.Web.UI.WebControls.HyperLink LinkGuide; + + /// <summary> + /// LinkNowNext control. + /// </summary> + /// <remarks> + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// </remarks> + protected global::System.Web.UI.WebControls.HyperLink LinkNowNext; + + /// <summary> + /// LinkSearch control. + /// </summary> + /// <remarks> + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// </remarks> + protected global::System.Web.UI.WebControls.HyperLink LinkSearch; + + /// <summary> + /// LinkSchedules control. + /// </summary> + /// <remarks> + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// </remarks> + protected global::System.Web.UI.WebControls.HyperLink LinkSchedules; + + /// <summary> + /// LinkRecordings control. + /// </summary> + /// <remarks> + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// </remarks> + protected global::System.Web.UI.WebControls.HyperLink LinkRecordings; + + /// <summary> + /// LinkLiveTV control. + /// </summary> + /// <remarks> + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// </remarks> + protected global::System.Web.UI.WebControls.HyperLink LinkLiveTV; + + /// <summary> + /// dateLabel control. + /// </summary> + /// <remarks> + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// </remarks> + protected global::System.Web.UI.WebControls.Label dateLabel; + } +} Added: trunk/Version2/Web App/MPW/JS/mpw.js =================================================================== --- trunk/Version2/Web App/MPW/JS/mpw.js (rev 0) +++ trunk/Version2/Web App/MPW/JS/mpw.js 2007-04-09 20:45:06 UTC (rev 39) @@ -0,0 +1,13 @@ +function showProgramDetails(IdProgram) { +document.getElementById("showDetails").value = "true"; +document.getElementById("idDetails").value = IdProgram; +document.getElementById("programInfo").style.display = "block"; +document.getElementById("programInfo").style.visibility = "visible"; +document.aspnetForm.submit(); +} + +function hideProgramDetails() { +$(showDetail).value = "false"; +$(idDetail).value = ""; +MPW_main.submit(); +} \ No newline at end of file Added: trunk/Version2/Web App/MPW/LiveTV.aspx =================================================================== --- trunk/Version2/Web App/MPW/LiveTV.aspx (rev 0) +++ trunk/Version2/Web App/MPW/LiveTV.aspx 2007-04-09 20:45:06 UTC (rev 39) @@ -0,0 +1,17 @@ +<%@ Page Language="C#" MasterPageFile="~/MPW.Master" AutoEventWireup="true" Codebehind="LiveTV.aspx.cs" + Inherits="MPW.WebForm1" Title="Untitled Page" %> + +<asp:Content ID="Content1" ContentPlaceHolderID="MPWContent" runat="server"> + <div style="width:500px; margin:auto;"> + <object id="live" width="400" height="370" classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" + type="application/x-oleobject"> + <param name="URL" value="rtsp://localhost/stream1"> + <param name="SendPlayStateChangeEvents" value="True"> + <param name="AutoStart" value="True"> + <param name="stretchToFit" value="True"> + <param name="uiMode" value="full"> + <param name="PlayCount" value="1"> + <param name="AutoRewind" value="0"> + </object> + </div> +</asp:Content> Added: trunk/Version2/Web App/MPW/LiveTV.aspx.cs =================================================================== --- trunk/Version2/Web App/MPW/LiveTV.aspx.cs (rev 0) +++ trunk/Version2/Web App/MPW/LiveTV.aspx.cs 2007-04-09 20:45:06 UTC (rev 39) @@ -0,0 +1,24 @@ +using System; +using System.Data; +using System.Configuration; +using System.Collections; +using System.Web; +using System.Web.Security; +using System.Web.UI; +using System.Web.UI.WebControls; +using System.Web.UI.WebControls.WebParts; +using System.Web.UI.HtmlControls; + +using TvControl; + +namespace MPW +{ + public partial class WebForm1 : System.Web.UI.Page + { + protected void Page_Load(object sender, EventArgs e) + { + MPW m = (MPW)Page.Master; + m.Sectiontitle = Resources.Resource.LiveTV; + } + } +} Added: trunk/Version2/Web App/MPW/LiveTV.aspx.designer.cs =================================================================== --- trunk/Version2/Web App/MPW/LiveTV.aspx.designer.cs (rev 0) +++ trunk/Version2/Web App/MPW/LiveTV.aspx.designer.cs 2007-04-09 20:45:06 UTC (rev 39) @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// <auto-generated> +// This code was generated by a tool. +// Runtime Version:2.0.50727.42 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// </auto-generated> +//------------------------------------------------------------------------------ + +namespace MPW { + + + /// <summary> + /// WebForm1 class. + /// </summary> + /// <remarks> + /// Auto-generated class. + /// </remarks> + public partial class WebForm1 { + } +} Added: trunk/Version2/Web App/MPW/Login.aspx =================================================================== --- trunk/Version2/Web App/MPW/Login.aspx (rev 0) +++ trunk/Version2/Web App/MPW/Login.aspx 2007-04-09 20:45:06 UTC (rev 39) @@ -0,0 +1,8 @@ +<%@ Page Language="C#" MasterPageFile="~/MPW.Master" AutoEventWireup="true" CodeBehind="Login.aspx.cs" Inherits="MPW.MasterPages.WebForm1" Title="MPW Login" %> +<asp:Content ID="Logon" ContentPlaceHolderID="MPWContent" runat="server"> + <br /> + <br /> + <asp:Login ID="MPWLogin" runat="server" Height="185px" OnAut... [truncated message content] |
From: <mas...@us...> - 2007-04-09 20:04:43
|
Revision: 38 http://svn.sourceforge.net/mp-webinterface/?rev=38&view=rev Author: maschine Date: 2007-04-09 13:02:35 -0700 (Mon, 09 Apr 2007) Log Message: ----------- Moved all Windows applications like server and control center to an own subfolder. Added Paths: ----------- trunk/Version2/Windows Apps/ trunk/Version2/Windows Apps/Control Center/ trunk/Version2/Windows Apps/MPW.sln trunk/Version2/Windows Apps/Setup/ trunk/Version2/Windows Apps/TestPage/ trunk/Version2/Windows Apps/WebServer/ trunk/Version2/Windows Apps/WindowsService/ trunk/Version2/Windows Apps/lib/ Removed Paths: ------------- trunk/Version2/Control Center/ trunk/Version2/MPW.sln trunk/Version2/Setup/ trunk/Version2/TestPage/ trunk/Version2/WebServer/ trunk/Version2/WindowsService/ trunk/Version2/lib/ Deleted: trunk/Version2/MPW.sln =================================================================== --- trunk/Version2/MPW.sln 2007-04-09 19:56:23 UTC (rev 37) +++ trunk/Version2/MPW.sln 2007-04-09 20:02:35 UTC (rev 38) @@ -1,78 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebServer", "WebServer\WebServer.csproj", "{4CEEFA1E-7F95-43DF-A78C-9FE86082FDC3}" - ProjectSection(WebsiteProperties) = preProject - Debug.AspNetCompiler.Debug = "True" - Release.AspNetCompiler.Debug = "False" - EndProjectSection -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Control Center", "Control Center\Control Center.csproj", "{8B650819-E843-488A-89CF-E629A389D4DA}" - ProjectSection(WebsiteProperties) = preProject - Debug.AspNetCompiler.Debug = "True" - Release.AspNetCompiler.Debug = "False" - EndProjectSection -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WindowsService", "WindowsService\WindowsService.csproj", "{23FDEE0E-6842-4E8D-B0E0-616F6A3D681F}" - ProjectSection(WebsiteProperties) = preProject - Debug.AspNetCompiler.Debug = "True" - Release.AspNetCompiler.Debug = "False" - EndProjectSection -EndProject -Project("{54435603-DBB4-11D2-8724-00A0C9A8B90C}") = "Setup", "Setup\Setup.vdproj", "{8258A5A9-36D2-4917-90CC-D5A83C429F37}" - ProjectSection(WebsiteProperties) = preProject - Debug.AspNetCompiler.Debug = "True" - Release.AspNetCompiler.Debug = "False" - EndProjectSection -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|.NET = Debug|.NET - Debug|Any CPU = Debug|Any CPU - Debug|Mixed Platforms = Debug|Mixed Platforms - Release|.NET = Release|.NET - Release|Any CPU = Release|Any CPU - Release|Mixed Platforms = Release|Mixed Platforms - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {4CEEFA1E-7F95-43DF-A78C-9FE86082FDC3}.Debug|.NET.ActiveCfg = Debug|Any CPU - {4CEEFA1E-7F95-43DF-A78C-9FE86082FDC3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4CEEFA1E-7F95-43DF-A78C-9FE86082FDC3}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4CEEFA1E-7F95-43DF-A78C-9FE86082FDC3}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {4CEEFA1E-7F95-43DF-A78C-9FE86082FDC3}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {4CEEFA1E-7F95-43DF-A78C-9FE86082FDC3}.Release|.NET.ActiveCfg = Release|Any CPU - {4CEEFA1E-7F95-43DF-A78C-9FE86082FDC3}.Release|Any CPU.ActiveCfg = Release|Any CPU - {4CEEFA1E-7F95-43DF-A78C-9FE86082FDC3}.Release|Any CPU.Build.0 = Release|Any CPU - {4CEEFA1E-7F95-43DF-A78C-9FE86082FDC3}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {4CEEFA1E-7F95-43DF-A78C-9FE86082FDC3}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {8B650819-E843-488A-89CF-E629A389D4DA}.Debug|.NET.ActiveCfg = Debug|Any CPU - {8B650819-E843-488A-89CF-E629A389D4DA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8B650819-E843-488A-89CF-E629A389D4DA}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8B650819-E843-488A-89CF-E629A389D4DA}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {8B650819-E843-488A-89CF-E629A389D4DA}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {8B650819-E843-488A-89CF-E629A389D4DA}.Release|.NET.ActiveCfg = Release|Any CPU - {8B650819-E843-488A-89CF-E629A389D4DA}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8B650819-E843-488A-89CF-E629A389D4DA}.Release|Any CPU.Build.0 = Release|Any CPU - {8B650819-E843-488A-89CF-E629A389D4DA}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {8B650819-E843-488A-89CF-E629A389D4DA}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {23FDEE0E-6842-4E8D-B0E0-616F6A3D681F}.Debug|.NET.ActiveCfg = Debug|Any CPU - {23FDEE0E-6842-4E8D-B0E0-616F6A3D681F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {23FDEE0E-6842-4E8D-B0E0-616F6A3D681F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {23FDEE0E-6842-4E8D-B0E0-616F6A3D681F}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {23FDEE0E-6842-4E8D-B0E0-616F6A3D681F}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {23FDEE0E-6842-4E8D-B0E0-616F6A3D681F}.Release|.NET.ActiveCfg = Release|Any CPU - {23FDEE0E-6842-4E8D-B0E0-616F6A3D681F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {23FDEE0E-6842-4E8D-B0E0-616F6A3D681F}.Release|Any CPU.Build.0 = Release|Any CPU - {23FDEE0E-6842-4E8D-B0E0-616F6A3D681F}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {23FDEE0E-6842-4E8D-B0E0-616F6A3D681F}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {8258A5A9-36D2-4917-90CC-D5A83C429F37}.Debug|.NET.ActiveCfg = Debug - {8258A5A9-36D2-4917-90CC-D5A83C429F37}.Debug|Any CPU.ActiveCfg = Debug - {8258A5A9-36D2-4917-90CC-D5A83C429F37}.Debug|Mixed Platforms.ActiveCfg = Debug - {8258A5A9-36D2-4917-90CC-D5A83C429F37}.Release|.NET.ActiveCfg = Release - {8258A5A9-36D2-4917-90CC-D5A83C429F37}.Release|Any CPU.ActiveCfg = Release - {8258A5A9-36D2-4917-90CC-D5A83C429F37}.Release|Mixed Platforms.ActiveCfg = Release - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal Copied: trunk/Version2/Windows Apps/Control Center (from rev 36, trunk/Version2/Control Center) Copied: trunk/Version2/Windows Apps/MPW.sln (from rev 36, trunk/Version2/MPW.sln) =================================================================== --- trunk/Version2/Windows Apps/MPW.sln (rev 0) +++ trunk/Version2/Windows Apps/MPW.sln 2007-04-09 20:02:35 UTC (rev 38) @@ -0,0 +1,78 @@ + +Microsoft Visual Studio Solution File, Format Version 9.00 +# Visual Studio 2005 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebServer", "WebServer\WebServer.csproj", "{4CEEFA1E-7F95-43DF-A78C-9FE86082FDC3}" + ProjectSection(WebsiteProperties) = preProject + Debug.AspNetCompiler.Debug = "True" + Release.AspNetCompiler.Debug = "False" + EndProjectSection +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Control Center", "Control Center\Control Center.csproj", "{8B650819-E843-488A-89CF-E629A389D4DA}" + ProjectSection(WebsiteProperties) = preProject + Debug.AspNetCompiler.Debug = "True" + Release.AspNetCompiler.Debug = "False" + EndProjectSection +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WindowsService", "WindowsService\WindowsService.csproj", "{23FDEE0E-6842-4E8D-B0E0-616F6A3D681F}" + ProjectSection(WebsiteProperties) = preProject + Debug.AspNetCompiler.Debug = "True" + Release.AspNetCompiler.Debug = "False" + EndProjectSection +EndProject +Project("{54435603-DBB4-11D2-8724-00A0C9A8B90C}") = "Setup", "Setup\Setup.vdproj", "{8258A5A9-36D2-4917-90CC-D5A83C429F37}" + ProjectSection(WebsiteProperties) = preProject + Debug.AspNetCompiler.Debug = "True" + Release.AspNetCompiler.Debug = "False" + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|.NET = Debug|.NET + Debug|Any CPU = Debug|Any CPU + Debug|Mixed Platforms = Debug|Mixed Platforms + Release|.NET = Release|.NET + Release|Any CPU = Release|Any CPU + Release|Mixed Platforms = Release|Mixed Platforms + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {4CEEFA1E-7F95-43DF-A78C-9FE86082FDC3}.Debug|.NET.ActiveCfg = Debug|Any CPU + {4CEEFA1E-7F95-43DF-A78C-9FE86082FDC3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4CEEFA1E-7F95-43DF-A78C-9FE86082FDC3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4CEEFA1E-7F95-43DF-A78C-9FE86082FDC3}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {4CEEFA1E-7F95-43DF-A78C-9FE86082FDC3}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {4CEEFA1E-7F95-43DF-A78C-9FE86082FDC3}.Release|.NET.ActiveCfg = Release|Any CPU + {4CEEFA1E-7F95-43DF-A78C-9FE86082FDC3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4CEEFA1E-7F95-43DF-A78C-9FE86082FDC3}.Release|Any CPU.Build.0 = Release|Any CPU + {4CEEFA1E-7F95-43DF-A78C-9FE86082FDC3}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {4CEEFA1E-7F95-43DF-A78C-9FE86082FDC3}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {8B650819-E843-488A-89CF-E629A389D4DA}.Debug|.NET.ActiveCfg = Debug|Any CPU + {8B650819-E843-488A-89CF-E629A389D4DA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8B650819-E843-488A-89CF-E629A389D4DA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8B650819-E843-488A-89CF-E629A389D4DA}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {8B650819-E843-488A-89CF-E629A389D4DA}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {8B650819-E843-488A-89CF-E629A389D4DA}.Release|.NET.ActiveCfg = Release|Any CPU + {8B650819-E843-488A-89CF-E629A389D4DA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8B650819-E843-488A-89CF-E629A389D4DA}.Release|Any CPU.Build.0 = Release|Any CPU + {8B650819-E843-488A-89CF-E629A389D4DA}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {8B650819-E843-488A-89CF-E629A389D4DA}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {23FDEE0E-6842-4E8D-B0E0-616F6A3D681F}.Debug|.NET.ActiveCfg = Debug|Any CPU + {23FDEE0E-6842-4E8D-B0E0-616F6A3D681F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {23FDEE0E-6842-4E8D-B0E0-616F6A3D681F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {23FDEE0E-6842-4E8D-B0E0-616F6A3D681F}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {23FDEE0E-6842-4E8D-B0E0-616F6A3D681F}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {23FDEE0E-6842-4E8D-B0E0-616F6A3D681F}.Release|.NET.ActiveCfg = Release|Any CPU + {23FDEE0E-6842-4E8D-B0E0-616F6A3D681F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {23FDEE0E-6842-4E8D-B0E0-616F6A3D681F}.Release|Any CPU.Build.0 = Release|Any CPU + {23FDEE0E-6842-4E8D-B0E0-616F6A3D681F}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {23FDEE0E-6842-4E8D-B0E0-616F6A3D681F}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {8258A5A9-36D2-4917-90CC-D5A83C429F37}.Debug|.NET.ActiveCfg = Debug + {8258A5A9-36D2-4917-90CC-D5A83C429F37}.Debug|Any CPU.ActiveCfg = Debug + {8258A5A9-36D2-4917-90CC-D5A83C429F37}.Debug|Mixed Platforms.ActiveCfg = Debug + {8258A5A9-36D2-4917-90CC-D5A83C429F37}.Release|.NET.ActiveCfg = Release + {8258A5A9-36D2-4917-90CC-D5A83C429F37}.Release|Any CPU.ActiveCfg = Release + {8258A5A9-36D2-4917-90CC-D5A83C429F37}.Release|Mixed Platforms.ActiveCfg = Release + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal Copied: trunk/Version2/Windows Apps/Setup (from rev 36, trunk/Version2/Setup) Copied: trunk/Version2/Windows Apps/TestPage (from rev 36, trunk/Version2/TestPage) Copied: trunk/Version2/Windows Apps/WebServer (from rev 36, trunk/Version2/WebServer) Copied: trunk/Version2/Windows Apps/WindowsService (from rev 36, trunk/Version2/WindowsService) Copied: trunk/Version2/Windows Apps/lib (from rev 36, trunk/Version2/lib) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mas...@us...> - 2007-04-09 19:56:26
|
Revision: 37 http://svn.sourceforge.net/mp-webinterface/?rev=37&view=rev Author: maschine Date: 2007-04-09 12:56:23 -0700 (Mon, 09 Apr 2007) Log Message: ----------- Moving all Version 1 (for MP TV engine 2) related files to an own subfolder. Added Paths: ----------- trunk/Version1/ trunk/Version1/MPWebControl Setup Project/ trunk/Version1/source/ Removed Paths: ------------- trunk/MPWebControl Setup Project/ trunk/source/ Copied: trunk/Version1/MPWebControl Setup Project (from rev 36, trunk/MPWebControl Setup Project) Copied: trunk/Version1/source (from rev 36, trunk/source) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mis...@us...> - 2007-03-18 22:09:30
|
Revision: 36 http://svn.sourceforge.net/mp-webinterface/?rev=36&view=rev Author: misterd_sf Date: 2007-03-18 10:33:15 -0700 (Sun, 18 Mar 2007) Log Message: ----------- Added possibility to bind to any interface Added Table for allowed IPs for restricted access mode Fixed Start/Stop Buttons of Systray Fixed Reload of the web server Changed read/write of configuration file to web server methods Modified Paths: -------------- trunk/Version2/Control Center/Control_Center_App.Designer.cs trunk/Version2/Control Center/Control_Center_App.cs trunk/Version2/Control Center/Control_Center_App.resx trunk/Version2/WebServer/Server.cs Modified: trunk/Version2/Control Center/Control_Center_App.Designer.cs =================================================================== --- trunk/Version2/Control Center/Control_Center_App.Designer.cs 2007-03-11 10:11:22 UTC (rev 35) +++ trunk/Version2/Control Center/Control_Center_App.Designer.cs 2007-03-18 17:33:15 UTC (rev 36) @@ -40,8 +40,8 @@ this.LblMPWWebsiteLink = new System.Windows.Forms.Label(); this.LLblMPWWebsiteLink = new System.Windows.Forms.LinkLabel(); this.gBxMPWWebServerSetup = new System.Windows.Forms.GroupBox(); + this.bindIPAddressDropDown = new System.Windows.Forms.ComboBox(); this.saveButton = new System.Windows.Forms.Button(); - this.bindIPBox = new System.Windows.Forms.TextBox(); this.accessModeDropDown = new System.Windows.Forms.ComboBox(); this.LblSetupAccessMode = new System.Windows.Forms.Label(); this.LblSetupBindLocalIP = new System.Windows.Forms.Label(); @@ -69,6 +69,9 @@ this.gBxLogs = new System.Windows.Forms.GroupBox(); this.CmdOpenAccessLog = new System.Windows.Forms.Button(); this.CmdOpenEventViewer = new System.Windows.Forms.Button(); + this.LblallowedIPs = new System.Windows.Forms.Label(); + this.allowedIPs = new System.Windows.Forms.DataGridView(); + this.allowedIP = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.gBxStatus.SuspendLayout(); this.gBxMPWWebServerSetup.SuspendLayout(); this.gBxMPWWebServer.SuspendLayout(); @@ -76,6 +79,7 @@ this.gBxAboutMPW.SuspendLayout(); this.gBxVersion.SuspendLayout(); this.gBxLogs.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.allowedIPs)).BeginInit(); this.SuspendLayout(); // // gBxStatus @@ -169,8 +173,10 @@ // // gBxMPWWebServerSetup // + this.gBxMPWWebServerSetup.Controls.Add(this.allowedIPs); + this.gBxMPWWebServerSetup.Controls.Add(this.LblallowedIPs); + this.gBxMPWWebServerSetup.Controls.Add(this.bindIPAddressDropDown); this.gBxMPWWebServerSetup.Controls.Add(this.saveButton); - this.gBxMPWWebServerSetup.Controls.Add(this.bindIPBox); this.gBxMPWWebServerSetup.Controls.Add(this.accessModeDropDown); this.gBxMPWWebServerSetup.Controls.Add(this.LblSetupAccessMode); this.gBxMPWWebServerSetup.Controls.Add(this.LblSetupBindLocalIP); @@ -178,14 +184,23 @@ this.gBxMPWWebServerSetup.Controls.Add(this.LblSetupWebserverPort); this.gBxMPWWebServerSetup.Location = new System.Drawing.Point(318, 12); this.gBxMPWWebServerSetup.Name = "gBxMPWWebServerSetup"; - this.gBxMPWWebServerSetup.Size = new System.Drawing.Size(300, 314); + this.gBxMPWWebServerSetup.Size = new System.Drawing.Size(325, 314); this.gBxMPWWebServerSetup.TabIndex = 1; this.gBxMPWWebServerSetup.TabStop = false; this.gBxMPWWebServerSetup.Text = "MPW Webserver setup"; // + // bindIPAddressDropDown + // + this.bindIPAddressDropDown.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.bindIPAddressDropDown.FormattingEnabled = true; + this.bindIPAddressDropDown.Location = new System.Drawing.Point(126, 58); + this.bindIPAddressDropDown.Name = "bindIPAddressDropDown"; + this.bindIPAddressDropDown.Size = new System.Drawing.Size(193, 21); + this.bindIPAddressDropDown.TabIndex = 11; + // // saveButton // - this.saveButton.Location = new System.Drawing.Point(126, 132); + this.saveButton.Location = new System.Drawing.Point(169, 279); this.saveButton.Name = "saveButton"; this.saveButton.Size = new System.Drawing.Size(115, 23); this.saveButton.TabIndex = 10; @@ -193,29 +208,24 @@ this.saveButton.UseVisualStyleBackColor = true; this.saveButton.Click += new System.EventHandler(this.saveButton_Click); // - // bindIPBox - // - this.bindIPBox.Location = new System.Drawing.Point(126, 59); - this.bindIPBox.Name = "bindIPBox"; - this.bindIPBox.Size = new System.Drawing.Size(115, 20); - this.bindIPBox.TabIndex = 9; - // // accessModeDropDown // + this.accessModeDropDown.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.accessModeDropDown.FormattingEnabled = true; this.accessModeDropDown.Items.AddRange(new object[] { "Local", "Global", "Restricted"}); - this.accessModeDropDown.Location = new System.Drawing.Point(126, 94); + this.accessModeDropDown.Location = new System.Drawing.Point(126, 85); this.accessModeDropDown.Name = "accessModeDropDown"; - this.accessModeDropDown.Size = new System.Drawing.Size(115, 21); + this.accessModeDropDown.Size = new System.Drawing.Size(193, 21); this.accessModeDropDown.TabIndex = 8; + this.accessModeDropDown.SelectedIndexChanged += new System.EventHandler(this.accessModeDropDown_SelectedIndexChanged); // // LblSetupAccessMode // this.LblSetupAccessMode.AutoSize = true; - this.LblSetupAccessMode.Location = new System.Drawing.Point(6, 102); + this.LblSetupAccessMode.Location = new System.Drawing.Point(6, 88); this.LblSetupAccessMode.Name = "LblSetupAccessMode"; this.LblSetupAccessMode.Size = new System.Drawing.Size(74, 13); this.LblSetupAccessMode.TabIndex = 7; @@ -224,7 +234,7 @@ // LblSetupBindLocalIP // this.LblSetupBindLocalIP.AutoSize = true; - this.LblSetupBindLocalIP.Location = new System.Drawing.Point(6, 67); + this.LblSetupBindLocalIP.Location = new System.Drawing.Point(6, 61); this.LblSetupBindLocalIP.Name = "LblSetupBindLocalIP"; this.LblSetupBindLocalIP.Size = new System.Drawing.Size(81, 13); this.LblSetupBindLocalIP.TabIndex = 6; @@ -234,8 +244,9 @@ // this.portBox.Location = new System.Drawing.Point(126, 32); this.portBox.Name = "portBox"; - this.portBox.Size = new System.Drawing.Size(115, 20); + this.portBox.Size = new System.Drawing.Size(193, 20); this.portBox.TabIndex = 1; + this.portBox.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.portBox_KeyPress); // // LblSetupWebserverPort // @@ -312,27 +323,27 @@ this.stopToolStripMenuItem, this.exitToolStripMenuItem}); this.trayContextMenu.Name = "trayContextMenu"; - this.trayContextMenu.Size = new System.Drawing.Size(99, 70); + this.trayContextMenu.Size = new System.Drawing.Size(110, 70); this.trayContextMenu.Text = "MPW"; // // trayStart // this.trayStart.Name = "trayStart"; - this.trayStart.Size = new System.Drawing.Size(98, 22); + this.trayStart.Size = new System.Drawing.Size(109, 22); this.trayStart.Text = "Start"; this.trayStart.Click += new System.EventHandler(this.trayStart_Click); // // stopToolStripMenuItem // this.stopToolStripMenuItem.Name = "stopToolStripMenuItem"; - this.stopToolStripMenuItem.Size = new System.Drawing.Size(98, 22); + this.stopToolStripMenuItem.Size = new System.Drawing.Size(109, 22); this.stopToolStripMenuItem.Text = "Stop"; this.stopToolStripMenuItem.Click += new System.EventHandler(this.stopToolStripMenuItem_Click); // // exitToolStripMenuItem // this.exitToolStripMenuItem.Name = "exitToolStripMenuItem"; - this.exitToolStripMenuItem.Size = new System.Drawing.Size(98, 22); + this.exitToolStripMenuItem.Size = new System.Drawing.Size(109, 22); this.exitToolStripMenuItem.Text = "Exit"; this.exitToolStripMenuItem.Click += new System.EventHandler(this.exitToolStripMenuItem_Click); // @@ -348,7 +359,7 @@ this.gBxAboutMPW.Controls.Add(this.LblMPWWebsiteLink); this.gBxAboutMPW.Location = new System.Drawing.Point(12, 332); this.gBxAboutMPW.Name = "gBxAboutMPW"; - this.gBxAboutMPW.Size = new System.Drawing.Size(606, 38); + this.gBxAboutMPW.Size = new System.Drawing.Size(631, 38); this.gBxAboutMPW.TabIndex = 3; this.gBxAboutMPW.TabStop = false; this.gBxAboutMPW.Text = "About MPW"; @@ -453,11 +464,39 @@ this.CmdOpenEventViewer.UseVisualStyleBackColor = true; this.CmdOpenEventViewer.Click += new System.EventHandler(this.CmdOpenEventViewer_Click); // + // LblallowedIPs + // + this.LblallowedIPs.AutoSize = true; + this.LblallowedIPs.Location = new System.Drawing.Point(6, 115); + this.LblallowedIPs.Name = "LblallowedIPs"; + this.LblallowedIPs.Size = new System.Drawing.Size(65, 13); + this.LblallowedIPs.TabIndex = 12; + this.LblallowedIPs.Text = "Allowed IPs:"; + // + // allowedIPs + // + this.allowedIPs.AllowUserToResizeColumns = false; + this.allowedIPs.AllowUserToResizeRows = false; + this.allowedIPs.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.allowedIPs.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { + this.allowedIP}); + this.allowedIPs.Location = new System.Drawing.Point(126, 112); + this.allowedIPs.Name = "allowedIPs"; + this.allowedIPs.RowHeadersWidthSizeMode = System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.DisableResizing; + this.allowedIPs.Size = new System.Drawing.Size(193, 161); + this.allowedIPs.TabIndex = 13; + // + // allowedIP + // + this.allowedIP.HeaderText = "IP"; + this.allowedIP.Name = "allowedIP"; + this.allowedIP.Width = 150; + // // Control_Center_App // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(632, 384); + this.ClientSize = new System.Drawing.Size(655, 384); this.Controls.Add(this.gBxLogs); this.Controls.Add(this.gBxAboutMPW); this.Controls.Add(this.gBxMPWWebServer); @@ -482,6 +521,7 @@ this.gBxVersion.ResumeLayout(false); this.gBxVersion.PerformLayout(); this.gBxLogs.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.allowedIPs)).EndInit(); this.ResumeLayout(false); } @@ -505,8 +545,7 @@ private System.Windows.Forms.Label statusTVService; private System.Windows.Forms.ComboBox accessModeDropDown; private System.Windows.Forms.Label LblSetupAccessMode; - private System.Windows.Forms.Label LblSetupBindLocalIP; - private System.Windows.Forms.TextBox bindIPBox; + private System.Windows.Forms.Label LblSetupBindLocalIP; private System.Windows.Forms.Button saveButton; private System.Windows.Forms.GroupBox gBxMPWWebServer; private System.Windows.Forms.NotifyIcon trayIcon; @@ -527,6 +566,10 @@ private System.Windows.Forms.GroupBox gBxLogs; private System.Windows.Forms.Button CmdOpenEventViewer; private System.Windows.Forms.Button CmdOpenAccessLog; + private System.Windows.Forms.ComboBox bindIPAddressDropDown; + private System.Windows.Forms.DataGridView allowedIPs; + private System.Windows.Forms.Label LblallowedIPs; + private System.Windows.Forms.DataGridViewTextBoxColumn allowedIP; } } Modified: trunk/Version2/Control Center/Control_Center_App.cs =================================================================== --- trunk/Version2/Control Center/Control_Center_App.cs 2007-03-11 10:11:22 UTC (rev 35) +++ trunk/Version2/Control Center/Control_Center_App.cs 2007-03-18 17:33:15 UTC (rev 36) @@ -8,388 +8,373 @@ using System.IO; using System.ServiceProcess; using System.Xml; +using System.Net; +using System.Net.NetworkInformation; +using MPW.WebServer; -namespace MPW.Control_Center -{ - public partial class Control_Center_App : Form - { - //Service Controllers - private ServiceController TVServiceController = new ServiceController("TVService"); - private ServiceController MPWServiceController = new ServiceController("MPW"); - - //MPW Webserver settings - private int port; - private String bindIP; - private int accesMode; - - private String configFile; +namespace MPW.Control_Center { + public partial class Control_Center_App : Form { + //Service Controllers + private ServiceController TVServiceController = new ServiceController("TVService"); + private ServiceController MPWServiceController = new ServiceController("MPW"); - private bool exitRequested; + //MPW Webserver settings + private ServerConfiguration configuration; - public Control_Center_App() - { - InitializeComponent(); - configFile = System.AppDomain.CurrentDomain.BaseDirectory + "Configuration.xml"; - RefreshControllers(); - LoadSettings(); + private String configFile; - LoadVersionInfo(); - } + private bool exitRequested; - /// <summary> - /// gets version info for MPW components and puts it on labels on form - /// </summary> - private void LoadVersionInfo() - { - LblMPWCCVersion.Text = System.Reflection.Assembly.GetCallingAssembly().GetName().Version.ToString(); - - string fileName; + private List<string> ipAddresses; - try - { - fileName = System.IO.Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory, "WebServer.dll"); - LblMPWWebserverVersion.Text = System.Diagnostics.FileVersionInfo.GetVersionInfo(fileName).ProductVersion; - } - catch - { } + public Control_Center_App() { + InitializeComponent(); + configFile = System.AppDomain.CurrentDomain.BaseDirectory + "Configuration.xml"; + RefreshControllers(); + InitializeIPList(); + LoadSettings(); - try - { - fileName = System.IO.Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory, "MPW Service.exe"); - LblMPWServiceVersion.Text = System.Diagnostics.FileVersionInfo.GetVersionInfo(fileName).ProductVersion; - } - catch - { } - - } + LoadVersionInfo(); + } - /// <summary> - /// refreshes the status indicators for MPW webserver and TV services - /// </summary> - private void RefreshControllers() - { - //MPW Webserver - MPWServiceController.Refresh(); - try - { - statusMPWServerConn.Text = MPWServiceController.Status.ToString(); - - if (MPWServiceController.Status == ServiceControllerStatus.Running) - { - statusMPWServerConn.ForeColor = Color.Green; - startstopButton.Text = "Stop"; + /// <summary> + /// Initialize the dropdown list with all available IPs + /// </summary> + private void InitializeIPList() { + ipAddresses = new List<string>(); + bindIPAddressDropDown.Items.Add("0.0.0.0 - All interfaces"); + ipAddresses.Add("0.0.0.0"); + bindIPAddressDropDown.Items.Add("127.0.0.1 - Loopback interface"); + ipAddresses.Add("127.0.0.1"); + IPHostEntry local = Dns.GetHostEntry(Environment.MachineName); + foreach (IPAddress ipaddress in local.AddressList) { + bindIPAddressDropDown.Items.Add(ipaddress.ToString()); + ipAddresses.Add(ipaddress.ToString()); + } } - else - { - statusMPWServerConn.ForeColor = Color.Red; - startstopButton.Text = "Start"; - } - } - catch - { - statusMPWServerConn.Text = "Error: Service not found!"; - startstopButton.Enabled = false; - } - - //TV Server - TVServiceController.Refresh(); - try - { - statusTVService.Text = TVServiceController.Status.ToString(); - if (TVServiceController.Status == ServiceControllerStatus.Running) - statusTVService.ForeColor = Color.Green; - else - statusTVService.ForeColor = Color.Red; - } - catch - { - statusTVService.Text = "Error: Service not found!"; - } - } + /// <summary> + /// gets version info for MPW components and puts it on labels on form + /// </summary> + private void LoadVersionInfo() { + LblMPWCCVersion.Text = System.Reflection.Assembly.GetCallingAssembly().GetName().Version.ToString(); - private void startstopButton_Click(object sender, EventArgs e) - { - if (startstopButton.Text == "Start") - Start(); - else - Stop(); - } + string fileName; - private void LLblMPWWebsiteLink_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) - { - System.Diagnostics.Process.Start(LLblMPWWebsiteLink.Text); - } + try { + fileName = System.IO.Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory, "WebServer.dll"); + LblMPWWebserverVersion.Text = System.Diagnostics.FileVersionInfo.GetVersionInfo(fileName).ProductVersion; + } catch { } - private void LLblMPWServerURL_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) - { - System.Diagnostics.Process.Start(LLblMPWServerURL.Text); - } + try { + fileName = System.IO.Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory, "MPW Service.exe"); + LblMPWServiceVersion.Text = System.Diagnostics.FileVersionInfo.GetVersionInfo(fileName).ProductVersion; + } catch { } - /// <summary> - /// Start the server - /// </summary> - private void Start() - { - RefreshControllers(); - try - { - MPWServiceController.Start(); - startstopButton.Text = "Stop"; - } - catch - { - statusMPWServerConn.Text = "Error, could not start Service."; - } - RefreshControllers(); - } + } - /// <summary> - /// Stop the server - /// </summary> - private void Stop() - { - RefreshControllers(); - if (MPWServiceController.Status == ServiceControllerStatus.Running) - { - MPWServiceController.Stop(); - startstopButton.Text = "Start"; - } - RefreshControllers(); - } + /// <summary> + /// refreshes the status indicators for MPW webserver and TV services + /// </summary> + private void RefreshControllers() { + //MPW Webserver + MPWServiceController.Refresh(); + try { + statusMPWServerConn.Text = MPWServiceController.Status.ToString(); - /// <summary> - /// Build a string with the server URL - /// </summary> - /// <returns>server URL</returns> - private String ConstructServerURL() - { - String url = "http://"; - url += bindIP; - url += ":" + port.ToString(); - url += "/"; - return url; - } + if (MPWServiceController.Status == ServiceControllerStatus.Running) { + statusMPWServerConn.ForeColor = Color.Green; + startstopButton.Text = "Stop"; + } else { + statusMPWServerConn.ForeColor = Color.Red; + startstopButton.Text = "Start"; + } + } catch { + statusMPWServerConn.Text = "Error: Service not found!"; + startstopButton.Enabled = false; + } - /// <summary> - /// Load the configuration - /// </summary> - /// <returns>true if settings loaded successfully</returns> - private bool LoadSettings() - { - try - { - XmlDocument doc = new XmlDocument(); - doc.Load(configFile); - XmlNode node = doc.DocumentElement.SelectSingleNode("/configuration/bindAddress"); - bindIP = node.InnerText; - node = doc.DocumentElement.SelectSingleNode("/configuration/port"); - port = int.Parse(node.InnerText); - node = doc.DocumentElement.SelectSingleNode("/configuration/allowedAccesMode"); - accesMode = int.Parse(node.InnerText); + //TV Server + TVServiceController.Refresh(); + try { + statusTVService.Text = TVServiceController.Status.ToString(); + + if (TVServiceController.Status == ServiceControllerStatus.Running) + statusTVService.ForeColor = Color.Green; + else + statusTVService.ForeColor = Color.Red; + } catch { + statusTVService.Text = "Error: Service not found!"; + } } - catch (Exception ex) - { - MessageBox.Show("An error occurred when trying to load the settings." + Environment.NewLine + Environment.NewLine + ex.ToString(), "Error when loading settings", MessageBoxButtons.OK, MessageBoxIcon.Error); - return false; + + private void startstopButton_Click(object sender, EventArgs e) { + if (startstopButton.Text == "Start") + Start(); + else + Stop(); } - //Set the read values to the various TextBoxes - portBox.Text = port.ToString(); - bindIPBox.Text = bindIP; - accessModeDropDown.SelectedIndex = accesMode; - LLblMPWServerURL.Text = ConstructServerURL(); + private void LLblMPWWebsiteLink_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { + System.Diagnostics.Process.Start(LLblMPWWebsiteLink.Text); + } - return true; - } + private void LLblMPWServerURL_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { + System.Diagnostics.Process.Start(LLblMPWServerURL.Text); + } - /// <summary> - /// save server configuration settings - /// </summary> - /// <returns>true if configuration settings were successfully saved.</returns> - private bool SaveSettings() - { - try - { - XmlDocument doc = new XmlDocument(); - doc.Load(configFile); + /// <summary> + /// Start the server + /// </summary> + private void Start() { + RefreshControllers(); + try { + MPWServiceController.Start(); + startstopButton.Text = "Stop"; + } catch { + statusMPWServerConn.Text = "Error, could not start Service."; + } + RefreshControllers(); + } - XmlNode node = doc.DocumentElement.SelectSingleNode("/configuration/bindAddress"); - node.InnerText = bindIP; - node = doc.DocumentElement.SelectSingleNode("/configuration/port"); - node.InnerText = port.ToString(); - node = doc.DocumentElement.SelectSingleNode("/configuration/allowedAccesMode"); - node.InnerText = accesMode.ToString(); - node = doc.DocumentElement.SelectSingleNode("/configuration/physicalPath"); - node.InnerText = System.AppDomain.CurrentDomain.BaseDirectory + @"wwwroot\"; + /// <summary> + /// Stop the server + /// </summary> + private void Stop() { + RefreshControllers(); + if (MPWServiceController.Status == ServiceControllerStatus.Running) { + MPWServiceController.Stop(); + startstopButton.Text = "Start"; + } + RefreshControllers(); + } - doc.Save(configFile); + /// <summary> + /// Build a string with the server URL + /// </summary> + /// <returns>server URL</returns> + private String ConstructServerURL() { + String url = "http://"; + url += configuration.BindAddress; + url += ":" + configuration.Port.ToString(); + url += "/"; + return url; } - catch (Exception ex) - { - MessageBox.Show("An error occurred when trying to save the settings." + Environment.NewLine + Environment.NewLine + ex.ToString(), "Error when saving settings", MessageBoxButtons.OK, MessageBoxIcon.Error); - return false; + + /// <summary> + /// Load the configuration + /// </summary> + /// <returns>true if settings loaded successfully</returns> + private bool LoadSettings() { + try { + configuration = ServerConfiguration.readConfiguration(configFile); + } catch (Exception ex) { + MessageBox.Show("An error occurred when trying to load the settings." + Environment.NewLine + Environment.NewLine + ex.ToString(), "Error when loading settings", MessageBoxButtons.OK, MessageBoxIcon.Error); + return false; + } + + //Set the read values to the various TextBoxes + portBox.Text = configuration.Port.ToString(); + if (ipAddresses.Contains(configuration.BindAddress)) { + bindIPAddressDropDown.SelectedIndex = ipAddresses.IndexOf(configuration.BindAddress); + } else { + bindIPAddressDropDown.SelectedIndex = 0; + } + accessModeDropDown.SelectedIndex = (int)configuration.AllowedAccessMode; + foreach(String allowedAddress in configuration.AllowedIP){ + allowedIPs.Rows.Add(allowedAddress); + } + LLblMPWServerURL.Text = ConstructServerURL(); + + return true; } - return true; - } + /// <summary> + /// save server configuration settings + /// </summary> + /// <returns>true if configuration settings were successfully saved.</returns> + private bool SaveSettings() { + try { + configuration.PhysicalPath = System.AppDomain.CurrentDomain.BaseDirectory + @"wwwroot\"; + ServerConfiguration.writeConfiguration(configFile, configuration); - /// <summary> - /// save configuration changes and reload configuration for server - /// </summary> - /// <param name="sender"></param> - /// <param name="e"></param> - private void saveButton_Click(object sender, EventArgs e) - { - //data validation - if (!int.TryParse(portBox.Text,out port)) - { - MessageBox.Show("The port number must be numerical only.", "Invalid port number", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); - return; + } catch (Exception ex) { + MessageBox.Show("An error occurred when trying to save the settings." + Environment.NewLine + Environment.NewLine + ex.ToString(), "Error when saving settings", MessageBoxButtons.OK, MessageBoxIcon.Error); + return false; + } + + return true; } - System.Net.IPAddress bindIPAddress; - if (!System.Net.IPAddress.TryParse(bindIPBox.Text, out bindIPAddress)) - { - MessageBox.Show("The bind IP address is not valid. It must be in the form of xxx.xxx.xxx.xxx, where x is a number.", "Invalid bind IP address", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); - return; + /// <summary> + /// save configuration changes and reload configuration for server + /// </summary> + /// <param name="sender"></param> + /// <param name="e"></param> + private void saveButton_Click(object sender, EventArgs e) { + //data validation + int port; + if (!int.TryParse(portBox.Text, out port)) { + MessageBox.Show("The port number must be numerical only.", "Invalid port number", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); + return; + } + + configuration.BindAddress = ipAddresses[bindIPAddressDropDown.SelectedIndex]; + configuration.Port = port; + configuration.AllowedAccessMode = (AccessMode)accessModeDropDown.SelectedIndex; + List<String> newAllowedIP = new List<String>(); + object value; + String ipString; + IPAddress testAddress; + foreach (DataGridViewRow row in allowedIPs.Rows) { + value = row.Cells[0].Value; + if (value != null) { + ipString = value.ToString(); + if (IPAddress.TryParse(ipString, out testAddress)) { + newAllowedIP.Add(ipString); + } + } + } + configuration.AllowedIP = newAllowedIP; + SaveSettings(); + try { + if (MPWServiceController.Status == ServiceControllerStatus.Running) + MPWServiceController.ExecuteCommand((int)CustomCommands.ReloadConfiguration); //ReloadConfiguration + else + MessageBox.Show("You will need to restart the server to use the new configuration!"); + } catch { + MessageBox.Show("Error setting the new configuration."); + } + LLblMPWServerURL.Text = ConstructServerURL(); } - //port = portBox.Text; //already set if valid from TryParse - bindIP = bindIPBox.Text; - accesMode = accessModeDropDown.SelectedIndex; - SaveSettings(); - try - { - if (MPWServiceController.Status == ServiceControllerStatus.Running) - MPWServiceController.ExecuteCommand(0); //ReloadConfiguration - else - MessageBox.Show("You will need to restart the server to use the new configuration!"); - } - catch - { - MessageBox.Show("Error setting the new configuration."); - } - LLblMPWServerURL.Text = ConstructServerURL(); - } + /// <summary> + /// Restore by double-clicking the tray icon + /// </summary> + /// <param name="sender"></param> + /// <param name="e"></param> + private void trayIcon_MouseDoubleClick(object sender, MouseEventArgs e) { + this.WindowState = System.Windows.Forms.FormWindowState.Normal; + trayIcon.Visible = true; + this.ShowInTaskbar = true; + RefreshControllers(); + } - /// <summary> - /// Restore by double-clicking the tray icon - /// </summary> - /// <param name="sender"></param> - /// <param name="e"></param> - private void trayIcon_MouseDoubleClick(object sender, MouseEventArgs e) - { - this.WindowState = System.Windows.Forms.FormWindowState.Normal; - trayIcon.Visible = true; - this.ShowInTaskbar = true; - RefreshControllers(); - } + /// <summary> + /// Minimize to tray on closing + /// </summary> + /// <param name="sender"></param> + /// <param name="e"></param> + private void Control_Center_App_FormClosing(object sender, FormClosingEventArgs e) { + if (!exitRequested) { + e.Cancel = true; + this.WindowState = System.Windows.Forms.FormWindowState.Minimized; + this.ShowInTaskbar = false; + } + } - /// <summary> - /// Minimize to tray on closing - /// </summary> - /// <param name="sender"></param> - /// <param name="e"></param> - private void Control_Center_App_FormClosing(object sender, FormClosingEventArgs e) - { - if (!exitRequested) - { - e.Cancel = true; - this.WindowState = System.Windows.Forms.FormWindowState.Minimized; - this.ShowInTaskbar = false; + /// <summary> + /// Tray menu action "Exit" + /// </summary> + /// <param name="sender"></param> + /// <param name="e"></param> + private void exitToolStripMenuItem_Click(object sender, EventArgs e) { + exitRequested = true; + this.Close(); } - } - /// <summary> - /// Tray menu action "Exit" - /// </summary> - /// <param name="sender"></param> - /// <param name="e"></param> - private void exitToolStripMenuItem_Click(object sender, EventArgs e) - { - exitRequested = true; - this.Close(); - } + /// <summary> + /// Tray menu action "Stop" + /// </summary> + /// <param name="sender"></param> + /// <param name="e"></param> + private void stopToolStripMenuItem_Click(object sender, EventArgs e) { + Stop(); + } - /// <summary> - /// Tray menu action "Stop" - /// </summary> - /// <param name="sender"></param> - /// <param name="e"></param> - private void stopToolStripMenuItem_Click(object sender, EventArgs e) - { - Start(); - } + /// <summary> + /// Tray menu action "Start" + /// </summary> + /// <param name="sender"></param> + /// <param name="e"></param> + private void trayStart_Click(object sender, EventArgs e) { + Start(); + } - /// <summary> - /// Tray menu action "Start" - /// </summary> - /// <param name="sender"></param> - /// <param name="e"></param> - private void trayStart_Click(object sender, EventArgs e) - { - Stop(); - } + /// <summary> + /// Status refresh button + /// </summary> + /// <param name="sender"></param> + /// <param name="e"></param> + private void CmdRefreshStatusInfo_Click(object sender, EventArgs e) { + RefreshControllers(); + } - /// <summary> - /// Status refresh button - /// </summary> - /// <param name="sender"></param> - /// <param name="e"></param> - private void CmdRefreshStatusInfo_Click(object sender, EventArgs e) - { - RefreshControllers(); - } + /// <summary> + /// Minimize to tray on minimize + /// </summary> + /// <param name="sender"></param> + /// <param name="e"></param> + private void Control_Center_App_Resize(object sender, EventArgs e) { + if (this.WindowState == FormWindowState.Minimized) + this.ShowInTaskbar = false; + } - /// <summary> - /// Minimize to tray on minimize - /// </summary> - /// <param name="sender"></param> - /// <param name="e"></param> - private void Control_Center_App_Resize(object sender, EventArgs e) - { - if (this.WindowState == FormWindowState.Minimized) - this.ShowInTaskbar = false; - } + /// <summary> + /// Update the Service status + /// </summary> + /// <param name="sender"></param> + /// <param name="e"></param> + private void refreshTimer_Tick(object sender, EventArgs e) { + if (this.WindowState != System.Windows.Forms.FormWindowState.Minimized) + RefreshControllers(); + } - /// <summary> - /// Update the Service status - /// </summary> - /// <param name="sender"></param> - /// <param name="e"></param> - private void refreshTimer_Tick(object sender, EventArgs e) - { - if (this.WindowState != System.Windows.Forms.FormWindowState.Minimized) - RefreshControllers(); - } + /// <summary> + /// Open Windows Event Viewer for user to browse logs + /// </summary> + /// <param name="sender"></param> + /// <param name="e"></param> + private void CmdOpenEventViewer_Click(object sender, EventArgs e) { + string fileName = System.IO.Path.Combine(Environment.SystemDirectory, "eventvwr.msc"); + System.Diagnostics.Process.Start(fileName); + } - /// <summary> - /// Open Windows Event Viewer for user to browse logs - /// </summary> - /// <param name="sender"></param> - /// <param name="e"></param> - private void CmdOpenEventViewer_Click(object sender, EventArgs e) - { - string fileName = System.IO.Path.Combine(Environment.SystemDirectory, "eventvwr.msc"); - System.Diagnostics.Process.Start(fileName); - } + /// <summary> + /// Open access log in text editor + /// </summary> + /// <param name="sender"></param> + /// <param name="e"></param> + private void CmdOpenAccessLog_Click(object sender, EventArgs e) { + string fileName; + fileName = System.IO.Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory, "access.log"); - /// <summary> - /// Open access log in text editor - /// </summary> - /// <param name="sender"></param> - /// <param name="e"></param> - private void CmdOpenAccessLog_Click(object sender, EventArgs e) - { - string fileName; - fileName = System.IO.Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory, "access.log"); + if (System.IO.File.Exists(fileName)) + System.Diagnostics.Process.Start(fileName); + else + MessageBox.Show("No access log file cound be found, most likely because no attempts of accessing MPW have been made.", "Access log not found", MessageBoxButtons.OK, MessageBoxIcon.Information); - if (System.IO.File.Exists(fileName)) - System.Diagnostics.Process.Start(fileName); - else - MessageBox.Show("No access log file cound be found, most likely because no attempts of accessing MPW have been made.", "Access log not found", MessageBoxButtons.OK, MessageBoxIcon.Information); + } - } - } + /// <summary> + /// Only accept numbers and control keys + /// </summary> + /// <param name="sender"></param> + /// <param name="e"></param> + private void portBox_KeyPress(object sender, KeyPressEventArgs e) { + if (!Char.IsNumber(e.KeyChar) && !Char.IsControl(e.KeyChar)) { + e.Handled = true; + } + + } + + /// <summary> + /// Activates/Deactivates the ip data grid + /// </summary> + /// <param name="sender"></param> + /// <param name="e"></param> + private void accessModeDropDown_SelectedIndexChanged(object sender, EventArgs e) { + allowedIPs.Enabled = accessModeDropDown.SelectedIndex == (int)AccessMode.Restricted; + } + } } \ No newline at end of file Modified: trunk/Version2/Control Center/Control_Center_App.resx =================================================================== --- trunk/Version2/Control Center/Control_Center_App.resx 2007-03-11 10:11:22 UTC (rev 35) +++ trunk/Version2/Control Center/Control_Center_App.resx 2007-03-18 17:33:15 UTC (rev 36) @@ -117,6 +117,9 @@ <resheader name="writer"> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> + <metadata name="allowedIP.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>True</value> + </metadata> <metadata name="trayIcon.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <value>17, 17</value> </metadata> @@ -9179,6 +9182,9 @@ <metadata name="refreshTimer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <value>246, 17</value> </metadata> + <metadata name="allowedIP.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>True</value> + </metadata> <data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <value> AAABAA8AAAAAAAEACAAoJAEA9gAAADAwAAABAAgAqA4AAB4lAQAgIAAAAQAIAKgIAADGMwEAGBgAAAEA Modified: trunk/Version2/WebServer/Server.cs =================================================================== --- trunk/Version2/WebServer/Server.cs 2007-03-11 10:11:22 UTC (rev 35) +++ trunk/Version2/WebServer/Server.cs 2007-03-18 17:33:15 UTC (rev 36) @@ -174,11 +174,18 @@ _socket.ExclusiveAddressUse = true; try { - - _socket.Bind(new IPEndPoint(IPAddress.Parse(_configuration.BindAddress), _configuration.Port)); + if (_configuration.BindAddress.Equals("0.0.0.0")) { + _socket.Bind(new IPEndPoint(IPAddress.Any, _configuration.Port)); + } else { + _socket.Bind(new IPEndPoint(IPAddress.Parse(_configuration.BindAddress), _configuration.Port)); + } } catch { _socket.ExclusiveAddressUse = false; - _socket.Bind(new IPEndPoint(IPAddress.Parse(_configuration.BindAddress), _configuration.Port)); + if (_configuration.BindAddress.Equals("0.0.0.0")) { + _socket.Bind(new IPEndPoint(IPAddress.Any, _configuration.Port)); + } else { + _socket.Bind(new IPEndPoint(IPAddress.Parse(_configuration.BindAddress), _configuration.Port)); + } } _socket.Listen((int)SocketOptionName.MaxConnections); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sam...@us...> - 2007-03-11 10:11:35
|
Revision: 35 http://svn.sourceforge.net/mp-webinterface/?rev=35&view=rev Author: samuel337 Date: 2007-03-11 03:11:22 -0700 (Sun, 11 Mar 2007) Log Message: ----------- tidied up code, added in version info and log buttons, added error handling/data validation routines Modified Paths: -------------- trunk/Version2/Control Center/Control_Center_App.Designer.cs trunk/Version2/Control Center/Control_Center_App.cs Modified: trunk/Version2/Control Center/Control_Center_App.Designer.cs =================================================================== --- trunk/Version2/Control Center/Control_Center_App.Designer.cs 2007-03-09 22:37:29 UTC (rev 34) +++ trunk/Version2/Control Center/Control_Center_App.Designer.cs 2007-03-11 10:11:22 UTC (rev 35) @@ -28,363 +28,505 @@ /// </summary> private void InitializeComponent() { - this.components = new System.ComponentModel.Container(); - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Control_Center_App)); - this.groupBox1 = new System.Windows.Forms.GroupBox(); - this.statusMPWServerConn = new System.Windows.Forms.Label(); - this.statusTVService = new System.Windows.Forms.Label(); - this.statusTVServerConn = new System.Windows.Forms.Label(); - this.label3 = new System.Windows.Forms.Label(); - this.label2 = new System.Windows.Forms.Label(); - this.label1 = new System.Windows.Forms.Label(); - this.label6 = new System.Windows.Forms.Label(); - this.linkLabel1 = new System.Windows.Forms.LinkLabel(); - this.groupBox2 = new System.Windows.Forms.GroupBox(); - this.saveButton = new System.Windows.Forms.Button(); - this.bindIPBox = new System.Windows.Forms.TextBox(); - this.accessModeDropDown = new System.Windows.Forms.ComboBox(); - this.label9 = new System.Windows.Forms.Label(); - this.label8 = new System.Windows.Forms.Label(); - this.linkLabel2 = new System.Windows.Forms.LinkLabel(); - this.label7 = new System.Windows.Forms.Label(); - this.portBox = new System.Windows.Forms.TextBox(); - this.label4 = new System.Windows.Forms.Label(); - this.startstopButton = new System.Windows.Forms.Button(); - this.groupBox3 = new System.Windows.Forms.GroupBox(); - this.button1 = new System.Windows.Forms.Button(); - this.trayIcon = new System.Windows.Forms.NotifyIcon(this.components); - this.trayContextMenu = new System.Windows.Forms.ContextMenuStrip(this.components); - this.trayStart = new System.Windows.Forms.ToolStripMenuItem(); - this.stopToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.refreshTimer = new System.Windows.Forms.Timer(this.components); - this.groupBox1.SuspendLayout(); - this.groupBox2.SuspendLayout(); - this.groupBox3.SuspendLayout(); - this.trayContextMenu.SuspendLayout(); - this.SuspendLayout(); - // - // groupBox1 - // - this.groupBox1.Controls.Add(this.statusMPWServerConn); - this.groupBox1.Controls.Add(this.statusTVService); - this.groupBox1.Controls.Add(this.statusTVServerConn); - this.groupBox1.Controls.Add(this.label3); - this.groupBox1.Controls.Add(this.label2); - this.groupBox1.Controls.Add(this.label1); - this.groupBox1.Location = new System.Drawing.Point(12, 12); - this.groupBox1.Name = "groupBox1"; - this.groupBox1.Size = new System.Drawing.Size(300, 139); - this.groupBox1.TabIndex = 0; - this.groupBox1.TabStop = false; - this.groupBox1.Text = "Status information"; - // - // statusMPWServerConn - // - this.statusMPWServerConn.AutoSize = true; - this.statusMPWServerConn.Location = new System.Drawing.Point(139, 102); - this.statusMPWServerConn.Name = "statusMPWServerConn"; - this.statusMPWServerConn.Size = new System.Drawing.Size(86, 13); - this.statusMPWServerConn.TabIndex = 7; - this.statusMPWServerConn.Text = "Not checked yet"; - // - // statusTVService - // - this.statusTVService.AutoSize = true; - this.statusTVService.Location = new System.Drawing.Point(139, 35); - this.statusTVService.Name = "statusTVService"; - this.statusTVService.Size = new System.Drawing.Size(86, 13); - this.statusTVService.TabIndex = 6; - this.statusTVService.Text = "Not checked yet"; - // - // statusTVServerConn - // - this.statusTVServerConn.AutoSize = true; - this.statusTVServerConn.Location = new System.Drawing.Point(139, 67); - this.statusTVServerConn.Name = "statusTVServerConn"; - this.statusTVServerConn.Size = new System.Drawing.Size(86, 13); - this.statusTVServerConn.TabIndex = 5; - this.statusTVServerConn.Text = "Not checked yet"; - // - // label3 - // - this.label3.AutoSize = true; - this.label3.Location = new System.Drawing.Point(6, 102); - this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(92, 13); - this.label3.TabIndex = 2; - this.label3.Text = "MPW Webserver:"; - // - // label2 - // - this.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(6, 67); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(127, 13); - this.label2.TabIndex = 1; - this.label2.Text = "Connection to TV Server:"; - // - // label1 - // - this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(6, 35); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(63, 13); - this.label1.TabIndex = 0; - this.label1.Text = "TV Service:"; - // - // label6 - // - this.label6.AutoSize = true; - this.label6.Location = new System.Drawing.Point(6, 118); - this.label6.Name = "label6"; - this.label6.Size = new System.Drawing.Size(92, 13); - this.label6.TabIndex = 4; - this.label6.Text = "MPW Homepage:"; - // - // linkLabel1 - // - this.linkLabel1.AutoSize = true; - this.linkLabel1.Location = new System.Drawing.Point(104, 118); - this.linkLabel1.Name = "linkLabel1"; - this.linkLabel1.Size = new System.Drawing.Size(166, 13); - this.linkLabel1.TabIndex = 3; - this.linkLabel1.TabStop = true; - this.linkLabel1.Text = "http://www.mp-webinterface.com"; - this.linkLabel1.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel1_LinkClicked); - // - // groupBox2 - // - this.groupBox2.Controls.Add(this.saveButton); - this.groupBox2.Controls.Add(this.bindIPBox); - this.groupBox2.Controls.Add(this.accessModeDropDown); - this.groupBox2.Controls.Add(this.label9); - this.groupBox2.Controls.Add(this.label8); - this.groupBox2.Controls.Add(this.linkLabel2); - this.groupBox2.Controls.Add(this.label7); - this.groupBox2.Controls.Add(this.portBox); - this.groupBox2.Controls.Add(this.label4); - this.groupBox2.Location = new System.Drawing.Point(318, 12); - this.groupBox2.Name = "groupBox2"; - this.groupBox2.Size = new System.Drawing.Size(300, 283); - this.groupBox2.TabIndex = 1; - this.groupBox2.TabStop = false; - this.groupBox2.Text = "MPW Webserver setup"; - // - // saveButton - // - this.saveButton.Location = new System.Drawing.Point(126, 132); - this.saveButton.Name = "saveButton"; - this.saveButton.Size = new System.Drawing.Size(115, 23); - this.saveButton.TabIndex = 10; - this.saveButton.Text = "Save Configuration"; - this.saveButton.UseVisualStyleBackColor = true; - this.saveButton.Click += new System.EventHandler(this.saveButton_Click); - // - // bindIPBox - // - this.bindIPBox.Location = new System.Drawing.Point(126, 59); - this.bindIPBox.Name = "bindIPBox"; - this.bindIPBox.Size = new System.Drawing.Size(115, 20); - this.bindIPBox.TabIndex = 9; - // - // accessModeDropDown - // - this.accessModeDropDown.FormattingEnabled = true; - this.accessModeDropDown.Items.AddRange(new object[] { + this.components = new System.ComponentModel.Container(); + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Control_Center_App)); + this.gBxStatus = new System.Windows.Forms.GroupBox(); + this.statusMPWServerConn = new System.Windows.Forms.Label(); + this.statusTVService = new System.Windows.Forms.Label(); + this.statusTVServerConn = new System.Windows.Forms.Label(); + this.LblMPWWebServerStatusDesc = new System.Windows.Forms.Label(); + this.LblTVServerConnStatusDesc = new System.Windows.Forms.Label(); + this.LblTVServiceStatusDesc = new System.Windows.Forms.Label(); + this.LblMPWWebsiteLink = new System.Windows.Forms.Label(); + this.LLblMPWWebsiteLink = new System.Windows.Forms.LinkLabel(); + this.gBxMPWWebServerSetup = new System.Windows.Forms.GroupBox(); + this.saveButton = new System.Windows.Forms.Button(); + this.bindIPBox = new System.Windows.Forms.TextBox(); + this.accessModeDropDown = new System.Windows.Forms.ComboBox(); + this.LblSetupAccessMode = new System.Windows.Forms.Label(); + this.LblSetupBindLocalIP = new System.Windows.Forms.Label(); + this.portBox = new System.Windows.Forms.TextBox(); + this.LblSetupWebserverPort = new System.Windows.Forms.Label(); + this.LLblMPWServerURL = new System.Windows.Forms.LinkLabel(); + this.LblServerURL = new System.Windows.Forms.Label(); + this.startstopButton = new System.Windows.Forms.Button(); + this.gBxMPWWebServer = new System.Windows.Forms.GroupBox(); + this.CmdRefreshStatusInfo = new System.Windows.Forms.Button(); + this.trayIcon = new System.Windows.Forms.NotifyIcon(this.components); + this.trayContextMenu = new System.Windows.Forms.ContextMenuStrip(this.components); + this.trayStart = new System.Windows.Forms.ToolStripMenuItem(); + this.stopToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.refreshTimer = new System.Windows.Forms.Timer(this.components); + this.gBxAboutMPW = new System.Windows.Forms.GroupBox(); + this.gBxVersion = new System.Windows.Forms.GroupBox(); + this.LblMPWServiceVersion = new System.Windows.Forms.Label(); + this.LblMPWServiceVersionDesc = new System.Windows.Forms.Label(); + this.LblMPWWebserverVersion = new System.Windows.Forms.Label(); + this.LblMPWWebserverVersionDesc = new System.Windows.Forms.Label(); + this.LblMPWCCVersion = new System.Windows.Forms.Label(); + this.LblMPWCCVersionDesc = new System.Windows.Forms.Label(); + this.gBxLogs = new System.Windows.Forms.GroupBox(); + this.CmdOpenAccessLog = new System.Windows.Forms.Button(); + this.CmdOpenEventViewer = new System.Windows.Forms.Button(); + this.gBxStatus.SuspendLayout(); + this.gBxMPWWebServerSetup.SuspendLayout(); + this.gBxMPWWebServer.SuspendLayout(); + this.trayContextMenu.SuspendLayout(); + this.gBxAboutMPW.SuspendLayout(); + this.gBxVersion.SuspendLayout(); + this.gBxLogs.SuspendLayout(); + this.SuspendLayout(); + // + // gBxStatus + // + this.gBxStatus.Controls.Add(this.statusMPWServerConn); + this.gBxStatus.Controls.Add(this.statusTVService); + this.gBxStatus.Controls.Add(this.statusTVServerConn); + this.gBxStatus.Controls.Add(this.LblMPWWebServerStatusDesc); + this.gBxStatus.Controls.Add(this.LblTVServerConnStatusDesc); + this.gBxStatus.Controls.Add(this.LblTVServiceStatusDesc); + this.gBxStatus.Location = new System.Drawing.Point(12, 12); + this.gBxStatus.Name = "gBxStatus"; + this.gBxStatus.Size = new System.Drawing.Size(300, 80); + this.gBxStatus.TabIndex = 0; + this.gBxStatus.TabStop = false; + this.gBxStatus.Text = "Status information"; + // + // statusMPWServerConn + // + this.statusMPWServerConn.AutoSize = true; + this.statusMPWServerConn.Location = new System.Drawing.Point(139, 55); + this.statusMPWServerConn.Name = "statusMPWServerConn"; + this.statusMPWServerConn.Size = new System.Drawing.Size(86, 13); + this.statusMPWServerConn.TabIndex = 7; + this.statusMPWServerConn.Text = "Not checked yet"; + // + // statusTVService + // + this.statusTVService.AutoSize = true; + this.statusTVService.Location = new System.Drawing.Point(139, 16); + this.statusTVService.Name = "statusTVService"; + this.statusTVService.Size = new System.Drawing.Size(86, 13); + this.statusTVService.TabIndex = 6; + this.statusTVService.Text = "Not checked yet"; + // + // statusTVServerConn + // + this.statusTVServerConn.AutoSize = true; + this.statusTVServerConn.Location = new System.Drawing.Point(139, 35); + this.statusTVServerConn.Name = "statusTVServerConn"; + this.statusTVServerConn.Size = new System.Drawing.Size(86, 13); + this.statusTVServerConn.TabIndex = 5; + this.statusTVServerConn.Text = "Not checked yet"; + // + // LblMPWWebServerStatusDesc + // + this.LblMPWWebServerStatusDesc.AutoSize = true; + this.LblMPWWebServerStatusDesc.Location = new System.Drawing.Point(6, 55); + this.LblMPWWebServerStatusDesc.Name = "LblMPWWebServerStatusDesc"; + this.LblMPWWebServerStatusDesc.Size = new System.Drawing.Size(92, 13); + this.LblMPWWebServerStatusDesc.TabIndex = 2; + this.LblMPWWebServerStatusDesc.Text = "MPW Webserver:"; + // + // LblTVServerConnStatusDesc + // + this.LblTVServerConnStatusDesc.AutoSize = true; + this.LblTVServerConnStatusDesc.Location = new System.Drawing.Point(6, 35); + this.LblTVServerConnStatusDesc.Name = "LblTVServerConnStatusDesc"; + this.LblTVServerConnStatusDesc.Size = new System.Drawing.Size(127, 13); + this.LblTVServerConnStatusDesc.TabIndex = 1; + this.LblTVServerConnStatusDesc.Text = "Connection to TV Server:"; + // + // LblTVServiceStatusDesc + // + this.LblTVServiceStatusDesc.AutoSize = true; + this.LblTVServiceStatusDesc.Location = new System.Drawing.Point(6, 16); + this.LblTVServiceStatusDesc.Name = "LblTVServiceStatusDesc"; + this.LblTVServiceStatusDesc.Size = new System.Drawing.Size(63, 13); + this.LblTVServiceStatusDesc.TabIndex = 0; + this.LblTVServiceStatusDesc.Text = "TV Service:"; + // + // LblMPWWebsiteLink + // + this.LblMPWWebsiteLink.AutoSize = true; + this.LblMPWWebsiteLink.Location = new System.Drawing.Point(6, 16); + this.LblMPWWebsiteLink.Name = "LblMPWWebsiteLink"; + this.LblMPWWebsiteLink.Size = new System.Drawing.Size(92, 13); + this.LblMPWWebsiteLink.TabIndex = 4; + this.LblMPWWebsiteLink.Text = "MPW Homepage:"; + // + // LLblMPWWebsiteLink + // + this.LLblMPWWebsiteLink.AutoSize = true; + this.LLblMPWWebsiteLink.Location = new System.Drawing.Point(104, 16); + this.LLblMPWWebsiteLink.Name = "LLblMPWWebsiteLink"; + this.LLblMPWWebsiteLink.Size = new System.Drawing.Size(166, 13); + this.LLblMPWWebsiteLink.TabIndex = 3; + this.LLblMPWWebsiteLink.TabStop = true; + this.LLblMPWWebsiteLink.Text = "http://www.mp-webinterface.com"; + this.LLblMPWWebsiteLink.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.LLblMPWWebsiteLink_LinkClicked); + // + // gBxMPWWebServerSetup + // + this.gBxMPWWebServerSetup.Controls.Add(this.saveButton); + this.gBxMPWWebServerSetup.Controls.Add(this.bindIPBox); + this.gBxMPWWebServerSetup.Controls.Add(this.accessModeDropDown); + this.gBxMPWWebServerSetup.Controls.Add(this.LblSetupAccessMode); + this.gBxMPWWebServerSetup.Controls.Add(this.LblSetupBindLocalIP); + this.gBxMPWWebServerSetup.Controls.Add(this.portBox); + this.gBxMPWWebServerSetup.Controls.Add(this.LblSetupWebserverPort); + this.gBxMPWWebServerSetup.Location = new System.Drawing.Point(318, 12); + this.gBxMPWWebServerSetup.Name = "gBxMPWWebServerSetup"; + this.gBxMPWWebServerSetup.Size = new System.Drawing.Size(300, 314); + this.gBxMPWWebServerSetup.TabIndex = 1; + this.gBxMPWWebServerSetup.TabStop = false; + this.gBxMPWWebServerSetup.Text = "MPW Webserver setup"; + // + // saveButton + // + this.saveButton.Location = new System.Drawing.Point(126, 132); + this.saveButton.Name = "saveButton"; + this.saveButton.Size = new System.Drawing.Size(115, 23); + this.saveButton.TabIndex = 10; + this.saveButton.Text = "Save Configuration"; + this.saveButton.UseVisualStyleBackColor = true; + this.saveButton.Click += new System.EventHandler(this.saveButton_Click); + // + // bindIPBox + // + this.bindIPBox.Location = new System.Drawing.Point(126, 59); + this.bindIPBox.Name = "bindIPBox"; + this.bindIPBox.Size = new System.Drawing.Size(115, 20); + this.bindIPBox.TabIndex = 9; + // + // accessModeDropDown + // + this.accessModeDropDown.FormattingEnabled = true; + this.accessModeDropDown.Items.AddRange(new object[] { "Local", "Global", "Restricted"}); - this.accessModeDropDown.Location = new System.Drawing.Point(126, 94); - this.accessModeDropDown.Name = "accessModeDropDown"; - this.accessModeDropDown.Size = new System.Drawing.Size(115, 21); - this.accessModeDropDown.TabIndex = 8; - // - // label9 - // - this.label9.AutoSize = true; - this.label9.Location = new System.Drawing.Point(6, 102); - this.label9.Name = "label9"; - this.label9.Size = new System.Drawing.Size(74, 13); - this.label9.TabIndex = 7; - this.label9.Text = "Access mode:"; - // - // label8 - // - this.label8.AutoSize = true; - this.label8.Location = new System.Drawing.Point(6, 67); - this.label8.Name = "label8"; - this.label8.Size = new System.Drawing.Size(81, 13); - this.label8.TabIndex = 6; - this.label8.Text = "Bind to local IP:"; - // - // linkLabel2 - // - this.linkLabel2.AutoSize = true; - this.linkLabel2.Location = new System.Drawing.Point(82, 262); - this.linkLabel2.Name = "linkLabel2"; - this.linkLabel2.Size = new System.Drawing.Size(0, 13); - this.linkLabel2.TabIndex = 5; - this.linkLabel2.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel2_LinkClicked); - // - // label7 - // - this.label7.AutoSize = true; - this.label7.Location = new System.Drawing.Point(9, 263); - this.label7.Name = "label7"; - this.label7.Size = new System.Drawing.Size(66, 13); - this.label7.TabIndex = 4; - this.label7.Text = "Server URL:"; - // - // portBox - // - this.portBox.Location = new System.Drawing.Point(126, 32); - this.portBox.Name = "portBox"; - this.portBox.Size = new System.Drawing.Size(115, 20); - this.portBox.TabIndex = 1; - // - // label4 - // - this.label4.AutoSize = true; - this.label4.Location = new System.Drawing.Point(6, 35); - this.label4.Name = "label4"; - this.label4.Size = new System.Drawing.Size(114, 13); - this.label4.TabIndex = 0; - this.label4.Text = "MPW Webserver Port:"; - // - // startstopButton - // - this.startstopButton.Location = new System.Drawing.Point(9, 37); - this.startstopButton.Name = "startstopButton"; - this.startstopButton.Size = new System.Drawing.Size(100, 23); - this.startstopButton.TabIndex = 3; - this.startstopButton.Text = "Start"; - this.startstopButton.UseVisualStyleBackColor = true; - this.startstopButton.Click += new System.EventHandler(this.startstopButton_Click); - // - // groupBox3 - // - this.groupBox3.Controls.Add(this.button1); - this.groupBox3.Controls.Add(this.label6); - this.groupBox3.Controls.Add(this.linkLabel1); - this.groupBox3.Controls.Add(this.startstopButton); - this.groupBox3.Location = new System.Drawing.Point(12, 157); - this.groupBox3.Name = "groupBox3"; - this.groupBox3.Size = new System.Drawing.Size(300, 138); - this.groupBox3.TabIndex = 2; - this.groupBox3.TabStop = false; - this.groupBox3.Text = "MPW Webserver Control"; - // - // button1 - // - this.button1.Location = new System.Drawing.Point(142, 37); - this.button1.Name = "button1"; - this.button1.Size = new System.Drawing.Size(83, 23); - this.button1.TabIndex = 5; - this.button1.Text = "Refresh status"; - this.button1.UseVisualStyleBackColor = true; - this.button1.Click += new System.EventHandler(this.button1_Click); - // - // trayIcon - // - this.trayIcon.ContextMenuStrip = this.trayContextMenu; - this.trayIcon.Icon = ((System.Drawing.Icon)(resources.GetObject("trayIcon.Icon"))); - this.trayIcon.Text = "MPW"; - this.trayIcon.Visible = true; - this.trayIcon.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.trayIcon_MouseDoubleClick); - // - // trayContextMenu - // - this.trayContextMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.accessModeDropDown.Location = new System.Drawing.Point(126, 94); + this.accessModeDropDown.Name = "accessModeDropDown"; + this.accessModeDropDown.Size = new System.Drawing.Size(115, 21); + this.accessModeDropDown.TabIndex = 8; + // + // LblSetupAccessMode + // + this.LblSetupAccessMode.AutoSize = true; + this.LblSetupAccessMode.Location = new System.Drawing.Point(6, 102); + this.LblSetupAccessMode.Name = "LblSetupAccessMode"; + this.LblSetupAccessMode.Size = new System.Drawing.Size(74, 13); + this.LblSetupAccessMode.TabIndex = 7; + this.LblSetupAccessMode.Text = "Access mode:"; + // + // LblSetupBindLocalIP + // + this.LblSetupBindLocalIP.AutoSize = true; + this.LblSetupBindLocalIP.Location = new System.Drawing.Point(6, 67); + this.LblSetupBindLocalIP.Name = "LblSetupBindLocalIP"; + this.LblSetupBindLocalIP.Size = new System.Drawing.Size(81, 13); + this.LblSetupBindLocalIP.TabIndex = 6; + this.LblSetupBindLocalIP.Text = "Bind to local IP:"; + // + // portBox + // + this.portBox.Location = new System.Drawing.Point(126, 32); + this.portBox.Name = "portBox"; + this.portBox.Size = new System.Drawing.Size(115, 20); + this.portBox.TabIndex = 1; + // + // LblSetupWebserverPort + // + this.LblSetupWebserverPort.AutoSize = true; + this.LblSetupWebserverPort.Location = new System.Drawing.Point(6, 35); + this.LblSetupWebserverPort.Name = "LblSetupWebserverPort"; + this.LblSetupWebserverPort.Size = new System.Drawing.Size(114, 13); + this.LblSetupWebserverPort.TabIndex = 0; + this.LblSetupWebserverPort.Text = "MPW Webserver Port:"; + // + // LLblMPWServerURL + // + this.LLblMPWServerURL.AutoSize = true; + this.LLblMPWServerURL.Location = new System.Drawing.Point(78, 51); + this.LLblMPWServerURL.Name = "LLblMPWServerURL"; + this.LLblMPWServerURL.Size = new System.Drawing.Size(0, 13); + this.LLblMPWServerURL.TabIndex = 5; + this.LLblMPWServerURL.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.LLblMPWServerURL_LinkClicked); + // + // LblServerURL + // + this.LblServerURL.AutoSize = true; + this.LblServerURL.Location = new System.Drawing.Point(6, 51); + this.LblServerURL.Name = "LblServerURL"; + this.LblServerURL.Size = new System.Drawing.Size(66, 13); + this.LblServerURL.TabIndex = 4; + this.LblServerURL.Text = "Server URL:"; + // + // startstopButton + // + this.startstopButton.Location = new System.Drawing.Point(6, 19); + this.startstopButton.Name = "startstopButton"; + this.startstopButton.Size = new System.Drawing.Size(199, 23); + this.startstopButton.TabIndex = 3; + this.startstopButton.Text = "Start"; + this.startstopButton.UseVisualStyleBackColor = true; + this.startstopButton.Click += new System.EventHandler(this.startstopButton_Click); + // + // gBxMPWWebServer + // + this.gBxMPWWebServer.Controls.Add(this.CmdRefreshStatusInfo); + this.gBxMPWWebServer.Controls.Add(this.startstopButton); + this.gBxMPWWebServer.Controls.Add(this.LblServerURL); + this.gBxMPWWebServer.Controls.Add(this.LLblMPWServerURL); + this.gBxMPWWebServer.Location = new System.Drawing.Point(12, 98); + this.gBxMPWWebServer.Name = "gBxMPWWebServer"; + this.gBxMPWWebServer.Size = new System.Drawing.Size(300, 78); + this.gBxMPWWebServer.TabIndex = 2; + this.gBxMPWWebServer.TabStop = false; + this.gBxMPWWebServer.Text = "MPW Webserver"; + // + // CmdRefreshStatusInfo + // + this.CmdRefreshStatusInfo.Location = new System.Drawing.Point(211, 19); + this.CmdRefreshStatusInfo.Name = "CmdRefreshStatusInfo"; + this.CmdRefreshStatusInfo.Size = new System.Drawing.Size(83, 23); + this.CmdRefreshStatusInfo.TabIndex = 5; + this.CmdRefreshStatusInfo.Text = "Refresh status"; + this.CmdRefreshStatusInfo.UseVisualStyleBackColor = true; + this.CmdRefreshStatusInfo.Click += new System.EventHandler(this.CmdRefreshStatusInfo_Click); + // + // trayIcon + // + this.trayIcon.ContextMenuStrip = this.trayContextMenu; + this.trayIcon.Icon = ((System.Drawing.Icon)(resources.GetObject("trayIcon.Icon"))); + this.trayIcon.Text = "MPW"; + this.trayIcon.Visible = true; + this.trayIcon.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.trayIcon_MouseDoubleClick); + // + // trayContextMenu + // + this.trayContextMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.trayStart, this.stopToolStripMenuItem, this.exitToolStripMenuItem}); - this.trayContextMenu.Name = "trayContextMenu"; - this.trayContextMenu.Size = new System.Drawing.Size(110, 70); - this.trayContextMenu.Text = "MPW"; - // - // trayStart - // - this.trayStart.Name = "trayStart"; - this.trayStart.Size = new System.Drawing.Size(109, 22); - this.trayStart.Text = "Start"; - this.trayStart.Click += new System.EventHandler(this.trayStart_Click); - // - // stopToolStripMenuItem - // - this.stopToolStripMenuItem.Name = "stopToolStripMenuItem"; - this.stopToolStripMenuItem.Size = new System.Drawing.Size(109, 22); - this.stopToolStripMenuItem.Text = "Stop"; - this.stopToolStripMenuItem.Click += new System.EventHandler(this.stopToolStripMenuItem_Click); - // - // exitToolStripMenuItem - // - this.exitToolStripMenuItem.Name = "exitToolStripMenuItem"; - this.exitToolStripMenuItem.Size = new System.Drawing.Size(109, 22); - this.exitToolStripMenuItem.Text = "Exit"; - this.exitToolStripMenuItem.Click += new System.EventHandler(this.exitToolStripMenuItem_Click); - // - // refreshTimer - // - this.refreshTimer.Enabled = true; - this.refreshTimer.Interval = 1000; - this.refreshTimer.Tick += new System.EventHandler(this.refreshTimer_Tick); - // - // Control_Center_App - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(632, 307); - this.Controls.Add(this.groupBox3); - this.Controls.Add(this.groupBox2); - this.Controls.Add(this.groupBox1); - this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.MaximizeBox = false; - this.Name = "Control_Center_App"; - this.Text = "MPW Control Center"; - this.Resize += new System.EventHandler(this.Control_Center_App_Resize); - this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Control_Center_App_FormClosing); - this.groupBox1.ResumeLayout(false); - this.groupBox1.PerformLayout(); - this.groupBox2.ResumeLayout(false); - this.groupBox2.PerformLayout(); - this.groupBox3.ResumeLayout(false); - this.groupBox3.PerformLayout(); - this.trayContextMenu.ResumeLayout(false); - this.ResumeLayout(false); + this.trayContextMenu.Name = "trayContextMenu"; + this.trayContextMenu.Size = new System.Drawing.Size(99, 70); + this.trayContextMenu.Text = "MPW"; + // + // trayStart + // + this.trayStart.Name = "trayStart"; + this.trayStart.Size = new System.Drawing.Size(98, 22); + this.trayStart.Text = "Start"; + this.trayStart.Click += new System.EventHandler(this.trayStart_Click); + // + // stopToolStripMenuItem + // + this.stopToolStripMenuItem.Name = "stopToolStripMenuItem"; + this.stopToolStripMenuItem.Size = new System.Drawing.Size(98, 22); + this.stopToolStripMenuItem.Text = "Stop"; + this.stopToolStripMenuItem.Click += new System.EventHandler(this.stopToolStripMenuItem_Click); + // + // exitToolStripMenuItem + // + this.exitToolStripMenuItem.Name = "exitToolStripMenuItem"; + this.exitToolStripMenuItem.Size = new System.Drawing.Size(98, 22); + this.exitToolStripMenuItem.Text = "Exit"; + this.exitToolStripMenuItem.Click += new System.EventHandler(this.exitToolStripMenuItem_Click); + // + // refreshTimer + // + this.refreshTimer.Enabled = true; + this.refreshTimer.Interval = 1000; + this.refreshTimer.Tick += new System.EventHandler(this.refreshTimer_Tick); + // + // gBxAboutMPW + // + this.gBxAboutMPW.Controls.Add(this.LLblMPWWebsiteLink); + this.gBxAboutMPW.Controls.Add(this.LblMPWWebsiteLink); + this.gBxAboutMPW.Location = new System.Drawing.Point(12, 332); + this.gBxAboutMPW.Name = "gBxAboutMPW"; + this.gBxAboutMPW.Size = new System.Drawing.Size(606, 38); + this.gBxAboutMPW.TabIndex = 3; + this.gBxAboutMPW.TabStop = false; + this.gBxAboutMPW.Text = "About MPW"; + // + // gBxVersion + // + this.gBxVersion.Controls.Add(this.LblMPWServiceVersion); + this.gBxVersion.Controls.Add(this.LblMPWServiceVersionDesc); + this.gBxVersion.Controls.Add(this.LblMPWWebserverVersion); + this.gBxVersion.Controls.Add(this.LblMPWWebserverVersionDesc); + this.gBxVersion.Controls.Add(this.LblMPWCCVersion); + this.gBxVersion.Controls.Add(this.LblMPWCCVersionDesc); + this.gBxVersion.Location = new System.Drawing.Point(12, 182); + this.gBxVersion.Name = "gBxVersion"; + this.gBxVersion.Size = new System.Drawing.Size(300, 84); + this.gBxVersion.TabIndex = 4; + this.gBxVersion.TabStop = false; + this.gBxVersion.Text = "Version Information"; + // + // LblMPWServiceVersion + // + this.LblMPWServiceVersion.AutoSize = true; + this.LblMPWServiceVersion.Location = new System.Drawing.Point(135, 61); + this.LblMPWServiceVersion.Name = "LblMPWServiceVersion"; + this.LblMPWServiceVersion.Size = new System.Drawing.Size(112, 13); + this.LblMPWServiceVersion.TabIndex = 5; + this.LblMPWServiceVersion.Text = "Error obtaining version"; + // + // LblMPWServiceVersionDesc + // + this.LblMPWServiceVersionDesc.AutoSize = true; + this.LblMPWServiceVersionDesc.Location = new System.Drawing.Point(6, 61); + this.LblMPWServiceVersionDesc.Name = "LblMPWServiceVersionDesc"; + this.LblMPWServiceVersionDesc.Size = new System.Drawing.Size(123, 13); + this.LblMPWServiceVersionDesc.TabIndex = 4; + this.LblMPWServiceVersionDesc.Text = "MPW Windows Service:"; + // + // LblMPWWebserverVersion + // + this.LblMPWWebserverVersion.AutoSize = true; + this.LblMPWWebserverVersion.Location = new System.Drawing.Point(135, 38); + this.LblMPWWebserverVersion.Name = "LblMPWWebserverVersion"; + this.LblMPWWebserverVersion.Size = new System.Drawing.Size(112, 13); + this.LblMPWWebserverVersion.TabIndex = 3; + this.LblMPWWebserverVersion.Text = "Error obtaining version"; + // + // LblMPWWebserverVersionDesc + // + this.LblMPWWebserverVersionDesc.AutoSize = true; + this.LblMPWWebserverVersionDesc.Location = new System.Drawing.Point(6, 38); + this.LblMPWWebserverVersionDesc.Name = "LblMPWWebserverVersionDesc"; + this.LblMPWWebserverVersionDesc.Size = new System.Drawing.Size(92, 13); + this.LblMPWWebserverVersionDesc.TabIndex = 2; + this.LblMPWWebserverVersionDesc.Text = "MPW Webserver:"; + // + // LblMPWCCVersion + // + this.LblMPWCCVersion.AutoSize = true; + this.LblMPWCCVersion.Location = new System.Drawing.Point(135, 16); + this.LblMPWCCVersion.Name = "LblMPWCCVersion"; + this.LblMPWCCVersion.Size = new System.Drawing.Size(112, 13); + this.LblMPWCCVersion.TabIndex = 1; + this.LblMPWCCVersion.Text = "Error obtaining version"; + // + // LblMPWCCVersionDesc + // + this.LblMPWCCVersionDesc.AutoSize = true; + this.LblMPWCCVersionDesc.Location = new System.Drawing.Point(6, 16); + this.LblMPWCCVersionDesc.Name = "LblMPWCCVersionDesc"; + this.LblMPWCCVersionDesc.Size = new System.Drawing.Size(107, 13); + this.LblMPWCCVersionDesc.TabIndex = 0; + this.LblMPWCCVersionDesc.Text = "MPW Control Center:"; + // + // gBxLogs + // + this.gBxLogs.Controls.Add(this.CmdOpenAccessLog); + this.gBxLogs.Controls.Add(this.CmdOpenEventViewer); + this.gBxLogs.Location = new System.Drawing.Point(12, 272); + this.gBxLogs.Name = "gBxLogs"; + this.gBxLogs.Size = new System.Drawing.Size(300, 54); + this.gBxLogs.TabIndex = 5; + this.gBxLogs.TabStop = false; + this.gBxLogs.Text = "Logs"; + // + // CmdOpenAccessLog + // + this.CmdOpenAccessLog.Location = new System.Drawing.Point(154, 19); + this.CmdOpenAccessLog.Name = "CmdOpenAccessLog"; + this.CmdOpenAccessLog.Size = new System.Drawing.Size(140, 23); + this.CmdOpenAccessLog.TabIndex = 1; + this.CmdOpenAccessLog.Text = "MPW Access Log"; + this.CmdOpenAccessLog.UseVisualStyleBackColor = true; + this.CmdOpenAccessLog.Click += new System.EventHandler(this.CmdOpenAccessLog_Click); + // + // CmdOpenEventViewer + // + this.CmdOpenEventViewer.Location = new System.Drawing.Point(6, 19); + this.CmdOpenEventViewer.Name = "CmdOpenEventViewer"; + this.CmdOpenEventViewer.Size = new System.Drawing.Size(142, 23); + this.CmdOpenEventViewer.TabIndex = 0; + this.CmdOpenEventViewer.Text = "MPW General Logs"; + this.CmdOpenEventViewer.UseVisualStyleBackColor = true; + this.CmdOpenEventViewer.Click += new System.EventHandler(this.CmdOpenEventViewer_Click); + // + // Control_Center_App + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(632, 384); + this.Controls.Add(this.gBxLogs); + this.Controls.Add(this.gBxAboutMPW); + this.Controls.Add(this.gBxMPWWebServer); + this.Controls.Add(this.gBxVersion); + this.Controls.Add(this.gBxMPWWebServerSetup); + this.Controls.Add(this.gBxStatus); + this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); + this.MaximizeBox = false; + this.Name = "Control_Center_App"; + this.Text = "MPW Control Center"; + this.Resize += new System.EventHandler(this.Control_Center_App_Resize); + this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Control_Center_App_FormClosing); + this.gBxStatus.ResumeLayout(false); + this.gBxStatus.PerformLayout(); + this.gBxMPWWebServerSetup.ResumeLayout(false); + this.gBxMPWWebServerSetup.PerformLayout(); + this.gBxMPWWebServer.ResumeLayout(false); + this.gBxMPWWebServer.PerformLayout(); + this.trayContextMenu.ResumeLayout(false); + this.gBxAboutMPW.ResumeLayout(false); + this.gBxAboutMPW.PerformLayout(); + this.gBxVersion.ResumeLayout(false); + this.gBxVersion.PerformLayout(); + this.gBxLogs.ResumeLayout(false); + this.ResumeLayout(false); } #endregion - private System.Windows.Forms.GroupBox groupBox1; - private System.Windows.Forms.GroupBox groupBox2; - private System.Windows.Forms.Label label1; - private System.Windows.Forms.Label label2; - private System.Windows.Forms.LinkLabel linkLabel1; - private System.Windows.Forms.Label label3; + private System.Windows.Forms.GroupBox gBxStatus; + private System.Windows.Forms.GroupBox gBxMPWWebServerSetup; + private System.Windows.Forms.Label LblTVServiceStatusDesc; + private System.Windows.Forms.Label LblTVServerConnStatusDesc; + private System.Windows.Forms.LinkLabel LLblMPWWebsiteLink; + private System.Windows.Forms.Label LblMPWWebServerStatusDesc; private System.Windows.Forms.TextBox portBox; - private System.Windows.Forms.Label label4; + private System.Windows.Forms.Label LblSetupWebserverPort; private System.Windows.Forms.Button startstopButton; - private System.Windows.Forms.Label label6; - private System.Windows.Forms.LinkLabel linkLabel2; - private System.Windows.Forms.Label label7; + private System.Windows.Forms.Label LblMPWWebsiteLink; + private System.Windows.Forms.LinkLabel LLblMPWServerURL; + private System.Windows.Forms.Label LblServerURL; private System.Windows.Forms.Label statusTVServerConn; private System.Windows.Forms.Label statusMPWServerConn; private System.Windows.Forms.Label statusTVService; private System.Windows.Forms.ComboBox accessModeDropDown; - private System.Windows.Forms.Label label9; - private System.Windows.Forms.Label label8; + private System.Windows.Forms.Label LblSetupAccessMode; + private System.Windows.Forms.Label LblSetupBindLocalIP; private System.Windows.Forms.TextBox bindIPBox; private System.Windows.Forms.Button saveButton; - private System.Windows.Forms.GroupBox groupBox3; + private System.Windows.Forms.GroupBox gBxMPWWebServer; private System.Windows.Forms.NotifyIcon trayIcon; private System.Windows.Forms.ContextMenuStrip trayContextMenu; private System.Windows.Forms.ToolStripMenuItem trayStart; private System.Windows.Forms.ToolStripMenuItem stopToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem; - private System.Windows.Forms.Button button1; + private System.Windows.Forms.Button CmdRefreshStatusInfo; private System.Windows.Forms.Timer refreshTimer; + private System.Windows.Forms.GroupBox gBxAboutMPW; + private System.Windows.Forms.GroupBox gBxVersion; + private System.Windows.Forms.Label LblMPWServiceVersion; + private System.Windows.Forms.Label LblMPWServiceVersionDesc; + private System.Windows.Forms.Label LblMPWWebserverVersion; + private System.Windows.Forms.Label LblMPWWebserverVersionDesc; + private System.Windows.Forms.Label LblMPWCCVersion; + private System.Windows.Forms.Label LblMPWCCVersionDesc; + private System.Windows.Forms.GroupBox gBxLogs; + private System.Windows.Forms.Button CmdOpenEventViewer; + private System.Windows.Forms.Button CmdOpenAccessLog; } } Modified: trunk/Version2/Control Center/Control_Center_App.cs =================================================================== --- trunk/Version2/Control Center/Control_Center_App.cs 2007-03-09 22:37:29 UTC (rev 34) +++ trunk/Version2/Control Center/Control_Center_App.cs 2007-03-11 10:11:22 UTC (rev 35) @@ -18,20 +18,54 @@ private ServiceController MPWServiceController = new ServiceController("MPW"); //MPW Webserver settings - private String port; + private int port; private String bindIP; private int accesMode; - private String file; + private String configFile; + private bool exitRequested; + public Control_Center_App() { InitializeComponent(); - file = System.AppDomain.CurrentDomain.BaseDirectory + "Configuration.xml"; + configFile = System.AppDomain.CurrentDomain.BaseDirectory + "Configuration.xml"; RefreshControllers(); LoadSettings(); + + LoadVersionInfo(); } + /// <summary> + /// gets version info for MPW components and puts it on labels on form + /// </summary> + private void LoadVersionInfo() + { + LblMPWCCVersion.Text = System.Reflection.Assembly.GetCallingAssembly().GetName().Version.ToString(); + + string fileName; + + try + { + fileName = System.IO.Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory, "WebServer.dll"); + LblMPWWebserverVersion.Text = System.Diagnostics.FileVersionInfo.GetVersionInfo(fileName).ProductVersion; + } + catch + { } + + try + { + fileName = System.IO.Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory, "MPW Service.exe"); + LblMPWServiceVersion.Text = System.Diagnostics.FileVersionInfo.GetVersionInfo(fileName).ProductVersion; + } + catch + { } + + } + + /// <summary> + /// refreshes the status indicators for MPW webserver and TV services + /// </summary> private void RefreshControllers() { //MPW Webserver @@ -39,37 +73,39 @@ try { statusMPWServerConn.Text = MPWServiceController.Status.ToString(); + + if (MPWServiceController.Status == ServiceControllerStatus.Running) + { + statusMPWServerConn.ForeColor = Color.Green; + startstopButton.Text = "Stop"; + } + else + { + statusMPWServerConn.ForeColor = Color.Red; + startstopButton.Text = "Start"; + } } catch { statusMPWServerConn.Text = "Error: Service not found!"; startstopButton.Enabled = false; } - if (statusMPWServerConn.Text == "Running") - { - statusMPWServerConn.ForeColor = Color.Green; - startstopButton.Text = "Stop"; - } - else - { - statusMPWServerConn.ForeColor = Color.Red; - startstopButton.Text = "Start"; - } - + //TV Server TVServiceController.Refresh(); try { statusTVService.Text = TVServiceController.Status.ToString(); + + if (TVServiceController.Status == ServiceControllerStatus.Running) + statusTVService.ForeColor = Color.Green; + else + statusTVService.ForeColor = Color.Red; } catch { statusTVService.Text = "Error: Service not found!"; - } - if (statusTVService.Text == "Running") - statusTVService.ForeColor = Color.Green; - else - statusTVService.ForeColor = Color.Red; + } } private void startstopButton_Click(object sender, EventArgs e) @@ -80,17 +116,19 @@ Stop(); } - private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) + private void LLblMPWWebsiteLink_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { - System.Diagnostics.Process.Start(linkLabel1.Text); + System.Diagnostics.Process.Start(LLblMPWWebsiteLink.Text); } - private void linkLabel2_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) + private void LLblMPWServerURL_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { - System.Diagnostics.Process.Start(linkLabel2.Text); + System.Diagnostics.Process.Start(LLblMPWServerURL.Text); } - //Start the server + /// <summary> + /// Start the server + /// </summary> private void Start() { RefreshControllers(); @@ -106,11 +144,13 @@ RefreshControllers(); } - //Stop the server + /// <summary> + /// Stop the server + /// </summary> private void Stop() { RefreshControllers(); - if (statusMPWServerConn.Text == "Running") + if (MPWServiceController.Status == ServiceControllerStatus.Running) { MPWServiceController.Stop(); startstopButton.Text = "Start"; @@ -118,56 +158,104 @@ RefreshControllers(); } - //Build a String with the server URL + /// <summary> + /// Build a string with the server URL + /// </summary> + /// <returns>server URL</returns> private String ConstructServerURL() { String url = "http://"; url += bindIP; - url += ":" + port; + url += ":" + port.ToString(); url += "/"; return url; } - //Load the configuration - private void LoadSettings() + /// <summary> + /// Load the configuration + /// </summary> + /// <returns>true if settings loaded successfully</returns> + private bool LoadSettings() { - XmlDocument doc = new XmlDocument(); - doc.Load(file); - XmlNode node = doc.DocumentElement.SelectSingleNode("/configuration/bindAddress"); - bindIP = node.InnerText; - node = doc.DocumentElement.SelectSingleNode("/configuration/port"); - port = node.InnerText; - node = doc.DocumentElement.SelectSingleNode("/configuration/allowedAccesMode"); - accesMode = int.Parse(node.InnerText); + try + { + XmlDocument doc = new XmlDocument(); + doc.Load(configFile); + XmlNode node = doc.DocumentElement.SelectSingleNode("/configuration/bindAddress"); + bindIP = node.InnerText; + node = doc.DocumentElement.SelectSingleNode("/configuration/port"); + port = int.Parse(node.InnerText); + node = doc.DocumentElement.SelectSingleNode("/configuration/allowedAccesMode"); + accesMode = int.Parse(node.InnerText); + } + catch (Exception ex) + { + MessageBox.Show("An error occurred when trying to load the settings." + Environment.NewLine + Environment.NewLine + ex.ToString(), "Error when loading settings", MessageBoxButtons.OK, MessageBoxIcon.Error); + return false; + } //Set the read values to the various TextBoxes - portBox.Text = port; + portBox.Text = port.ToString(); bindIPBox.Text = bindIP; accessModeDropDown.SelectedIndex = accesMode; - linkLabel2.Text = ConstructServerURL(); + LLblMPWServerURL.Text = ConstructServerURL(); + + return true; } - //Save the configuration - private void SaveSettings() + /// <summary> + /// save server configuration settings + /// </summary> + /// <returns>true if configuration settings were successfully saved.</returns> + private bool SaveSettings() { - XmlDocument doc = new XmlDocument(); - doc.Load(file); + try + { + XmlDocument doc = new XmlDocument(); + doc.Load(configFile); - XmlNode node = doc.DocumentElement.SelectSingleNode("/configuration/bindAddress"); - node.InnerText = bindIP; - node = doc.DocumentElement.SelectSingleNode("/configuration/port"); - node.InnerText = port; - node = doc.DocumentElement.SelectSingleNode("/configuration/allowedAccesMode"); - node.InnerText = accesMode.ToString(); - node = doc.DocumentElement.SelectSingleNode("/configuration/physicalPath"); - node.InnerText = System.AppDomain.CurrentDomain.BaseDirectory + @"wwwroot\"; + XmlNode node = doc.DocumentElement.SelectSingleNode("/configuration/bindAddress"); + node.InnerText = bindIP; + node = doc.DocumentElement.SelectSingleNode("/configuration/port"); + node.InnerText = port.ToString(); + node = doc.DocumentElement.SelectSingleNode("/configuration/allowedAccesMode"); + node.InnerText = accesMode.ToString(); + node = doc.DocumentElement.SelectSingleNode("/configuration/physicalPath"); + node.InnerText = System.AppDomain.CurrentDomain.BaseDirectory + @"wwwroot\"; - doc.Save(file); + doc.Save(configFile); + } + catch (Exception ex) + { + MessageBox.Show("An error occurred when trying to save the settings." + Environment.NewLine + Environment.NewLine + ex.ToString(), "Error when saving settings", MessageBoxButtons.OK, MessageBoxIcon.Error); + return false; + } + + return true; } + /// <summary> + /// save configuration changes and reload configuration for server + /// </summary> + /// <param name="sender"></param> + /// <param name="e"></param> private void saveButton_Click(object sender, EventArgs e) { - port = portBox.Text; + //data validation + if (!int.TryParse(portBox.Text,out port)) + { + MessageBox.Show("The port number must be numerical only.", "Invalid port number", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); + return; + } + + System.Net.IPAddress bindIPAddress; + if (!System.Net.IPAddress.TryParse(bindIPBox.Text, out bindIPAddress)) + { + MessageBox.Show("The bind IP address is not valid. It must be in the form of xxx.xxx.xxx.xxx, where x is a number.", "Invalid bind IP address", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); + return; + } + + //port = portBox.Text; //already set if valid from TryParse bindIP = bindIPBox.Text; accesMode = accessModeDropDown.SelectedIndex; SaveSettings(); @@ -182,10 +270,14 @@ { MessageBox.Show("Error setting the new configuration."); } - linkLabel2.Text = ConstructServerURL(); + LLblMPWServerURL.Text = ConstructServerURL(); } - //Restore by double-clicking the tray icon + /// <summary> + /// Restore by double-clicking the tray icon + /// </summary> + /// <param name="sender"></param> + /// <param name="e"></param> private void trayIcon_MouseDoubleClick(object sender, MouseEventArgs e) { this.WindowState = System.Windows.Forms.FormWindowState.Normal; @@ -194,52 +286,110 @@ RefreshControllers(); } - //Minimize to tray on closing + /// <summary> + /// Minimize to tray on closing + /// </summary> + /// <param name="sender"></param> + /// <param name="e"></param> private void Control_Center_App_FormClosing(object sender, FormClosingEventArgs e) { - e.Cancel = true; - this.WindowState = System.Windows.Forms.FormWindowState.Minimized; - this.ShowInTaskbar = false; + if (!exitRequested) + { + e.Cancel = true; + this.WindowState = System.Windows.Forms.FormWindowState.Minimized; + this.ShowInTaskbar = false; + } } - //Tray menu action "Exit" + /// <summary> + /// Tray menu action "Exit" + /// </summary> + /// <param name="sender"></param> + /// <param name="e"></param> private void exitToolStripMenuItem_Click(object sender, EventArgs e) { - trayIcon.Dispose(); - this.Dispose(); + exitRequested = true; + this.Close(); } - //Tray menu action "Stop" + /// <summary> + /// Tray menu action "Stop" + /// </summary> + /// <param name="sender"></param> + /// <param name="e"></param> private void stopToolStripMenuItem_Click(object sender, EventArgs e) { Start(); } - //Tray menu action "Start" + /// <summary> + /// Tray menu action "Start" + /// </summary> + /// <param name="sender"></param> + /// <param name="e"></param> private void trayStart_Click(object sender, EventArgs e) { Stop(); } - //Status refreh button - private void button1_Click(object sender, EventArgs e) + /// <summary> + /// Status refresh button + /// </summary> + /// <param name="sender"></param> + /// <param name="e"></param> + private void CmdRefreshStatusInfo_Click(object sender, EventArgs e) { RefreshControllers(); } - //Minimize to tray on minimize + /// <summary> + /// Minimize to tray on minimize + /// </summary> + /// <param name="sender"></param> + /// <param name="e"></param> private void Control_Center_App_Resize(object sender, EventArgs e) { if (this.WindowState == FormWindowState.Minimized) this.ShowInTaskbar = false; } - //Update the Service status + /// <summary> + /// Update the Service status + /// </summary> + /// <param name="sender"></param> + /// <param name="e"></param> private void refreshTimer_Tick(object sender, EventArgs e) { if (this.WindowState != System.Windows.Forms.FormWindowState.Minimized) RefreshControllers(); } + /// <summary> + /// Open Windows Event Viewer for user to browse logs + /// </summary> + /// <param name="sender"></param> + /// <param name="e"></param> + private void CmdOpenEventViewer_Click(object sender, EventArgs e) + { + string fileName = System.IO.Path.Combine(Environment.SystemDirectory, "eventvwr.msc"); + System.Diagnostics.Process.Start(fileName); + } + + /// <summary> + /// Open access log in text editor + /// </summary> + /// <param name="sender"></param> + /// <param name="e"></param> + private void CmdOpenAccessLog_Click(object sender, EventArgs e) + { + string fileName; + fileName = System.IO.Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory, "access.log"); + + if (System.IO.File.Exists(fileName)) + System.Diagnostics.Process.Start(fileName); + else + MessageBox.Show("No access log file cound be found, most likely because no attempts of accessing MPW have been made.", "Access log not found", MessageBoxButtons.OK, MessageBoxIcon.Information); + + } } } \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mis...@us...> - 2007-03-09 22:37:32
|
Revision: 34 http://svn.sourceforge.net/mp-webinterface/?rev=34&view=rev Author: misterd_sf Date: 2007-03-09 14:37:29 -0800 (Fri, 09 Mar 2007) Log Message: ----------- Commented WebServer and windows service Modified Paths: -------------- trunk/Version2/WebServer/ByteParser.cs trunk/Version2/WebServer/ByteString.cs trunk/Version2/WebServer/Connection.cs trunk/Version2/WebServer/Host.cs trunk/Version2/WebServer/Messages.cs trunk/Version2/WebServer/Request.cs trunk/Version2/WebServer/Server.cs trunk/Version2/WebServer/ServerConfiguration.cs trunk/Version2/WebServer/WebServer.csproj trunk/Version2/WindowsService/DebugServiceControlForm.Designer.cs trunk/Version2/WindowsService/DebugServiceControlForm.cs trunk/Version2/WindowsService/Program.cs trunk/Version2/WindowsService/ProjectInstaller.Designer.cs trunk/Version2/WindowsService/ProjectInstaller.cs trunk/Version2/WindowsService/Service.Designer.cs trunk/Version2/WindowsService/Service.cs trunk/Version2/WindowsService/WindowsService.csproj Modified: trunk/Version2/WebServer/ByteParser.cs =================================================================== --- trunk/Version2/WebServer/ByteParser.cs 2007-03-09 17:45:37 UTC (rev 33) +++ trunk/Version2/WebServer/ByteParser.cs 2007-03-09 22:37:29 UTC (rev 34) @@ -11,15 +11,31 @@ using System.Text; namespace MPW.WebServer { - + /// <summary> + /// Internal class for byte parsing + /// </summary> internal class ByteParser { #region variables + /// <summary> + /// Bytes + /// </summary> private byte[] _bytes; + /// <summary> + /// Position + /// </summary> private int _pos; + /// <summary> + /// Server + /// </summary> private Server _server; #endregion #region ctor + /// <summary> + /// Constructor + /// </summary> + /// <param name="bytes">Bytes to parse</param> + /// <param name="server">Server object</param> internal ByteParser(byte[] bytes, Server server) { _bytes = bytes; _pos = 0; @@ -28,6 +44,9 @@ #endregion #region properties + /// <summary> + /// Gets the current offset + /// </summary> internal int CurrentOffset { get { @@ -37,6 +56,10 @@ #endregion #region internal methods + /// <summary> + /// Read a line from the byte array + /// </summary> + /// <returns>Byte string</returns> internal ByteString ReadLine() { ByteString line = null; Modified: trunk/Version2/WebServer/ByteString.cs =================================================================== --- trunk/Version2/WebServer/ByteString.cs 2007-03-09 17:45:37 UTC (rev 33) +++ trunk/Version2/WebServer/ByteString.cs 2007-03-09 22:37:29 UTC (rev 34) @@ -11,15 +11,32 @@ using System.Text; namespace MPW.WebServer { - + /// <summary> + /// Internal class for a byte string + /// </summary> internal class ByteString { #region variables + /// <summary> + /// Bytes + /// </summary> private byte[] _bytes; + /// <summary> + /// Offset + /// </summary> private int _offset; + /// <summary> + /// Length + /// </summary> private int _length; #endregion #region ctor + /// <summary> + /// Constructor + /// </summary> + /// <param name="bytes">Bytes</param> + /// <param name="offset">Offset</param> + /// <param name="length">Length</param> public ByteString(byte[] bytes, int offset, int length) { _bytes = bytes; _offset = offset; @@ -28,30 +45,47 @@ #endregion #region properties + /// <summary> + /// Gets the bytes of the bytestring + /// </summary> public byte[] Bytes { get { return _bytes; } } + /// <summary> + /// Is Byte string empty? + /// </summary> public bool IsEmpty { get { return (_bytes == null || _length == 0); } } + /// <summary> + /// Length of the byte string + /// </summary> public int Length { get { return _length; } } - + + /// <summary> + /// Gets the offset of the byte string + /// </summary> public int Offset { get { return _offset; } } + /// <summary> + /// Gets a single byte of the byte string + /// </summary> + /// <param name="index">Index of the byte</param> + /// <returns>Single byte of the byte string</returns> public byte this[int index] { get { return _bytes[_offset+index]; @@ -60,10 +94,19 @@ #endregion #region public methods + /// <summary> + /// Returns the String of the byte string + /// </summary> + /// <returns>String of the byte string (UTF-8 encoding)</returns> public String GetString() { return GetString(Encoding.UTF8); } + /// <summary> + /// Returns the String of the byte string in the given encoding + /// </summary> + /// <param name="enc">Encoding of the String</param> + /// <returns>String of the byte string in the given encoding</returns> public String GetString(Encoding enc) { if (IsEmpty) { return String.Empty; @@ -71,6 +114,10 @@ return enc.GetString(_bytes, _offset, _length); } + /// <summary> + /// Returns a copy of the byte array + /// </summary> + /// <returns>Byte array copy</returns> public byte[] GetBytes() { byte[] bytes = new byte[_length]; if (_length > 0) { @@ -79,10 +126,21 @@ return bytes; } + /// <summary> + /// Index of a single character + /// </summary> + /// <param name="ch">Character</param> + /// <returns>Index of the character</returns> public int IndexOf(char ch) { return IndexOf(ch, 0); } + /// <summary> + /// Index of a single character + /// </summary> + /// <param name="ch">Character</param> + /// <param name="offset">Offset</param> + /// <returns>Index of the character</returns> public int IndexOf(char ch, int offset) { for (int i = offset; i < _length; i++) { if (this[i] == (byte)ch) { @@ -93,14 +151,30 @@ return -1; } + /// <summary> + /// Returns a sub(byte)string + /// </summary> + /// <param name="offset">Offset</param> + /// <returns>Sub(byte)string</returns> public ByteString Substring(int offset) { return Substring(offset, _length-offset); } + /// <summary> + /// Returns a sub(byte)string + /// </summary> + /// <param name="offset">Offset</param> + /// <param name="len">Length</param> + /// <returns>Sub(byte)string</returns> public ByteString Substring(int offset, int len) { return new ByteString(_bytes, _offset+offset, len); } + /// <summary> + /// Splits the byte string + /// </summary> + /// <param name="sep">Seperator character</param> + /// <returns>Array of the byte string</returns> public ByteString[] Split(char sep) { ArrayList list = new ArrayList(); Modified: trunk/Version2/WebServer/Connection.cs =================================================================== --- trunk/Version2/WebServer/Connection.cs 2007-03-09 17:45:37 UTC (rev 33) +++ trunk/Version2/WebServer/Connection.cs 2007-03-09 22:37:29 UTC (rev 34) @@ -20,16 +20,36 @@ using System.Web.Hosting; namespace MPW.WebServer { - + /// <summary> + /// Connection class, that handles all socket related operations + /// </summary> internal class Connection : MarshalByRefObject { #region variables + /// <summary> + /// Web Server + /// </summary> private Server _server; + /// <summary> + /// Socket connection to client + /// </summary> private Socket _socket; + /// <summary> + /// Server configuration + /// </summary> private ServerConfiguration _configuration; + /// <summary> + /// ContentType mapping + /// </summary> private Dictionary<String, String> _contentTypes; #endregion #region ctor + /// <summary> + /// Constructor + /// </summary> + /// <param name="server">Web Server</param> + /// <param name="socket">Socket connection to client</param> + /// <param name="configuration">Server Configuration</param> internal Connection(Server server, Socket socket, ServerConfiguration configuration) { _server = server; _socket = socket; @@ -39,6 +59,10 @@ #endregion #region overrides + /// <summary> + /// Init the lifetime service + /// </summary> + /// <returns></returns> public override object InitializeLifetimeService() { // never expire the license return null; @@ -46,12 +70,21 @@ #endregion #region properties + /// <summary> + /// Status of the socket connection + /// </summary> internal bool Connected { get { - return _socket.Connected; + if (_socket != null) { + return _socket.Connected; + } + return false; } } + /// <summary> + /// Is local connection? + /// </summary> internal bool IsLocal { get { string remoteIP = RemoteIP; @@ -64,6 +97,9 @@ } } + /// <summary> + /// Returns the local IP + /// </summary> internal string LocalIP { get { IPEndPoint endPoint = (IPEndPoint)_socket.LocalEndPoint; @@ -75,6 +111,9 @@ } } + /// <summary> + /// Returns the remote ip + /// </summary> internal string RemoteIP { get { IPEndPoint endPoint = (IPEndPoint)_socket.RemoteEndPoint; @@ -93,21 +132,14 @@ #endregion #region private static methods - private bool CheckLocalServerIP(string remoteIP) { - try { - IPHostEntry hostEntry = Dns.GetHostEntry(Environment.MachineName); - IPAddress localAddress; - for (int i = 0; i < hostEntry.AddressList.Length; i++) { - localAddress = hostEntry.AddressList[i]; - if (remoteIP.Equals(localAddress.ToString())) { - return true; - } - } - } catch (Exception e) { - _server.WriteErrorToLog("Error while checking Server IP.\n", e); - } - return false; - } + /// <summary> + /// Generates the response http header + /// </summary> + /// <param name="statusCode">State headers</param> + /// <param name="moreHeaders">Additional Headers</param> + /// <param name="contentLength">Length of the content</param> + /// <param name="keepAlive">Keep the connection alive</param> + /// <returns>Response header</returns> private static String MakeResponseHeaders(int statusCode, String moreHeaders, int contentLength, bool keepAlive) { StringBuilder sb = new StringBuilder(); @@ -127,6 +159,32 @@ #endregion #region private methods + /// <summary> + /// Checks if the remote IP is a local server IP + /// </summary> + /// <param name="remoteIP">Remote IP</param> + /// <returns>true, if the remote ip is a local server IP; false otherwise</returns> + private bool CheckLocalServerIP(string remoteIP) { + try { + IPHostEntry hostEntry = Dns.GetHostEntry(Environment.MachineName); + IPAddress localAddress; + for (int i = 0; i < hostEntry.AddressList.Length; i++) { + localAddress = hostEntry.AddressList[i]; + if (remoteIP.Equals(localAddress.ToString())) { + return true; + } + } + } catch (Exception e) { + _server.WriteErrorToLog("Error while checking Server IP.\n", e); + } + return false; + } + + /// <summary> + /// Generates the content type header + /// </summary> + /// <param name="fileName">FileName</param> + /// <returns>Content type header</returns> private String MakeContentTypeHeader(String fileName) { Debug.Assert(File.Exists(fileName)); @@ -138,6 +196,12 @@ return null; } + /// <summary> + /// Generates the error response body + /// </summary> + /// <param name="statusCode">Status code of the error</param> + /// <param name="message">Error message</param> + /// <returns>Body of the error response</returns> private string GetErrorResponseBody(int statusCode, string message) { string body = Messages.FormatErrorMessageBody(statusCode, _server.VirtualPath); if (message != null && message.Length > 0) { @@ -148,6 +212,9 @@ #endregion #region internal methods + /// <summary> + /// Close the socket connection + /// </summary> internal void Close() { try { if (_socket != null) { @@ -161,6 +228,11 @@ } } + /// <summary> + /// Reads the request bytes + /// </summary> + /// <param name="maxBytes">Maximum bytes</param> + /// <returns>Request bytes</returns> internal byte[] ReadRequestBytes(int maxBytes) { try { if (WaitForRequestBytes() == 0) { @@ -195,10 +267,19 @@ } } + /// <summary> + /// Writes 100 error response + /// </summary> internal void Write100Continue() { WriteEntireResponseFromString(100, null, null, true); } + /// <summary> + /// Writes Body of the response + /// </summary> + /// <param name="data">Data to send</param> + /// <param name="offset">Offset in the byte array</param> + /// <param name="length">Length to send</param> internal void WriteBody(byte[] data, int offset, int length) { try { _socket.Send(data, offset, length, SocketFlags.None); @@ -207,6 +288,13 @@ } } + /// <summary> + /// Writes Response from String + /// </summary> + /// <param name="statusCode">Status code of the response</param> + /// <param name="extraHeaders">Additional headers</param> + /// <param name="body">Body</param> + /// <param name="keepAlive">Keep the connection alive?</param> internal void WriteEntireResponseFromString(int statusCode, String extraHeaders, String body, bool keepAlive) { try { int bodyLength = (body != null) ? Encoding.UTF8.GetByteCount(body) : 0; @@ -223,6 +311,11 @@ } } + /// <summary> + /// Writes Response from file + /// </summary> + /// <param name="fileName">Filename of the response</param> + /// <param name="keepAlive">Keep the connection alive?</param> internal void WriteEntireResponseFromFile(String fileName, bool keepAlive) { if (!File.Exists(fileName)) { WriteErrorAndClose(404); @@ -264,18 +357,36 @@ } } + /// <summary> + /// Writes the error response and close connection + /// </summary> + /// <param name="statusCode">Status code</param> + /// <param name="message">Error message</param> internal void WriteErrorAndClose(int statusCode, string message) { WriteEntireResponseFromString(statusCode, null, GetErrorResponseBody(statusCode, message), false); } + /// <summary> + /// Writes the error response and close connection + /// </summary> + /// <param name="statusCode">Status code</param> internal void WriteErrorAndClose(int statusCode) { WriteErrorAndClose(statusCode, null); } + /// <summary> + /// Writes error message with additional headers + /// </summary> + /// <param name="statusCode">Status code</param> + /// <param name="extraHeaders">Additional headers</param> internal void WriteErrorWithExtraHeadersAndKeepAlive(int statusCode, string extraHeaders) { WriteEntireResponseFromString(statusCode, extraHeaders, GetErrorResponseBody(statusCode, null), true); } - + + /// <summary> + /// Wait for request bytes + /// </summary> + /// <returns>Available bytes</returns> internal int WaitForRequestBytes() { int availBytes = 0; @@ -296,6 +407,11 @@ return availBytes; } + /// <summary> + /// Writes all headers + /// </summary> + /// <param name="statusCode">Status code</param> + /// <param name="extraHeaders">Additional headers</param> internal void WriteHeaders(int statusCode, String extraHeaders) { string headers = MakeResponseHeaders(statusCode, extraHeaders, -1, false); Modified: trunk/Version2/WebServer/Host.cs =================================================================== --- trunk/Version2/WebServer/Host.cs 2007-03-09 17:45:37 UTC (rev 33) +++ trunk/Version2/WebServer/Host.cs 2007-03-09 22:37:29 UTC (rev 34) @@ -23,27 +23,62 @@ using log4net; namespace MPW.WebServer { - + /// <summary> + /// Hosting environment of the web server + /// </summary> internal class Host : MarshalByRefObject, IRegisteredObject { #region variables + /// <summary> + /// Server + /// </summary> private Server _server; + + /// <summary> + /// Server configuration + /// </summary> private ServerConfiguration _configuration; + /// <summary> + /// Pending calls + /// </summary> private volatile int _pendingCallsCount; + + /// <summary> + /// Virtual path (lower case) + /// </summary> private string _lowerCasedVirtualPath; + + /// <summary> + /// Virtaul path with trailing slash (lower case) + /// </summary> private string _lowerCasedVirtualPathWithTrailingSlash; + + /// <summary> + /// Physical Client script path + /// </summary> private string _physicalClientScriptPath; + + /// <summary> + /// Client script path with trailing slash (lower case) + /// </summary> private string _lowerCasedClientScriptPathWithTrailingSlash; #endregion #region ctor + /// <summary> + /// Constructor and register this object as hosting environment + /// </summary> public Host() { HostingEnvironment.RegisterObject(this); } #endregion #region overrides + /// <summary> + /// Never expire the license + /// </summary> + /// <returns></returns> public override object InitializeLifetimeService() { // never expire the license return null; @@ -51,6 +86,11 @@ #endregion #region public methods + /// <summary> + /// Configure the hosting environment + /// </summary> + /// <param name="server">Server</param> + /// <param name="configuration">Server configuration</param> public void Configure(Server server, ServerConfiguration configuration) { _server = server; _configuration = configuration; @@ -62,6 +102,10 @@ _lowerCasedClientScriptPathWithTrailingSlash = CultureInfo.InvariantCulture.TextInfo.ToLower(HttpRuntime.AspClientScriptVirtualPath + "/"); } + /// <summary> + /// Process request + /// </summary> + /// <param name="conn">Connection of the request</param> public void ProcessRequest(Connection conn) { // Add a pending call to make sure our thread doesn't get killed AddPendingCall(); @@ -76,15 +120,29 @@ } } + /// <summary> + /// Shutdown the hosting environment + /// </summary> public void Shutdown() { HostingEnvironment.InitiateShutdown(); } + /// <summary> + /// Is virtual path in application path + /// </summary> + /// <param name="path">Virtual path</param> + /// <returns>true, if in virutal path; false otherwise</returns> public bool IsVirtualPathInApp(String path) { bool isClientScriptPath; return IsVirtualPathInApp(path, out isClientScriptPath); } + /// <summary> + /// Is virtual path in application path + /// </summary> + /// <param name="path">Virtual path</param> + /// <param name="isClientScriptPath">Output, if is client script path</param> + /// <returns>true, if in virutal path; false otherwise</returns> public bool IsVirtualPathInApp(String path, out bool isClientScriptPath) { isClientScriptPath = false; @@ -116,6 +174,11 @@ return false; } + /// <summary> + /// Is virtual path a application path + /// </summary> + /// <param name="path">Virtual path</param> + /// <returns>true, if a application path; false otherwise</returns> public bool IsVirtualPathAppPath(String path) { if (path == null) { return false; @@ -128,6 +191,9 @@ #endregion #region private methods + /// <summary> + /// Wait for pending calls to finish + /// </summary> private void WaitForPendingCallsToFinish() { for (; ; ) { if (_pendingCallsCount <= 0) @@ -137,18 +203,28 @@ } } + /// <summary> + /// Adds a pending call + /// </summary> private void AddPendingCall() { #pragma warning disable 0420 Interlocked.Increment(ref _pendingCallsCount); #pragma warning restore 0420 } + /// <summary> + /// Removes a pending call + /// </summary> private void RemovePendingCall() { #pragma warning disable 0420 Interlocked.Decrement(ref _pendingCallsCount); #pragma warning restore 0420 } + /// <summary> + /// Stop hosting envieronment + /// </summary> + /// <param name="immediate">Stop immediately</param> void IRegisteredObject.Stop(bool immediate) { // Unhook the Host so Server will process the requests in the new appdomain. if (_server != null) { @@ -163,36 +239,54 @@ #endregion #region properties + /// <summary> + /// Gets the normalized client script path + /// </summary> public string NormalizedClientScriptPath { get { return _lowerCasedClientScriptPathWithTrailingSlash; } } + /// <summary> + /// Gets the normalized virtual path + /// </summary> public string NormalizedVirtualPath { get { return _lowerCasedVirtualPathWithTrailingSlash; } } + /// <summary> + /// Gets the physical client script path + /// </summary> public string PhysicalClientScriptPath { get { return _physicalClientScriptPath; } } + /// <summary> + /// Gets the physical path + /// </summary> public string PhysicalPath { get { return _configuration.PhysicalPath; } } + /// <summary> + /// Gets the configuration port + /// </summary> public int Port { get { return _configuration.Port; } } + /// <summary> + /// Gets the virtual path + /// </summary> public string VirtualPath { get { return _configuration.VirtualPath; Modified: trunk/Version2/WebServer/Messages.cs =================================================================== --- trunk/Version2/WebServer/Messages.cs 2007-03-09 17:45:37 UTC (rev 33) +++ trunk/Version2/WebServer/Messages.cs 2007-03-09 22:37:29 UTC (rev 34) @@ -16,19 +16,32 @@ namespace MPW.WebServer { - // - // Internal class provides helpers for string formatting of HTTP responses - // + /// <summary> + /// Internal class provides helpers for string formatting of HTTP responses + /// </summary> internal static class Messages { #region variables and constants + /// <summary> + /// HTTP Error format 1 + /// </summary> private const String _httpErrorFormat1 = @"<html> <head> <title>{0}</title> "; + /// <summary> + /// Version String + /// </summary> + public static String VersionString = typeof(Server).Assembly.GetName().Version.ToString(); - public static String VersionString = typeof(Server).Assembly.GetName().Version.ToString(); + /// <summary> + /// Server name + /// </summary> public static String ServerName = typeof(Server).Assembly.GetName().Name; + + /// <summary> + /// HTTP style + /// </summary> private const String _httpStyle = @" <style> body {font-family:""Verdana"";font-weight:normal;font-size: 8pt;color:black;} @@ -43,7 +56,9 @@ .expandable { text-decoration:underline; font-weight:bold; color:navy; cursor:hand; } </style> "; - + /// <summary> + /// HTTP Error format 2 + /// </summary> private static String _httpErrorFormat2 = @" </head> <body bgcolor=""white""> @@ -61,13 +76,18 @@ </body> </html> "; - + /// <summary> + /// Directory listing format 1 + /// </summary> private const String _dirListingFormat1 = @"<html> <head> <title>Directory Listing -- {0}</title> "; + /// <summary> + /// Directory listing format 2 + /// </summary> private const String _dirListingFormat2 = @" </head> <body bgcolor=""white""> @@ -79,6 +99,9 @@ <PRE> "; + /// <summary> + /// Directory listing tail + /// </summary> private static String _dirListingTail = @"</PRE> <hr width=100% size=1 color=silver> @@ -91,15 +114,24 @@ </html> "; + /// <summary> + /// Directory listing parent format + /// </summary> private const String _dirListingParentFormat = @"<A href=""{0}"">[To Parent Directory]</A> "; + /// <summary> + /// Directory listing file format + /// </summary> private const String _dirListingFileFormat = @"{0,38:dddd, MMMM dd, yyyy hh:mm tt} {1,12:n0} <A href=""{2}"">{3}</A> "; + /// <summary> + /// Directory listing directory format + /// </summary> private const String _dirListingDirFormat = @"{0,38:dddd, MMMM dd, yyyy hh:mm tt} <dir> <A href=""{1}/"">{2}</A> "; @@ -107,6 +139,12 @@ #endregion #region public static methods + /// <summary> + /// Formats a body of an error message + /// </summary> + /// <param name="statusCode">Status code</param> + /// <param name="appName">Application name</param> + /// <returns>Formated response body of an error message</returns> public static String FormatErrorMessageBody(int statusCode, String appName) { String desc = HttpWorkerRequest.GetStatusDescription(statusCode); @@ -115,6 +153,13 @@ + String.Format(_httpErrorFormat2, appName, statusCode, desc); } + /// <summary> + /// Formats a body for a directory listing + /// </summary> + /// <param name="dirPath">Path of the directory</param> + /// <param name="parentPath">Parent Path</param> + /// <param name="elements">Elements of the directory</param> + /// <returns></returns> public static String FormatDirectoryListing(String dirPath, String parentPath, FileSystemInfo[] elements) { StringBuilder sb = new StringBuilder(); Modified: trunk/Version2/WebServer/Request.cs =================================================================== --- trunk/Version2/WebServer/Request.cs 2007-03-09 17:45:37 UTC (rev 33) +++ trunk/Version2/WebServer/Request.cs 2007-03-09 22:37:29 UTC (rev 34) @@ -26,12 +26,25 @@ namespace MPW.WebServer { - + /// <summary> + /// Request representation. Handles the request + /// Based on the SimpleWorkerRequest of .NET Framework + /// </summary> internal class Request : SimpleWorkerRequest { #region variables + /// <summary> + /// All bad Path characters + /// </summary> private static char[] badPathChars = new char[] { '%', '>', '<', ':', '\\' }; + + /// <summary> + /// List of default documents + /// </summary> private List<String> _defaultDocuments; + /// <summary> + /// Array of all restricted directory + /// </summary> private static string[] restrictedDirs = new string[] { "/bin", "/app_browsers", @@ -40,62 +53,190 @@ "/app_localresources", "/app_globalresources", "/app_webreferences" }; + + /// <summary> + /// Maximum chunk length + /// </summary> private const int MaxChunkLength = 64 * 1024; + /// <summary> + /// Web server + /// </summary> private Server _server; + + /// <summary> + /// Corresponding host environment + /// </summary> private Host _host; + + /// <summary> + /// Corresponding connection + /// </summary> private Connection _connection; + + /// <summary> + /// Corresponding configuration + /// </summary> private ServerConfiguration _configuration; - // security permission to Assert remoting calls to _connection + /// <summary> + /// security permission to Assert remoting calls to _connection + /// </summary> private IStackWalk _connectionPermission = new PermissionSet(PermissionState.Unrestricted); - // raw request data + /// <summary> + /// raw request data + /// </summary> private const int maxHeaderBytes = 32 * 1024; + + /// <summary> + /// Header bytes + /// </summary> private byte[] _headerBytes; + + /// <summary> + /// Start header offset + /// </summary> private int _startHeadersOffset; + + /// <summary> + /// End header offset + /// </summary> private int _endHeadersOffset; + + /// <summary> + /// Header byte string + /// </summary> private ArrayList _headerByteStrings; - // parsed request data - + /// <summary> + /// Is client script path + /// </summary> private bool _isClientScriptPath; + /// <summary> + /// HTTP method + /// </summary> private string _verb; + + /// <summary> + /// URL + /// </summary> private string _url; + + /// <summary> + /// Protocol + /// </summary> private string _prot; + /// <summary> + /// Path + /// </summary> private string _path; + + /// <summary> + /// File path + /// </summary> private string _filePath; + + /// <summary> + /// Path information + /// </summary> private string _pathInfo; + + /// <summary> + /// Translated Path + /// </summary> private string _pathTranslated; + + /// <summary> + /// Query string + /// </summary> private string _queryString; + + /// <summary> + /// Query string in byte array + /// </summary> private byte[] _queryStringBytes; + /// <summary> + /// Length of content + /// </summary> private int _contentLength; + + /// <summary> + /// Length of content preload + /// </summary> private int _preloadedContentLength; + + /// <summary> + /// Content preload + /// </summary> private byte[] _preloadedContent; + /// <summary> + /// All headers in raw format + /// </summary> private string _allRawHeaders; + + /// <summary> + /// Unknown request headers + /// </summary> private string[][] _unknownRequestHeaders; + + /// <summary> + /// Known request headers + /// </summary> private string[] _knownRequestHeaders; + + /// <summary> + /// + /// </summary> private bool _specialCaseStaticFileHeaders; - // cached response + /// <summary> + /// Indicates, if header is sent + /// </summary> private bool _headersSent; + + /// <summary> + /// Status of the response + /// </summary> private int _responseStatus; + + /// <summary> + /// Response headers + /// </summary> private StringBuilder _responseHeadersBuilder; + + /// <summary> + /// Reponse Body bytes + /// </summary> private ArrayList _responseBodyBytes; + + /// <summary> + /// Remote IP + /// </summary> private String remoteIP; #endregion #region static variables + /// <summary> + /// Int to hex character array + /// </summary> private static char[] IntToHex = new char[16] { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' }; #endregion #region ctor + /// <summary> + /// Constructor + /// </summary> + /// <param name="server">Server</param> + /// <param name="host">Host</param> + /// <param name="connection">Connection</param> + /// <param name="configuration">Server configuration</param> public Request(Server server, Host host, Connection connection,ServerConfiguration configuration) : base(String.Empty, String.Empty, null) { _server = server; @@ -107,6 +248,9 @@ #endregion #region public methods + /// <summary> + /// Process the request + /// </summary> public void Process() { // read the request if (!TryParseRequest()) { @@ -144,7 +288,13 @@ HttpRuntime.ProcessRequest(this); _server.writeInfoAccessLog("Response send by HttpRuntime request for request from: " + remoteIP + " for " + this._path); } + #endregion + #region private methods + /// <summary> + /// Checks for all secuirty options. If access is denied than an error will be sent + /// </summary> + /// <returns>true, if request is allowed; false otherwise</returns> private bool checkSecurity() { if (_configuration.AllowedAccessMode != AccessMode.Global) { if (_configuration.AllowedAccessMode == AccessMode.Local) { @@ -165,7 +315,7 @@ } } if (!ipFound) { - _connection.WriteErrorAndClose(403); + _connection.WriteErrorAndClose(403); _server.writeErrorAccessLog("Send error 403 (Acces Denied by configuration) for request from: " + remoteIP + " for " + this._path); return false; } @@ -192,9 +342,13 @@ } return true; } - #endregion - - #region private methods + + /// <summary> + /// Sends a response from a file stream + /// </summary> + /// <param name="f">Filestream</param> + /// <param name="offset">Offset</param> + /// <param name="length">Length</param> private void SendResponseFromFileStream(FileStream f, long offset, long length) { long fileSize = f.Length; @@ -233,6 +387,9 @@ } } + /// <summary> + /// Reset the request + /// </summary> private void Reset() { _headerBytes = null; _startHeadersOffset = 0; @@ -262,6 +419,10 @@ _specialCaseStaticFileHeaders = false; } + /// <summary> + /// Tries to parse the request. If request couldn't be parsed than an error will be sent + /// </summary> + /// <returns>true, if request can be parsed;false otherwise</returns> private bool TryParseRequest() { Reset(); @@ -302,6 +463,10 @@ return true; } + /// <summary> + /// Tries to read all headers from the request + /// </summary> + /// <returns>true, if everything can be parsed; false otherwise</returns> private bool TryReadAllHeaders() { // read the first packet (up to 32K) byte[] headerBytes = _connection.ReadRequestBytes(maxHeaderBytes); @@ -353,6 +518,9 @@ return true; } + /// <summary> + /// Reads all request headers + /// </summary> private void ReadAllHeaders() { _headerBytes = null; @@ -365,6 +533,9 @@ while (_endHeadersOffset < 0); // found \r\n\r\n } + /// <summary> + /// Parse a request line + /// </summary> private void ParseRequestLine() { ByteString requestLine = (ByteString)_headerByteStrings[0]; ByteString[] elems = requestLine.Split(' '); @@ -433,6 +604,10 @@ _pathTranslated = MapPath(_filePath); } + /// <summary> + /// Checks if the path is not allowed + /// </summary> + /// <returns>true, if it is a bad path; false otherwise</returns> private bool IsBadPath() { if (_path.IndexOfAny(badPathChars) >= 0) { return true; @@ -449,6 +624,9 @@ return false; } + /// <summary> + /// Parse the request headers + /// </summary> private void ParseHeaders() { _knownRequestHeaders = new string[RequestHeaderMaximum]; @@ -496,6 +674,9 @@ } } + /// <summary> + /// Parse posted content in the request + /// </summary> private void ParsePostedContent() { _contentLength = 0; _preloadedContentLength = 0; @@ -522,6 +703,9 @@ } } + /// <summary> + /// Skips all posted content + /// </summary> private void SkipAllPostedContent() { if (_contentLength > 0 && _preloadedContentLength < _contentLength) { int bytesRemaining = (_contentLength - _preloadedContentLength); @@ -536,6 +720,10 @@ } } + /// <summary> + /// Checks if this is a request for a restricted directory + /// </summary> + /// <returns>true, if it is a request for a restricted directory; false otherwise</returns> private bool IsRequestForRestrictedDirectory() { String p = CultureInfo.InvariantCulture.TextInfo.ToLower(_path); @@ -554,6 +742,10 @@ return false; } + /// <summary> + /// Process a directory listing request + /// </summary> + /// <returns>true, if request could be handled; false otherwise</returns> private bool ProcessDirectoryListingRequest() { if (_verb != "GET") { return false; @@ -626,6 +818,9 @@ return true; } + /// <summary> + /// Prepares the response + /// </summary> private void PrepareResponse() { _headersSent = false; _responseStatus = 200; @@ -636,6 +831,11 @@ #endregion #region private static methods + /// <summary> + /// Encodes a url redirect + /// </summary> + /// <param name="path">Path</param> + /// <returns>encoded url redirect</returns> private string UrlEncodeRedirect(string path) { // this method mimics the logic in HttpResponse.Redirect (which relies on internal methods) try { @@ -682,6 +882,10 @@ #endregion #region Implementation of HttpWorkerRequest + /// <summary> + /// Flushs the response + /// </summary> + /// <param name="finalFlush">Do a final flush? (Close connection)</param> public override void FlushResponse(bool finalFlush) { _connectionPermission.Assert(); @@ -702,6 +906,9 @@ } } + /// <summary> + /// Handles end of request + /// </summary> public override void EndOfRequest() { Connection conn = _connection; @@ -710,44 +917,85 @@ _connection = null; } } + + /// <summary> + /// Gets uri path + /// </summary> + /// <returns>Uri path</returns> public override string GetUriPath() { return _path; } + /// <summary> + /// Gets query string + /// </summary> + /// <returns>Query string</returns> public override string GetQueryString() { return _queryString; } + /// <summary> + /// Gets query string as raw bytes + /// </summary> + /// <returns>query string as raw bytes</returns> public override byte[] GetQueryStringRawBytes() { return _queryStringBytes; } + /// <summary> + /// Gets raw url + /// </summary> + /// <returns>Raw url</returns> public override string GetRawUrl() { return _url; } + /// <summary> + /// Gets http method + /// </summary> + /// <returns>Http method</returns> public override string GetHttpVerbName() { return _verb; } + /// <summary> + /// Gets http protocol + /// </summary> + /// <returns>Http protocol</returns> public override string GetHttpVersion() { return _prot; } + /// <summary> + /// Gets remote IP/address + /// </summary> + /// <returns>Remote IP/address</returns> public override string GetRemoteAddress() { _connectionPermission.Assert(); return _connection.RemoteIP; } + /// <summary> + /// Gets remote port + /// </summary> + /// <returns>Remote port</returns> public override int GetRemotePort() { return 0; } + /// <summary> + /// Gets local address + /// </summary> + /// <returns>Local address</returns> public override string GetLocalAddress() { _connectionPermission.Assert(); return _connection.LocalIP; } + /// <summary> + /// Gets server name + /// </summary> + /// <returns>Server name</returns> public override string GetServerName() { string localAddress = GetLocalAddress(); if (localAddress.Equals("127.0.0.1")) { @@ -756,38 +1004,76 @@ return localAddress; } + /// <summary> + /// Gets local port + /// </summary> + /// <returns>Local port</returns> public override int GetLocalPort() { return _host.Port; } + /// <summary> + /// Gets file path + /// </summary> + /// <returns>File path</returns> public override string GetFilePath() { return _filePath; } + /// <summary> + /// Gets translated file path + /// </summary> + /// <returns>Translated file path</returns> public override string GetFilePathTranslated() { return _pathTranslated; } + /// <summary> + /// Gets Path information + /// </summary> + /// <returns>Path infroamtion</returns> public override string GetPathInfo() { return _pathInfo; } + /// <summary> + /// Gets application path + /// </summary> + /// <returns>Application Path</returns> public override string GetAppPath() { return _host.VirtualPath; } + /// <summary> + /// Gets translated application path + /// </summary> + /// <returns>Translated application path</returns> public override string GetAppPathTranslated() { return _host.PhysicalPath; } + /// <summary> + /// Gets preload entity body + /// </summary> + /// <returns>Preload entity body</returns> public override byte[] GetPreloadedEntityBody() { return _preloadedContent; } + /// <summary> + /// Returns a value indicating whether all request data is available and no further reads from the client are required + /// </summary> + /// <returns>true, if all request data is available; false otherwise</returns> public override bool IsEntireEntityBodyIsPreloaded() { return (_contentLength == _preloadedContentLength); } + /// <summary> + /// Reads entity body + /// </summary> + /// <param name="buffer">Buffer</param> + /// <param name="size">Size of buffer</param> + /// <returns>Number of read bytes</returns> public override int ReadEntityBody(byte[] buffer, int size) { int bytesRead = 0; @@ -802,10 +1088,20 @@ return bytesRead; } + /// <summary> + /// Gets known request headers with given index + /// </summary> + /// <param name="index">Index of the header</param> + /// <returns>Request header</returns> public override string GetKnownRequestHeader(int index) { return _knownRequestHeaders[index]; } + /// <summary> + /// Gets unknown request header with the given name + /// </summary> + /// <param name="name">Name of the header</param> + /// <returns>Request header</returns> public override string GetUnknownRequestHeader(string name) { int n = _unknownRequestHeaders.Length; @@ -818,10 +1114,19 @@ return null; } + /// <summary> + /// Gets all unknown request headers + /// </summary> + /// <returns>All unknown request headers</returns> public override string[][] GetUnknownRequestHeaders() { return _unknownRequestHeaders; } + /// <summary> + /// Gets server variable + /// </summary> + /// <param name="name">Name of the server variable</param> + /// <returns>Value of the server variable</returns> public override string GetServerVariable(string name) { string s = String.Empty; @@ -842,6 +1147,11 @@ return s; } + /// <summary> + /// Maps a path from virutal to physical + /// </summary> + /// <param name="path">Virtual path</param> + /// <returns>Physical path</returns> public override string MapPath(string path) { string mappedPath = String.Empty; bool isClientScriptPath = false; @@ -883,10 +1193,20 @@ return mappedPath; } + /// <summary> + /// Sends status + /// </summary> + /// <param name="statusCode">Statuscode</param> + /// <param name="statusDescription">Descritption</param> public override void SendStatus(int statusCode, string statusDescription) { _responseStatus = statusCode; } + /// <summary> + /// Sends known response header + /// </summary> + /// <param name="index">Index of the response header</param> + /// <param name="value">Value of the response header</param> public override void SendKnownResponseHeader(int index, string value) { if (_headersSent) { return; @@ -921,6 +1241,11 @@ _responseHeadersBuilder.Append("\r\n"); } + /// <summary> + /// Sends unknown response header + /// </summary> + /// <param name="name">Name of the response header</param> + /// <param name="value">Value of the response header</param> public override void SendUnknownResponseHeader(string name, string value) { if (_headersSent) return; @@ -931,6 +1256,10 @@ _responseHeadersBuilder.Append("\r\n"); } + /// <summary> + /// Sends calculated content length + /// </summary> + /// <param name="contentLength">Content Length</param> public override void SendCalculatedContentLength(int contentLength) { if (!_headersSent) { _responseHeadersBuilder.Append("Content-Length: "); @@ -939,20 +1268,36 @@ } } + /// <summary> + /// Returns if the headers are sent + /// </summary> + /// <returns>true, if the headers are sent;false otherwise</returns> public override bool HeadersSent() { return _headersSent; } + /// <summary> + /// Checks, if the client is connected + /// </summary> + /// <returns>true, if client is connected; false otherwise</returns> public override bool IsClientConnected() { _connectionPermission.Assert(); return _connection.Connected; } + /// <summary> + /// Closes the connection + /// </summary> public override void CloseConnection() { _connectionPermission.Assert(); _connection.Close(); } + /// <summary> + /// Sends response from memory + /// </summary> + /// <param name="data">Data to send</param> + /// <param name="length">Length of the data</param> public override void SendResponseFromMemory(byte[] data, int length) { try { if (length > 0) { @@ -966,6 +1311,12 @@ } } + /// <summary> + /// Sends a response from file + /// </summary> + /// <param name="filename">Filename</param> + /// <param name="offset">Offset</param> + /// <param name="length">Length</param> public override void SendResponseFromFile(string filename, long offset, long length) { if (length == 0) { return; @@ -984,6 +1335,12 @@ } } + /// <summary> + /// Sends a response from file + /// </summary> + /// <param name="handle">Handle of the file</param> + /// <param name="offset">Offset</param> + /// <param name="length">Length</param> public override void SendResponseFromFile(IntPtr handle, long offset, long length) { if (length == 0) { return; Modified: trunk/Version2/WebServer/Server.cs =================================================================== --- trunk/Version2/WebServer/Server.cs 2007-03-09 17:45:37 UTC (rev 33) +++ trunk/Version2/WebServer/Server.cs 2007-03-09 22:37:29 UTC (rev 34) @@ -21,27 +21,67 @@ using log4net; namespace MPW.WebServer { - + /// <summary> + /// Main class of the web server + /// </summary> public sealed class Server : MarshalByRefObject { #region variables + /// <summary> + /// Global web server log + /// </summary> private ILog log = LogManager.GetLogger("WebServer"); + + /// <summary> + /// Log of all access + /// </summary> private ILog accessLog = LogManager.GetLogger("WebServerAccess"); + + /// <summary> + /// Configuration of the server + /// </summary> private ServerConfiguration _configuration; + /// <summary> + /// Callback on start + /// </summary> private WaitCallback _onStart; + + /// <summary> + /// Callback on socket accept + /// </summary> private WaitCallback _onSocketAccept; + /// <summary> + /// Indicates, if shutdown is in progress + /// </summary> private bool _shutdownInProgress; + /// <summary> + /// Indicates, if server is pause + /// </summary> private bool _pause; + /// <summary> + /// Application Manager + /// </summary> private ApplicationManager _appManager; + /// <summary> + /// Server socket + /// </summary> private Socket _socket; + + /// <summary> + /// Hosting environment + /// </summary> private Host _host; #endregion #region ctor + /// <summary> + /// Constructor + /// </summary> + /// <param name="configuration">Server configuration</param> public Server(ServerConfiguration configuration) { _configuration = configuration; String tempPhysicalPath = configuration.PhysicalPath; @@ -56,6 +96,10 @@ #endregion #region overrides + /// <summary> + /// Never expire the license + /// </summary> + /// <returns>Object</returns> public override object InitializeLifetimeService() { // never expire the license return null; @@ -63,24 +107,36 @@ #endregion #region prroperties + /// <summary> + /// Gets the virtual Path + /// </summary> public string VirtualPath { get { return _configuration.VirtualPath; } } + /// <summary> + /// Gets the physical path + /// </summary> public string PhysicalPath { get { return _configuration.PhysicalPath; } } + /// <summary> + /// Gets the port + /// </summary> public int Port { get { return _configuration.Port; } } + /// <summary> + /// Gets the root url + /// </summary> public string RootUrl { get { if (_configuration.Port != 80) { @@ -91,10 +147,17 @@ } } + /// <summary> + /// Gets/Sets if the server is paused + /// </summary> public bool Pause { get { return _pause; } set { _pause = value; } } + + /// <summary> + /// Gets the bind address + /// </summary> public String BindAdress { get { return _configuration.BindAddress; @@ -103,9 +166,9 @@ #endregion #region public methods - // - // Socket listening - // + /// <summary> + /// Starts the server and listen on the socket + /// </summary> public void Start() { _socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); _socket.ExclusiveAddressUse = true; @@ -124,6 +187,9 @@ log.Debug("Web server started. Listening on: " + _configuration.BindAddress + ":" + _configuration.Port); } + /// <summary> + /// Stops the server, all connections and the hosting environment + /// </summary> public void Stop() { _shutdownInProgress = true; @@ -152,6 +218,11 @@ _shutdownInProgress = false; } } + + /// <summary> + /// Reloads the web server with a new configuration + /// </summary> + /// <param name="configuration">New configuration</param> public void Reload(ServerConfiguration configuration) { Stop(); _configuration = configuration; @@ -162,6 +233,10 @@ #endregion #region event handling + /// <summary> + /// Handles on socket accept event and process the new request + /// </summary> + /// <param name="acceptedSocket">New socket</param> private void OnSocketAccept(object acceptedSocket) { if (!_shutdownInProgress) { Connection conn = new Connection(this, (Socket)acceptedSocket, _configuration); @@ -192,14 +267,21 @@ } } - // called at the end of request processing - // to disconnect the remoting proxy for Connection object - // and allow GC to pick it up + /// <summary> + /// called at the end of request processing + /// to disconnect the remoting proxy for Connection object + /// and allow GC to pick it up + /// </summary> + /// <param name="conn">Corresponding connection</param> internal void OnRequestEnd(Connection conn) { RemotingServices.Disconnect(conn); //accessLog.Info("Request from: " + conn.RemoteIP + " done."); } + /// <summary> + /// Handles the on start event and listens on the socket + /// </summary> + /// <param name="unused"></param> private void OnStart(Object unused) { while (!_shutdownInProgress) { try { @@ -213,6 +295,10 @@ #endregion #region private methods + /// <summary> + /// Generates the hosting environment + /// </summary> + /// <returns>Hosting environment, if possible</returns> private Host GetHost() { if (_shutdownInProgress) return null; @@ -242,15 +328,34 @@ #endregion #region internal methods + /// <summary> + /// Called, when host is stopped. Sets internal variable to null + /// </summary> internal void HostStopped() { _host = null; } + + /// <summary> + /// Writes an error to log + /// </summary> + /// <param name="message">Error message</param> + /// <param name="e">Corresponding Exception</param> internal void WriteErrorToLog(String message, Exception e) { log.Error(message, e); } + + /// <summary> + /// Writes an access information to the access log + /// </summary> + ... [truncated message content] |
From: <mis...@us...> - 2007-03-09 17:45:39
|
Revision: 33 http://svn.sourceforge.net/mp-webinterface/?rev=33&view=rev Author: misterd_sf Date: 2007-03-09 09:45:37 -0800 (Fri, 09 Mar 2007) Log Message: ----------- Updated logging (Added AccessLog and reconfigured logging of the webserver) fixed a small bug when shutting down the server Modified Paths: -------------- trunk/Version2/WebServer/ByteParser.cs trunk/Version2/WebServer/Connection.cs trunk/Version2/WebServer/Host.cs trunk/Version2/WebServer/Request.cs trunk/Version2/WebServer/Server.cs trunk/Version2/WindowsService/LoggingConfiguration.xml Modified: trunk/Version2/WebServer/ByteParser.cs =================================================================== --- trunk/Version2/WebServer/ByteParser.cs 2007-03-09 14:19:08 UTC (rev 32) +++ trunk/Version2/WebServer/ByteParser.cs 2007-03-09 17:45:37 UTC (rev 33) @@ -16,12 +16,14 @@ #region variables private byte[] _bytes; private int _pos; + private Server _server; #endregion #region ctor - internal ByteParser(byte[] bytes) { + internal ByteParser(byte[] bytes, Server server) { _bytes = bytes; _pos = 0; + _server = server; } #endregion @@ -58,7 +60,7 @@ _pos = _bytes.Length; } catch (Exception e){ - Server.WriteErrorToLog("Error in ByteParser.\n", e); + _server.WriteErrorToLog("Error in ByteParser.\n", e); } return line; } Modified: trunk/Version2/WebServer/Connection.cs =================================================================== --- trunk/Version2/WebServer/Connection.cs 2007-03-09 14:19:08 UTC (rev 32) +++ trunk/Version2/WebServer/Connection.cs 2007-03-09 17:45:37 UTC (rev 33) @@ -93,7 +93,7 @@ #endregion #region private static methods - private static bool CheckLocalServerIP(string remoteIP) { + private bool CheckLocalServerIP(string remoteIP) { try { IPHostEntry hostEntry = Dns.GetHostEntry(Environment.MachineName); IPAddress localAddress; @@ -104,7 +104,7 @@ } } } catch (Exception e) { - Server.WriteErrorToLog("Error while checking Server IP.\n", e); + _server.WriteErrorToLog("Error while checking Server IP.\n", e); } return false; } @@ -155,7 +155,7 @@ _socket.Close(); } }catch(Exception e){ - Server.WriteErrorToLog("Could not close socket.\n", e); + _server.WriteErrorToLog("Could not close socket.\n", e); } finally { _socket = null; } @@ -190,7 +190,7 @@ return buffer; } catch (Exception e) { - Server.WriteErrorToLog("Could not read request bytes.\n", e); + _server.WriteErrorToLog("Could not read request bytes.\n", e); return null; } } @@ -203,7 +203,7 @@ try { _socket.Send(data, offset, length, SocketFlags.None); } catch (Exception e) { - Server.WriteErrorToLog("Could not write body.\n", e); + _server.WriteErrorToLog("Could not write body.\n", e); } } @@ -215,7 +215,7 @@ _socket.Send(Encoding.UTF8.GetBytes(headers + body)); } } catch (Exception e) { - Server.WriteErrorToLog("Could not write entire response from string.\n", e); + _server.WriteErrorToLog("Could not write entire response from string.\n", e); } finally { if (!keepAlive) { Close(); @@ -254,7 +254,7 @@ completed = true; } } catch (Exception e) { - Server.WriteErrorToLog("Could not write entire response from file.\n", e); + _server.WriteErrorToLog("Could not write entire response from file.\n", e); } finally { if (!keepAlive || !completed) Close(); @@ -290,7 +290,7 @@ availBytes = _socket.Available; } catch (Exception e) { - Server.WriteErrorToLog("Error while waiting for request bytes.\n", e); + _server.WriteErrorToLog("Error while waiting for request bytes.\n", e); } return availBytes; @@ -304,7 +304,7 @@ _socket.Send(Encoding.UTF8.GetBytes(headers)); } } catch (Exception e) { - Server.WriteErrorToLog("Could not write headers.\n", e); + _server.WriteErrorToLog("Could not write headers.\n", e); } } #endregion Modified: trunk/Version2/WebServer/Host.cs =================================================================== --- trunk/Version2/WebServer/Host.cs 2007-03-09 14:19:08 UTC (rev 32) +++ trunk/Version2/WebServer/Host.cs 2007-03-09 17:45:37 UTC (rev 33) @@ -70,7 +70,7 @@ Request request = new Request(_server, this, conn, _configuration); request.Process(); } catch (Exception e) { - Server.WriteErrorToLog("Could not process Request.\n", e); + _server.WriteErrorToLog("Could not process Request.\n", e); } finally { RemovePendingCall(); } Modified: trunk/Version2/WebServer/Request.cs =================================================================== --- trunk/Version2/WebServer/Request.cs 2007-03-09 14:19:08 UTC (rev 32) +++ trunk/Version2/WebServer/Request.cs 2007-03-09 17:45:37 UTC (rev 33) @@ -86,6 +86,7 @@ private int _responseStatus; private StringBuilder _responseHeadersBuilder; private ArrayList _responseBodyBytes; + private String remoteIP; #endregion #region static variables @@ -115,28 +116,33 @@ // 100 response to POST if (_verb == "POST" && _contentLength > 0 && _preloadedContentLength < _contentLength) { _connection.Write100Continue(); + _server.writeErrorAccessLog("Send Error 100 response for request from: " + remoteIP + " for " + this._path); } // special case for client script if (_isClientScriptPath) { _connection.WriteEntireResponseFromFile(_host.PhysicalClientScriptPath + _path.Substring(_host.NormalizedClientScriptPath.Length), false); + _server.writeInfoAccessLog("Send response from file for request from: " + remoteIP + " for " + this._path); return; } // deny access to code, bin, etc. if (IsRequestForRestrictedDirectory()) { _connection.WriteErrorAndClose(403); + _server.writeErrorAccessLog("Send error 403 (Restricted directory) for request from: " + remoteIP + " for " + this._path); return; } // special case for directory listing if (ProcessDirectoryListingRequest()) { + _server.writeInfoAccessLog("Send directory listing for request from: " + remoteIP + " for " + this._path); return; } PrepareResponse(); // Hand the processing over to HttpRuntime HttpRuntime.ProcessRequest(this); + _server.writeInfoAccessLog("Response send by HttpRuntime request for request from: " + remoteIP + " for " + this._path); } private bool checkSecurity() { @@ -145,6 +151,7 @@ if (!_connection.IsLocal) { _connection.WriteErrorAndClose(403); + _server.writeErrorAccessLog("Send error 403 (Acces Denied by configuration) for request from: " + remoteIP + " for " + this._path); return false; } @@ -158,6 +165,8 @@ } } if (!ipFound) { + _connection.WriteErrorAndClose(403); + _server.writeErrorAccessLog("Send error 403 (Acces Denied by configuration) for request from: " + remoteIP + " for " + this._path); return false; } } @@ -165,6 +174,7 @@ String uri = _path + _queryString; if (uri.Length > _configuration.MaxUriLength) { _connection.WriteErrorAndClose(403, "URI Exceeded Maximum Server Limit."); + _server.writeErrorAccessLog("Send error 403 (URI Exceeded Maximum Server Limit) for request from: " + remoteIP + " for " + this._path); return false; } List<String> vrbCollection = _configuration.HTTPMethods; @@ -177,6 +187,7 @@ if (!vrbFound) { _connection.WriteErrorAndClose(403); + _server.writeErrorAccessLog("Send error 403 (HTTP method not found) for request from: " + remoteIP + " for " + this._path); return false; } return true; @@ -263,16 +274,20 @@ } ParseRequestLine(); + remoteIP = _connection.RemoteIP; + _server.writeInfoAccessLog("Request from: " + remoteIP + " for " + this._path); // Check for bad path if (IsBadPath()) { _connection.WriteErrorAndClose(400); + _server.writeErrorAccessLog("Send error 400 (Bad Path) for request from: " + remoteIP + " for " + this._path); return false; } // Check if the path is not well formed or is not for the current app if (!_host.IsVirtualPathInApp(_path, out _isClientScriptPath)) { _connection.WriteErrorAndClose(404); + _server.writeErrorAccessLog("Send error 404 (Path is not well formed) for request from: " + remoteIP + " for " + this._path); return false; } // Check security @@ -314,7 +329,7 @@ _headerByteStrings = new ArrayList(); // find the end of headers - ByteParser parser = new ByteParser(_headerBytes); + ByteParser parser = new ByteParser(_headerBytes,_server); for (; ; ) { ByteString line = parser.ReadLine(); @@ -590,7 +605,7 @@ try { infos = (new DirectoryInfo(dirPathTranslated)).GetFileSystemInfos(); } catch (Exception e){ - Server.WriteErrorToLog("Could not get all files and subdirs.\n", e); + _server.WriteErrorToLog("Could not get all files and subdirs.\n", e); } // determine if parent is appropriate @@ -621,7 +636,7 @@ #endregion #region private static methods - private static string UrlEncodeRedirect(string path) { + private string UrlEncodeRedirect(string path) { // this method mimics the logic in HttpResponse.Redirect (which relies on internal methods) try { // count non-ascii characters @@ -659,7 +674,7 @@ path = path.Replace(" ", "%20"); } } catch (Exception e) { - Server.WriteErrorToLog("Error in URL Encode Redirect.\n", e); + _server.WriteErrorToLog("Error in URL Encode Redirect.\n", e); } return path; } @@ -947,7 +962,7 @@ _responseBodyBytes.Add(bytes); } } catch (Exception e) { - Server.WriteErrorToLog("Could not send response from memory.\n", e); + _server.WriteErrorToLog("Could not send response from memory.\n", e); } } @@ -961,7 +976,7 @@ f = new FileStream(filename, FileMode.Open, FileAccess.Read, FileShare.Read); SendResponseFromFileStream(f, offset, length); }catch(Exception e){ - Server.WriteErrorToLog("Could not send response from file (filename).\n", e); + _server.WriteErrorToLog("Could not send response from file (filename).\n", e); } finally { if (f != null) { f.Close(); @@ -980,7 +995,7 @@ f = new FileStream(sfh, FileAccess.Read); SendResponseFromFileStream(f, offset, length); } catch (Exception e) { - Server.WriteErrorToLog("Could not send response from file (Handle).\n", e); + _server.WriteErrorToLog("Could not send response from file (Handle).\n", e); } finally { if (f != null) { f.Close(); Modified: trunk/Version2/WebServer/Server.cs =================================================================== --- trunk/Version2/WebServer/Server.cs 2007-03-09 14:19:08 UTC (rev 32) +++ trunk/Version2/WebServer/Server.cs 2007-03-09 17:45:37 UTC (rev 33) @@ -17,12 +17,15 @@ using System.Threading; using System.Web; using System.Web.Hosting; +using log4net.Core; +using log4net; namespace MPW.WebServer { public sealed class Server : MarshalByRefObject { #region variables - private static readonly log4net.ILog log = log4net.LogManager.GetLogger("WebServer"); + private ILog log = LogManager.GetLogger("WebServer"); + private ILog accessLog = LogManager.GetLogger("WebServerAccess"); private ServerConfiguration _configuration; private WaitCallback _onStart; @@ -128,11 +131,11 @@ if (_socket != null) { _socket.Close(); } + Thread.Sleep(100); } catch { } finally { _socket = null; } - try { if (_host != null) { _host.Shutdown(); @@ -242,10 +245,16 @@ internal void HostStopped() { _host = null; } - internal static void WriteErrorToLog(String message, Exception e) { + internal void WriteErrorToLog(String message, Exception e) { log.Error(message, e); } - #endregion + internal void writeInfoAccessLog(String message) { + accessLog.Info(message); + } + internal void writeErrorAccessLog(String message) { + accessLog.Error(message); + } + #endregion } } Modified: trunk/Version2/WindowsService/LoggingConfiguration.xml =================================================================== --- trunk/Version2/WindowsService/LoggingConfiguration.xml 2007-03-09 14:19:08 UTC (rev 32) +++ trunk/Version2/WindowsService/LoggingConfiguration.xml 2007-03-09 17:45:37 UTC (rev 33) @@ -1,10 +1,6 @@ <?xml version="1.0" encoding="utf-8" ?> <log4net> - <appender name="ConsoleAppender" type="log4net.Appender.ConsoleAppender"> - <layout type="log4net.Layout.PatternLayout" value="%date [%thread] %-5level %logger - %message%newline" /> - </appender> - <appender name="EventLogAppender" type="log4net.Appender.EventLogAppender" > <applicationName value="MPW" /> <logName value="MPW Service"/> @@ -20,7 +16,7 @@ <eventLogEntryType value="Error" /> </mapping> <mapping> - <level value="WARNING" /> + <level value="WARN" /> <eventLogEntryType value="Warning" /> </mapping> <mapping> @@ -36,9 +32,17 @@ <file value="access.log" /> <appendToFile value="true" /> <layout type="log4net.Layout.PatternLayout"> - <conversionPattern value="%date [%thread] %-5level %logger [%property{NDC}] - %message%newline" /> + <conversionPattern value="%date %-5level - %message%newline" /> </layout> </appender> + + <appender name="MPWFileAppender" type="log4net.Appender.FileAppender"> + <file value="mpw.log" /> + <appendToFile value="true" /> + <layout type="log4net.Layout.PatternLayout"> + <conversionPattern value="%date %-5level - %message%newline" /> + </layout> + </appender> <category name="MPW"> <level value="ALL" /> @@ -46,7 +50,7 @@ </category> <category name="WebServer"> <level value="ALL" /> - <appender-ref ref="ConsoleAppender" /> + <appender-ref ref="MPWFileAppender" /> <appender-ref ref="EventLogAppender" /> </category> <category name="WebServerAccess" additivity="false"> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mis...@us...> - 2007-03-09 14:19:10
|
Revision: 32 http://svn.sourceforge.net/mp-webinterface/?rev=32&view=rev Author: misterd_sf Date: 2007-03-09 06:19:08 -0800 (Fri, 09 Mar 2007) Log Message: ----------- Added two custom commands: Reload Configuration and Reinit Logging Modified Paths: -------------- trunk/Version2/WebServer/Server.cs trunk/Version2/WebServer/WebServer.csproj trunk/Version2/WindowsService/Service.Designer.cs trunk/Version2/WindowsService/Service.cs Added Paths: ----------- trunk/Version2/WebServer/CustomCommands.cs Added: trunk/Version2/WebServer/CustomCommands.cs =================================================================== --- trunk/Version2/WebServer/CustomCommands.cs (rev 0) +++ trunk/Version2/WebServer/CustomCommands.cs 2007-03-09 14:19:08 UTC (rev 32) @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace MPW.WebServer { + /// <summary> + /// Enumeration of known Custom Commands of the server and windows service + /// </summary> + public enum CustomCommands { + /// <summary> + /// Reloads the configuration and also filename from AppConfig. + /// </summary> + ReloadConfiguration=128, + /// <summary> + /// Reinits logging and reading the new config file name from AppConfig. + /// </summary> + ReinitLogging=129 + } +} Modified: trunk/Version2/WebServer/Server.cs =================================================================== --- trunk/Version2/WebServer/Server.cs 2007-03-09 09:30:00 UTC (rev 31) +++ trunk/Version2/WebServer/Server.cs 2007-03-09 14:19:08 UTC (rev 32) @@ -146,8 +146,16 @@ } finally { _host = null; log.Debug("Web server stopped."); + _shutdownInProgress = false; } } + public void Reload(ServerConfiguration configuration) { + Stop(); + _configuration = configuration; + String tempPhysicalPath = configuration.PhysicalPath; + _configuration.PhysicalPath = tempPhysicalPath.EndsWith("\\", StringComparison.Ordinal) ? tempPhysicalPath : tempPhysicalPath + "\\"; + Start(); + } #endregion #region event handling Modified: trunk/Version2/WebServer/WebServer.csproj =================================================================== --- trunk/Version2/WebServer/WebServer.csproj 2007-03-09 09:30:00 UTC (rev 31) +++ trunk/Version2/WebServer/WebServer.csproj 2007-03-09 14:19:08 UTC (rev 32) @@ -48,6 +48,7 @@ <ItemGroup> <Compile Include="ByteParser.cs" /> <Compile Include="ByteString.cs" /> + <Compile Include="CustomCommands.cs" /> <Compile Include="ServerConfiguration.cs" /> <Compile Include="Connection.cs" /> <Compile Include="Host.cs" /> Modified: trunk/Version2/WindowsService/Service.Designer.cs =================================================================== --- trunk/Version2/WindowsService/Service.Designer.cs 2007-03-09 09:30:00 UTC (rev 31) +++ trunk/Version2/WindowsService/Service.Designer.cs 2007-03-09 14:19:08 UTC (rev 32) @@ -26,7 +26,7 @@ this.eventLog = new System.Diagnostics.EventLog(); ((System.ComponentModel.ISupportInitialize)(this.eventLog)).BeginInit(); // - // MPW_Service + // Service // this.CanHandlePowerEvent = true; this.CanPauseAndContinue = true; Modified: trunk/Version2/WindowsService/Service.cs =================================================================== --- trunk/Version2/WindowsService/Service.cs 2007-03-09 09:30:00 UTC (rev 31) +++ trunk/Version2/WindowsService/Service.cs 2007-03-09 14:19:08 UTC (rev 32) @@ -115,6 +115,18 @@ /// </summary> /// <param name="command">Command code</param> protected override void OnCustomCommand(int command) { + CustomCommands custCommand = (CustomCommands)command; + switch (custCommand) { + case CustomCommands.ReloadConfiguration: + String configFile = System.AppDomain.CurrentDomain.BaseDirectory + "\\" + ConfigurationManager.AppSettings["ConfigurationFile"]; + _configuration = ServerConfiguration.readConfiguration(configFile); + _server.Reload(_configuration); + break; + case CustomCommands.ReinitLogging: + string loggingConfigFile = System.AppDomain.CurrentDomain.BaseDirectory + "\\" + ConfigurationManager.AppSettings["LoggingConfigurationFile"]; + XmlConfigurator.ConfigureAndWatch(new FileInfo(loggingConfigFile)); + break; + } base.OnCustomCommand(command); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mas...@us...> - 2007-03-09 09:30:03
|
Revision: 31 http://svn.sourceforge.net/mp-webinterface/?rev=31&view=rev Author: maschine Date: 2007-03-09 01:30:00 -0800 (Fri, 09 Mar 2007) Log Message: ----------- -Added refresh Timer -Added SVN:ignore to bin/obj folders Modified Paths: -------------- trunk/Version2/Control Center/Control_Center_App.Designer.cs trunk/Version2/Control Center/Control_Center_App.cs trunk/Version2/Control Center/Control_Center_App.resx trunk/Version2/Setup/Setup.vdproj Added Paths: ----------- trunk/Version2/TestPage/Index.htm Removed Paths: ------------- trunk/Version2/TestPage/Test.htm Property Changed: ---------------- trunk/Version2/ trunk/Version2/Control Center/ trunk/Version2/Setup/ trunk/Version2/WebServer/ trunk/Version2/WindowsService/ Property changes on: trunk/Version2 ___________________________________________________________________ Name: svn:ignore + MPW.suo Property changes on: trunk/Version2/Control Center ___________________________________________________________________ Name: svn:ignore + obj bin Modified: trunk/Version2/Control Center/Control_Center_App.Designer.cs =================================================================== --- trunk/Version2/Control Center/Control_Center_App.Designer.cs 2007-03-08 12:13:06 UTC (rev 30) +++ trunk/Version2/Control Center/Control_Center_App.Designer.cs 2007-03-09 09:30:00 UTC (rev 31) @@ -57,6 +57,7 @@ this.trayStart = new System.Windows.Forms.ToolStripMenuItem(); this.stopToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.refreshTimer = new System.Windows.Forms.Timer(this.components); this.groupBox1.SuspendLayout(); this.groupBox2.SuspendLayout(); this.groupBox3.SuspendLayout(); @@ -323,6 +324,12 @@ this.exitToolStripMenuItem.Text = "Exit"; this.exitToolStripMenuItem.Click += new System.EventHandler(this.exitToolStripMenuItem_Click); // + // refreshTimer + // + this.refreshTimer.Enabled = true; + this.refreshTimer.Interval = 1000; + this.refreshTimer.Tick += new System.EventHandler(this.refreshTimer_Tick); + // // Control_Center_App // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -377,6 +384,7 @@ private System.Windows.Forms.ToolStripMenuItem stopToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem; private System.Windows.Forms.Button button1; + private System.Windows.Forms.Timer refreshTimer; } } Modified: trunk/Version2/Control Center/Control_Center_App.cs =================================================================== --- trunk/Version2/Control Center/Control_Center_App.cs 2007-03-08 12:13:06 UTC (rev 30) +++ trunk/Version2/Control Center/Control_Center_App.cs 2007-03-09 09:30:00 UTC (rev 31) @@ -227,11 +227,19 @@ RefreshControllers(); } + //Minimize to tray on minimize private void Control_Center_App_Resize(object sender, EventArgs e) { if (this.WindowState == FormWindowState.Minimized) this.ShowInTaskbar = false; } + //Update the Service status + private void refreshTimer_Tick(object sender, EventArgs e) + { + if (this.WindowState != System.Windows.Forms.FormWindowState.Minimized) + RefreshControllers(); + } + } } \ No newline at end of file Modified: trunk/Version2/Control Center/Control_Center_App.resx =================================================================== --- trunk/Version2/Control Center/Control_Center_App.resx 2007-03-08 12:13:06 UTC (rev 30) +++ trunk/Version2/Control Center/Control_Center_App.resx 2007-03-09 09:30:00 UTC (rev 31) @@ -9176,6 +9176,9 @@ AAD//wAA//8AAA== </value> </data> + <metadata name="refreshTimer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <value>246, 17</value> + </metadata> <data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <value> AAABAA8AAAAAAAEACAAoJAEA9gAAADAwAAABAAgAqA4AAB4lAQAgIAAAAQAIAKgIAADGMwEAGBgAAAEA Property changes on: trunk/Version2/Setup ___________________________________________________________________ Name: svn:ignore + Debug Release Modified: trunk/Version2/Setup/Setup.vdproj =================================================================== --- trunk/Version2/Setup/Setup.vdproj 2007-03-08 12:13:06 UTC (rev 30) +++ trunk/Version2/Setup/Setup.vdproj 2007-03-09 09:30:00 UTC (rev 31) @@ -63,7 +63,7 @@ } "Entry" { - "MsmKey" = "8:_DB1EB6A709194CA9A153A70E56357E20" + "MsmKey" = "8:_CB8899743E654F4DA69502F65F066B34" "OwnerKey" = "8:_UNDEFINED" "MsmSig" = "8:_UNDEFINED" } @@ -306,12 +306,12 @@ "IsDependency" = "11:TRUE" "IsolateTo" = "8:" } - "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_DB1EB6A709194CA9A153A70E56357E20" + "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_CB8899743E654F4DA69502F65F066B34" { - "SourcePath" = "8:..\\TestPage\\Test.htm" - "TargetName" = "8:Test.htm" + "SourcePath" = "8:..\\TestPage\\Index.htm" + "TargetName" = "8:Index.htm" "Tag" = "8:" - "Folder" = "8:_630010CA5B27470EBA4BEB29C8484993" + "Folder" = "8:_3AAF0448C26C4EFC8D390F14EF2EACFB" "Condition" = "8:" "Transitive" = "11:FALSE" "Vital" = "11:TRUE" @@ -457,14 +457,14 @@ "Name" = "8:Microsoft Visual Studio" "ProductName" = "8:MPW" "ProductCode" = "8:{FFA1A109-9C5B-4D11-9B85-9E8B4F5392E4}" - "PackageCode" = "8:{91217F2D-1313-4C9F-B9B7-124AA41D22C3}" + "PackageCode" = "8:{32952FCB-D143-40A8-8CAD-76D0E157BA34}" "UpgradeCode" = "8:{4F72B4EB-D91C-4E25-9ABE-C7669CDE4B98}" "RestartWWWService" = "11:FALSE" "RemovePreviousVersions" = "11:TRUE" "DetectNewerInstalledVersion" = "11:TRUE" "InstallAllUsers" = "11:TRUE" "ProductVersion" = "8:0.1" - "Manufacturer" = "8:Team Mediaportal" + "Manufacturer" = "8:Team MediaPortal" "ARPHELPTELEPHONE" = "8:" "ARPHELPLINK" = "8:" "Title" = "8:MPW" Added: trunk/Version2/TestPage/Index.htm =================================================================== --- trunk/Version2/TestPage/Index.htm (rev 0) +++ trunk/Version2/TestPage/Index.htm 2007-03-09 09:30:00 UTC (rev 31) @@ -0,0 +1 @@ +Hello World! \ No newline at end of file Deleted: trunk/Version2/TestPage/Test.htm =================================================================== --- trunk/Version2/TestPage/Test.htm 2007-03-08 12:13:06 UTC (rev 30) +++ trunk/Version2/TestPage/Test.htm 2007-03-09 09:30:00 UTC (rev 31) @@ -1 +0,0 @@ -Hello World! \ No newline at end of file Property changes on: trunk/Version2/WebServer ___________________________________________________________________ Name: svn:ignore + obj bin Property changes on: trunk/Version2/WindowsService ___________________________________________________________________ Name: svn:ignore + obj bin This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |