internal static void Init() { if (isInited is false) { isInited = true; try { Assembly.LoadFrom("Markdig.dll"); } catch (Exception) { Trace.WriteLine("Cannot load Markdig.dll, MDBlog may be unable to work correctly."); } bool Found = false; //Determine if Markdig is loaded. foreach (var item in AppDomain.CurrentDomain.GetAssemblies()) { try { foreach (var t in item.GetTypes()) { if (t.Namespace is not null) { if ( t.Namespace.StartsWith("Markdig")) { isMarkdownUnavailable = false; Found = true; break; } } } } catch (Exception) { } if (Found == true) { break; } } if (isMarkdownUnavailable == true) { Trace.WriteLine("Markdig is unavailable, MDBlog may be unable to work correctly."); } CheckArticleTemplate(); CheckHomepageItemTamplate(); CheckHomepageTamplate(); CheckArticleFolder(); ScheduleTask.Schedule(typeof(SharedResources), "MarkdownBlog.FixedTimeUpdate", ScheduleTaskGap.Sec10); } }
public Main() { ScheduleTask.Schedule(typeof(UpdateTemplateTask), "SimpleDirectoryBrowser.UpdateTask", ScheduleTaskGap.Sec30); }