private MirandaContext(PluginManagerBase pluginManager, MirandaPluginLink mirandaLink, bool skipContextInfo) { if (mirandaLink == null) throw new ArgumentNullException("mirandaLink"); this.pluginManager = pluginManager; this.mirandaDatabase = new MirandaDatabase(); this.pluginLink = mirandaLink; this.contactList = new ContactList(); this.serviceInterceptors = new ServiceCallInterceptionManager(); GetMMInterface(); PopulateEnvironmentInformation(); if (!skipContextInfo) PopulateContextInformation(); else this.protocols = new ProtocolDictionary(0); }
public ProtocolToken(String pattern) { this.pattern = pattern; this.parameters = new ProtocolDictionary(); }
public ProtocolToken(String pattern, ProtocolDictionary parameters) { this.pattern = pattern; this.parameters = parameters; }
private unsafe void PopulateNetworkProtocols() { try { int count; PROTOCOLDESCRIPTOR** pointerArrayPtr; int result = CallServiceUnsafe(MirandaServices.MS_PROTO_ENUMPROTOCOLS, &count, &pointerArrayPtr); if (result != 0) throw new MirandaException(String.Format(TextResources.ExceptionMsg_Formatable2_MirandaServiceReturnedFailure, MirandaServices.MS_PROTO_ENUMPROTOCOLS, result.ToString())); ProtocolDictionary protocols = new ProtocolDictionary(count); for (int i = 0; i < count; i++) { // *(ptr_to_array_of_ptrs + i * sizeof(PROTOCOLDESCRIPTOR)) = *ptr_to_ptr = *ptr = data PROTOCOLDESCRIPTOR nativeDescriptor = **(((PROTOCOLDESCRIPTOR**)pointerArrayPtr) + i); Protocol protocol = new Protocol(ref nativeDescriptor); protocols.Add(protocol.Name, protocol); } this.protocols = protocols; } catch (Exception) { this.protocols = new ProtocolDictionary(0); } }