Diagramme de classe des services
public void VolumeUp()
{
CurrentApplication.MediaCenterEnvironment.AudioMixer.VolumeUp();
}
public bool Equals(ehiProxy.Channel x, ehiProxy.Channel y)
if (x.PrimaryService == null || y.PrimaryService == null)
return (x.PrimaryService == y.PrimaryService);
return (x.PrimaryService.CallSign == y.PrimaryService.CallSign);
private DataContracts.Channel createChannel
(ehiProxy.Channel channel, DateTime fromDate, DateTime toDate)
return
new DataContracts.Channel()
Id = channel.Id,
Number = channel.Number,
IsActive = channel.IsActive,
PrimaryService = createService(channel.PrimaryService),
Scheduling = (
from s in channel.ShowsAt(fromDate.ToUniversalTime(),
toDate.ToUniversalTime())
where s.Program != null
select createScheduleEntry(s)
).ToList()
};
private DataContracts.Service createService(ehiProxy.Service service)
return new DataContracts.Service()
Affiliation = service.Affiliation,
CallSign = service.CallSign,
Id = service.Id,
IsDigital = service.IsDigital,
IsDisabled = service.IsDisabled,
IsPayPerView = service.IsPayPerView,
Name = service.Name,
VirtualChannelNumber = service.VirtualChannelNumber
private DataContracts.ScheduleEntry createScheduleEntry(ehiProxy.ScheduleEntry scheduleEntry)
return new DataContracts.ScheduleEntry()
Dolby = scheduleEntry.Dolby,
EndTime = scheduleEntry.EndTime,
GenericId = scheduleEntry.GenericId,
HDTV = scheduleEntry.HDTV,
Id = scheduleEntry.Id,
Live = scheduleEntry.Live,
StartTime = scheduleEntry.StartTime,
SubTitled = scheduleEntry.SubTitled,
Program = createProgram(scheduleEntry.Program)
private DataContracts.Program createProgram(ehiProxy.Program program)
return new DataContracts.Program()
Description = program.Description,
DirectorStrs = new List<string>(program.DirectorStrs),
EpisodeId = program.EpisodeId,
EpisodeTitle = program.EpisodeTitle,
ActorStrs = new List<string>(program.ActorStrs),
GuestsStrs = new List<string>(program.GuestsStrs),
HasMultipleScheduleEntries = program.HasMultipleScheduleEntries,
HostsStrs = new List<string>(program.HostsStrs),
Id = program.Id,
Language = program.Language,
StoreId = program.StoreId,
Title = program.Title,
Year = program.Year
Microsoft.MediaCenter.TV.Epg.Lineup lu = new Microsoft.MediaCenter.TV.Epg.Lineup();
_programs = lu.GetServiceIds();
DirectoryInfo info = new DirectoryInfo(Environment.GetFolderPath(Environment.SpecialFolder.System));
if (Directory.Exists(info.Parent.FullName + @"\ehome"))
Environment.CurrentDirectory = info.Parent.FullName + @"\ehome";
Microsoft.Ehome.Epg.Guide.Initialize();
Etc.
System.Reflection.Assembly assemb
= System.Reflection.Assembly.Load("ehepg");
String s = assemb.GetType("Microsoft.Ehome.Epg.Helper.EpgFileHelper", false, true)
.GetProperty("CurrentEpgFile").GetValue(null, null);
SQLLite ADO.NET
Application.SetSuspendState(System.Windows.Forms.PowerState.Suspend, true, true);
[DllImport("user32.dll")]
private static extern bool ShowWindow(IntPtr hWnd, WindowShowStyle nCmdShow);
public static extern bool SetForegroundWindow(IntPtr hWnd);
public Stream GetFile(String fileName, String encoding)
DirectoryInfo info
= new DirectoryInfo(Environment.GetFolderPath(Environment.SpecialFolder.System));
WebOperationContext.Current.OutgoingResponse.ContentType = encoding;
return File.OpenRead(String.Format(@"{0}\{1}\{2}", info.Parent.FullName, "ehome", fileName));
return null;