Browse Source

Web tracing helper classes updated. Added note about missing Visual Leak Detector.

pull/1099/head
Evaldas Jocys 7 years ago
parent
commit
bd29a7680d
  1. 71
      x360ce.Engine/JocysCom/Diagnostics/TraceHelper.cs
  2. 10
      x360ce.Engine/JocysCom/IO/LogFileWriter.cs
  3. 1
      x360ce.Engine/JocysCom/Runtime/LogHelper.Exception.cs
  4. 7
      x360ce.Engine/JocysCom/Runtime/LogHelper.cs
  5. 108
      x360ce.Engine/JocysCom/Web/Services/HttpLogModule.cs
  6. 203
      x360ce.Engine/JocysCom/Web/Services/RawDataLogHttpModule.cs
  7. 291
      x360ce.Engine/JocysCom/Web/Services/TraceExtension.cs
  8. 26
      x360ce.Engine/JocysCom/Web/Services/TraceExtensionAttribute.cs
  9. 5
      x360ce.Engine/x360ce.Engine.csproj
  10. 9
      x360ce.Web/WebServices/x360ce.asmx.cs
  11. 11
      x360ce.Web/WebServices/x360ce.asmx.v3.cs
  12. 4
      x360ce.Web/WebServices/x360ce.asmx.v4.cs
  13. 6
      x360ce.Web/x360ce.Web.csproj
  14. 4
      x360ce/x360ce/dllmain.cpp

71
x360ce.Engine/JocysCom/Diagnostics/TraceHelper.cs

@ -0,0 +1,71 @@
using System.Collections.Specialized;
using System.Diagnostics;
using System.IO;
using System.Text;
using System.Xml;
using System.Xml.XPath;
namespace JocysCom.ClassLibrary.Diagnostics
{
public class TraceHelper
{
public static void AddLog(string sourceName, params object[] data)
{
// Add source
var source = new TraceSource(sourceName);
//source.Listeners.Add(_Listener);
source.Switch.Level = SourceLevels.All;
source.TraceData(TraceEventType.Information, 0, data);
source.Flush();
source.Close();
}
public static void AddLog(string sourceName, NameValueCollection collection)
{
// Write Data.
var settings = new XmlWriterSettings();
settings.Indent = true;
settings.IndentChars = ("\t");
settings.OmitXmlDeclaration = true;
var sb = new StringBuilder();
// Create the XmlWriter object and write some content.
var writer = XmlWriter.Create(sb, settings);
writer.WriteStartElement("Data");
foreach (var key in collection.AllKeys)
{
var keyString = string.Format("{0}", key);
var valString = string.Format("{0}", collection[key]);
writer.WriteElementString(keyString, valString);
}
writer.WriteEndElement();
writer.Flush();
AddXml(sourceName, sb.ToString());
writer.Close();
}
static void AddXml(string sourceName, string xml)
{
using (var sr = new StringReader(xml))
{
using (var tr = new XmlTextReader(sr))
{
// Settings used to protect from
// CWE-611: Improper Restriction of XML External Entity Reference('XXE')
// https://cwe.mitre.org/data/definitions/611.html
var settings = new XmlReaderSettings();
settings.DtdProcessing = DtdProcessing.Ignore;
settings.XmlResolver = null;
using (var xr = XmlReader.Create(tr, settings))
{
var doc = new XPathDocument(tr);
var nav = doc.CreateNavigator();
AddLog(sourceName, nav);
}
}
}
}
}
}

10
x360ce.Engine/JocysCom/IO/LogFileWriter.cs

@ -19,7 +19,7 @@ namespace JocysCom.ClassLibrary.IO
object streamWriterLock = new object();
public string LogFileName { get; set; }
public string _CurrentFileFileName { get; set; }
public string _CurrentFileFileName { get; private set; }
public bool LogFileEnabled { get; set; }
public DateTime LogFileDate { get; set; }
@ -52,13 +52,17 @@ namespace JocysCom.ClassLibrary.IO
public LogFileWriter()
{
_configPrefix = "";
// This class can be inherited therefore make sure that prefix is different.
// Get type will return derived class or this class if not derived.
_configPrefix = GetType().Name;
_Init();
}
public LogFileWriter(string configPrefix)
{
_configPrefix = configPrefix ?? "";
// This class can be inherited therefore make sure that prefix is different.
// Get type will return derived class or this class if not derived.
_configPrefix = configPrefix ?? GetType().Name;
if (!_configPrefix.EndsWith("_") && !_configPrefix.EndsWith("-"))
_configPrefix += "_";
_Init();

1
x360ce.Engine/JocysCom/Runtime/LogHelper.Exception.cs

@ -5,7 +5,6 @@ using System.Configuration;
using System.Diagnostics;
using System.Security;
using System.ComponentModel;
using System.Collections.Generic;
namespace JocysCom.ClassLibrary.Runtime
{

7
x360ce.Engine/JocysCom/Runtime/LogHelper.cs

@ -18,9 +18,14 @@ namespace JocysCom.ClassLibrary.Runtime
public LogHelper()
{
// This class can be inherited therefore make sure that prefix is different.
// Get type will return derived class or this class if not derived.
_configPrefix = GetType().Name;
_FileWriter = new IO.LogFileWriter(_configPrefix);
}
static string _configPrefix;
private static LogHelper _Current;
private static object currentLock = new object();
public static LogHelper Current
@ -45,8 +50,6 @@ namespace JocysCom.ClassLibrary.Runtime
_Current.Dispose();
}
static string _configPrefix = "LogHelper_";
#region Process Exceptions
/// <summary>

108
x360ce.Engine/JocysCom/Web/Services/HttpLogModule.cs

@ -1,108 +0,0 @@
using System;
using System.Diagnostics;
using System.IO;
using System.Text;
using System.Web;
using System.Xml;
using System.Xml.XPath;
namespace JocysCom.ClassLibrary.Web.Services
{
public class HttpLogModule : IHttpModule
{
// If you are running Web Application in Classic mode:
// <system.web>
// <httpModules>
// <add name="ClientHttpModule" type="JocysCom.ClassLibrary.Web.Services.HttpLogModule,JocysCom.ClassLibrary" />
// </httpModules>
// </system.web>
//
// If you are running Web Server in Integrated mode:
// <system.webServer>
// <modules>
// <add name="ClientHttpModule" type="JocysCom.ClassLibrary.Web.Services.HttpLogModule,JocysCom.ClassLibrary" />
// </modules>
// </system.webServer>
// <system.diagnostics>
// <sources>
// <source name="HttpLogModule" switchValue="Verbose">
// <listeners>
// <add name="HttpPostLogs" />
// </listeners>
// </source>
// </sources >
//<sharedListeners >
// <!-- Files can be opened with SvcTraceViewer.exe.make sure that IIS_IUSRS group has write permissions on this folder. -->
// <add name="HttpPostLogs" type="JocysCom.ClassLibrary.Diagnostics.RollingXmlWriterTraceListener, JocysCom.ClassLibrary" initializeData="c:\inetpub\logs\LogFiles\HttpPostListener.svclog" />
//</sharedListeners>
void AddLog(params object[] data)
{
// Add source
var source = new TraceSource(GetType().Name);
//source.Listeners.Add(_Listener);
source.Switch.Level = SourceLevels.All;
source.TraceData(TraceEventType.Information, 38, data);
source.Flush();
source.Close();
}
void AddXml(string xml)
{
using (var sr = new StringReader(xml))
{
using (var tr = new XmlTextReader(sr))
{
var doc = new XPathDocument(tr);
var nav = doc.CreateNavigator();
AddLog(nav);
}
}
}
public HttpLogModule()
{
}
public void Dispose()
{
}
public void Init(HttpApplication context)
{
context.BeginRequest += new EventHandler(context_BeginRequest);
}
private void context_BeginRequest(object sender, EventArgs e)
{
if (sender != null && sender is HttpApplication)
{
var request = (sender as HttpApplication).Request;
var response = (sender as HttpApplication).Response;
if (request != null)
{
var settings = new XmlWriterSettings();
settings.Indent = true;
settings.IndentChars = ("\t");
settings.OmitXmlDeclaration = true;
var sb = new StringBuilder();
// Create the XmlWriter object and write some content.
var writer = XmlWriter.Create(sb, settings);
writer.WriteStartElement("Data");
writer.WriteElementString("HttpMethod", request.HttpMethod);
writer.WriteElementString("Form", request.Form.ToString());
writer.WriteEndElement();
writer.Flush();
AddXml(sb.ToString());
writer.Close();
// Add to IIS log.
//if (!string.IsNullOrWhiteSpace(body))
// response.AppendToLog(body);
}
}
}
}
}

203
x360ce.Engine/JocysCom/Web/Services/RawDataLogHttpModule.cs

@ -0,0 +1,203 @@
using System;
using System.Collections.Specialized;
using System.IO;
using System.Text;
using System.Web;
namespace JocysCom.ClassLibrary.Diagnostics
{
public class RawDataLogHttpModule : IHttpModule
{
/*
If you are running Web Application in:
Classic mode then add node inside <configuration><system.web><httpModules> section.
Integrated mode then add node inside "<configuration><system.webServer><modules> section.
<!-- Enabling Tracing: JocysCom.ClassLibrary.Web.Services.TraceRawDataHttpModule -->
<add name="JocysComHttpModule" type="JocysCom.ClassLibrary.Web.Services.RawDataLogHttpModule,JocysCom.ClassLibrary" />
Add source inside <configuration><system.diagnostics><sources> node:
<!-- Enabling Tracing: JocysCom.ClassLibrary.Web.Services.RawDataLogHttpModule -->
<source name="RawDataLogHttpModule" switchValue="Verbose">
<listeners>
<add name="SvcFileTraceListener" />
</listeners>
</source>
Add listener inside <configuration><system.diagnostics><sharedListeners> node:
<!-- Files can be opened with SvcTraceViewer.exe.make sure that IIS_IUSRS group has write permissions on this folder. -->
<add name="SvcFileTraceListener" type="System.Diagnostics.XmlWriterTraceListener" initializeData="c:\inetpub\logs\LogFiles\WebServiceLogs.svclog" />
*/
public RawDataLogHttpModule()
{
}
public void Dispose()
{
}
public void Init(HttpApplication context)
{
// Capture request.
context.BeginRequest += context_BeginRequest;
// Capture response.
context.PreRequestHandlerExecute += context_PreRequestHandlerExecute;
context.PreSendRequestContent += context_PreSendRequestContent;
}
private void context_BeginRequest(object sender, EventArgs e)
{
var application = sender as HttpApplication;
if (application == null)
return;
var request = application.Request;
if (request == null)
return;
// Process.
var col = new NameValueCollection();
col.Add("HashCode", string.Format("{0:X4}", request.GetHashCode()));
col.Add("Event", "BeginRequest");
col.Add("UserHostAddress", request.UserHostAddress);
col.Add("Url", string.Format("{0}", request.Url));
col.Add("HttpMethod", request.HttpMethod);
var sb = new StringBuilder();
foreach (var key in request.Headers.AllKeys)
sb.AppendFormat("{0}: {1}\r\n", key, request.Headers[key]);
col.Add("Headers", sb.ToString());
// Get raw body.
request.InputStream.Position = 0;
var sr = new StreamReader(request.InputStream, request.ContentEncoding);
var body = sr.ReadToEnd();
request.InputStream.Position = 0;
col.Add("Body", body);
TraceHelper.AddLog(GetType().Name, col);
// Add custom information to IIS log.
// response.AppendToLog(body);
}
void context_PreRequestHandlerExecute(object sender, EventArgs e)
{
var application = sender as HttpApplication;
var context = application.Context;
var response = context.Response;
// Add a filter to capture response stream
response.Filter = new ResponseCaptureStream(response.Filter, response.ContentEncoding);
}
void context_PreSendRequestContent(object sender, EventArgs e)
{
var application = sender as HttpApplication;
var context = application.Context;
var request = context.Request;
var response = context.Response;
var filter = response.Filter as ResponseCaptureStream;
if (filter == null)
return;
// Process.
var col = new NameValueCollection();
col.Add("HashCode", string.Format("{0:X4}", request.GetHashCode()));
col.Add("Event", "PreSendRequestContent");
col.Add("StatusCode", response.StatusCode.ToString());
var sb = new StringBuilder();
foreach (var key in response.Headers.AllKeys)
sb.AppendFormat("{0}: {1}\r\n", key, response.Headers[key]);
col.Add("Headers", sb.ToString());
// Get raw body.
var body = filter.StreamContent;
col.Add("Body", body);
TraceHelper.AddLog(GetType().Name, col);
}
private class ResponseCaptureStream : Stream
{
private readonly Stream _streamToCapture;
private readonly Encoding _responseEncoding;
private string _streamContent;
public string StreamContent
{
get { return _streamContent; }
private set
{
_streamContent = value;
}
}
public ResponseCaptureStream(Stream streamToCapture, Encoding responseEncoding)
{
_responseEncoding = responseEncoding;
_streamToCapture = streamToCapture;
}
public override bool CanRead
{
get { return _streamToCapture.CanRead; }
}
public override bool CanSeek
{
get { return _streamToCapture.CanSeek; }
}
public override bool CanWrite
{
get { return _streamToCapture.CanWrite; }
}
public override void Flush()
{
_streamToCapture.Flush();
}
public override long Length
{
get { return _streamToCapture.Length; }
}
public override long Position
{
get
{
return _streamToCapture.Position;
}
set
{
_streamToCapture.Position = value;
}
}
public override int Read(byte[] buffer, int offset, int count)
{
return _streamToCapture.Read(buffer, offset, count);
}
public override long Seek(long offset, SeekOrigin origin)
{
return _streamToCapture.Seek(offset, origin);
}
public override void SetLength(long value)
{
_streamToCapture.SetLength(value);
}
public override void Write(byte[] buffer, int offset, int count)
{
_streamContent += _responseEncoding.GetString(buffer);
_streamToCapture.Write(buffer, offset, count);
}
public override void Close()
{
_streamToCapture.Close();
base.Close();
}
}
}
}

291
x360ce.Engine/JocysCom/Web/Services/TraceExtension.cs

@ -1,291 +0,0 @@
using System;
using System.IO;
using System.Web.Services.Protocols;
using System.Windows.Forms;
namespace JocysCom.ClassLibrary.Web.Services
{
//<!-- Trace Extension -->
//<add key = "TraceExtension_LogFileOn" value="true"/>
//<add key = "TraceExtension_LogBrowserCompatible" value="false"/>
//<add key = "TraceExtension_LogFileDirectory" value="%ProgramData%\JocysCom\WebServiceName"/>
/// <summary>
/// Define a SOAP Extension that traces the SOAP request and SOAP
/// response for the XML Web service method the SOAP extension is
/// applied to.
/// </summary>
/// <remarks>
/// http://msdn.microsoft.com/en-us/library/ms972353.aspx
/// You must add attribute &gt;TraceExtensionAttribute()&lt;
/// on web service method in order for extension to capture traffic:
/// [WebMethod(Description = "Called when vendor wishes to accept booking."), TraceExtension()]
/// public string AcceptBooking(int ConciergeRef, string WSContract, string VendorRef)
/// {
/// }
/// </remarks>
public class TraceExtension : SoapExtension, IDisposable
{
// Fields
public static string DirPath = string.Empty;
/// <summary>
/// Newly created stream.
/// </summary>
Stream logStream;
static object objFileLock = new object();
/// <summary>
/// Save the old stream.
/// </summary>
private Stream oldStream;
private const string RootNodeName = "SoapMessages";
#region "Properties"
public bool ParseBool(string name, bool defaultValue)
{
string v = System.Configuration.ConfigurationManager.AppSettings[name];
if (v == null) return defaultValue;
return bool.Parse(v);
}
public string ParseString(string name, string defaultValue)
{
string v = System.Configuration.ConfigurationManager.AppSettings[name];
if (v == null) return defaultValue;
return v;
}
public bool IsLogFileOn
{
get { return ParseBool("TraceExtension_LogFileOn", false); }
}
public bool IsLogBrowserCompatible
{
get { return ParseBool("TraceExtension_LogBrowserCompatible", true); }
}
public string LogDirectory
{
get
{
if (string.IsNullOrEmpty(_LogDirectory))
{
var log = ParseString("TraceExtension_LogFileDirectory", null);
if (!string.IsNullOrEmpty(log))
{
_LogDirectory = Environment.ExpandEnvironmentVariables(log);
}
}
if (string.IsNullOrEmpty(_LogDirectory))
_LogDirectory = GetLogFolder();
return _LogDirectory;
}
set { _LogDirectory = value; }
}
string _LogDirectory;
#endregion
// Methods
/// <summary>
/// Save the Stream representing the SOAP request or SOAP response into a local memory buffer.
/// </summary>
/// <param name="stream">Stream input</param>
/// <returns>New stream</returns>
public override Stream ChainStream(System.IO.Stream stream)
{
oldStream = stream;
if (IsLogFileOn)
{
logStream = new MemoryStream();
return logStream;
}
return oldStream;
}
/// <summary>
/// Copy one stream to another.
/// </summary>
/// <param name="input"></param>
/// <param name="output"></param>
private void Copy(Stream input, Stream output)
{
byte[] buffer = new byte[0x4000];
int count;
while ((count = input.Read(buffer, 0, buffer.Length)) != 0)
output.Write(buffer, 0, count);
}
public string GetLogFolder(bool userLevel = false)
{
var specialFolder = userLevel
? Environment.SpecialFolder.ApplicationData
: Environment.SpecialFolder.CommonApplicationData;
var path = string.Format("{0}\\{1}\\{2}",
Environment.GetFolderPath(specialFolder),
Application.CompanyName,
Application.ProductName);
return path;
}
public string GetFileName(string fileName = null, bool userLevel = false)
{
var file = string.IsNullOrEmpty(fileName)
? string.Format("{0}_{1:yyyyMMdd_HHmmss}.log", GetType().Name, DateTime.Now)
: fileName;
var path = Path.Combine(LogDirectory, file);
return path;
}
FileStream GetFileStream()
{
string filename = GetFileName();
FileInfo fi = new FileInfo(Path.Combine(LogDirectory, filename));
if (!fi.Directory.Exists)
fi.Directory.Create();
FileStream fsReturn = new FileStream(fi.FullName, FileMode.Append, FileAccess.Write);
return fsReturn;
}
/// <summary>
/// The SOAP extension was configured to run using a configuration file
/// instead of an attribute applied to a specific XML Web service
/// method.
/// </summary>
/// <param name="WebServiceType"></param>
/// <returns></returns>
public override object GetInitializer(Type WebServiceType)
{
return null;
}
/// <summary>
/// When the SOAP extension is accessed for the first time, the XML Web
/// service method it is applied to is accessed to store the file
/// name passed in, using the corresponding SoapExtensionAttribute.
/// </summary>
/// <param name="methodInfo"></param>
/// <param name="attribute"></param>
/// <returns></returns>
public override object GetInitializer(LogicalMethodInfo methodInfo, SoapExtensionAttribute attribute)
{
return null;
}
/// <summary>
/// Receive the file name stored by GetInitializer and store it in a
/// member variable for this specific instance.
/// </summary>
/// <param name="initializer">Initializer object</param>
public override void Initialize(object initializer)
{
}
public override void ProcessMessage(SoapMessage message)
{
lock (objFileLock)
{
if (IsLogFileOn)
{
switch (message.Stage)
{
case SoapMessageStage.BeforeSerialize:
// Output/Request:
// The stage before a System.Web.Services.Protocols.SoapMessage is serialized.
break;
case SoapMessageStage.AfterSerialize:
// Output/Request:
// The stage just after a System.Web.Services.Protocols.SoapMessage is serialized,
// but before the SOAP message is sent over the wire.
break;
case SoapMessageStage.BeforeDeserialize:
// Input/Response:
// The stage just before a System.Web.Services.Protocols.SoapMessage is deserialized
// from the SOAP message sent across the network into an object.
break;
case SoapMessageStage.AfterDeserialize:
// Input/Response:
//The stage after a System.Web.Services.Protocols.SoapMessage is deserialized
break;
}
Write(message);
}
}
}
private DateTime oldTime;
private void Write(SoapMessage message)
{
double timePassed = 0;
var n = DateTime.Now;
if (oldTime != null) timePassed = n.Subtract(oldTime).TotalSeconds;
oldTime = n;
bool writeStream = message.Stage == SoapMessageStage.AfterSerialize | message.Stage == SoapMessageStage.BeforeDeserialize;
bool isInput = message.Stage == SoapMessageStage.BeforeDeserialize | message.Stage == SoapMessageStage.AfterDeserialize;
if (writeStream)
{
if (isInput)
{
Copy(oldStream, logStream);
}
else
{
logStream.Position = 0;
Copy(logStream, oldStream);
}
logStream.Position = 0;
}
FileStream fs = GetFileStream();
StreamWriter w = new StreamWriter(fs);
w.WriteLine("----------------------------------------------------------------");
w.WriteLine(string.Format("{0:yyyy-MM-ddTHH:mm:ss.ffffffzzz} ({1:0.000}) {2} {3}", DateTime.Now, timePassed, message.GetHashCode(), message.Stage));
if (message.Stage == SoapMessageStage.BeforeSerialize)
{
w.WriteLine(string.Format("Action: {0}", message.Url));
w.WriteLine(string.Format("URL: {0}", message.Action));
}
if (writeStream)
{
w.WriteLine("----------------");
w.Flush();
Copy(logStream, fs);
}
w.Close();
if (isInput) logStream.Position = 0;
}
#region "IDisposable"
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}
protected virtual void Dispose(bool disposing)
{
if (disposing)
{
// Free managed resources.
if (logStream != null)
{
logStream.Dispose();
logStream = null;
}
}
}
#endregion
}
}

26
x360ce.Engine/JocysCom/Web/Services/TraceExtensionAttribute.cs

@ -1,26 +0,0 @@
using System;
using System.Web.Services.Protocols;
namespace JocysCom.ClassLibrary.Web.Services
{
// Create a SoapExtensionAttribute for our SOAP Extension that can be
// applied to an XML Web service method.
[AttributeUsage(AttributeTargets.Method)]
public class TraceExtensionAttribute : SoapExtensionAttribute
{
public override Type ExtensionType
{
get { return typeof(TraceExtension); }
}
public override int Priority
{
get { return _Priority; }
set { _Priority = value; }
}
private int _Priority;
}
}

5
x360ce.Engine/x360ce.Engine.csproj

@ -231,6 +231,7 @@
<Compile Include="JocysCom\Controls\ToolStripBorderlessRenderer.cs" />
<Compile Include="JocysCom\Data\SqlHelper.cs" />
<Compile Include="JocysCom\Diagnostics\RollingXmlWriterTraceListener.cs" />
<Compile Include="JocysCom\Diagnostics\TraceHelper.cs" />
<Compile Include="JocysCom\Drawing\Effects\Brightness.cs" />
<Compile Include="JocysCom\Drawing\Effects\Common.cs" />
<Compile Include="JocysCom\Drawing\Effects\Grayscale.cs" />
@ -317,9 +318,7 @@
<Compile Include="JocysCom\Text\Helper.cs" />
<Compile Include="JocysCom\Threading\QueueTimer.cs" />
<Compile Include="JocysCom\Threading\QueueTimerEventArgs.cs" />
<Compile Include="JocysCom\Web\Services\HttpLogModule.cs" />
<Compile Include="JocysCom\Web\Services\TraceExtension.cs" />
<Compile Include="JocysCom\Web\Services\TraceExtensionAttribute.cs" />
<Compile Include="JocysCom\Web\Services\RawDataLogHttpModule.cs" />
<Compile Include="JocysCom\Web\WebControlsHelper.cs" />
<Compile Include="JocysCom\Win32\ABE.cs" />
<Compile Include="JocysCom\Win32\ABM.cs" />

9
x360ce.Web/WebServices/x360ce.asmx.cs

@ -1,15 +1,10 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Web.Security;
using x360ce.Engine.Data;
using x360ce.Engine;
using System.Data;
using JocysCom.ClassLibrary.Data;
using JocysCom.ClassLibrary.Runtime;
using JocysCom.ClassLibrary.Web.Services;
namespace x360ce.Web.WebServices
{
@ -31,7 +26,7 @@ namespace x360ce.Web.WebServices
/// </summary>
/// <param name="args"></param>
/// <returns></returns>
[WebMethod(EnableSession = true, Description = "Search controller settings."), TraceExtension]
[WebMethod(EnableSession = true, Description = "Search controller settings.")]
public SearchResult SearchSettings(SearchParameter[] args)
{
// Create default value to reply.
@ -78,7 +73,7 @@ namespace x360ce.Web.WebServices
/// </summary>
/// <param name="checksum">List of unique identifiers of PAD setting</param>
/// <returns>List of PAD settings.</returns>
[WebMethod(EnableSession = true, Description = "Load controller settings."), TraceExtension]
[WebMethod(EnableSession = true, Description = "Load controller settings.")]
public SearchResult LoadSetting(Guid[] checksum)
{
var sr = new SearchResult();

11
x360ce.Web/WebServices/x360ce.asmx.v3.cs

@ -1,15 +1,8 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Web.Security;
using x360ce.Engine.Data;
using x360ce.Engine;
using System.Data;
using JocysCom.ClassLibrary.Data;
using JocysCom.ClassLibrary.Runtime;
using JocysCom.ClassLibrary.Web.Services;
namespace x360ce.Web.WebServices
{
@ -21,7 +14,7 @@ namespace x360ce.Web.WebServices
/// <param name="s">Setting object which contains information about DirectInput device and file/game name it is used for.</param>
/// <param name="ps">PAD settings which contains mapping between DirectInput device and virtual XBox controller.</param>
/// <returns>Status of operation. Empty if success.</returns>
[WebMethod(EnableSession = true, Description = "Save controller settings."), TraceExtension]
[WebMethod(EnableSession = true, Description = "Save controller settings.")]
public string SaveSetting(UserSetting s, PadSetting ps)
{
var db = new x360ceModelContainer();

4
x360ce.Web/WebServices/x360ce.asmx.v4.cs

@ -7,9 +7,7 @@ using System.Web.Security;
using x360ce.Engine.Data;
using x360ce.Engine;
using System.Data;
using JocysCom.ClassLibrary.Data;
using JocysCom.ClassLibrary.Runtime;
using JocysCom.ClassLibrary.Web.Services;
namespace x360ce.Web.WebServices
{
@ -80,7 +78,7 @@ namespace x360ce.Web.WebServices
#endregion
[WebMethod(EnableSession = true, Description = "Get default list of games."), TraceExtension]
[WebMethod(EnableSession = true, Description = "Get default list of games.")]
public SettingsData GetSettingsData()
{
var data = new SettingsData();

6
x360ce.Web/x360ce.Web.csproj

@ -304,15 +304,15 @@
<ItemGroup>
<Folder Include="Files\" />
</ItemGroup>
<ItemGroup>
<Content Include="Security\Site.Master" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\x360ce.Engine\x360ce.Engine.csproj">
<Project>{f980d78a-9448-4834-a6fe-84797077d309}</Project>
<Name>x360ce.Engine</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Content Include="Security\Site.Master" />
</ItemGroup>
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>

4
x360ce/x360ce/dllmain.cpp

@ -8,7 +8,9 @@
#include "ControllerManager.h"
#include "InputHookManager.h"
#ifdef _DEBUG
#ifdef _DEBUG
// Cannot open source file "vld.h" error means then you need to install
// "Visual Leak Detector for Visual C++" from https ://kinddragon.github.io/vld
#include <vld.h>
#endif

Loading…
Cancel
Save