📄 datamapping.cs
字号:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
namespace DAL
{
partial class DataMappingDataContext
{
private static StreamWriter sw = new StreamWriter(Path.Combine(Directory.GetCurrentDirectory(), "log.txt"), true);
/**/
/// <summary>
/// Try to create DataContext with log.
/// </summary>
/// <param name="withLog"></param>
public DataMappingDataContext(bool withLog)
: this(Provider.ConnectionString)
{
OnCreated();
if (withLog)
{
if (sw == null)
{
sw = new StreamWriter(Path.Combine(Directory.GetCurrentDirectory(), "log.txt"), true);
}
this.Log = sw;
}
}
/**/
/// <summary>
/// try to close streamwriter
/// </summary>
/// <param name="disposing"></param>
protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
sw.Flush();
}
}
internal static class Provider
{
internal static string ConnectionString
{
get
{
//string path = Directory.GetCurrentDirectory();
//path = Path.Combine(path, "killperson.sdf");
//return "Data Source = " + path;
return DAL.Properties.Settings.Default.KillingGameConnectionString;
}
}
}
public partial class PlayerEntity : Player
{
public string IP { get; set; }
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -