Пример #1
0
        public static void SaveConfig()
        {
            if (bIsSetting == false)
            {
                Define.LogError("logic error! - config value not setted");
                return;
            }

            JsonHelper.SaveConfig(data);
        }
Пример #2
0
        public static string GetReviewFileName(ReviewFile a_refData)
        {
            if (a_refData == null)
            {
                Define.LogError("arg error"); return(string.Empty);
            }

            StringBuilder s = new StringBuilder();

            s.Append(System.IO.Path.GetFileNameWithoutExtension(a_refData.m_sName_NoExt));
            s.Append(chNameSeperator);
            s.Append(string.Format("{0:0000}", a_refData.m_nStudyCount));
            s.Append(chNameSeperator);
            s.Append(a_refData.m_sStartDate);
            s.Append(chNameSeperator);
            s.Append(a_refData.m_sReviewDate);
            s.Append(a_refData.m_sExtension);

            return(s.ToString());
        }
Пример #3
0
        public static string FileName_inMyDocument(eDocumentFile a_eFile)
        {
            string sTemp = string.Empty;

            switch (a_eFile)
            {
            case eDocumentFile.Config:      { sTemp = sConfigFile; } break;

            case eDocumentFile.Log:
            {
                sTemp += "[";
                sTemp += DateTime.Now.ToShortDateString();
                sTemp += "]";
                sTemp += sLogFile;
            } break;

            default:                                        { Define.LogError("arg error"); return(string.Empty); }
            }

            return(System.IO.Path.Combine(sSavePath, sTemp));
        }
Пример #4
0
        public static Process ExecuteFile(string a_sFileName_withFullPath)
        {
            Process          process = new Process();
            ProcessStartInfo info    = new ProcessStartInfo();

            info.UseShellExecute = true;
            info.FileName        = a_sFileName_withFullPath;
            process.StartInfo    = info;

            try
            {
                process.Start();
            }
            catch (Exception Ex)
            {
                Define.LogError(Ex.Message);
                return(null);
            }

            return(process);
        }
Пример #5
0
        public static string FolderName(eFolder a_eFolder, int a_nData = 0)
        {
            string sName = string.Empty;

            switch (a_eFolder)
            {
            case eFolder.Normal:
            {
                string sStringFormat = string.Empty;

                if (a_nData < (int)Global.eDate.AfterDateGap)
                {
                    sStringFormat = System.IO.Path.Combine(Properties.Resources.sFolderName_Study, Properties.Resources.sFixedDateForderAdd);
                    a_nData      -= (int)Global.eDate.FixedDateGap;
                }
                else
                {
                    sStringFormat = System.IO.Path.Combine(Properties.Resources.sFolderName_Study, Properties.Resources.sAfterDateFolderAdd);
                    a_nData      -= (int)Global.eDate.AfterDateGap;
                }

                sName = string.Format(sStringFormat, a_nData);                         // _{0}일, {0}일 후
            } break;

            case eFolder.Start:             { sName = Properties.Resources.sFolderName_Start; } break;

            case eFolder.Study:             { sName = Properties.Resources.sFolderName_Study; } break;

            case eFolder.Finish:    { sName = Properties.Resources.sFolderName_Finish; } break;
            }

            if (string.IsNullOrEmpty(sName) == true)
            {
                Define.LogError("arg error");
                return(string.Empty);
            }

            return(sName);
        }