public static void LoadSettings() { Options = new OptionsObject(); Options.DemoPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "Demos", "[GROUP]"); try { var str = File.ReadAllText(OptionsFilename); Options = JsonConvert.DeserializeObject <OptionsObject>(str); } catch (IOException) { } }
/// <summary> /// Создать дочерние узлы /// </summary> /// <param name="ParentTreeNode"></param> /// <param name="CallBack"></param> private static void CreateSubNodes(TreeNode ParentTreeNode, DelegateLanguageChange CallBack) { ParentTreeNode.Nodes.Clear(); List <CICloneOptionsGroup> OptionsObjectsList = CreateOptionsObjectsList(CallBack); foreach (CICloneOptionsGroup OptionsObject in OptionsObjectsList) { TreeNode SubNode = new TreeNode(); SubNode.Name = OptionsObject.GetName(); SubNode.Text = OptionsObject.GetName(); SubNode.Tag = OptionsObject; ParentTreeNode.Nodes.Add(SubNode); } }
/// <summary> /// Retorna as configurações iniciais de carregamento do calendario /// </summary> /// <param name="options"></param> /// <returns>Json(string)</returns> public static string GetJSonConfigEvents(OptionsCalendar options = new OptionsCalendar()) { OptionsObject config = new OptionsObject { header = string.IsNullOrEmpty(options.header) ? "false" : options.header , defaultView = options.defaultView.ToString() , allDaySlot = options.allDaySlot , slotEventOverlap = options.slotEventOverlap , selectable = options.selectable , columnFormat = options.columnFormat , timeFormat = options.timeFormat , slotDuration = options.slotDuration.ToString("hh':'mm':'ss") , minTime = TruncateTimeMinutes(options.minTime, options.slotDuration.Minutes).ToString("hh':'mm':'ss") , maxTime = options.maxTime.ToString("hh':'mm':'ss") , scrollTime = options.scrollTime.ToString("hh':'mm':'ss") , aspectRatio = options.aspectRatio , lang = options.lang , defaultDate = options.defaultDate.ToString("s") , calendarClass = options.calendarClass }; return(JsonConvert.SerializeObject(config)); }