Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(771)

Unified Diff: visual_studio/NativeClientVSAddIn/NativeClientVSAddIn/ProcessInfo.cs

Issue 10908249: Remove windows line ending from repo files (Closed) Base URL: https://github.com/samclegg/nativeclient-sdk.git@master
Patch Set: fix copyright headers Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: visual_studio/NativeClientVSAddIn/NativeClientVSAddIn/ProcessInfo.cs
diff --git a/visual_studio/NativeClientVSAddIn/NativeClientVSAddIn/ProcessInfo.cs b/visual_studio/NativeClientVSAddIn/NativeClientVSAddIn/ProcessInfo.cs
index 118b5b454e6fad5546182b333ce18c7f2132e097..ca5333a6797f0bbb5523d43d28344771942a3880 100644
--- a/visual_studio/NativeClientVSAddIn/NativeClientVSAddIn/ProcessInfo.cs
+++ b/visual_studio/NativeClientVSAddIn/NativeClientVSAddIn/ProcessInfo.cs
@@ -1,90 +1,90 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-namespace NativeClientVSAddIn
-{
- using System;
- using System.Globalization;
- using System.Management;
-
- /// <summary>
- /// Holds information about a process for a ProcessSearcher.
- /// </summary>
- public class ProcessInfo
- {
- /// <summary>
- /// Constructs a process entry.
- /// </summary>
- /// <param name="id">Process ID.</param>
- /// <param name="parentId">Process ID of the parent process.</param>
- /// <param name="creationDate">
- /// String date in format 'yyyyMMddHHmmss.ffffff', or if empty then current time used.
- /// </param>
- /// <param name="commandLine">Command line arguments to the process.</param>
- /// <param name="name">Process name.</param>
- public ProcessInfo(uint id, uint parentId, string creationDate, string commandLine, string name)
- {
- if (string.IsNullOrEmpty(creationDate))
- {
- // If creationDate string is empty, then use the current timestamp.
- CreationDate = DateTime.UtcNow;
- }
- else
- {
- // Example creationDate: "20120622150149.843021-420".
- CreationDate = DateTime.ParseExact(
- creationDate.Substring(0, 21),
- "yyyyMMddHHmmss.ffffff",
- CultureInfo.InvariantCulture);
- long timeZoneMinutes = long.Parse(creationDate.Substring(21));
- CreationDate = CreationDate.AddMinutes(-timeZoneMinutes);
- }
-
- ID = id;
- ParentID = parentId;
- CommandLine = commandLine;
- Name = name;
- }
-
- /// <summary>
- /// Gets or sets Process ID of the represented process.
- /// </summary>
- public uint ID { get; set; }
-
- /// <summary>
- /// Gets or sets Process ID of the parent process.
- /// </summary>
- public uint ParentID { get; set; }
-
- /// <summary>
- /// Gets or sets DateTime of the process creation.
- /// </summary>
- public DateTime CreationDate { get; set; }
-
- /// <summary>
- /// Gets or sets Command line arguments to the process.
- /// </summary>
- public string CommandLine { get; set; }
-
- /// <summary>
- /// Gets or sets Name of the process.
- /// </summary>
- public string Name { get; set; }
-
- /// <summary>
- /// Casts from a management object that is a Win32_Process underlying type to a ProcessInfo.
- /// </summary>
- /// <param name="from">A management object that is Win32_Process underneath.</param>
- /// <returns>A ProcessInfo object.</returns>
- public static explicit operator ProcessInfo(ManagementObject from)
- {
- return new ProcessInfo(
- id: (uint)from["ProcessID"],
- parentId: (uint)from["ParentProcessID"],
- creationDate: from["CreationDate"] as string,
- commandLine: from["CommandLine"] as string,
- name: from["Name"] as string);
- }
- }
-}
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+namespace NativeClientVSAddIn
+{
+ using System;
+ using System.Globalization;
+ using System.Management;
+
+ /// <summary>
+ /// Holds information about a process for a ProcessSearcher.
+ /// </summary>
+ public class ProcessInfo
+ {
+ /// <summary>
+ /// Constructs a process entry.
+ /// </summary>
+ /// <param name="id">Process ID.</param>
+ /// <param name="parentId">Process ID of the parent process.</param>
+ /// <param name="creationDate">
+ /// String date in format 'yyyyMMddHHmmss.ffffff', or if empty then current time used.
+ /// </param>
+ /// <param name="commandLine">Command line arguments to the process.</param>
+ /// <param name="name">Process name.</param>
+ public ProcessInfo(uint id, uint parentId, string creationDate, string commandLine, string name)
+ {
+ if (string.IsNullOrEmpty(creationDate))
+ {
+ // If creationDate string is empty, then use the current timestamp.
+ CreationDate = DateTime.UtcNow;
+ }
+ else
+ {
+ // Example creationDate: "20120622150149.843021-420".
+ CreationDate = DateTime.ParseExact(
+ creationDate.Substring(0, 21),
+ "yyyyMMddHHmmss.ffffff",
+ CultureInfo.InvariantCulture);
+ long timeZoneMinutes = long.Parse(creationDate.Substring(21));
+ CreationDate = CreationDate.AddMinutes(-timeZoneMinutes);
+ }
+
+ ID = id;
+ ParentID = parentId;
+ CommandLine = commandLine;
+ Name = name;
+ }
+
+ /// <summary>
+ /// Gets or sets Process ID of the represented process.
+ /// </summary>
+ public uint ID { get; set; }
+
+ /// <summary>
+ /// Gets or sets Process ID of the parent process.
+ /// </summary>
+ public uint ParentID { get; set; }
+
+ /// <summary>
+ /// Gets or sets DateTime of the process creation.
+ /// </summary>
+ public DateTime CreationDate { get; set; }
+
+ /// <summary>
+ /// Gets or sets Command line arguments to the process.
+ /// </summary>
+ public string CommandLine { get; set; }
+
+ /// <summary>
+ /// Gets or sets Name of the process.
+ /// </summary>
+ public string Name { get; set; }
+
+ /// <summary>
+ /// Casts from a management object that is a Win32_Process underlying type to a ProcessInfo.
+ /// </summary>
+ /// <param name="from">A management object that is Win32_Process underneath.</param>
+ /// <returns>A ProcessInfo object.</returns>
+ public static explicit operator ProcessInfo(ManagementObject from)
+ {
+ return new ProcessInfo(
+ id: (uint)from["ProcessID"],
+ parentId: (uint)from["ParentProcessID"],
+ creationDate: from["CreationDate"] as string,
+ commandLine: from["CommandLine"] as string,
+ name: from["Name"] as string);
+ }
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698