예제 #1
0
        public void RemoveFilter(IOutputFilterModuleInstance filter)
        {
            if (filter == null) throw new ArgumentNullException("filter");

            _RemoveChildren(filter);
            _RemoveFromParent(filter);
        }
예제 #2
0
        private HashSet<IOutputFilterModuleInstance> _CreateChildCollection(IOutputFilterModuleInstance filter)
        {
            HashSet<IOutputFilterModuleInstance> childCollection = new HashSet<IOutputFilterModuleInstance>();
            _filterChildren[filter] = childCollection;

            return childCollection;
        }
예제 #3
0
        public void SetParent(IOutputFilterModuleInstance filter, IOutputFilterModuleInstance parentFilter)
        {
            if (filter == null) throw new ArgumentNullException("filter");

            _RemoveFromParent(filter);
            _SetParent(filter, parentFilter);
        }
예제 #4
0
        //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);
            }
        }
예제 #5
0
        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);
        }
예제 #6
0
        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();
            }
        }
예제 #8
0
 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);
 }
예제 #9
0
        private HashSet<IOutputFilterModuleInstance> _GetChildren(IOutputFilterModuleInstance filter)
        {
            HashSet<IOutputFilterModuleInstance> chilren;

            if (!_filterChildren.TryGetValue(filter, out chilren)) {
                chilren = _CreateChildCollection(filter);
            }

            return chilren;
        }
예제 #10
0
 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);
     }
 }
예제 #11
0
        private FilterShape _CreateShapeFromFilter(IOutputFilterModuleInstance filter)
        {
            FilterShape filterShape = _MakeFilterShape(filter);

            if (filterShape != null)
            {
                _filterShapes.Add(filterShape);
            }
            return(filterShape);
        }
예제 #12
0
        public void SetParent(IOutputFilterModuleInstance filter, IOutputFilterModuleInstance parentFilter)
        {
            if (filter == null)
            {
                throw new ArgumentNullException("filter");
            }

            _RemoveFromParent(filter);
            _SetParent(filter, parentFilter);
        }
예제 #13
0
        public void RemoveFilter(IOutputFilterModuleInstance filter)
        {
            if (filter == null)
            {
                throw new ArgumentNullException("filter");
            }

            _RemoveChildren(filter);
            _RemoveFromParent(filter);
        }
예제 #14
0
        private HashSet <IOutputFilterModuleInstance> _GetChildren(IOutputFilterModuleInstance filter)
        {
            HashSet <IOutputFilterModuleInstance> chilren;

            if (!_filterChildren.TryGetValue(filter, out chilren))
            {
                chilren = _CreateChildCollection(filter);
            }

            return(chilren);
        }
예제 #15
0
 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();
            }
        }
예제 #17
0
        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);
        }
예제 #21
0
 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);
     }
 }
예제 #23
0
 private FilterShape _CreateShapeFromFilter(IOutputFilterModuleInstance filter)
 {
     FilterShape filterShape = _MakeFilterShape(filter);
     if (filterShape != null)
         _filterShapes.Add(filterShape);
     return filterShape;
 }
예제 #24
0
        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;
        }
예제 #25
0
        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();
 }
예제 #27
0
 public HashSet<IOutputFilterModuleInstance> GetChildren(IOutputFilterModuleInstance filter)
 {
     return _GetChildren(filter);
 }
예제 #28
0
 public HashSet <IOutputFilterModuleInstance> GetChildren(IOutputFilterModuleInstance filter)
 {
     return(_GetChildren(filter));
 }
예제 #29
0
 private void _RemoveChildren(IOutputFilterModuleInstance filter)
 {
     _filterChildren.Remove(filter);
 }
예제 #30
0
 private void _RemoveChildren(IOutputFilterModuleInstance filter)
 {
     _filterChildren.Remove(filter);
 }
예제 #31
0
 //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);
     }
 }
 public void SetFilterInstance(IOutputFilterModuleInstance filterInstance)
 {
     _filterInstance = filterInstance;
     _recalcControlPoints();
 }
예제 #33
0
 public IEnumerable <IOutputFilterModuleInstance> GetChildren(IOutputFilterModuleInstance filter)
 {
     return(_GetChildren(filter));
 }