Les dejo un video muy breve sobre Data Access Application Block, saludos
Introducción a DAABEl mismo video en rapidshare
Les dejo un video muy breve sobre Data Access Application Block, saludos
Introducción a DAAB1: [ConfigurationElementType(typeof(CustomTraceListenerData))]
2: public class MyCustomTraceListener: Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.CustomTraceListener
1: public override void Write(string message)
2: {
3: throw new Exception("The method or operation is not implemented.");
4: }
5: public override void WriteLine(string message)
6: {
7: throw new Exception("The method or operation is not implemented.");
8: }
1: public abstract class CustomTraceListener : TraceListener
2: {
3: protected CustomTraceListener();
4: public ILogFormatter Formatter { get; set; }
5: }
1: public abstract class TraceListener : MarshalByRefObject, IDisposable
2: {
3: protected TraceListener();
4: public virtual void Close();
5: public void Dispose();
6: protected virtual void Dispose(bool disposing);
7: public virtual void Fail(string message);
8: public virtual void Fail(string message, string detailMessage);
9: protected internal virtual string[] GetSupportedAttributes();
10: [ComVisible(false)]
11: public virtual void TraceData(TraceEventCache eventCache, string source, TraceEventType eventType, int id, object data); [ComVisible(false)]
12: public virtual void TraceData(TraceEventCache eventCache, string source, TraceEventType eventType, int id, params object[] data);
13: [ComVisible(false)]
14: public virtual void TraceEvent(TraceEventCache eventCache, string source, TraceEventType eventType, int id);
1: [ComVisible(false)]
2: public virtual void TraceData(TraceEventCache eventCache, string source, TraceEventType eventType, int id, object data);
3: [ComVisible(false)]
4: public virtual void TraceData(TraceEventCache eventCache, string source, TraceEventType eventType, int id, params object[] data);
1: [ConfigurationElementType(typeof(CustomTraceListenerData))]
2: public class MyCustomTraceListener: Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.CustomTraceListener
3: {
4: public override void Write(string message)
5: {
6: Console.WriteLine(message);
7: }
8:
9: public override void WriteLine(string message)
10: {
11: Console.WriteLine(message);
12: }
13:
14: public override void TraceData(System.Diagnostics.TraceEventCache eventCache, string source, System.Diagnostics.TraceEventType eventType, int id, object data)
15: {
16: if (data is LogEntry && this.Formatter != null)
17: {
18: this.WriteLine(this.Formatter.Format(data as LogEntry));
19: }
20: else
21: {
22: this.WriteLine(data.ToString());
23: }
24: }
25: }
26:
1: public LogEntry();
2: public LogEntry(object message, ICollection categories, int priority, int eventId, TraceEventType severity, string title, IDictionary properties);
3: public LogEntry(object message, string category, int priority, int eventId, TraceEventType severity, string title, IDictionary properties);
4: public Guid ActivityId { get; set; }
5: public string ActivityIdString { get; }
6: public string AppDomainName { get; set; }
7: public ICollection Categories { get; set; }
8: public string[] CategoriesStrings { get; }
9: public string ErrorMessages { get; }
10: public IDictionary ExtendedProperties { get; set; }
11: public string LoggedSeverity { get; }
12: public string MachineName { get; set; }
13: public string ProcessId { get; set; }
protected internal virtual string[] GetSupportedAttributes();
1: protected override string[] GetSupportedAttributes()
2: {
3: return new string[] {"ConnectionString","StoredProcedureName"};
4: }
string connectionString = Attributes["ConnectionString"];