Esempio n. 1
0
        //=====================================================================

        /// <summary>
        /// Constructor
        /// </summary>
        public MainWindow()
        {
            InitializeComponent();

            cboLanguage.SelectedIndex = 4;
            txtSampleText.Text = File.ReadAllText(@"..\..\MainWindow.xaml");

            // Load the template flow document
            flowTemplate = File.ReadAllText(@"..\..\..\ColorizerLibrary\Template\DocumentTemplate.xaml");

            // Create the code colorizer
            codeColorizer = new CodeColorizer();
            codeColorizer.Init();
        }
Esempio n. 2
0
        protected void Page_Load(object sender, System.EventArgs e)
		{
            if(!Page.IsPostBack)
            {
                // In this case, we'll use a static instance to improve
                // performance with repeated use.
                syntaxEngine = new CodeColorizer();
                syntaxEngine.Init();

                string demoSource = Server.MapPath("Default.aspx.cs");
                using(StreamReader sr = new StreamReader(demoSource))
                {
                    txtContent.Text = sr.ReadToEnd();
                }
            }
        }