Ejemplo n.º 1
0
 private void WPF_Loaded(object sender, RoutedEventArgs e)
 {
     //Load
     //Streamers
     if (_server.StreamerList != null)
     {
         foreach (var streamer in _server.StreamerList)
         {
             StreamerList.Add(streamer);
         }
     }
     //ReactionLocks
     if (_server.ReactionLockList != null)
     {
         foreach (var reactionLock in _server.ReactionLockList)
         {
             ReactionLockList.Add(reactionLock);
         }
     }
     //Settings
     if (_server.Prefix != PrefixChar.None)
     {
         serverPrefixCheckBox.IsChecked = true;
         serverPrefixBox.SelectedValue  = _server.Prefix;
     }
     adminRoleBox.Text         = _server.AdminRole.ToString();
     botChanBox.Text           = _server.BotChannel.ToString();
     newUserRoleBox.Text       = _server.NewUserRole.ToString();
     intervalSlider.Value      = _server.StreamerCheckInterval;
     streamPostChannelBox.Text = _server.StreamPostChannel.ToString();
     streamerRoleBox.Text      = _server.StreamingRole.ToString();
 }
 public void Update(StreamerList updateStreamer)
 {
     using (IDbConnection dbConnection = Connection)
     {
         dbConnection.Open();
         dbConnection.Execute("team4.UpdateStreamer", updateStreamer, commandType: CommandType.StoredProcedure);
     }
 }
 public int Insert(StreamerList AddStreamer)
 {
     using (IDbConnection dbConnection = Connection)
     {
         dbConnection.Open();
         return(dbConnection.Query <InsertID>("team4.AddStreamer", AddStreamer, commandType: CommandType.StoredProcedure).First().ID);
     }
 }
Ejemplo n.º 4
0
        private void UpdateView(string view)
        {
            switch (view)
            {
            case "streamers":
                StreamerList.Clear();
                foreach (var streamer in _server.StreamerList)
                {
                    StreamerList.Add(streamer);
                }
                break;

            case "reactionlock":
                ReactionLockList.Clear();
                foreach (var reactionLock in _server.ReactionLockList)
                {
                    ReactionLockList.Add(reactionLock);
                }
                break;
            }
        }