Exemplo n.º 1
0
        private static string LoadStringFromFile(string path)
        {
            string javaScript = string.Empty;

            using (var stream = ExtensionUtilities.GetStream(path))
            {
                using (var reader = new StreamReader(stream))
                {
                    javaScript = reader.ReadToEnd();
                }
            }

            return(javaScript);
        }
Exemplo n.º 2
0
 private static void LoadSample(RadDiagram diagram, string name)
 {
     diagram.Clear();
     using (var stream = ExtensionUtilities.GetStream(string.Format("/Common/SampleDiagrams/{0}.xml", name)))
     {
         using (var reader = new StreamReader(stream))
         {
             var xml = reader.ReadToEnd();
             if (!string.IsNullOrEmpty(xml))
             {
                 diagram.Load(xml);
             }
         }
     }
     diagram.Dispatcher.BeginInvoke(new Action(() => diagram.AutoFit()), System.Windows.Threading.DispatcherPriority.Loaded);
 }