Callback() public static method

public static Callback ( int callback, Content content ) : string
callback int
content Runt.Core.Model.Content
return string
Beispiel #1
0
        public void GetSymbolInfo(int callback, string symbolName)
        {
            var state     = _state;
            var workspace = state.Workspace;
            var tabs      = state.Tabs;
            var tab       = tabs.SingleOrDefault(t => t.Active);

            if (tab == null)
            {
                return;
            }

            var content = GetContent(tab.ContentId, false);

            var proj = workspace.Projects.SingleOrDefault(p => content.RelativePath.StartsWith(p.RelativePath, StringComparison.OrdinalIgnoreCase));

            if (proj == null)
            {
                return;
            }

            var compilation = GetCompilation(proj.Id);
            var tokenInfo   = TokenInfo.GetInfo(compilation.Compilation, Path.Combine(workspace.Path, content.RelativePath), symbolName);

            Send(Messages.Callback(callback, ((JToken)tokenInfo) ?? new JRaw("null")));
            //var symbolInfo = compilation.GetSymbolInfo(reference, symbolName);
        }
Beispiel #2
0
        public void LoadContent(int callback, string contentId)
        {
            var content = GetContent(contentId, true);

            Send(Messages.Callback(callback, content));
        }