diff --git a/4.4/_on_premise_2_getting_started-_console_2_program_8cs-example.html b/4.4/_on_premise_2_getting_started-_console_2_program_8cs-example.html
index 92e6f3b4..3aa19559 100644
--- a/4.4/_on_premise_2_getting_started-_console_2_program_8cs-example.html
+++ b/4.4/_on_premise_2_getting_started-_console_2_program_8cs-example.html
@@ -69,7 +69,7 @@
using FiftyOne.Pipeline.Core.FlowElements;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
{
public class Program
{
public class Example : ExampleBase
{
public void Run(string dataFile, ILoggerFactory loggerFactory, TextWriter output)
{
using (var pipeline = new DeviceDetectionPipelineBuilder(loggerFactory)
.UseOnPremise(dataFile, null, false)
.SetPerformanceProfile(PerformanceProfiles.LowMemory)
.SetShareUsage(false)
.SetAutoUpdate(false)
.SetDataUpdateOnStartUp(false)
.SetDataFileSystemWatcher(false)
.Build())
{
foreach (var values in ExampleUtils.EvidenceValues)
{
AnalyseEvidence(values, pipeline, output);
}
ExampleUtils.CheckDataFile(pipeline, loggerFactory.CreateLogger<Program>());
}
}
private void AnalyseEvidence(
Dictionary<string, object> evidence,
IPipeline pipeline,
TextWriter output)
{
using (var data = pipeline.CreateFlowData())
{
StringBuilder message = new StringBuilder();
message.AppendLine("Input values:");
foreach (var entry in evidence)
{
message.AppendLine($"\t{entry.Key}: {entry.Value}");
}
output.WriteLine(message.ToString());
data.AddEvidence(evidence);
data.Process();
message = new StringBuilder();
message.AppendLine("Results:");
var device = data.Get<IDeviceData>();
OutputValue("Mobile Device", device.IsMobile, message);
OutputValue("Platform Name", device.PlatformName, message);
OutputValue("Platform Version", device.PlatformVersion, message);
OutputValue("Browser Name", device.BrowserName, message);
OutputValue("Browser Version", device.BrowserVersion, message);
OutputValue("DeviceId", device.DeviceId, message);
message.AppendLine("Matched");
foreach(var entry in device.UserAgents.Value)
{
message.AppendLine($"\t{entry}");
}
output.WriteLine(message.ToString());
}
}
private void OutputValue(string name,
IAspectPropertyValue value,
StringBuilder message)
{
message.AppendLine(value.HasValue ?
$"\t{name}: " + value.Value :
$"\t{name}: " + value.NoValueMessage);
}
}
static void Main(string[] args)
{
var dataFile = args.Length > 0 ? args[0] :
ExampleUtils.FindFile(Constants.LITE_HASH_DATA_FILE_NAME);
var loggerFactory = LoggerFactory.Create(b => b.AddConsole());
var logger = loggerFactory.CreateLogger<Program>();
if (dataFile != null)
{
new Example().Run(dataFile, loggerFactory, Console.Out);
}
else
{
logger.LogError("Failed to find a device detection data file. Make sure the " +
"device-detection-data submodule has been updated by running " +
"`git submodule update --recursive`.");
}
loggerFactory.Dispose();
}
}
}
+using FiftyOne.Pipeline.Core.FlowElements;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
{
public class Program
{
public class Example : ExampleBase
{
public void Run(string dataFile, ILoggerFactory loggerFactory, TextWriter output)
{
using (var pipeline = new DeviceDetectionPipelineBuilder(loggerFactory)
.UseOnPremise(dataFile, null, false)
.SetPerformanceProfile(PerformanceProfiles.LowMemory)
.SetShareUsage(false)
.SetAutoUpdate(false)
.SetDataUpdateOnStartUp(false)
.SetDataFileSystemWatcher(false)
.Build())
{
var deviceIDs = new List<string>(ExampleUtils.EvidenceValues.Count);
foreach (var values in ExampleUtils.EvidenceValues)
{
AnalyseEvidence(values, pipeline, output, out var nextDeviceID);
deviceIDs.Add(nextDeviceID);
}
foreach (var nextDeviceID in deviceIDs.Where(d => d is not null))
{
var evidence = new Dictionary<string, object>()
{
{ "query.51D_deviceId", nextDeviceID },
};
AnalyseEvidence(evidence, pipeline, output, out _);
}
ExampleUtils.CheckDataFile(pipeline, loggerFactory.CreateLogger<Program>());
}
}
private void AnalyseEvidence(
Dictionary<string, object> evidence,
IPipeline pipeline,
TextWriter output,
out string deviceID)
{
using (var data = pipeline.CreateFlowData())
{
StringBuilder message = new StringBuilder();
message.AppendLine("Input values:");
foreach (var entry in evidence)
{
message.AppendLine($"\t{entry.Key}: {entry.Value}");
}
output.WriteLine(message.ToString());
data.AddEvidence(evidence);
data.Process();
message = new StringBuilder();
message.AppendLine("Results:");
var device = data.Get<IDeviceData>();
OutputValue("Mobile Device", device.IsMobile, message);
OutputValue("Platform Name", device.PlatformName, message);
OutputValue("Platform Version", device.PlatformVersion, message);
OutputValue("Browser Name", device.BrowserName, message);
OutputValue("Browser Version", device.BrowserVersion, message);
OutputValue("DeviceId", device.DeviceId, message);
message.AppendLine("Matched");
foreach(var entry in device.UserAgents.Value)
{
message.AppendLine($"\t{entry}");
}
output.WriteLine(message.ToString());
deviceID = device.DeviceId.HasValue ? device.DeviceId.Value : null;
}
}
private void OutputValue(string name,
IAspectPropertyValue value,
StringBuilder message)
{
message.AppendLine(value.HasValue ?
$"\t{name}: " + value.Value :
$"\t{name}: " + value.NoValueMessage);
}
}
static void Main(string[] args)
{
var dataFile = args.Length > 0 ? args[0] :
ExampleUtils.FindFile(Constants.LITE_HASH_DATA_FILE_NAME);
var loggerFactory = LoggerFactory.Create(b => b.AddConsole());
var logger = loggerFactory.CreateLogger<Program>();
if (dataFile != null)
{
new Example().Run(dataFile, loggerFactory, Console.Out);
}
else
{
logger.LogError("Failed to find a device detection data file. Make sure the " +
"device-detection-data submodule has been updated by running " +
"`git submodule update --recursive`.");
}
loggerFactory.Dispose();
}
}
}