public static void GetAdamInstanceData() { AdamInstance adamInstance; try { adamInstance = AdamInstance.GetAdamInstance(adamContext); } // This catch block runs if the ADAM connection string is // invalid or the server can't be reached catch (ActiveDirectoryObjectNotFoundException e) { Console.WriteLine(e.Message); return; } Console.WriteLine("<--ADAM Instance Information-->\n"); Console.WriteLine("Configuration set {0}", adamInstance.ConfigurationSet); // get the roles of this ADAM instance AdamRoleCollection roles = adamInstance.Roles; Console.WriteLine("\nADAM Roles\n"); foreach (AdamRole role in roles) { Console.WriteLine("\t{0}", role.ToString()); } Console.WriteLine("\nADAM Partitions\n"); // get the partitions of this ADAM instance ReadOnlyStringCollection partitions = adamInstance.Partitions; try { foreach (string partition in partitions) { Console.WriteLine("\t{0}", partition.ToString()); } } catch (ActiveDirectoryObjectNotFoundException e) { // This exception occurs if the partitions container // can't be found. Console.WriteLine(e.Message); } }
public ScintillaControl(string sciLexerDllName) { _sciLexerDllName = sciLexerDllName; // Instantiate the indexers for this instance IndicatorStyle = new Collection<IndicatorStyle>(this); IndicatorForegroundColor = new IntCollection(this); MarkerForegroundColor = new CachingIntCollection(this); MarkerBackgroundColor = new CachingIntCollection(this); Line = new ReadOnlyStringCollection(this); // setup instance-based-indexers IndicatorForegroundColor.Setup(2082, 2083); MarkerForegroundColor.Setup(2041); MarkerBackgroundColor.Setup(2042); Line.Setup(2153,2350); // Set up default encoding _encoding = Encoding.GetEncoding(this.CodePage); InitializeComponent(); }