예제 #1
0
 /// <summary>
 /// Create new instance of Stage Root Path
 /// </summary>
 /// <param name="subset"></param>
 /// <param name="process"></param>
 /// <returns></returns>
 public static JitLocation CreateRoot(JitStage stage, JitProcess process = null)
 {
     return(new JitLocation
     {
         Stage = stage,
         SubsetCache = stage,
         Path = "\\",
         Process = process,
     });
 }
예제 #2
0
 public JitLocation ToChangeProcess(JitProcess newProcess)
 {
     return(new JitLocation
     {
         Stage = Stage,
         SubsetCache = SubsetCache,
         Path = Path,
         Process = newProcess,
     });
 }
예제 #3
0
 private int GetProcPriority(JitProcess proc)
 {
     if (ProcPriorities.TryGetValue(proc.ID, out var p1))
     {
         return(p1);
     }
     if (ProcPriorities.TryGetValue(proc.Name, out var p2))
     {
         return(p2);
     }
     throw new JitException(JitException.NoProcKey, $"{proc.Name} or {proc.ID}");
 }
예제 #4
0
 /// <summary>
 /// Get Process Key
 /// </summary>
 /// <param name="proc"></param>
 /// <returns></returns>
 public static ProcessKey GetProcessKey(JitProcess proc)
 {
     if (proc is JitProcessDummy dummy)
     {
         return(dummy.ProcessKey);
     }
     else
     {
         if (proc.Name == null)
         {
             return(proc.ID);
         }
         else
         {
             return(proc.Name);
         }
     }
 }
예제 #5
0
        public static JitLocation Create(JitStage stage, string pathFromStage, JitProcess process = null)
        {
            JitLocation loc;

            if (pathFromStage == "\\")
            {
                return(CreateRoot(stage, process));
            }
            else
            {
                loc = stage.FindSubsetProcess(CreateRoot(stage), pathFromStage);
                return(new JitLocation
                {
                    Stage = stage,
                    SubsetCache = loc?.Process as JitSubset,
                    Path = pathFromStage,
                    Process = process,
                });
            }
        }
예제 #6
0
 /// <summary>
 /// Bridge to Stage.GetWorks()
 /// </summary>
 /// <returns></returns>
 public IEnumerable <(JitWork Work, DateTime EnterTime)> GetWorks(JitProcess process)
 {
     return(Stage.GetWorks(ToChangeProcess(process)));
 }