Exemple #1
0
 public static void Init()
 {
     if (!Directory.Exists(Program.RunLocal + "Video"))
     {
         Directory.CreateDirectory(Program.RunLocal + "Video");
     }
     Config = ConfigUtils.VideoPic;
     back   = ColorTranslator.FromHtml(Config.BackGround);
     name_color?.Dispose();
     uid_color?.Dispose();
     title_color?.Dispose();
     info_color?.Dispose();
     state_color?.Dispose();
     name_font?.Dispose();
     uid_font?.Dispose();
     title_font?.Dispose();
     info_font?.Dispose();
     state_font?.Dispose();
     name_color  = new SolidBrush(ColorTranslator.FromHtml(Config.NameColor));
     uid_color   = new SolidBrush(ColorTranslator.FromHtml(Config.UidColor));
     title_color = new SolidBrush(ColorTranslator.FromHtml(Config.TitleColor));
     info_color  = new SolidBrush(ColorTranslator.FromHtml(Config.InfoColor));
     state_color = new SolidBrush(ColorTranslator.FromHtml(Config.StateColor));
     name_font   = new(Config.Font, Config.NameSize, FontStyle.Regular);
     uid_font    = new(Config.Font, Config.UidSize, FontStyle.Regular);
     title_font  = new(Config.Font, Config.TitleSize, FontStyle.Regular);
     info_font   = new(Config.Font, Config.InfoSize, FontStyle.Regular);
     state_font  = new(Config.Font, Config.StateSize, FontStyle.Regular);
     Qback       = ColorTranslator.FromHtml(Config.QBack);
     Qpoint      = ColorTranslator.FromHtml(Config.QPoint);
 }
 public IActionResult Save([FromBody] VideoSave saveData)
 {
     try
     {
         var userData = jwtService.ParseData(this.User);
         var result   = this.videoService.Save(
             saveData.videoId, saveData.seekTo, saveData.duration,
             saveData.name, saveData.description, saveData.url,
             saveData.changes, saveData.newItems,
             saveData.finalSave, userData.UserId);
         return(Ok(result));
     }
     catch (ServiceException e)
     {
         return(BadRequest(e.Message));
     }
 }
        public override void Load(string s)
        {
            VideoSave save = null;

            if (!string.IsNullOrEmpty(s))
            {
                save = JsonUtility.FromJson <VideoSave>(s);
            }
            if (save != null)
            {
                currentSettings = save;
            }
            else
            {
                currentSettings = defaultSaveSettings.ShallowCopy();
            }
            singleton = this;
        }