- 설정 업데이트 (창크기, Column 체크)

- 로딩 중 마우스 포인터
This commit is contained in:
2017-06-24 15:34:18 +09:00
parent 334c131e6e
commit 8c46481430
5 changed files with 169 additions and 56 deletions

View File

@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
@@ -13,6 +14,11 @@ namespace friction
static string m_strPath = "";
static Config()
{
}
public static void Init()
{
string strPrjName = System.Reflection.Assembly.GetEntryAssembly().GetName().Name;
string strFolder = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), strPrjName);
@@ -23,11 +29,6 @@ namespace friction
Load();
}
public static void Init()
{
}
[DllImport("kernel32")]
private static extern long WritePrivateProfileString(string section, string key, string val, string filePath);
[DllImport("kernel32")]
@@ -44,13 +45,43 @@ namespace friction
foreach (string strFile in astrList)
OPTION.AddRecentFile(strFile);
}
iRes = GetPrivateProfileString("Option", "bound", "", temp, 10240, m_strPath);
if(temp.Length > 0)
{
string[] astrBound = temp.ToString().Split(',');
int iLeft, iWidth, iTop, iHeight;
int.TryParse(astrBound[0], out iLeft);
int.TryParse(astrBound[1], out iWidth);
int.TryParse(astrBound[2], out iTop);
int.TryParse(astrBound[3], out iHeight);
OPTION.WindowBound = new Rectangle(iLeft, iTop, iWidth, iHeight);
}
iRes = GetPrivateProfileString("Option", "checked-column", "", temp, 10240, m_strPath);
if (temp.Length > 0)
{
string[] astrBound = temp.ToString().Split(',');
OPTION.CheckedColumns = astrBound.ToList();
}
iRes = GetPrivateProfileString("Option", "unchecked-column", "", temp, 10240, m_strPath);
if (temp.Length > 0)
{
string[] astrBound = temp.ToString().Split(',');
OPTION.UncheckedColumns = astrBound.ToList();
}
}
private static void Save()
public static void Save()
{
WritePrivateProfileString("Option", "recent", OPTION.GetRecentAll(), m_strPath);
WritePrivateProfileString("Option", "bound", OPTION.WindowBoundStr(), m_strPath);
WritePrivateProfileString("Option", "checked-column", OPTION.CheckedColumnsStr(), m_strPath);
WritePrivateProfileString("Option", "unchecked-column", OPTION.UncheckedColumnsStr(), m_strPath);
}
@@ -69,6 +100,9 @@ namespace friction
public static class OPTION
{
public static List<string> m_RecentList = new List<string>();
public static Rectangle WindowBound { set; get; }
public static List<string> CheckedColumns { set; get; }
public static List<string> UncheckedColumns { set; get; }
public static void AddRecentFile(string strPath)
{
@@ -76,13 +110,50 @@ namespace friction
m_RecentList.Remove(strPath);
m_RecentList.Add(strPath);
Save();
}
public static string GetRecentAll()
{
return string.Join("//", m_RecentList);
}
public static string WindowBoundStr()
{
return string.Format("{0}, {1}, {2}, {3}", WindowBound.Left, WindowBound.Width, WindowBound.Top, WindowBound.Height);
}
public static string CheckedColumnsStr()
{
string strResult = "";
if(CheckedColumns != null)
{
foreach (var item in CheckedColumns)
{
if (strResult.Length > 0)
strResult += ",";
strResult += item;
}
}
return strResult;
}
public static string UncheckedColumnsStr()
{
string strResult = "";
if(UncheckedColumns != null)
{
foreach (var item in UncheckedColumns)
{
if (strResult.Length > 0)
strResult += ",";
strResult += item;
}
}
return strResult;
}
}