コード例 #1
0
 public void SendTo(HDCPParserArgs command, HDNetWork.HDTCPRemoteHostState state = null)
 {
     if (state == null)
     {
         SendToAll(command);
     }
     else
     {
         mainService.SendTo(command, state);
     }
 }
コード例 #2
0
 public void SendToAll(HDCPParserArgs command)
 {
     mainService.SendToAll(command);
 }
コード例 #3
0
        void mainService_OnGetConfig(object sender, HDCPProtocol2.HDCP.HDCPParserArgs e)
        {
            try
            {
                HDCPParserArgs Command = new HDCPParserArgs()
                {
                    RemoteHostState = e.RemoteHostState,
                    Command         = HDCPCommand.CONFIG,
                    MessageData     = new MessageData()
                };

                FieldComponent component = new FieldComponent();

                #region Config
                component.AddComponent(new FieldOne()
                {
                    ID          = configDBStationID,
                    DisplayText = "Chuỗi kết nối DB Station",
                    Value       = config.DBStationConnectionString
                });

                component.AddComponent(new FieldOne()
                {
                    ID          = configAsRunLogFolderID,
                    DisplayText = "As run log xml folder",
                    Value       = config.AsRunLogFolder
                });

                component.AddComponent(new FieldOne()
                {
                    ID          = configAdTypeID,
                    DisplayText = "Thể loại của quảng cáo(mỗi thể loại cách nhau bằng dấu ;)",
                    Value       = config.AdTypes
                });

                component.AddComponent(new FieldOne()
                {
                    ID          = configAdMaxDurationID,
                    DisplayText = "Thời lượng tối đa của quảng cáo(frame)",
                    Type        = FieldType.Long,
                    EditMark    = "n0",
                    Value       = config.MaxAdDuration
                });

                component.AddComponent(new FieldOne()
                {
                    ID          = configVODFolderID,
                    DisplayText = "VOD folder",
                    Value       = config.VODFolder
                });

                component.AddComponent(new FieldOne()
                {
                    ID          = configVODXmlFolderID,
                    DisplayText = "VOD XML Folder",
                    Value       = config.VODXmlFolder
                });

                component.AddComponent(new FieldOne()
                {
                    ID          = configSessionStrID,
                    DisplayText = "Session String",
                    Value       = config.sessionStr
                });

                component.AddComponent(new FieldOne()
                {
                    ID          = configImportTimeID,
                    DisplayText = "Thời gian quét As run log(giây)",
                    Type        = FieldType.Int,
                    EditMark    = "n0",
                    MinValue    = 10,
                    MaxValue    = 36000,
                    Value       = config.ImportTime
                });

                component.AddComponent(new FieldOne()
                {
                    ID          = configExportTimeID,
                    DisplayText = "Thời gian xuất VOD(giây)",
                    Type        = FieldType.Int,
                    EditMark    = "n0",
                    MinValue    = 10,
                    MaxValue    = 36000,
                    Value       = config.ExportTime
                });

                component.AddComponent(new FieldOne()
                {
                    ID          = configLastExportDay,
                    DisplayText = "Ngày cuối cùng xuất VOD",
                    Type        = FieldType.Int,
                    EditMark    = "f0",
                    MinValue    = -10,
                    MaxValue    = 0,
                    Value       = config.LastExportDay
                });

                component.AddComponent(new FieldOne()
                {
                    ID          = configLastExportHour,
                    DisplayText = "Giờ cuối cùng xuất VOD",
                    Type        = FieldType.Int,
                    EditMark    = "f0",
                    MinValue    = -23,
                    MaxValue    = 0,
                    Value       = config.LastExportHour
                });

                component.AddComponent(new FieldOne()
                {
                    ID          = configEmailID,
                    DisplayText = "Email",
                    Value       = config.EmailSend
                });
                #endregion

                Command.MessageData.AddComponent(HDCPCommand.CONFIG.ToString(), component.ToXml());

                SendTo(Command, e.RemoteHostState);
            }
            catch (Exception ex)
            {
                SendLogToAll("Lỗi gửi cấu hình:" + ex.Message);

                HDCPParserArgs Command = new HDCPParserArgs()
                {
                    RemoteHostState = e.RemoteHostState,
                    Command         = HDCPCommand.CONFIG,
                    MessageData     = new MessageData()
                };
                SendTo(Command, e.RemoteHostState);
            }
        }