From a85daf8db33ed09436192ba80d5c1db847017c25 Mon Sep 17 00:00:00 2001 From: bruno-f-cruz Date: Wed, 5 Jul 2023 12:45:55 +0100 Subject: [PATCH] Improve documentation consistency --- Bonsai.System/IO/GetEnvironmentVariable.cs | 40 +++++++++++++--------- 1 file changed, 23 insertions(+), 17 deletions(-) diff --git a/Bonsai.System/IO/GetEnvironmentVariable.cs b/Bonsai.System/IO/GetEnvironmentVariable.cs index 2b8ede9c..279535d2 100644 --- a/Bonsai.System/IO/GetEnvironmentVariable.cs +++ b/Bonsai.System/IO/GetEnvironmentVariable.cs @@ -1,46 +1,52 @@ -using Bonsai; using System; using System.ComponentModel; -using System.Linq; using System.Reactive.Linq; namespace Bonsai.IO -{ +{ /// - /// Represents an operator that returns the value of an OS environment variable. + /// Represents an operator that gets the value of an environment variable for the current process. /// - /// - [Description("Returns the value of an environment variable.")] + /// + [Description("Returns the value of an environment variable for the current process.")] public class GetEnvironmentVariable : Source { + /// + /// Gets or sets the name of the environment variable to query the value of. + /// [Description("The name of the environment variable to query the value of.")] public string Variable { get; set; } /// - /// Generates an observable sequence containing a string with the value - /// of the queried environment variable. + /// Gets the value of the specified environment variable for the current process + /// and returns it through an observable sequence. /// /// - /// An observable sequence containing the value of the queried - /// environment variable. + /// A sequence containing the value of the specified environment variable. The + /// value will be if the environment variable is not found. /// public override IObservable Generate() { - return Observable.Return(Environment.GetEnvironmentVariable(Variable)); + return Observable.Return(Environment.GetEnvironmentVariable(Name)); } /// - /// Generates an observable sequence containing a string with the value - /// of the queried environment variable, triggered with any input - /// sequence + /// Gets the value of the specified environment variable for the current process + /// whenever an observable sequence emits a notification. /// + /// + /// The type of the elements in the sequence. + /// + /// + /// The sequence of notifications used to get the value of the environment variable. + /// /// - /// An observable sequence containing the value of the queried - /// environment variable. + /// A sequence containing the current values of the specified environment variable. + /// The value may be if the environment variable is not found. /// public IObservable Generate(IObservable source) { - return source.Select(x => { return Environment.GetEnvironmentVariable(Variable); }); + return source.Select(_ => { return Environment.GetEnvironmentVariable(Name); }); } } }