Example #1
0
 private void BuildJobCount(List <Job> jobList, JobCount jobCount)
 {
     foreach (var job in jobList)
     {
         var cn = job.CN;
         if (cn != null)
         {
             jobCount.Total++;
         }
         var gn = job.GN;
         if (gn != null)
         {
             jobCount.IncreaseGN(gn);
         }
         var g = job.G;
         if (g != null)
         {
             jobCount.IncreaseG(g);
         }
         if (job.RowType == Job.RowTypes.Move)
         {
             jobCount.Step++;
         }
         if (job.RowType == Job.RowTypes.Comment)
         {
             if (jobCount.Preview == null)
             {
                 jobCount.Preview = job.RowString.Trim();
             }
         }
     }
 }
Example #2
0
 public JobFile(string fileName, Context context = null)
 {
     jobList  = new List <Job>();
     jobCount = new JobCount(fileName);
     ReadFile(fileName, jobList, context);
     BuildJobCount(jobList, jobCount);
 }
Example #3
0
 private void SaveFile(string fileName, List <Job> items, Context context = null)
 {
     try {
         using (var sw = context != null ? new StreamWriter(context.Assets.Open(fileName), Encoding.GetEncoding("euc-kr")) : new StreamWriter(fileName, false, Encoding.GetEncoding("euc-kr"))) {
             foreach (var item in items)
             {
                 sw.WriteLine(item.RowString);
             }
             sw.Close();
             Job.LogDebug("저장 완료:" + fileName);
         }
         jobCount = null;
         jobCount = new JobCount(fileName);
         BuildJobCount(jobList, jobCount);
     } catch {
         Job.LogDebug("저장 실패:" + fileName);
     }
 }
Example #4
0
		private void BuildJobCount(List<Job> jobList, JobCount jobCount)
		{
			foreach (var job in jobList) {
				var cn = job.CN;
				if (cn != null) {
					jobCount.Total++;
				}
				var gn = job.GN;
				if (gn != null) {
					jobCount.IncreaseGN(gn);
				}
				var g = job.G;
				if (g != null) {
					jobCount.IncreaseG(g);
				}
				if (job.RowType == Job.RowTypes.Move) {
					jobCount.Step++;
				}
				if (job.RowType == Job.RowTypes.Comment) {
					if (jobCount.Preview == null)
						jobCount.Preview = job.RowString.Trim();
				}
			}
		}
Example #5
0
		private void SaveFile(string fileName, List<Job> items, Context context = null)
		{
			try {
				using (var sw = context != null ? new StreamWriter(context.Assets.Open(fileName), Encoding.GetEncoding("euc-kr")) : new StreamWriter(fileName, false, Encoding.GetEncoding("euc-kr"))) {
					foreach (var item in items) {
						sw.WriteLine(item.RowString);
					}
					sw.Close();
					Job.LogDebug("저장 완료:" + fileName);
				}
				jobCount = null;
				jobCount = new JobCount(fileName);
				BuildJobCount(jobList, jobCount);
			} catch {
				Job.LogDebug("저장 실패:" + fileName);
			}
		}
Example #6
0
		public JobFile(string fileName, Context context = null)
		{
			jobList = new List<Job>();
			jobCount = new JobCount(fileName);
			ReadFile(fileName, jobList, context);
			BuildJobCount(jobList, jobCount);
		}