Exemple #1
0
        //Òþ²Ø»ùÀà³ÉÔ±
        public new static AgDocument FromFile(string fullPath)
        {
            if (File.Exists(fullPath))
            {
                string sourceText = File.ReadAllText(fullPath);

                AgDocument document = new AgDocument(Path.GetDirectoryName(fullPath), sourceText);
                document.FullPath = fullPath;

                return(document);
            }

            return(null);
        }
Exemple #2
0
        public static AgDocument FromFile(string fullPath)
        {
            if (File.Exists(fullPath))
            {
                string sourceText = File.ReadAllText(fullPath);

                AgDocument document = new AgDocument(Path.GetDirectoryName(fullPath), sourceText);
                document.FullPath = fullPath;

                return document;
            }

            return null;
        }
Exemple #3
0
        public static XamlDocument FromFile(string fullPath)
        {
            if (File.Exists(fullPath))
            {
                string sourceText = File.ReadAllText(fullPath);

                XamlDocument document = null;

                if (sourceText.Contains("http://schemas.microsoft.com/winfx/2006/xaml/presentation"))
                {
                    document = new WpfDocument(Path.GetDirectoryName(fullPath), sourceText);
                }
                else
                {
                    document = new AgDocument(Path.GetDirectoryName(fullPath), sourceText);
                }


                document.FullPath = fullPath;
                return(document);
            }

            return(null);
        }
Exemple #4
0
        void NewAgTab_Executed(object sender, ExecutedRoutedEventArgs args)
        {
            if (sender == this)
            {
                AgDocument doc = new AgDocument(System.IO.Directory.GetCurrentDirectory());
                XamlDocuments.Add(doc);

                this.DocumentsView.SelectedDocument = doc;

            }
        }
Exemple #5
0
        public static XamlDocument FromFile(string fullPath)
        {
            if (File.Exists(fullPath))
            {
                string sourceText = File.ReadAllText(fullPath);

                XamlDocument document = null;

                if (sourceText.Contains("http://schemas.microsoft.com/winfx/2006/xaml/presentation"))
                {
                    document = new WpfDocument(Path.GetDirectoryName(fullPath), sourceText);
                }
                else
                {
                    document = new AgDocument(Path.GetDirectoryName(fullPath), sourceText);
                }

                document.FullPath = fullPath;
                return document;
            }

            return null;
        }