Exemplo n.º 1
0
        internal MemberResult[] GetMemberNames(ProjectAnalyzer analyzer, string text)
        {
            _completionResultEvent.Reset();
            _memberResults = null;

            using (new SocketLock(this)) {
                Socket.Send(GetMembersCommandBytes);
                SendString(text);
            }

            if (_completionResultEvent.WaitOne(1000) && _memberResults != null)
            {
                MemberResult[] res = new MemberResult[_memberResults.TypeMembers.Count + _memberResults.InstanceMembers.Count];
                int            i   = 0;
                foreach (var member in _memberResults.TypeMembers)
                {
                    res[i++] = CreateMemberResult(analyzer, member.Key, member.Value);
                }
                foreach (var member in _memberResults.InstanceMembers)
                {
                    res[i++] = CreateMemberResult(analyzer, member.Key, member.Value);
                }

                _memberResults = null;
                return(res);
            }
            return(null);
        }
Exemplo n.º 2
0
        private void HandleMemberResult()
        {
            string typeName = Socket.ReadString();

            var instDict = ReadMemberDict();
            var typeDict = ReadMemberDict();

            _memberResults = new MemberResults(typeName, instDict, typeDict);

            _completionResultEvent.Set();
        }
            private void HandleMemberResult()
            {
                Debug.Assert(Monitor.IsEntered(_streamLock));

                string typeName = _stream.ReadString();
                var    instDict = ReadMemberDict();
                var    typeDict = ReadMemberDict();

                _memberResults = new MemberResults(typeName, instDict, typeDict);

                _completionResultEvent.Set();
            }
            public CompletionResult[] GetMemberNames(string text)
            {
                _completionResultEvent.Reset();
                _memberResults = null;

                using (new StreamLock(this, throwIfDisconnected: false)) {
                    if (_stream == null)
                    {
                        return(new CompletionResult[0]);
                    }
                    try {
                        _stream.Write(GetMembersCommandBytes);
                        SendString(text);
                    } catch (IOException) {
                        return(new CompletionResult[0]);
                    }
                }

                if (_completionResultEvent.WaitOne(1000) && _memberResults != null)
                {
                    var res = new CompletionResult[_memberResults.TypeMembers.Count + _memberResults.InstanceMembers.Count];
                    int i   = 0;
                    foreach (var member in _memberResults.TypeMembers)
                    {
                        res[i++] = CreateCompletionResult(member.Key, member.Value);
                    }
                    foreach (var member in _memberResults.InstanceMembers)
                    {
                        res[i++] = CreateCompletionResult(member.Key, member.Value);
                    }

                    _memberResults = null;
                    return(res);
                }
                return(null);
            }
 private void HandleMemberResultError()
 {
     _memberResults = null;
     _completionResultEvent.Set();
 }
Exemplo n.º 6
0
            public MemberResult[] GetMemberNames(string text) {
                _completionResultEvent.Reset();
                _memberResults = null;

                using (new StreamLock(this, throwIfDisconnected: false)) {
                    if (_stream == null) {
                        return new MemberResult[0];
                    }
                    try {
                        _stream.Write(GetMembersCommandBytes);
                        SendString(text);
                    } catch (IOException) {
                        return new MemberResult[0];
                    }
                }

                if (_completionResultEvent.WaitOne(1000) && _memberResults != null) {
                    MemberResult[] res = new MemberResult[_memberResults.TypeMembers.Count + _memberResults.InstanceMembers.Count];
                    int i = 0;
                    foreach (var member in _memberResults.TypeMembers) {
                        res[i++] = CreateMemberResult(member.Key, member.Value);
                    }
                    foreach (var member in _memberResults.InstanceMembers) {
                        res[i++] = CreateMemberResult(member.Key, member.Value);
                    }

                    _memberResults = null;
                    return res;
                }
                return null;
            }
Exemplo n.º 7
0
 private void HandleMemberResultError() {
     _memberResults = null;
     _completionResultEvent.Set();
 }
Exemplo n.º 8
0
            private void HandleMemberResult() {
                Debug.Assert(Monitor.IsEntered(_streamLock));

                string typeName = _stream.ReadString();
                var instDict = ReadMemberDict();
                var typeDict = ReadMemberDict();
                _memberResults = new MemberResults(typeName, instDict, typeDict);

                _completionResultEvent.Set();
            }
Exemplo n.º 9
0
            private void HandleMemberResult()
            {
                string typeName = Stream.ReadString();

                var instDict = ReadMemberDict();
                var typeDict = ReadMemberDict();
                _memberResults = new MemberResults(typeName, instDict, typeDict);

                _completionResultEvent.Set();
            }