/// <summary> /// Gets the custom class object based on the given parameters /// </summary> private void ClassHelper_OnGetCustomClass(object sender, ClassEventArgs e) { if (e.Object == null) { // Provide your custom classes switch (e.ClassName) { // Define the class MyTask implementing ITask and you can provide your scheduled tasks out of App_Code case "Custom.MyTask": e.Object = new Custom.MyTask(); break; // Define the class MyCustomIndex implementing ICustomSearchIndex and you can provide your custom search indexes from App_Code case "Custom.MyIndex": e.Object = new Custom.MyIndex(); break; // Define the class MyCustomSiteInfoProvider inheriting the SiteInfoProvider and you can customize the provider case "CustomSiteInfoProvider": e.Object = new CustomSiteInfoProvider(); break; // Define the class MyCustomCacheHelper inheriting the CacheHelper and you can customize the helper case "CustomCacheHelper": e.Object = new CustomCacheHelper(); break; // Define the class MyCustomEmailProvider inheriting the EmailProvider and you can customize the provider case "CustomEmailProvider": e.Object = new CustomEmailProvider(); break; } } }
/// <summary> /// Gets the custom class object based on the given class name. This handler is called when the assembly name is App_Code. /// </summary> private static void GetCustomClass(object sender, ClassEventArgs e) { if (e.Object == null) { // Provide your custom classes switch (e.ClassName) { // Define the class CustomShippingOptionInfoProvider inheriting the ShippingOptionInfoProvider and you can customize the provider case "CustomShippingOptionInfoProvider": e.Object = new CustomShippingOptionInfoProvider(); break; // Define the class CustomShoppingCartInfoProvider inheriting the ShoppingCartInfoProvider and you can customize the provider case "CustomShoppingCartInfoProvider": e.Object = new CustomShoppingCartInfoProvider(); break; // Define the class CustomShoppingCartItemInfoProvider inheriting the ShoppingCartItemInfoProvider and you can customize the provider case "CustomShoppingCartItemInfoProvider": e.Object = new CustomShoppingCartItemInfoProvider(); break; // Define the class CustomSKUInfoProvider inheriting the SKUInfoProvider and you can customize the provider case "CustomSKUInfoProvider": e.Object = new CustomSKUInfoProvider(); break; } } }
public void OnEvent(object sender, Db4objects.Db4o.Events.ClassEventArgs args) { ClassEventArgs classEventArgs = (ClassEventArgs)args; Assert.AreEqual(typeof(ClassRegistrationEventsTestCase.Data).FullName, CrossPlatformServices .SimpleName(classEventArgs.ClassMetadata().GetName())); eventFlag.eventOccurred = true; }
public void OnEvent(object sender, ClassEventArgs args) { var classEventArgs = args; Assert.AreEqual(typeof(Data).FullName, CrossPlatformServices .SimpleName(classEventArgs.ClassMetadata().GetName())); eventFlag.eventOccurred = true; }
/// <summary> /// Gets the custom class object based on the given class name. This handler is called when the assembly name is App_Code. /// </summary> private static void GetCustomClass(object sender, ClassEventArgs e) { if (e.Object == null) { switch (e.ClassName) { // Load SampleIntegrationConnector case "SampleIntegrationConnector": e.Object = new SampleIntegrationConnector(); break; } } }
/// <summary> /// Gets a custom class object based on the given parameters. /// </summary> private void ClassHelper_OnGetCustomClass(object sender, ClassEventArgs e) { if (e.Object == null) { // Checks the name of the requested class. switch (e.ClassName) { // Gets an instance of the CustomTask class. case "Custom.CarzCustomTask": e.Object = new Custom.CarzCustomTask(); break; } } }
public static void InstantiateClass(object sender, ClassEventArgs cea) { MycroParser mp = (MycroParser)sender; if (cea.Type.Name == "DataRelation") { string name = cea.Node.Attributes["Name"].Value; string childColumnRef = cea.Node.Attributes["ChildColumn"].Value; string parentColumnRef = cea.Node.Attributes["ParentColumn"].Value; DataColumn dcChild = (DataColumn)mp.GetInstance(childColumnRef.Between('{', '}')); DataColumn dcParent = (DataColumn)mp.GetInstance(parentColumnRef.Between('{', '}')); cea.Result = new DataRelation(name, dcParent, dcChild); cea.Handled = true; } }
public void OnEvent(object sender, Db4objects.Db4o.Events.ClassEventArgs args) { ClassEventArgs cea = (ClassEventArgs)args; processor.OnClassRegistered(cea.ClassMetadata()); }
public void OnEvent(object sender, ClassEventArgs args) { var cea = args; processor.OnClassRegistered(cea.ClassMetadata()); }
private void OnSelectedClassChanged(object sender, ClassEventArgs e) { if (e.ClassInfo != null) { ShowList(null); } else { HideList(null); } }