private void AddCustomSink( string name, string type) { // Create instance of custom type sink from a assembly. try { LogSink sink = (LogSink)TestToolHelpers.CreateInstanceFromTypeName(type, new object[] { name }); if (sink == null) { throw new InvalidOperationException(String.Format("Failed to create custom sink: {0}.", type)); } logProfile.AddSink(name, sink); } catch (FileNotFoundException e) { throw new XmlException( String.Format("The assembly of the custom sink ({0}) could not be found.", name), e); } catch (ArgumentException e) { throw new XmlException( String.Format("The type of the custom sink ({0}) could not be found.", name), e); } }
private static bool IsDeleteEntry(XmlNode entry) { XmlAttribute att = entry.Attributes["delete"]; if (null == att) { // The attribute "delete" doesn't present. return(false); } return(TestToolHelpers.XmlBoolToBool(att.Value)); }