HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/MBoogaard/oosting-horseriding.com/CMS/CMSAdminControls/Debug/FilesLog.ascx.cs
using System;
using System.Data;
using System.Linq;

using CMS.DataEngine;
using CMS.ExtendedControls;
using CMS.Helpers;
using CMS.IO;
using CMS.UIControls;

public partial class CMSAdminControls_Debug_FilesLog : FilesLog
{
    protected override void OnPreRender(EventArgs e)
    {
        base.OnPreRender(e);

        Visible = false;

        var dt = GetLogData();
        if (dt != null)
        {
            DataView dv;
            var providerSet = !String.IsNullOrEmpty(ProviderName);

            lock (dt)
            {
                if (providerSet || WriteOnly)
                {
                    var readOnlyOperationSet = FileDebugOperation.ReadOnlyOperations.ToHashSet(StringComparer.InvariantCultureIgnoreCase);

                    var results = from row in dt.AsEnumerable()
                                  where (!providerSet || row.Field<string>("ProviderName").Equals(ProviderName, StringComparison.InvariantCultureIgnoreCase)) 
                                        && (!WriteOnly || !readOnlyOperationSet.Contains(row.Field<string>("FileOperation")))
                                  select row;

                    dv = results.AsDataView();
                }
                else
                {
                    dv = new DataView(dt);
                }
            }

            if (!DataHelper.DataSourceIsEmpty(dv))
            {
                Visible = true;

                gridStates.SetHeaders("", "FilesLog.Operation", "FilesLog.FilePath", "FilesLog.OperationType", "General.Context");

                // Hide the operation type column if only specific operation type is selected
                if (providerSet)
                {
                    gridStates.Columns[3].Visible = false;
                }

                HeaderText = GetString("FilesLog.Info");

                // Bind the data
                BindGrid(gridStates, dv);
            }
        }
    }
}