void Env_LinkedMonitoredCode (LinkedCode obj) { dependenciesStore.Clear (); var q = obj.Types.OrderBy (x => x.Name); foreach (var t in q) { dependenciesStore.AddNode (new DependencyTreeNode (t)); } }
private void Env_LinkedMonitoredCode (LinkedCode obj) { dependenciesStore.Clear (); var q = obj.Types.OrderBy (x => x.Name); foreach (var t in q) { dependenciesStore.Add (t); } }
private void Env_LinkedMonitoredCode(LinkedCode obj) { dependenciesStore.Clear(); var q = obj.Types.OrderBy(x => x.Name); foreach (var t in q) { dependenciesStore.Add(t); } }
void Env_LinkedMonitoredCode(LinkedCode obj) { dependenciesStore.Clear(); var q = obj.Types.OrderBy(x => x.Name); foreach (var t in q) { dependenciesStore.AddNode(new DependencyTreeNode(t)); } }
async Task VisualizeTypeAsync (bool forceEval, bool showError) { // // Gobble up all we can about the types in the active document // var typeDecls = await GetTopLevelTypeDeclsAsync (); foreach (var td in typeDecls) { td.SetTypeCode (); } // // Refresh the monitored type // if (string.IsNullOrWhiteSpace (monitorTypeName)) return; var monitorTC = TypeCode.Get (monitorTypeName); var code = await Task.Run (() => monitorTC.GetLinkedCode ()); if (!forceEval && lastLinkedCode != null && lastLinkedCode.CacheKey == code.CacheKey) { return; } // // Send the code to the device // try { Connect (); // // Declare it // Log (code.Declarations); if (!await EvalAsync (code.Declarations, showError)) return; // // Show it // Log (code.ValueExpression); if (!await EvalAsync (code.ValueExpression, showError)) return; // // If we made it this far, remember so we don't re-send the same // thing immediately // lastLinkedCode = code; } catch (Exception ex) { if (showError) { Alert ("Could not communicate with the app.\n\n{0}: {1}", ex.GetType (), ex.Message); } } }
async Task VisualizeTypeAsync (bool forceEval, bool showError) { // // Gobble up all we can about the types in the active document // var doc = IdeApp.Workbench.ActiveDocument; var resolver = await doc.GetSharedResolver (); var typeDecls = resolver.RootNode.Descendants. OfType<TypeDeclaration> (). Where (x => !(x.Parent is TypeDeclaration)); foreach (var td in typeDecls) { TypeCode.Set (td, resolver); } // // Refresh the monitored type // if (string.IsNullOrWhiteSpace (monitorTypeName)) return; var monitorTC = TypeCode.Get (monitorTypeName); var code = await Task.Run (() => monitorTC.GetLinkedCode ()); if (!forceEval && lastLinkedCode != null && lastLinkedCode.CacheKey == code.CacheKey) { return; } lastLinkedCode = code; // // Send the code to the device // try { Connect (); // // Declare it // Log (code.Declarations); if (!await EvalAsync (code.Declarations, showError)) return; // // Show it // Log (code.ValueExpression); if (!await EvalAsync (code.ValueExpression, showError)) return; } catch (Exception ex) { if (showError) { Alert ("Could not communicate with the app.\n\n{0}: {1}", ex.GetType (), ex.Message); } } }