public void RemoveFilter(IOutputFilterModuleInstance filter) { if (filter == null) throw new ArgumentNullException("filter"); _RemoveChildren(filter); _RemoveFromParent(filter); }
private HashSet<IOutputFilterModuleInstance> _CreateChildCollection(IOutputFilterModuleInstance filter) { HashSet<IOutputFilterModuleInstance> childCollection = new HashSet<IOutputFilterModuleInstance>(); _filterChildren[filter] = childCollection; return childCollection; }
public void SetParent(IOutputFilterModuleInstance filter, IOutputFilterModuleInstance parentFilter) { if (filter == null) throw new ArgumentNullException("filter"); _RemoveFromParent(filter); _SetParent(filter, parentFilter); }
//public void AddChild(IOutputFilterModuleInstance parentFilter, IOutputFilterModuleInstance childFilter) { //} //public void RemoveChild(IOutputFilterModuleInstance parentFilter, IOutputFilterModuleInstance childFilter) { //} private void _SetParent(IOutputFilterModuleInstance filter, IOutputFilterModuleInstance parentFilter) { if (parentFilter != null) { _GetChildren(parentFilter).Add(filter); } }
private FilterShape _MakeFilterShape(IOutputFilterModuleInstance filter) { FilterShape filterShape = (FilterShape)project.ShapeTypes["FilterShape"].CreateInstance(); filterShape.Title = filter.Descriptor.TypeName; filterShape.SecurityDomainName = SECURITY_DOMAIN_MOVABLE_SHAPE_WITH_CONNECTIONS; filterShape.FillStyle = project.Design.FillStyles["Filter"]; filterShape.SetFilterInstance(filter); diagramDisplay.InsertShape(filterShape); diagramDisplay.Diagram.Shapes.SetZOrder(filterShape, 10); // Z Order of 10; should be above other elements/outputs, but under lines diagramDisplay.Diagram.AddShapeToLayers(filterShape, _visibleLayer.Id); if (filterShape.DataFlowComponent != null) { if (!_dataFlowComponentToShapes.ContainsKey(filterShape.DataFlowComponent)) { _dataFlowComponentToShapes[filterShape.DataFlowComponent] = new List <FilterSetupShapeBase>(); } _dataFlowComponentToShapes[filterShape.DataFlowComponent].Add(filterShape); } if (_filterToFilterShape.ContainsKey(filter)) { throw new Exception("filter->shape map already has an entry when it shouldn't"); } _filterToFilterShape[filter] = filterShape; return(filterShape); }
private HashSet <IOutputFilterModuleInstance> _CreateChildCollection(IOutputFilterModuleInstance filter) { HashSet <IOutputFilterModuleInstance> childCollection = new HashSet <IOutputFilterModuleInstance>(); _filterChildren[filter] = childCollection; return(childCollection); }
private void buttonSetupFilter_Click(object sender, EventArgs e) { IOutputFilterModuleInstance instance = listViewFilters.SelectedItems[0].Tag as IOutputFilterModuleInstance; if (instance != null) { instance.Setup(); } }
public void AddFilter(IOutputFilterModuleInstance filter) { if (filter == null) throw new ArgumentNullException("filter"); if (_filterChildren.ContainsKey(filter)) { throw new InvalidOperationException("Filter " + filter.Descriptor.TypeName + " is being added to the child lookup more than once."); } _CreateChildCollection(filter); }
private HashSet<IOutputFilterModuleInstance> _GetChildren(IOutputFilterModuleInstance filter) { HashSet<IOutputFilterModuleInstance> chilren; if (!_filterChildren.TryGetValue(filter, out chilren)) { chilren = _CreateChildCollection(filter); } return chilren; }
private void _RemoveFromParent(IOutputFilterModuleInstance filter) { // Filter may not yet be connected. if (filter.Source == null) return; // Source may be a element. IOutputFilterModuleInstance parentFilter = filter.Source as IOutputFilterModuleInstance; if (parentFilter != null) { _GetChildren(parentFilter).Remove(filter); } }
private FilterShape _CreateShapeFromFilter(IOutputFilterModuleInstance filter) { FilterShape filterShape = _MakeFilterShape(filter); if (filterShape != null) { _filterShapes.Add(filterShape); } return(filterShape); }
public void SetParent(IOutputFilterModuleInstance filter, IOutputFilterModuleInstance parentFilter) { if (filter == null) { throw new ArgumentNullException("filter"); } _RemoveFromParent(filter); _SetParent(filter, parentFilter); }
public void RemoveFilter(IOutputFilterModuleInstance filter) { if (filter == null) { throw new ArgumentNullException("filter"); } _RemoveChildren(filter); _RemoveFromParent(filter); }
private HashSet <IOutputFilterModuleInstance> _GetChildren(IOutputFilterModuleInstance filter) { HashSet <IOutputFilterModuleInstance> chilren; if (!_filterChildren.TryGetValue(filter, out chilren)) { chilren = _CreateChildCollection(filter); } return(chilren); }
public void AddFilter(IOutputFilterModuleInstance filter) { if (filter == null) { throw new ArgumentNullException("filter"); } if (_filterChildren.ContainsKey(filter)) { throw new InvalidOperationException("Filter " + filter.Descriptor.TypeName + " is being added to the child lookup more than once."); } _CreateChildCollection(filter); }
private void listViewFilters_DoubleClick(object sender, EventArgs e) { if (listViewFilters.SelectedItems.Count <= 0) { return; } IOutputFilterModuleInstance instance = listViewFilters.SelectedItems[0].Tag as IOutputFilterModuleInstance; if (instance != null) { instance.Setup(); } }
private void _RemoveFromParent(IOutputFilterModuleInstance filter) { // Filter may not yet be connected. if (filter.Source == null) { return; } // Source may be a element. IOutputFilterModuleInstance parentFilter = filter.Source as IOutputFilterModuleInstance; if (parentFilter != null) { _GetChildren(parentFilter).Remove(filter); } }
private void buttonAddFilter_Click(object sender, EventArgs e) { ConfigFiltersAndPatching.FilterTypeComboBoxEntry item = comboBoxNewFilterTypes.SelectedItem as ConfigFiltersAndPatching.FilterTypeComboBoxEntry; if (item == null) { MessageBox.Show("Please select a filter type first.", "Select filter type"); return; } IOutputFilterModuleInstance moduleInstance = ApplicationServices.Get <IOutputFilterModuleInstance>(item.Guid); _data.Filters.Add(moduleInstance); listViewFilters.Items.Add(new ListViewItem { Text = moduleInstance.Name, Tag = moduleInstance }); _WizardStageChanged(); }
private void buttonMoveUp_Click(object sender, EventArgs e) { if (listViewFilters.SelectedIndices.Count != 1 || listViewFilters.SelectedIndices[0] <= 0) { return; } int index = listViewFilters.SelectedIndices[0]; ListViewItem item = listViewFilters.Items[index]; listViewFilters.Items.RemoveAt(index); listViewFilters.Items.Insert(index - 1, item); IOutputFilterModuleInstance instance = _data.Filters[index]; _data.Filters.RemoveAt(index); _data.Filters.Insert(index - 1, instance); _updateButtonStatuses(); _WizardStageChanged(); }
private FilterShape _CreateNewFilterInstanceAndShape(Guid filterTypeId, bool defaultLayout, IModuleDataModel dataModelToCopy = null) { IOutputFilterModuleInstance moduleInstance = ApplicationServices.Get <IOutputFilterModuleInstance>(filterTypeId); if (dataModelToCopy != null) { moduleInstance.ModuleData = dataModelToCopy.Clone(); } FilterShape shape = _CreateShapeFromFilter(moduleInstance); VixenSystem.Filters.AddFilter(moduleInstance); shape.Width = SHAPE_FILTERS_WIDTH; shape.Height = SHAPE_FILTERS_HEIGHT; if (defaultLayout) { shape.X = (diagramDisplay.Width / 2) - diagramDisplay.GetDiagramPosition().X; shape.Y = diagramDisplay.GetDiagramOffset().Y + (diagramDisplay.Height / 2); } return(shape); }
public IEnumerable<IOutputFilterModuleInstance> GetChildren(IOutputFilterModuleInstance filter) { return _GetChildren(filter); }
public override void CopyFrom(Shape source) { base.CopyFrom(source); if (source is FilterShape) { FilterShape src = (FilterShape) source; _filterInstance = src.FilterInstance; _CopyControlPointsFrom(src); } }
private FilterShape _CreateShapeFromFilter(IOutputFilterModuleInstance filter) { FilterShape filterShape = _MakeFilterShape(filter); if (filterShape != null) _filterShapes.Add(filterShape); return filterShape; }
private FilterShape _MakeFilterShape(IOutputFilterModuleInstance filter) { FilterShape filterShape = (FilterShape)project.ShapeTypes["FilterShape"].CreateInstance(); filterShape.Title = filter.Descriptor.TypeName; filterShape.SecurityDomainName = SECURITY_DOMAIN_MOVABLE_SHAPE_WITH_CONNECTIONS; filterShape.FillStyle = project.Design.FillStyles["Filter"]; filterShape.SetFilterInstance(filter); diagramDisplay.InsertShape(filterShape); diagramDisplay.Diagram.Shapes.SetZOrder(filterShape, 10); // Z Order of 10; should be above other elements/outputs, but under lines diagramDisplay.Diagram.AddShapeToLayers(filterShape, _visibleLayer.Id); _addShapeToDataFlowMap(filterShape, _dataFlowComponentToShapes); _addFilterShapeToFilterMap(filterShape, _filterToFilterShape); _addFilterShapeToParentDataFlowComponentMap(filterShape, _dataFlowComponentToChildFilterShapes); _calculateFilterDepthFromSource(filterShape); return filterShape; }
private FilterShape _MakeFilterShape(IOutputFilterModuleInstance filter) { FilterShape filterShape = (FilterShape)project.ShapeTypes["FilterShape"].CreateInstance(); filterShape.Title = filter.Descriptor.TypeName; filterShape.SecurityDomainName = SECURITY_DOMAIN_MOVABLE_SHAPE_WITH_CONNECTIONS; filterShape.FillStyle = project.Design.FillStyles["Filter"]; filterShape.SetFilterInstance(filter); diagramDisplay.InsertShape(filterShape); diagramDisplay.Diagram.Shapes.SetZOrder(filterShape, 10); // Z Order of 10; should be above other elements/outputs, but under lines diagramDisplay.Diagram.AddShapeToLayers(filterShape, _visibleLayer.Id); if (filterShape.DataFlowComponent != null) { if (!_dataFlowComponentToShapes.ContainsKey(filterShape.DataFlowComponent)) _dataFlowComponentToShapes[filterShape.DataFlowComponent] = new List<FilterSetupShapeBase>(); _dataFlowComponentToShapes[filterShape.DataFlowComponent].Add(filterShape); } if (_filterToFilterShape.ContainsKey(filter)) throw new Exception("filter->shape map already has an entry when it shouldn't"); _filterToFilterShape[filter] = filterShape; return filterShape; }
public void SetFilterInstance(IOutputFilterModuleInstance filterInstance) { _filterInstance = filterInstance; _recalcControlPoints(); }
public HashSet<IOutputFilterModuleInstance> GetChildren(IOutputFilterModuleInstance filter) { return _GetChildren(filter); }
public HashSet <IOutputFilterModuleInstance> GetChildren(IOutputFilterModuleInstance filter) { return(_GetChildren(filter)); }
private void _RemoveChildren(IOutputFilterModuleInstance filter) { _filterChildren.Remove(filter); }
public IEnumerable <IOutputFilterModuleInstance> GetChildren(IOutputFilterModuleInstance filter) { return(_GetChildren(filter)); }