當前位置: 首頁>>代碼示例>>C#>>正文


C# TvControl.User類代碼示例

本文整理匯總了C#中TvControl.User的典型用法代碼示例。如果您正苦於以下問題:C# User類的具體用法?C# User怎麽用?C# User使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


User類屬於TvControl命名空間,在下文中一共展示了User類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: TvNotifyManager

    public TvNotifyManager()
    {
      using (Settings xmlreader = new MPSettings())
      {
        _enableRecNotification = xmlreader.GetValueAsBool("mytv", "enableRecNotifier", false);
        _preNotifyConfig = xmlreader.GetValueAsInt("mytv", "notifyTVBefore", 300);
      }

      _busy = false;
      _timer = new Timer();
      _timer.Stop();
      // check every 15 seconds for notifies
      _dummyuser = new User();
      _dummyuser.IsAdmin = false;
      _dummyuser.Name = "Free channel checker";
      _timer.Interval = 15000;
      _timer.Enabled = true;
      // Execute TvNotifyManager in a separate thread, so that it doesn't block the Main UI Render thread when Tvservice connection died
      new Thread(() =>
                   {
                     _timer.Tick += new EventHandler(_timer_Tick);

                   }
        ) {Name = "TvNotifyManager"}.Start();
      _notifiedRecordings = new ArrayList();
    }
開發者ID:arangas,項目名稱:MediaPortal-1,代碼行數:26,代碼來源:TvNotifyManager.cs

示例2: Connect

 public bool Connect(string hostname)
 {
   try
   {
     string connStr;
     string provider;
     if (!GetDatabaseConnectionString(out connStr, out provider))
       return false;
     RemoteControl.HostName = hostname;
     Gentle.Framework.ProviderFactory.SetDefaultProviderConnectionString(connStr);
     me = new User();
     me.IsAdmin = true;
     groups = ChannelGroup.ListAll();
     radioGroups = RadioChannelGroup.ListAll();
     channels = Channel.ListAll();
     mappings = GroupMap.ListAll();
     cards = Card.ListAll();
   }
   catch (Exception ex)
   {
     lastException = ex;
     RemoteControl.Clear();
     return false;
   }
   return true;
 }
開發者ID:npcomplete111,項目名稱:MediaPortal-1,代碼行數:26,代碼來源:ServerInterface.cs

示例3: VirtualCard

 /// <summary>
 /// Initializes a new instance of the <see cref="VirtualCard"/> class.
 /// </summary>
 /// <param name="user">The user.</param>
 /// <param name="server">The server.</param>
 /// <param name="recordingFormat">The recording format.</param>
 public VirtualCard(User user, string server, int recordingFormat)
 {
   _user = user;
   _server = server;
   _recordingFolder = String.Format(@"{0}\Team MediaPortal\MediaPortal TV Server\recordings",
                                    Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData));
   _recordingFormat = recordingFormat;
 }
開發者ID:npcomplete111,項目名稱:MediaPortal-1,代碼行數:14,代碼來源:VirtualCard.cs

示例4: AddUserOwnerTest

    public void AddUserOwnerTest()
    {
      ITvCardContext ctx = new TvCardContext();

      IUser u1 = new User("u1", false, 1);
      ctx.Add(u1);

      Assert.IsTrue(ctx.IsOwner(u1), "user is not owner");
    }
開發者ID:arangas,項目名稱:MediaPortal-1,代碼行數:9,代碼來源:TvCardContextTest.cs

示例5: AddNewUserTest

    public void AddNewUserTest()
    {
      ITvCardContext ctx = new TvCardContext();

      IUser u1 = new User("u1", false, 1);
      ctx.Add(u1);

      Assert.IsTrue(UserExists(ctx, u1), "user is not found");
    }
開發者ID:arangas,項目名稱:MediaPortal-1,代碼行數:9,代碼來源:TvCardContextTest.cs

示例6: RemoveUserTest

    public void RemoveUserTest()
    {
      ITvCardContext ctx = new TvCardContext();

      IUser u1 = new User("u1", false, 1);
      ctx.Add(u1);      
      ctx.Remove(u1);
      Assert.AreEqual(0, ctx.Users.Length, "user count wrong");
      Assert.IsFalse(UserExists(ctx, u1), "user is found");

      Assert.IsTrue(((TvCardContext)ctx).UsersOld.Contains(u1), "user not found in history");      
    }
開發者ID:arangas,項目名稱:MediaPortal-1,代碼行數:12,代碼來源:TvCardContextTest.cs

示例7: AddAlreadyExistingUserTest

    public void AddAlreadyExistingUserTest()
    {
      ITvCardContext ctx = new TvCardContext();

      IUser u1 = new User("u1", false, 1);
      ctx.Add(u1);

      User u2 = new User("u1", false, 2);
      ctx.Add(u2);

      Assert.AreEqual(1, ctx.Users.Length, "user count wrong");
      Assert.IsTrue(UserExists(ctx, u2), "user is not found");
    }
開發者ID:arangas,項目名稱:MediaPortal-1,代碼行數:13,代碼來源:TvCardContextTest.cs

示例8: AddAnotherUserNotOwnerTest

    public void AddAnotherUserNotOwnerTest()
    {
      ITvCardContext ctx = new TvCardContext();

      IUser u1 = new User("u1", false, 1);
      ctx.Add(u1);

      User u2 = new User("u2", false, 2);
      ctx.Add(u2);

      Assert.IsTrue(ctx.IsOwner(u1), "user is owner");
      Assert.IsFalse(ctx.IsOwner(u2), "user is not owner");
    }
開發者ID:arangas,項目名稱:MediaPortal-1,代碼行數:13,代碼來源:TvCardContextTest.cs

示例9: ShowDialog

    public new DialogResult ShowDialog(IWin32Window owner)
    {
      Text = "Preview " + _channel.DisplayName;

      TvServer server = new TvServer();
      IUser user = new User("setuptv", false);
      TvResult result = server.StartTimeShifting(ref user, _channel.IdChannel, out _card);
      if (result != TvResult.Succeeded)
      {
        MessageBox.Show("Preview failed:" + result);
        Close();
        return DialogResult.None;
      }

      Log.Info("preview {0} user:{1} {2} {3} {4}", _channel.DisplayName, user.CardId, user.SubChannel, user.Name,
               _card.TimeShiftFileName);
      _player = new Player();
      _player.Play(_card.TimeShiftFileName, this);

      return base.ShowDialog(owner);
    }
開發者ID:npcomplete111,項目名稱:MediaPortal-1,代碼行數:21,代碼來源:FormPreview.cs

示例10: RecordingDetail

    /// <summary>
    /// constructor
    /// </summary>
    /// <param name="schedule">Schedule of this recording</param>
    /// <param name="channel">Channel on which the recording is done</param>
    /// <param name="endTime">Date/Time the recording should start without pre-record interval</param>
    /// <param name="endTime">Date/Time the recording should stop with post record interval</param>
    /// <param name="isSerie">Is serie recording</param>
    /// 
    /// 
    public RecordingDetail(Schedule schedule, Channel channel, DateTime endTime, bool isSerie)
    {
      _user = new User();
      User.Name = string.Format("scheduler{0}", schedule.IdSchedule);
      User.CardId = -1;
      User.SubChannel = -1;
      User.IsAdmin = true;

      _schedule = schedule;
      _channel = channel;
      _endTime = endTime;
      _program = null;
      _isSerie = isSerie;

      DateTime startTime = DateTime.MinValue;

      if (isSerie)
      {
        DateTime now = DateTime.Now.AddMinutes(schedule.PreRecordInterval);
        startTime = new DateTime(now.Year, now.Month, now.Day, schedule.StartTime.Hour, schedule.StartTime.Minute, 0);
      }
      else
      {
        startTime = schedule.StartTime;
      }

      _program = schedule.ReferencedChannel().GetProgramAt(startTime);

      //no program? then treat this as a manual recording
      if (_program == null)
      {
        _program = new TvDatabase.Program(0, DateTime.Now, endTime, "manual", "", "",
                                          TvDatabase.Program.ProgramState.None,
                                          System.Data.SqlTypes.SqlDateTime.MinValue.Value, string.Empty, string.Empty,
                                          string.Empty, string.Empty, -1, string.Empty, 0);
      }
    }
開發者ID:npcomplete111,項目名稱:MediaPortal-1,代碼行數:47,代碼來源:RecordingDetail.cs

示例11: SwitchTVServerToChannel

        private VirtualCard SwitchTVServerToChannel(string userName, int channelId)
        {
            // validate arguments
            if (String.IsNullOrEmpty(userName))
            {
                Log.Error("Called SwitchTVServerToChannel with empty userName");
                return null;
            }

            // create the user
            Log.Debug("Starting timeshifting with username {0} on channel id {1}", userName, channelId);
            IUser currentUser = new User();
            currentUser.Name = userName;
            currentUser.IsAdmin = true;

            // actually start timeshifting
            VirtualCard tvCard;
            Log.Debug("Starting timeshifting");
            TvResult result = _tvControl.StartTimeShifting(ref currentUser, channelId, out tvCard);
            Log.Trace("Tried to start timeshifting, result {0}", result);

            // make sure result is correct and return
            if (result != TvResult.Succeeded)
            {
                Log.Error("Starting timeshifting failed with result {0}", result);
                return null;
            }

            Log.Debug("Timeshifting succeeded");
            if (tvCard == null)
            {
                Log.Error("Couldn't get virtual card");
                return null;
            }

            return tvCard;
        }
開發者ID:jpykie,項目名稱:MPExtended,代碼行數:37,代碼來源:TVAccessService.cs

示例12: GetChannelState

 public WebChannelState GetChannelState(int channelId, string userName)
 {
     IUser user = new User();
     user.Name = userName;
     TvControl.ChannelState state = _tvControl.GetChannelState(channelId, user);
     Log.Trace("ChannelId: " + channelId + ", State: " + state.ToString());
     return state.ToWebChannelState(channelId);
 }
開發者ID:jpykie,項目名稱:MPExtended,代碼行數:8,代碼來源:TVAccessService.cs

示例13: StopTimeShifting

 public bool StopTimeShifting(int idChannel,int idCard,string userName)
 {
     if (!ConnectToDatabase())
     return false;
       User user = new User(userName, false, idCard);
       user.IdChannel = idChannel;
       return RemoteControl.Instance.StopTimeShifting(ref user);
 }
開發者ID:oxan,項目名稱:mpwebservices,代碼行數:8,代碼來源:TvServiceWebServices.asmx.cs

示例14: StartTimeShifting

 public WebTvResult StartTimeShifting(int idChannel)
 {
     if (!ConnectToDatabase())
     return new WebTvResult();
       VirtualCard vcard;
       TvResult result;
       string rtspURL="";
       string timeshiftFilename="";
       User me = new User(System.Guid.NewGuid().ToString("B"),false);
       try
       {
     result = RemoteControl.Instance.StartTimeShifting(ref me, idChannel, out vcard);
       }
       catch (Exception)
       {
     return new WebTvResult();
       }
       if (result == TvResult.Succeeded)
       {
     me.IdChannel = idChannel;
     me.CardId = vcard.Id;
     rtspURL = vcard.RTSPUrl;
     timeshiftFilename=vcard.TimeShiftFileName;
       }
       return new WebTvResult((int)result,rtspURL,timeshiftFilename,me);
 }
開發者ID:oxan,項目名稱:mpwebservices,代碼行數:26,代碼來源:TvServiceWebServices.asmx.cs

示例15: SendHeartBeat

 public void SendHeartBeat(int idChannel,int idCard,string userName)
 {
     if (!ConnectToDatabase())
     return;
       User user = new User(userName, false, idCard);
       user.IdChannel = idChannel;
       try
       {
     RemoteControl.Instance.HeartBeat(user);
       }
       catch (Exception)
       {
       }
 }
開發者ID:oxan,項目名稱:mpwebservices,代碼行數:14,代碼來源:TvServiceWebServices.asmx.cs


注:本文中的TvControl.User類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。