Esempio n. 1
0
        protected override void OnPreRender(EventArgs e)
        {
            base.OnPreRender(e);

            ShowLastError();

            try
            {
                CheckDatabase();
            }
            catch (Exception ex)
            {
                lblDbConnection.Text = formatException(ex);
            }

            try
            {
                lblRootNode.Text = CurrentInstallationManager.CheckRootItem();
            }
            catch (Exception ex)
            {
                lblRootNode.Text = formatException(ex);
            }

            try
            {
                lblStartNode.Text = CurrentInstallationManager.CheckStartPage();
            }
            catch (Exception ex)
            {
                lblStartNode.Text = formatException(ex);
            }

            try
            {
                recentChanges = N2.Find.Items.All.MaxResults(5).OrderBy.Updated.Desc.Select().Select(i => i.SavedBy + ": #" + i.ID + " " + i.Title + " (" + i.Updated + ")").ToArray();
            }
            catch (Exception ex)
            {
                lblChanges.Text = formatException(ex);
            }

            try
            {
                lblN2Version.Text   = (new AssemblyName(Assembly.Load("N2").FullName)).Version.ToString();
                lblEditVersion.Text = (new AssemblyName(Assembly.Load("N2.Management").FullName)).Version.ToString();
            }
            catch (Exception ex)
            {
                lblEditVersion.Text = formatException(ex);
            }

            try
            {
                rptDefinitions.DataSource = N2.Context.Definitions.GetDefinitions().SelectMany(d => N2.Context.Definitions.GetTemplates(d.ItemType).Select(t => t.Definition));
                rptDefinitions.DataBind();
            }
            catch (Exception ex)
            {
                lblDefinitions.Text = formatException(ex);
            }

            try
            {
                rptAssembly.DataSource = N2.Context.Current.Resolve <ITypeFinder>().GetAssemblies();
                rptAssembly.DataBind();
            }
            catch (Exception ex)
            {
                lblAssemblies.Text = formatException(ex);
            }
        }
Esempio n. 2
0
        protected override void OnPreRender(EventArgs e)
        {
            base.OnPreRender(e);

            ShowLastError();

            try
            {
                CheckDatabase();
            }
            catch (Exception ex)
            {
                lblDbConnection.Text = formatException(ex);
            }

            try
            {
                lblRootNode.Text = CurrentInstallationManager.CheckRootItem();
            }
            catch (Exception ex)
            {
                lblRootNode.Text = formatException(ex);
            }

            try
            {
                lblStartNode.Text = CurrentInstallationManager.CheckStartPage();
            }
            catch (Exception ex)
            {
                lblStartNode.Text = formatException(ex);
            }

            try
            {
                //recentChanges = N2.Find.Items.All.MaxResults(5).OrderBy.Updated.Desc.Select().Select(i => i.SavedBy + ": #" + i.ID + " " + i.Title + " (" + i.Updated + ")").ToArray();
                recentChanges = Engine.Resolve <IContentItemRepository>().Find(ParameterCollection.Empty.OrderBy("Updated DESC").Take(5)).Select(i => i.SavedBy + ": #" + i.ID + " " + i.Title + " (" + i.Updated + ")").ToArray();
                //N2.Find.Items.All.MaxResults(5).OrderBy.Updated.Desc.Select().Select(i => i.SavedBy + ": #" + i.ID + " " + i.Title + " (" + i.Updated + ")").ToArray();
            }
            catch (Exception ex)
            {
                lblChanges.Text = formatException(ex);
            }

            try
            {
                rptDefinitions.DataSource = N2.Context.Definitions.GetDefinitions().SelectMany(d => N2.Context.Current.Resolve <ITemplateAggregator>().GetTemplates(d.ItemType).Select(t => t.Definition));
                rptDefinitions.DataBind();
            }
            catch (Exception ex)
            {
                lblDefinitions.Text = formatException(ex);
            }

            try
            {
                rptAssembly.DataSource = N2.Context.Current.Resolve <ITypeFinder>().GetAssemblies();
                rptAssembly.DataBind();
            }
            catch (Exception ex)
            {
                lblAssemblies.Text = formatException(ex);
            }

            ScheduledActions = Engine.Resolve <N2.Plugin.Scheduling.Scheduler>().Actions;
        }