private void OnFragmentTreeItemDoubleClick(object sender, Aga.Controls.Tree.TreeNodeAdvMouseEventArgs e) { if (e.Node != null && e.Node.Tag is TreeViewArchiveModel.ParameterStructItem) { ShaderParameterUtil.EditParameter(graphControl, ((TreeViewArchiveModel.ParameterStructItem)e.Node.Tag).ArchiveName); } }
private void OnNodesChange() { var didSomething = ShaderParameterUtil.FillInMaterialParameters(_document, graphControl); if (didSomething) { _materialParametersGrid.Refresh(); } }
void OnShowElementMenu(object sender, AcceptElementLocationEventArgs e) { if (e.Element is Node && ((Node)e.Element).Tag is ShaderProcedureNodeTag) { var tag = (ShaderProcedureNodeTag)((Node)e.Element).Tag; nodeMenu.Tag = tag.Id; nodeMenu.Show(e.Position); e.Cancel = false; } if (e.Element is Node && ((Node)e.Element).Tag is ShaderParameterNodeTag) { var tag = (ShaderParameterNodeTag)((Node)e.Element).Tag; parameterBoxMenu.Tag = tag.Id; parameterBoxMenu.Show(e.Position); e.Cancel = false; } else if (e.Element is ShaderFragmentNodeItem) { var tag = (ShaderFragmentNodeItem)e.Element; if (tag.ArchiveName != null) { ShaderParameterUtil.EditParameter(graphControl, tag.ArchiveName); e.Cancel = false; } } else if (e.Element is NodeConnector && ((NodeConnector)e.Element).Item is ShaderFragmentNodeItem) { var tag = (ShaderFragmentNodeItem)((NodeConnector)e.Element).Item; if (tag.ArchiveName != null) { ShaderParameterUtil.EditParameter(graphControl, tag.ArchiveName); e.Cancel = false; } } else { // if you don't want to show a menu for this item (but perhaps show a menu for something more higher up) // then you can cancel the event e.Cancel = true; } }