예제 #1
0
        /// <summary>
        /// Loads the current ProcessRuntimeDescriptor persisting it
        /// if it isn't found
        /// </summary>
        /// <returns></returns>
        protected internal Task <ProcessRuntimeDescriptor> LoadCurrentRuntimeDescriptor()
        {
            return(Task.Run(() =>
            {
                ProcessRuntimeDescriptor current = ProcessRuntimeDescriptor.GetCurrent();
                ProcessRuntimeDescriptor retrieved = LoadRuntimeDescriptor(current);

                if (retrieved == null)
                {
                    retrieved = PersistRuntimeDescriptor(current);
                }

                return retrieved;
            }));
        }
예제 #2
0
        public void ProcessRuntimeDescriptorTest()
        {
            ProcessRuntimeDescriptor instance = ProcessRuntimeDescriptor.GetCurrent();

            OutLineFormat("MachineName: {0}", ConsoleColor.Cyan, instance.MachineName);
            OutLineFormat("CommandLine: {0}", ConsoleColor.Cyan, instance.CommandLine);
            OutLineFormat("FilePath: {0}", ConsoleColor.Cyan, instance.FilePath);
            instance.AssemblyDescriptors.Each(ad =>
            {
                OutLineFormat("Name: {0}", ConsoleColor.DarkCyan, ad.Name);
                OutLineFormat("FileHash: {0}", ConsoleColor.DarkCyan, ad.FileHash);
                OutLineFormat("AssemblyFullName: {0}", ConsoleColor.DarkCyan, ad.AssemblyFullName);
            });
            OutLine();
        }