- mysql.chm.zip
- MySQL.chm
- bse.platten_en.zip
- BSE.Platten
- BSE.CoverFlow.WPFLib
- BSE.Platten.Admin.WinApp
- BSE.Platten.Admin
- BSE.Platten.Audio
- BSE.Platten.BO
- BSE.Platten.Common
- BSE.Platten.Covers
- BSE.Platten.FreeDb
- BSE.Platten.Ripper
- BSE.Platten.sln
- BSE.Platten.Statistik
- BSE.Platten.Tunes
- BSEadminSetup
- BSEadminSetup.vdproj
- Debug
- Release
- BSEtunesSetup
- BSEtunesSetup.vdproj
- Debug
- Release
- dll
- BSE.CDDrives.DLL
- BSE.Charts.DLL
- BSE.Configuration.DLL
- BSE.RemovableDrives.DLL
- BSE.Shell.DLL
- BSE.ThreadedShell.DLL
- BSE.Windows.Forms.DLL
- Lame
- lame_enc.dll
- lame-3.97
- mysqlcreatedatabase5x.sql.zip
- BSE.Platten.zip
|
using System;
using System.IO;
using BSE.Configuration;
namespace BSE.Platten.Admin
{
/// <summary>
/// Zusammendfassende Beschreibung f�r CommonProperties.
/// </summary>
public class CEnvironment : BSE.Platten.BO.CEnvironment
{
#region FieldsPrivate
private string m_strPassword;
private string m_strUserName;
private string m_strHost;
private CConfiguration m_configuration;
#endregion
#region Properties
public string UserName
{
set {this.m_strUserName = value;}
get
{
if (String.IsNullOrEmpty(this.m_strUserName) == true)
{
this.m_strUserName = System.Environment.UserName;
}
return this.m_strUserName;
}
}
public string Password
{
set {this.m_strPassword = value;}
get {return this.m_strPassword;}
}
public string Host
{
set { this.m_strHost = value; }
get { return this.m_strHost; }
}
#endregion
#region MethodsPublic
public CEnvironment()
{
}
public BSE.Configuration.CConfiguration GetConfiguration()
{
CConfiguration configuration = null;
if (this.m_configuration == null)
{
throw new Exception("CConfiguration cannot be null");
}
else
{
configuration = this.m_configuration;
}
return configuration;
}
public CEnvironment(BSE.Configuration.CConfiguration configuration)
{
this.m_configuration = configuration;
}
public string GetDataBaseHost()
{
if (this.m_configuration == null)
{
throw new Exception("CConfiguration cannot be null");
}
return GetDataBaseHost(this.m_configuration);
}
public string GetDataBaseHost(BSE.Configuration.CConfiguration configuration)
{
string strMessage = "\r\nAchtung!\nTragen Sie bitte im Men�\nExtras -> Optionen\ndie Adresse des Datenbankservers ein.";
string strDataBaseHost = string.Empty;
try
{
BSE.Configuration.CVisualObject visualObject = new BSE.Configuration.CVisualObject();
visualObject.Element = "databasehost";
visualObject.Description = "Adresse des Datenbankservers";
visualObject.VisualObjectType = BSE.Configuration.CVisualObjectType.OpenTextBox;
visualObject.ErrorMessage = strMessage;
strDataBaseHost = configuration.GetValue(BSE.Configuration.CConfiguration.VisualObjectsElementName,visualObject).ToString();
return strDataBaseHost;
}
catch (BSE.Configuration.CConfigurationValueNotFoundException e)
{
throw e;
}
catch (Exception e)
{
throw e;
}
}
public string GetConnectionString()
{
if (this.m_configuration == null)
{
throw new Exception("CConfiguration cannot be null");
}
return GetConnectionString(this.m_configuration);
}
public string GetConnectionString(BSE.Configuration.CConfiguration configuration)
{
string strConnectionString = string.Empty;
if (String.IsNullOrEmpty(m_strPassword) == true)
{
//strConnectionString = string.Format("server={0};user id={1}; password={2}; Port={3}; database=platten; pooling=false;Allow Zero Datetime = True",
strConnectionString = string.Format("server={0};user id={1}; password={2}; Port={3}; database=platten; pooling=false;",
GetDataBaseHost(configuration),
this.UserName,
"",
3307);
}
else
{
strConnectionString = string.Format("server={0};user id={1}; password={2}; Port={3}; database=platten; pooling=false",
this.Host,
this.UserName,
this.Password,
3307);
}
return strConnectionString;
}
public string GetAudioHomeDirectory()
{
if (this.m_configuration == null)
{
throw new Exception("CConfiguration cannot be null");
}
return GetAudioHomeDirectory(this.m_configuration);
}
public string GetAudioHomeDirectory(BSE.Configuration.CConfiguration configuration)
{
string strMessage = "\r\nAchtung!\nDas Programm weiss nicht, wo die mp3 Dateien liegen.\nTragen Sie Bitte im Men� Extras -> Optionen\n das Verzeichnis ein.";
string strAudioHomeDirectory = string.Empty;
try
{
BSE.Configuration.CVisualObject visualObject = new BSE.Configuration.CVisualObject();
visualObject.Element = "dirmp3";
visualObject.Description = "Audio Home- Verzeichnis";
visualObject.VisualObjectType = BSE.Configuration.CVisualObjectType.OpenFolderBrowseDialog;
visualObject.ErrorMessage = strMessage;
strAudioHomeDirectory = configuration.GetValue(BSE.Configuration.CConfiguration.VisualObjectsElementName,visualObject).ToString();
if (!strAudioHomeDirectory.EndsWith(System.IO.Path.DirectorySeparatorChar.ToString()))
{
strAudioHomeDirectory += System.IO.Path.DirectorySeparatorChar;
}
return strAudioHomeDirectory;
}
catch (BSE.Configuration.CConfigurationValueNotFoundException e)
{
throw e;
}
catch (Exception e)
{
throw e;
}
}
public string GetPlayer()
{
if (this.m_configuration == null)
{
throw new Exception("CConfiguration cannot be null");
}
return GetPlayer(this.m_configuration);
}
public string GetPlayer(BSE.Configuration.CConfiguration configuration)
{
string strMessage = "\r\nAchtung!\nDas Programm weiss nicht, wo sich der Winamp Player befindet.\nSuchen Sie ihn Bitte im Men� Extras -> Optionen.";
string strPlayer = string.Empty;
try
{
BSE.Configuration.CVisualObject visualObject = new BSE.Configuration.CVisualObject();
visualObject.Element = "player";
visualObject.Description = "Winamp Player";
visualObject.VisualObjectType = BSE.Configuration.CVisualObjectType.OpenFileDialog;
visualObject.ErrorMessage = strMessage;
strPlayer = configuration.GetValue(BSE.Configuration.CConfiguration.VisualObjectsElementName,visualObject).ToString();
return strPlayer;
}
catch (BSE.Configuration.CConfigurationValueNotFoundException e)
{
throw e;
}
catch (Exception e)
{
throw e;
}
}
#endregion
#region MethodsPrivate
#endregion
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.