void FetchPost()
        {
            PostEventListener postEventListener = new PostEventListener();

            postEventListener.FetchPost();
            postEventListener.OnPostReterive += PostEventListener_OnPostReterive;
        }
Beispiel #2
0
        public static Configuration CreateConfiguration(ConnectionInfo connection, HbmMapping mapping, bool showsql)
        {
            var cfg = new Configuration();

            switch (connection.ProviderName)
            {
            case Constants.SqlCeProvider:
                ConfigureSqlCe(cfg, connection.ConnectionString, showsql);
                break;

            case Constants.SqlServerProvider:
                ConfigureSqlServer(cfg, connection.ConnectionString, showsql);
                break;

            case Constants.SqliteProvider:
                ConfigureSqlLiteInMemory(cfg, connection.ConnectionString, showsql);
                break;

            default:
                throw new System.NotSupportedException("ProviderName");
            }

            var preListener = new PreEventListener();

            cfg.AppendListeners(ListenerType.PreUpdate, new IPreUpdateEventListener[] { preListener });
            cfg.AppendListeners(ListenerType.PreInsert, new IPreInsertEventListener[] { preListener });
            cfg.AppendListeners(ListenerType.PreDelete, new IPreDeleteEventListener[] { preListener });
            cfg.AppendListeners(ListenerType.PreLoad, new IPreLoadEventListener[] { preListener });

            var postListener = new PostEventListener();

            cfg.AppendListeners(ListenerType.PostUpdate, new IPostUpdateEventListener[] { postListener });
            cfg.AppendListeners(ListenerType.PostInsert, new IPostInsertEventListener[] { postListener });
            cfg.AppendListeners(ListenerType.PostDelete, new IPostDeleteEventListener[] { postListener });
            cfg.AppendListeners(ListenerType.PostLoad, new IPostLoadEventListener[] { postListener });

            cfg.EventListeners.FlushEventListeners = new IFlushEventListener[] { new FixedDefaultFlushEventListener() };

            cfg.AddMapping(mapping);
            return(cfg);
        }
Beispiel #3
0
 void FetchPost()
 {
     postEventListener = new PostEventListener();
     postEventListener.FetchPost();
     postEventListener.OnPostRetrieved += PostEventListener_OnPostRetrieved;
 }