示例#1
0
 private static void SaveWorks()
 {
     ObjectSerization.Serization(Works, _FilePath);
     if (WorksChanged != null)
     {
         WorksChanged(Works, new EventArgs());
     }
 }
示例#2
0
        public static void Initialize(TimeSpan Saiso, string FilePath = "Settings/WorksManager.wmg")
        {
            Work._SaiSo = Saiso;
            _FilePath   = FilePath;
            FileInfo file = new FileInfo(_FilePath);

            if (file.Exists)
            {
                Works = ObjectSerization.Deserization(_FilePath) as LinkedList <Work>;
                Work.AWorkTerminatedByUser += OnAWorkTerminated;
                Work.AworkDone             += OnAWorkDone;
                WorkExcuter.Initialize();
            }
            else
            {
                SaveWorks();
                Initialize(Saiso);
            }
        }