public void TreeListFocusedNodeChanged(object sender, INode inode) { m_currentNode = inode; if (m_currentNode != null) { INodeCollection nodesList = null; if (m_currentNode is BaseContainerNode || m_currentNode is Case) { nodesList = m_currentNode.Nodes; } else if ((m_currentNode is Node) && (m_lastNode != null ? m_currentNode.Parent != m_lastNode.Parent : true)) { nodesList = m_currentNode.Parent.Nodes; } else if (m_currentNode.Parent == m_currentCase) { nodesList = m_currentCase.Nodes; } else { return; } SetGridData(nodesList); } }
private void OnCaseUpdate(object sender) { Case newCase = sender as Case; if (newCase == null) { return; } INodeCollection nodesList = null; if (m_currentCase == newCase) { if (m_currentCase.Nodes.Count > 0) { nodesList = (m_currentNode != null && m_currentNode is BaseContainerNode) ? m_currentNode.Nodes : m_currentNode.Parent.Nodes; } else { nodesList = new INodeCollection(); } } else { m_currentCase = newCase; nodesList = m_currentCase.Nodes; } SetGridData(nodesList); }
public Node(XmlNode node, XmlNode parent, Document document) { _nativeNode = node; _attributes = new AttributeCollection(node); _children = new NodeCollection(node, document); _parent = parent; _document = document; }
private static Calculator CreateSut( IModifierCollection?modifierCollection = null, ICalculationGraphPruner?graphPruner = null, INodeRepository?nodeRepository = null, INodeCollection <IStat>?explicitlyRegisteredStats = null) => new Calculator(new EventBuffer(), modifierCollection ?? Mock.Of <IModifierCollection>(), graphPruner ?? Mock.Of <ICalculationGraphPruner>(), nodeRepository ?? Mock.Of <INodeRepository>(), explicitlyRegisteredStats ?? Mock.Of <INodeCollection <IStat> >());
public NavGraph(INodeCollection para_vertices, IEdgeCollection para_edges, INavAlgorithm para_navAlg) { vertices = para_vertices; edges = para_edges; navAlgorithm = para_navAlg; }
public Case(string caseName = "Default Case") { ID = Guid.NewGuid().ToString(); Parent = null; NodeName = caseName; Nodes = new INodeCollection(); StateImageIndex = ImageConstants.TREE_LIST_CASE_INDEX; }
private static void SaveLexemTable(string path, INodeCollection nodes) { var ns = nodes.Tokens; var str = ns.Select(n => $"{n.Name,-20} {n.Id,-20}"); WriteAllLines(path, str); }
/// <summary> /// Sets the data required for mesh generation. /// </summary> /// <param name="cancellationToken">Token to observe for cancellation indication.</param> /// <param name="originPoint">Origin point of the chunk that's being meshed.</param> /// <param name="blocksCollection"><see cref="INodeCollection{T}" /> of blocksCollection contained within the chunk.</param> /// <param name="aggressiveFaceMerging">Indicates whether to merge similarly textured faces.</param> public void SetData(CancellationToken cancellationToken, int3 originPoint, INodeCollection <ushort> blocksCollection, bool aggressiveFaceMerging) { _CancellationToken = CancellationTokenSource.CreateLinkedTokenSource(AsyncJobScheduler.AbortToken, cancellationToken).Token; _OriginPoint = originPoint; _BlocksCollection = blocksCollection; _AggressiveFaceMerging = aggressiveFaceMerging; }
private void EnsureHasSelection() { INodeCollection nodeCollection = _listContacts.JetListView.NodeCollection; if (_listContacts.Selection.Count == 0 && nodeCollection.VisibleItemCount > 0) { _listContacts.Selection.Add(nodeCollection.FirstVisibleNode.Data); } }
public Calculator( EventBuffer eventBuffer, IModifierCollection modifierCollection, ICalculationGraphPruner graphPruner, INodeRepository nodeRepository, INodeCollection <IStat> explicitlyRegisteredStats) { _eventBuffer = eventBuffer; _modifierCollection = modifierCollection; _graphPruner = graphPruner; NodeRepository = nodeRepository; ExplicitlyRegisteredStats = explicitlyRegisteredStats; }
public Calculator( ISuspendableEvents suspender, IModifierCollection modifierCollection, ICalculationGraphPruner graphPruner, INodeRepository nodeRepository, INodeCollection <IStat> explicitlyRegisteredStats) { _suspender = suspender; _modifierCollection = modifierCollection; _graphPruner = graphPruner; NodeRepository = nodeRepository; ExplicitlyRegisteredStats = explicitlyRegisteredStats; }
private static ValueNode CreateAggregatingSut(INodeCollection <Modifier> nodeCollection) { var stat = new StatStub(); var nodeRepository = Mock.Of <INodeRepository>(r => r.GetFormNodeCollection(stat, Form.More, Path) == nodeCollection); var valueMock = new Mock <IValue>(); valueMock.Setup(v => v.Calculate(It.IsAny <IValueCalculationContext>())) .Returns((IValueCalculationContext c) => c.GetValues(Form.More, stat).FirstOrDefault()); return(CreateSut(nodeRepository, valueMock.Object)); }
public SyntaxPushdownParser( IPushdownAutomaton pushdownAutomaton, INodeCollection nodes, bool shouldIgnoreUndefinedTokens, int undefinedTokenClassId ) { this.pushdownAutomaton = pushdownAutomaton; this.nodes = nodes; this.shouldIgnoreUndefinedTokens = shouldIgnoreUndefinedTokens; this.undefinedTokenClassId = undefinedTokenClassId; }
public override void OnInspectorGUI() { INodeCollection myTarget = (INodeCollection)target; Node node = (Node)myTarget; if (node.Variables.Count() == 0) { return; } Variable variable = node.Variables.GetByID(myTarget.SelectedVariableID); VariableEditor.OnInspectorGUI(variable); }
private void FinishMeshing() { // clear mask, add to object pool, and unset reference Array.Clear(_MeshingBlocks, 0, _MeshingBlocks.Length); _MeshingBlockArrayPool.TryAdd(_MeshingBlocks); _MeshingBlocks = default; // clear array to free RAM until next execution Array.Clear(_NeighborBlocksCollections, 0, _NeighborBlocksCollections.Length); _OriginPoint = default; _BlocksCollection = default; _AggressiveFaceMerging = default; }
public void EditorInit(INodeCollection parent, Vector2 position, System.Type subType = null) { CreateID(); PinCollection = new PinCollection(this); Parent = parent; this.Position = position; SetSubtype(subType); OnInit(); OnInstantiated(); this.IsInitialized = true; }
protected override void OnHeaderGUI() { INodeCollection myTarget = (INodeCollection)target; Node node = (Node)myTarget; if (node.Variables.Count() > 0) { Variable variable = node.Variables.GetByID(myTarget.SelectedVariableID); if (variable != null) { RunemarkGUI.inspectorTitle.Draw(variable.Name + " (Local Variable)", ""); return; } } base.OnHeaderGUI(); }
private void SetGridData(INodeCollection nodesList) { DataSourceList = new List <Node>(); foreach (INode node in nodesList) { Node temp = node as Node; if (temp != null) { DataSourceList.Add(temp); } } CurrentGridControl.BeginUpdate(); CurrentGridControl.DataSource = DataSourceList; CurrentGridControl.EndUpdate(); m_lastNode = m_currentNode; }
/// <summary> /// Gets the areas. /// </summary> /// <param name="projectName">Name of the project.</param> /// <param name="depth">The depth.</param> /// <returns>Task<IReadOnlyList<IArea>>.</returns> public Task <IReadOnlyList <IArea> > GetAreas(string projectName, int depth) { return(AsyncOperation(() => { IWorkItemStore workItemStore = WorkItemStore(); IProject project = workItemStore.Projects[projectName]; INodeCollection areaRootNodes = project.AreaRootNodes; var result = new List <IArea>(); foreach (INode areaNode in areaRootNodes) { result.Add(AreaWrapper.CreateWrapper(areaNode)); foreach (INode childNode in areaNode.ChildNodes) { result.Add(AreaWrapper.CreateWrapper(childNode)); } } return (IReadOnlyList <IArea>)result; })); }
private void PrepareMeshing() { Debug.Assert(_BlocksCollection != null, $"{nameof(_BlocksCollection)} should not be null when meshing is started. It's possible {nameof(SetData)}() has not been called."); Debug.Assert(_NeighborBlocksCollections != null, $"{nameof(_NeighborBlocksCollections)} should not be null when meshing is started."); Debug.Assert(_NeighborBlocksCollections.Length == 6, $"{nameof(_NeighborBlocksCollections)} should have a length of 6, one for each neighboring chunk."); // retrieve existing objects from object pool _MeshingBlocks = _MeshingBlockArrayPool.Retrieve() ?? new MeshingBlock[GenerationConstants.CHUNK_SIZE_CUBED]; _MeshData = _MeshDataPool.Retrieve() ?? new MeshData(new List <int>(), new List <int>()); int index = 0; for (int y = 0; y < GenerationConstants.CHUNK_SIZE; y++) { for (int z = 0; z < GenerationConstants.CHUNK_SIZE; z++) { for (int x = 0; x < GenerationConstants.CHUNK_SIZE; x++, index++) { _MeshingBlocks[index].ID = ((Octree)_BlocksCollection).GetPoint(x, y, z); } } } // unset reference to block collection to avoid use during meshing generation _BlocksCollection = null; for (int normalIndex = 0; normalIndex < 6; normalIndex++) { int3 globalPosition = _OriginPoint + (GenerationConstants.NormalVectorByIteration[normalIndex] * GenerationConstants.CHUNK_SIZE); if (WorldController.Current.TryGetChunk(globalPosition, out ChunkController chunkController)) { _NeighborBlocksCollections[normalIndex] = chunkController.Blocks; } } }
private static Calculator CreateSut( IModifierCollection modifierCollection = null, ICalculationGraphPruner graphPruner = null, INodeRepository nodeRepository = null, INodeCollection <IStat> explicitlyRegisteredStats = null) => new Calculator(new EventBuffer(), modifierCollection, graphPruner, nodeRepository, explicitlyRegisteredStats);
public GrpcTransportService(IGrpcTransportProvider transportProvider, IGrpcHostConfiguration hostConfiguration, INodeCollection collection) { _transportProvider = transportProvider; _hostConfiguration = hostConfiguration; _collection = collection; }
partial void ChildNodes_SetCondition(ref INode instance, ref INodeCollection setValue);
public PredescenceTableParser(INodeCollection nodes) { this.nodes = nodes; }
public FiniteAutomatonParser(IClassTable classTable, INodeCollection nodes, IEnumerable <string> unclassifiedTerminals) { this.classTable = classTable; this.nodes = nodes; this.unclassifiedTerminals = unclassifiedTerminals; }
private void SetGridData(INodeCollection nodesList) { DataSourceList = new List<Node>(); foreach (INode node in nodesList) { Node temp = node as Node; if (temp != null) { DataSourceList.Add(temp); } } CurrentGridControl.BeginUpdate(); CurrentGridControl.DataSource = DataSourceList; CurrentGridControl.EndUpdate(); m_lastNode = m_currentNode; }
protected internal Node(INode parent, string name, INodeCollection<INode> children) { Parent = parent; Name = name; Children = children; }
public XmlTreeView(INodeCollection collection) { InitializeComponent(); XmlTree.ItemsSource = collection.Children; }
/// <summary> /// Initializes a new instance of the <see cref="MemberAssignmentNode" /> struct. /// </summary> /// <param name="memberAssignment">The member assignment.</param> /// <param name="nodes">The nodes.</param> public MemberAssignmentNode([NotNull] MemberAssignment memberAssignment, [NotNull] INodeCollection nodes) { this.MemberAssignment = memberAssignment; this.Nodes = nodes; }
public void EnsureNodesConfigurationIsValid(INodeCollection nodes) { int mastersCount = nodes.All.Count(n => n.IsMaster); if (mastersCount != 1) throw new BadConfigurationException("There must be exactly 1 master node"); if (nodes.All.Select(n => n.ServerId).Distinct().Count() < nodes.All.Count()) throw new BadConfigurationException("Every node must have unique Id"); }
protected abstract INode Pin(INode pinnedParent, INodeCollection<INode> pinnedChildren);
partial void IterationRootNodes_SetCondition(ref IProject instance, ref INodeCollection setValue);
protected override INode Pin(INode pinnedParent, INodeCollection<INode> pinnedChildren) { return Pin((IFormula)pinnedParent, pinnedChildren); }
private static Calculator CreateSut( ISuspendableEvents suspender = null, IModifierCollection modifierCollection = null, ICalculationGraphPruner graphPruner = null, INodeRepository nodeRepository = null, INodeCollection <IStat> explicitlyRegisteredStats = null) => new Calculator(suspender, modifierCollection, graphPruner, nodeRepository, explicitlyRegisteredStats);
private void Initialize() { _attributes = new AttributeCollection(_nativeDocument); _children = new NodeCollection(_nativeDocument, this); _documentNode = new Node(_nativeDocument.DocumentElement, _nativeDocument, this); }
public WireController(INodeCollection graph, VisualEditor editor) { _graph = graph; _editor = editor; }
public NodeMessageFabricObserver(INodeCollection nodes, IGrpcHostNode hostNode) { _nodes = nodes; _hostNode = hostNode; }