Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 43 additions & 1 deletion dotnet/src/dotnetframework/GxClasses/Domain/GXRuntime.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
using System;
using System.Collections;
using GeneXus.Utils;

namespace GX
{
public class GXRuntime
Expand All @@ -10,6 +14,44 @@ public static short Environment
}
}
public static int ExitCode { get; set; }

public static bool HasEnvironmentVariable(string varName)
{
if (string.IsNullOrEmpty(varName))
return false;
else
{
string value = System.Environment.GetEnvironmentVariable(varName);
if (value == null)
return false;
else
return true;
}
}
public static GXProperties GetEnvironmentVariables()
{
IDictionary variables = System.Environment.GetEnvironmentVariables();
GXProperties gXProperties = new GXProperties();
foreach (DictionaryEntry dentry in variables)
{
string key = (String)dentry.Key;
string value = (String)dentry.Value;
gXProperties.Add(key, value);

}
return (gXProperties);
}
public static string GetEnvironmentVariable(string varName)
{
if (string.IsNullOrEmpty(varName))
return string.Empty;
else
{
string value = System.Environment.GetEnvironmentVariable(varName);
if (value == null)
return string.Empty;
else
return value;
}
}
}
}