- iismanager.zip
- IISManager
- DirectoryManager
- Base
- bin
- Debug
- Orama.Telamon.Framework.General.DirectoryManager.dll
- Orama.Telamon.Framework.General.DirectoryManager.pdb
- Release
- Orama.Telamon.Framework.General.DirectoryManager.dll
- Orama.Telamon.Framework.General.DirectoryManager.pdb
- Common
- DirectoryManager.csproj
- DirectoryManager.csproj.vspscc
- IIS
- obj
- Debug
- Release
- Properties
- IISManager.sln
- IISTreeView
|
using System;
using System.Collections.Generic;
using System.Text;
using System.DirectoryServices;
namespace Sarafian.Framework.General.DirectoryManager.Common
{
public class PropertyValues
{
public PropertyValues(DirectoryEntry entry)
{
this.entry = entry;
this.properties = new Dictionary<string, PropertyValue>();
try
{
foreach (object propertyName in entry.Properties.PropertyNames)
{
this.properties.Add(propertyName.ToString(), PropertyValue.Create(entry, propertyName.ToString()));
}
}
catch (Exception ex)
{
HasError = true;
}
}
public PropertyValues(DirectoryEntry entry,string[] propertyNames)
{
this.entry = entry;
this.properties = new Dictionary<string, PropertyValue>();
try
{
foreach (string propertyName in propertyNames)
{
this.properties.Add(propertyName, PropertyValue.Create(entry, propertyName.ToString()));
}
}
catch (Exception ex)
{
HasError = true;
}
}
private DirectoryEntry entry;
private Dictionary<string, PropertyValue> properties;
public bool HasError { get; private set; }
public bool HasProperty(string propertyName)
{
return this.properties.ContainsKey(propertyName);
}
public string GetPropertyString(string propertyName)
{
return HasProperty(propertyName) ? this.properties[propertyName].StringValue : null;
}
public PropertyValue this[string propertyName]
{
get
{
if (HasProperty(propertyName))
{
return this.properties[propertyName];
}
return null;
}
}
public void SetPropertyValue(string propertyName, object value)
{
if (HasProperty(propertyName))
{
this.properties[propertyName].Value = value;
}
else
{
PropertyValue pv = PropertyValue.Create(this.entry, propertyName);
pv.Value = value;
}
}
public Dictionary<string, PropertyValue>.ValueCollection Values
{
get { return this.properties.Values; }
}
}
}
|
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.
I live in Athens Greece and currently I am working with Business scale application with .NET latest technologies
I've been developing applications for personal and friends usage with C++ using majorly Borland's various IDEs since 1994.
In 2002 I began working for an R&D institute where I was introduced to C# which I worships ever since.
I love core application development and I would like to publish more articles here and on my blog, but there is not enough time to do so.
I usualy "waste" my spare time watching sitcoms, preferable SCI-FI.
I would like to play chess but I can't find any real world players to hang out with.