Пример #1
0
        void Log_Initializing(object sender, LogInitializingEventArgs e)
        {
            if (m_HaveCanceled == false)
            {
                //we haven't done our first cancel test.
                e.Cancel       = true;
                m_HaveCanceled = true;
            }
            else
            {
                //set up our logging.
                PublisherConfiguration publisher = e.Configuration.Publisher;
                publisher.ProductName     = "NUnit";
                publisher.ApplicationName = "Gibraltar.Test";

                //and now try to get the file version.  This is risky.
                var fileVersionAttributes = this.GetType().GetTypeInfo().Assembly.GetCustomAttributes(typeof(AssemblyFileVersionAttribute));

                if (fileVersionAttributes != null)
                {
                    AssemblyFileVersionAttribute leadAttribute = fileVersionAttributes.FirstOrDefault() as AssemblyFileVersionAttribute;

                    if (leadAttribute != null)
                    {
                        publisher.ApplicationVersion = new Version(leadAttribute.Version);
                    }
                }

                publisher.ApplicationDescription = "NUnit tests of the Gibraltar Core Library";

                e.Configuration.SessionFile.EnableFilePruning = false;
            }
        }
        private static void LogOnInitializing(object sender, LogInitializingEventArgs e)
        {
            e.Configuration.Publisher.ProductName = "Loupe";
            e.Configuration.Publisher.ApplicationName = "Network Agent Tests";

            AssemblyFileVersionAttribute assemblyFileVersion = (AssemblyFileVersionAttribute)Assembly.GetAssembly(typeof(ConnectivityMonitor)).GetCustomAttributes(typeof(AssemblyFileVersionAttribute), false).FirstOrDefault();
            e.Configuration.Publisher.ApplicationVersion = new Version(assemblyFileVersion.Version);
        }
Пример #3
0
 void Log_Initializing(object sender, LogInitializingEventArgs e)
 {
     //lets spot check a few values to be sure they're the same.
     Assert.AreEqual(m_Configuration.Publisher.ProductName, e.Configuration.Publisher.ProductName);
     Assert.AreEqual(m_Configuration.Publisher.ApplicationName, e.Configuration.Publisher.ApplicationName);
     Assert.AreEqual(m_Configuration.Publisher.ApplicationVersion, e.Configuration.Publisher.ApplicationVersion);
     Assert.AreEqual(m_Configuration.SessionFile.EnableFilePruning, e.Configuration.SessionFile.EnableFilePruning);
 }
 void Log_Initializing(object sender, LogInitializingEventArgs e)
 {
     e.Configuration.AutoSendConsent.CompanyName = companyName;
     e.Configuration.AutoSendConsent.ServiceName = serviceName;
     e.Configuration.AutoSendConsent.PrivacyPolicyUrl = privacyPolicyUrl;
     e.Configuration.AutoSendConsent.Enabled = autoSendConsent;
     e.Configuration.AutoSendConsent.ConsentDefault = consentDefault;
     e.Configuration.AutoSendConsent.PromptUserOnStartupLimit = promptUserOnStartupLimit;
 }
        void Log_Initializing(object sender, LogInitializingEventArgs e)
        {
            var publisherConfig = e.Configuration.Publisher;

            publisherConfig.ApplicationDescription = "HTTp Module Unit Tests";
            publisherConfig.ApplicationName        = "Unit Tests";
            publisherConfig.ProductName            = "Loupe.Agent.Web.Module";
            publisherConfig.EnvironmentName        = "Development";
        }
Пример #6
0
        private static void LogOnInitializing(object sender, LogInitializingEventArgs e)
        {
            e.Configuration.Publisher.ProductName     = "Loupe";
            e.Configuration.Publisher.ApplicationName = "Network Agent Tests";

            AssemblyFileVersionAttribute assemblyFileVersion = (AssemblyFileVersionAttribute)Assembly.GetAssembly(typeof(ConnectivityMonitor)).GetCustomAttributes(typeof(AssemblyFileVersionAttribute), false).FirstOrDefault();

            e.Configuration.Publisher.ApplicationVersion = new Version(assemblyFileVersion.Version);
        }
        private static void LogOnInitializing(object sender, LogInitializingEventArgs e)
        {
            if (e.Cancel)
            {
                return;
            }

            //we really need a post-initializing event so we can get the final running
            //configuration but this is the closest we can get with the current Loupe agent.
            _agentConfiguration = e.Configuration;

            Log.Initializing -= LogOnInitializing;
        }
Пример #8
0
        static void Log_Initializing(object sender, LogInitializingEventArgs e)
        {
            // Here we can configure and even cancel initialization of the application.

            // You can use the publisher configuration to override the product & application name
            e.Configuration.Publisher.ProductName = "Override Product";
            e.Configuration.Publisher.ApplicationName = "Override Application";

            // You can also add name/value pairs to be recorded in the session header for improved
            // categorization and analysis later.
            e.Configuration.Properties.Add("CustomerName", "The customer name from our license");

            // You can also use the cancel feature combined with #define to turn off the agent at compile time.
#if (!DEBUG)
            // This is not a debug compile, and we'll choose to disable the agent for release builds.
            e.Cancel = true;
#endif
        }
Пример #9
0
        static void Log_Initializing(object sender, LogInitializingEventArgs e)
        {
            // Here we can configure and even cancel initialization of the application.

            // You can use the publisher configuration to override the product & application name
            e.Configuration.Publisher.ProductName     = "Override Product";
            e.Configuration.Publisher.ApplicationName = "Override Application";

            // You can also add name/value pairs to be recorded in the session header for improved
            // categorization and analysis later.
            e.Configuration.Properties.Add("CustomerName", "The customer name from our license");

            // You can also use the cancel feature combined with #define to turn off the agent at compile time.
#if (!DEBUG)
            // This is not a debug compile, and we'll choose to disable the agent for release builds.
            e.Cancel = true;
#endif
        }
Пример #10
0
 void Log_Initializing(object sender, LogInitializingEventArgs e)
 {
     e.Configuration.Viewer.FormTitleText = "Live Log Viewer (WinForms within WPF)";
 }
Пример #11
0
 private static void OnLogInitializing(object sender, LogInitializingEventArgs e)
 {
     e.Configuration.Publisher.EnableDebugMode = true;
 }
Пример #12
0
 void Log_Initializing(object sender, LogInitializingEventArgs e)
 {
     e.Configuration.Viewer.FormTitleText = "Live Log Viewer (WinForms within WPF)";
 }