Exemplo n.º 1
0
        public void RemoveFilter(IOutputFilterModuleInstance filter)
        {
            if (filter == null) throw new ArgumentNullException("filter");

            _RemoveChildren(filter);
            _RemoveFromParent(filter);
        }
Exemplo n.º 2
0
        private HashSet<IOutputFilterModuleInstance> _CreateChildCollection(IOutputFilterModuleInstance filter)
        {
            HashSet<IOutputFilterModuleInstance> childCollection = new HashSet<IOutputFilterModuleInstance>();
            _filterChildren[filter] = childCollection;

            return childCollection;
        }
Exemplo n.º 3
0
        public void SetParent(IOutputFilterModuleInstance filter, IOutputFilterModuleInstance parentFilter)
        {
            if (filter == null) throw new ArgumentNullException("filter");

            _RemoveFromParent(filter);
            _SetParent(filter, parentFilter);
        }
Exemplo n.º 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);
            }
        }
Exemplo n.º 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);
        }
Exemplo n.º 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();
            }
        }
Exemplo n.º 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);
 }
Exemplo n.º 9
0
        private HashSet<IOutputFilterModuleInstance> _GetChildren(IOutputFilterModuleInstance filter)
        {
            HashSet<IOutputFilterModuleInstance> chilren;

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

            return chilren;
        }
Exemplo n.º 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);
     }
 }
Exemplo n.º 11
0
        private FilterShape _CreateShapeFromFilter(IOutputFilterModuleInstance filter)
        {
            FilterShape filterShape = _MakeFilterShape(filter);

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

            _RemoveFromParent(filter);
            _SetParent(filter, parentFilter);
        }
Exemplo n.º 13
0
        public void RemoveFilter(IOutputFilterModuleInstance filter)
        {
            if (filter == null)
            {
                throw new ArgumentNullException("filter");
            }

            _RemoveChildren(filter);
            _RemoveFromParent(filter);
        }
Exemplo n.º 14
0
        private HashSet <IOutputFilterModuleInstance> _GetChildren(IOutputFilterModuleInstance filter)
        {
            HashSet <IOutputFilterModuleInstance> chilren;

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

            return(chilren);
        }
Exemplo n.º 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();
            }
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
     }
 }
Exemplo n.º 23
0
 private FilterShape _CreateShapeFromFilter(IOutputFilterModuleInstance filter)
 {
     FilterShape filterShape = _MakeFilterShape(filter);
     if (filterShape != null)
         _filterShapes.Add(filterShape);
     return filterShape;
 }
Exemplo n.º 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;
        }
Exemplo n.º 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();
 }
Exemplo n.º 27
0
 public HashSet<IOutputFilterModuleInstance> GetChildren(IOutputFilterModuleInstance filter)
 {
     return _GetChildren(filter);
 }
Exemplo n.º 28
0
 public HashSet <IOutputFilterModuleInstance> GetChildren(IOutputFilterModuleInstance filter)
 {
     return(_GetChildren(filter));
 }
Exemplo n.º 29
0
 private void _RemoveChildren(IOutputFilterModuleInstance filter)
 {
     _filterChildren.Remove(filter);
 }
Exemplo n.º 30
0
 private void _RemoveChildren(IOutputFilterModuleInstance filter)
 {
     _filterChildren.Remove(filter);
 }
Exemplo n.º 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();
 }
Exemplo n.º 33
0
 public IEnumerable <IOutputFilterModuleInstance> GetChildren(IOutputFilterModuleInstance filter)
 {
     return(_GetChildren(filter));
 }