Пример #1
0
 public RelayMessageArgs(string SourceChannel, string TargetChannel, StreamProviderTypes type, string Message)
 {
     this.SourceChannel = SourceChannel;
     this.TargetChannel = TargetChannel;
     this.StreamType    = type;
     this.Message       = Message;
 }
Пример #2
0
 public async Task <bool> SaveStreamEdit(int StreamID, string StreamName, StreamProviderTypes Type, int UpTime, int Quote, string Relay)
 {
     try
     {
         var stream = _context.StreamModels.Where(x => x.ID == StreamID).FirstOrDefault();
         if (stream != null)
         {
             stream.StreamName          = StreamName;
             stream.Type                = Type;
             stream.UpTimeInterval      = UpTime;
             stream.QuoteInterval       = Quote;
             stream.DiscordRelayChannel = Relay;
             _context.SaveChanges();
             return(true);
         }
     }catch (Exception ex)
     {
         Console.WriteLine(ex.ToString());
     }
     return(false);
 }
Пример #3
0
 public async Task <bool> Create(string StreamName, StreamProviderTypes Type, int UpTime, int Quote, string Relay)
 {
     try
     {
         Stream newstream = new Stream();
         newstream.StreamName          = StreamName;
         newstream.Type                = Type;
         newstream.UpTimeInterval      = UpTime;
         newstream.QuoteInterval       = Quote;
         newstream.DiscordRelayChannel = Relay;
         _context.StreamModels.Add(newstream);
         _context.SaveChanges();
         //handleCreated(newstream);
         return(true);
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.ToString());
     }
     return(false);
 }