Quantcast
Channel: #Zyan Communication Framework
Viewing all articles
Browse latest Browse all 665

New Post: MEF, Events, Inheritated Interface and Zyan

$
0
0
yallie wrote:
Also, I can't quite understand your application structure...
Looks like MEF attributes are somewhat misplaced.
  • Why do you apply InheritedExport(GetType(IBase)) to the IUserManagement interface?
  • Why doesn't your UserManagement class implement IUserManagement interface?
    Exporting IUserManagement doesn't make sense unless your class implements the exported interface.
  • What is the purpose behind the ClassBase class?
OK - I will try to explain

But first: I have missspelled the UserManagemt-Snippet. Now ist correkt - it implements IUserManagement - Sorry

To your first question: I have understand, that InheritedExport shoulb be link to the "sub"-Interface. If I change it to "IUserManagement" then following error cames up:
Es wurde mehr als ein Export gefunden, der der Einschränkung "((exportDefinition.ContractName == "Common.Application.IUserManagement") AndAlso (exportDefinition.Metadata.ContainsKey("ExportTypeIdentity") AndAlso "Common.Application.IUserManagement".Equals(exportDefinition.Metadata.get_Item("ExportTypeIdentity"))))" entspricht.
the Stacktrace:
Server stack trace: 
   bei System.ComponentModel.Composition.Hosting.ExportProvider.GetExports(ImportDefinition definition, AtomicComposition atomicComposition)
   bei System.ComponentModel.Composition.Hosting.ExportProvider.GetExportsCore(Type type, Type metadataViewType, String contractName, ImportCardinality cardinality)
   bei System.ComponentModel.Composition.Hosting.ExportProvider.GetExportCore[T](String contractName)
   bei System.ComponentModel.Composition.Hosting.ExportProvider.GetExport[T](String contractName)
   bei Zyan.Communication.Composition.IComponentCatalogMefExtensions.<>c__DisplayClass8`1.<RegisterComponent>b__2()
   bei Zyan.Communication.ComponentCatalog.GetComponentInstance(ComponentRegistration registration)
   bei Zyan.Communication.ZyanComponentHost.GetComponentInstance(ComponentRegistration registration)
   bei Zyan.Communication.ZyanDispatcher.Invoke_ResolveComponentInstance(InvocationDetails details)
   bei Zyan.Communication.ZyanDispatcher.AddEventHandler(String interfaceName, DelegateCorrelationInfo correlation, String uniqueName)
   bei System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
   bei System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg, Int32 methodPtr, Boolean fExecuteInContext)

Exception rethrown at [0]: 
   bei System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
   bei System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
   bei Zyan.Communication.IZyanDispatcher.AddEventHandler(String interfaceName, DelegateCorrelationInfo correlation, String uniqueName)
   bei Zyan.Communication.ZyanProxy.AddRemoteEventHandler(DelegateCorrelationInfo correlationInfo)
   bei Zyan.Communication.ZyanProxy.HandleEventSubscription(IMethodCallMessage methodCallMessage, MethodInfo methodInfo)
   bei Zyan.Communication.ZyanProxy.InterceptAndInvoke(IMethodCallMessage methodCallMessage, Boolean allowInterception)
   bei Zyan.Communication.ZyanProxy.Invoke(IMessage message)
   bei System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
   bei DataExtensions.DataSource.IClientNotificator.add_ServerCalled(ServerCalledEventHandler value)
   bei Client.Application.AdminUsersViewModel..ctor() in D:\_AppDev\Visual Studio 2010\Projekte\Client.Application\ViewModels\AdminUsersViewModel.vb:Zeile 41.
So, now what I want to do.

I want to have a generell Interface. In the IBase shoulb be a event that in ALL interfaces are the same.

All Modul-Interfaces (aka IUserManagement) should be inherited from IBase and have the modul specific functions

Is that possible?

BTW: ClassBase have some Properties and Funtions for displaying text and so on. Not complicates or so. Do you need more Information about that? I thing the ClassBase can delete from the snippet.

I hope it was helpfull

Viewing all articles
Browse latest Browse all 665

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>