コード例 #1
0
ファイル: FilterChildren.cs プロジェクト: stewmc/vixen
        public void RemoveFilter(IOutputFilterModuleInstance filter)
        {
            if (filter == null) throw new ArgumentNullException("filter");

            _RemoveChildren(filter);
            _RemoveFromParent(filter);
        }
コード例 #2
0
ファイル: FilterChildren.cs プロジェクト: stewmc/vixen
        private HashSet<IOutputFilterModuleInstance> _CreateChildCollection(IOutputFilterModuleInstance filter)
        {
            HashSet<IOutputFilterModuleInstance> childCollection = new HashSet<IOutputFilterModuleInstance>();
            _filterChildren[filter] = childCollection;

            return childCollection;
        }
コード例 #3
0
ファイル: FilterChildren.cs プロジェクト: stewmc/vixen
        public void SetParent(IOutputFilterModuleInstance filter, IOutputFilterModuleInstance parentFilter)
        {
            if (filter == null) throw new ArgumentNullException("filter");

            _RemoveFromParent(filter);
            _SetParent(filter, parentFilter);
        }
コード例 #4
0
ファイル: FilterChildren.cs プロジェクト: robness/Vixen
        //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
ファイル: FilterChildren.cs プロジェクト: robness/Vixen
        private HashSet <IOutputFilterModuleInstance> _CreateChildCollection(IOutputFilterModuleInstance filter)
        {
            HashSet <IOutputFilterModuleInstance> childCollection = new HashSet <IOutputFilterModuleInstance>();

            _filterChildren[filter] = childCollection;

            return(childCollection);
        }
コード例 #7
0
        private void buttonSetupFilter_Click(object sender, EventArgs e)
        {
            IOutputFilterModuleInstance instance = listViewFilters.SelectedItems[0].Tag as IOutputFilterModuleInstance;

            if (instance != null)
            {
                instance.Setup();
            }
        }
コード例 #8
0
ファイル: FilterChildren.cs プロジェクト: stewmc/vixen
 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
ファイル: FilterChildren.cs プロジェクト: stewmc/vixen
        private HashSet<IOutputFilterModuleInstance> _GetChildren(IOutputFilterModuleInstance filter)
        {
            HashSet<IOutputFilterModuleInstance> chilren;

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

            return chilren;
        }
コード例 #10
0
ファイル: FilterChildren.cs プロジェクト: stewmc/vixen
 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
ファイル: FilterChildren.cs プロジェクト: robness/Vixen
        public void SetParent(IOutputFilterModuleInstance filter, IOutputFilterModuleInstance parentFilter)
        {
            if (filter == null)
            {
                throw new ArgumentNullException("filter");
            }

            _RemoveFromParent(filter);
            _SetParent(filter, parentFilter);
        }
コード例 #13
0
ファイル: FilterChildren.cs プロジェクト: robness/Vixen
        public void RemoveFilter(IOutputFilterModuleInstance filter)
        {
            if (filter == null)
            {
                throw new ArgumentNullException("filter");
            }

            _RemoveChildren(filter);
            _RemoveFromParent(filter);
        }
コード例 #14
0
ファイル: FilterChildren.cs プロジェクト: robness/Vixen
        private HashSet <IOutputFilterModuleInstance> _GetChildren(IOutputFilterModuleInstance filter)
        {
            HashSet <IOutputFilterModuleInstance> chilren;

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

            return(chilren);
        }
コード例 #15
0
ファイル: FilterChildren.cs プロジェクト: ctmal/vixen
 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);
 }
コード例 #16
0
        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
ファイル: FilterChildren.cs プロジェクト: robness/Vixen
        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);
            }
        }
コード例 #18
0
        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();
        }
コード例 #19
0
        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();
        }
コード例 #20
0
        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
ファイル: FilterChildren.cs プロジェクト: stewmc/vixen
 public IEnumerable<IOutputFilterModuleInstance> GetChildren(IOutputFilterModuleInstance filter)
 {
     return _GetChildren(filter);
 }
コード例 #22
0
 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;
        }
コード例 #26
0
 public void SetFilterInstance(IOutputFilterModuleInstance filterInstance)
 {
     _filterInstance = filterInstance;
     _recalcControlPoints();
 }
コード例 #27
0
ファイル: FilterChildren.cs プロジェクト: jaredb7/vixen
 public HashSet<IOutputFilterModuleInstance> GetChildren(IOutputFilterModuleInstance filter)
 {
     return _GetChildren(filter);
 }
コード例 #28
0
ファイル: FilterChildren.cs プロジェクト: robness/Vixen
 public HashSet <IOutputFilterModuleInstance> GetChildren(IOutputFilterModuleInstance filter)
 {
     return(_GetChildren(filter));
 }
コード例 #29
0
ファイル: FilterChildren.cs プロジェクト: robness/Vixen
 private void _RemoveChildren(IOutputFilterModuleInstance filter)
 {
     _filterChildren.Remove(filter);
 }
コード例 #30
0
ファイル: FilterChildren.cs プロジェクト: stewmc/vixen
 private void _RemoveChildren(IOutputFilterModuleInstance filter)
 {
     _filterChildren.Remove(filter);
 }
コード例 #31
0
ファイル: FilterChildren.cs プロジェクト: stewmc/vixen
 //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);
     }
 }
コード例 #32
0
 public void SetFilterInstance(IOutputFilterModuleInstance filterInstance)
 {
     _filterInstance = filterInstance;
     _recalcControlPoints();
 }
コード例 #33
0
ファイル: FilterChildren.cs プロジェクト: ctmal/vixen
 public IEnumerable <IOutputFilterModuleInstance> GetChildren(IOutputFilterModuleInstance filter)
 {
     return(_GetChildren(filter));
 }