Retrieving the process through a property
<p>I am trying to define a property inside the main class in my Windows Service. The property will be used to retrieve the name of the process whenever required.</p>

<p>For eg:</p>

<pre><code>public string PName
{
return SomeProcess.Name;
}

public string PID
{
return SomeProcess.ProcessId;
}

public Process SomeProcess
{
private Process[] myProcess = Process.GetProcessesByName("notepad"); //Process is underlined here with red wavy line saying "A get or set accessor mehtod is expected"
get
{return myProcess[0];}
}
</code></pre>

<p>The problem is inside the SomeProcess property written in the comment. What am I doing wrong here?</p>
