Beispiel #1
0
 /// <summary>
 ///     Loads Snippets
 /// </summary>
 private void LoadSnippets()
 {
     Globals.Snippets = new List <YnoteSnippet>();
     string[] snippets = Directory.GetFiles(GlobalSettings.SettingsDir, "*.ynotesnippet",
                                            SearchOption.AllDirectories);
     Thread.Sleep(5);
     foreach (string snippet in snippets)
     {
         YnoteSnippet snip = YnoteSnippet.Read(snippet);
         Globals.Snippets.Add(snip);
     }
 }
Beispiel #2
0
        /// <summary>
        /// Loads Snippets
        /// </summary>
        private void LoadSnippets()
        {
#if DEBUG
            var watch = new Stopwatch();
            watch.Start();
#endif
            Globals.Snippets = new List <YnoteSnippet>();
            string[] snippets = Directory.GetFiles(GlobalSettings.SettingsDir, "*.ynotesnippet",
                                                   SearchOption.AllDirectories);
            Thread.Sleep(5);
            foreach (string snippet in snippets)
            {
                YnoteSnippet snip = YnoteSnippet.Read(snippet);
                Globals.Snippets.Add(snip);
            }
#if DEBUG
            watch.Stop();
            Debug.WriteLine(string.Format("Loaded {0} Snippets in {1} ms", Globals.Snippets.Count, watch.ElapsedMilliseconds));
#endif
        }