104 lines
3.3 KiB
C#
104 lines
3.3 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using Winsock_Orcas;
|
|
|
|
namespace Project
|
|
{
|
|
public static class Pub
|
|
{
|
|
public struct sUserInfo
|
|
{
|
|
public string no;
|
|
public string name;
|
|
public string dept;
|
|
public string email;
|
|
public int level;
|
|
}
|
|
|
|
//Variable
|
|
public static Device.Barcode barcode;
|
|
|
|
public static UserSetting uSetting; //user setting
|
|
public static Setting setting; //global setting
|
|
|
|
public static arUtil.Log log; //global logging system
|
|
public static sUserInfo Login;
|
|
|
|
public static DateTime LastInputTime = DateTime.Now;
|
|
public static CResult Result = new CResult();
|
|
|
|
public static void init()
|
|
{
|
|
string Path = Util.CurrentPath;
|
|
if (Util.isLocalApplication())
|
|
{
|
|
Path = @"c:\Amkor\GroupWare\";
|
|
if (!System.IO.Directory.Exists(Path))
|
|
System.IO.Directory.CreateDirectory(Path);
|
|
}
|
|
|
|
//setting
|
|
setting = new Setting();
|
|
setting.Load();
|
|
|
|
uSetting = new UserSetting();
|
|
uSetting.Load();
|
|
|
|
//log
|
|
log = new arUtil.Log();
|
|
Login = new sUserInfo();
|
|
|
|
//language
|
|
Lang.Loading(Pub.setting.Language + ".ini");
|
|
}
|
|
|
|
public static void SetFormStatus(ref System.Windows.Forms.Form f, string formid,Boolean read)
|
|
{
|
|
var fi = new System.IO.FileInfo(Util.CurrentPath + "formSetting\\" + formid + ".xml");
|
|
if (fi.Directory.Exists == false) fi.Directory.Create();
|
|
arUtil.XMLHelper xml = new arUtil.XMLHelper(fi.FullName);
|
|
if (!xml.Exist())
|
|
{
|
|
xml.CreateFile();
|
|
if (read) return; //읽기인데 파일이 없으므로 넘어간다.
|
|
}
|
|
if (read)
|
|
{
|
|
var leftStr = xml.get_Data("position", "left");
|
|
var topStr = xml.get_Data("position", "top");
|
|
int l = 0;
|
|
int t = 0;
|
|
if (!int.TryParse(leftStr, out l)) l = 0;
|
|
if (!int.TryParse(topStr, out t)) t = 0;
|
|
if (l != 0 || t != 0)
|
|
{
|
|
f.Location = new System.Drawing.Point(l, t);
|
|
}
|
|
|
|
var wStr = xml.get_Data("size", "width");
|
|
var hStr = xml.get_Data("size", "height");
|
|
int w = 0;
|
|
int h = 0;
|
|
if (!int.TryParse(wStr, out w)) w = 0;
|
|
if (!int.TryParse(hStr, out h)) h = 0;
|
|
if (w != 0 || h != 0)
|
|
{
|
|
f.Size = new System.Drawing.Size(w, h);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
xml.set_Data("position", "left", f.Left.ToString());
|
|
xml.set_Data("position", "top", f.Top.ToString());
|
|
xml.set_Data("size", "width", f.Width.ToString());
|
|
xml.set_Data("size", "height", f.Height.ToString());
|
|
xml.Save();
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
}
|