protected override void OnRegistered()
        {
            base.OnRegistered();

            // Evaluate the document
            OwnerDocument.Evaluate();

            // Scroll the schedule to 6 AM
            m_ScheduleView.Content.ScrollToTime(TimeSpan.FromHours(6));
        }
Beispiel #2
0
        private void LoadExample(NXmlElement element)
        {
            string groupNamespace = NExamplesHomePage.GetNamespace(element);
            string name           = element.GetAttributeValue("name");
            string type           = groupNamespace + "." + element.GetAttributeValue("type");

            try
            {
                type = "Nevron.Nov.Examples." + type;
                Type exampleType = Type.GetType(type);
                if (exampleType != null)
                {
                    NDomType domType = NDomType.FromType(exampleType);
                    NDebug.Assert(domType != null, "The example type:" + type + " is not a valid type");

                    // Create the example
                    DateTime     start   = DateTime.Now;
                    NExampleBase example = domType.CreateInstance() as NExampleBase;
                    example.Title = name;
                    example.Initialize();
                    m_Splitter.Pane2.Content = example;

                    string stats = "Example created in: " + (DateTime.Now - start).TotalSeconds + " seconds, ";

                    // Evaluate the example
                    start = DateTime.Now;
                    OwnerDocument.Evaluate();
                    stats += " evaluated in: " + (DateTime.Now - start).TotalSeconds + " seconds";

                    m_StatusLabel.Text = stats;
                }

                // Set the breadcrumb
                CreateBreadcrumb(element);
            }
            catch (Exception ex)
            {
                NTrace.WriteException("Failed to load example", ex);
                m_Splitter.Pane2.Content = new NErrorPanel("Failed to load example. Exception was: " + ex.Message);
            }
        }