コード例 #1
0
ファイル: MirandaContext.cs プロジェクト: tomasdeml/hyphen
        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);
        }
コード例 #2
0
 public ProtocolToken(String pattern)
 {
     this.pattern = pattern;
     this.parameters = new ProtocolDictionary();
 }
コード例 #3
0
 public ProtocolToken(String pattern, ProtocolDictionary parameters)
 {
     this.pattern = pattern;
     this.parameters = parameters;
 }
コード例 #4
0
ファイル: MirandaContext.cs プロジェクト: tomasdeml/hyphen
        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);
            }
        }