using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace ButcherFactory.BO.Utils
|
|
{
|
|
public static class AppContext
|
|
{
|
|
public static bool RpcFacadeInited { get; set; }
|
|
static ServerUrlConfig _connectInfo = ServerUrlConfig.Init();
|
|
public static ServerUrlConfig ConnectInfo { get { return _connectInfo; } }
|
|
|
|
static WpfUser _user = null;
|
|
public static WpfUser User
|
|
{
|
|
get
|
|
{
|
|
if (_user == null)
|
|
_user = LoginUtil.InitUserFromLocal();
|
|
return _user;
|
|
}
|
|
}
|
|
}
|
|
|
|
public class ServerUrlConfig
|
|
{
|
|
public static ServerUrlConfig Init()
|
|
{
|
|
return XmlUtil.DeserializeFromFile<ServerUrlConfig>();
|
|
}
|
|
|
|
public string ServerUrl { get; set; }
|
|
|
|
public string SqlConnection { get; set; }
|
|
|
|
public void Save()
|
|
{
|
|
XmlUtil.SerializerObjToFile(this);
|
|
}
|
|
}
|
|
}
|