Esempio n. 1
0
 public DrawingBoard(Engine.Workflow w) : this()
 {
     Workflow = w;
     this.DrawableSurface.SetWorkflow(w);
     Workflow.CoordinatesManager.ZoomFactorChanged    += E_CoordinatesManager_ZoomFactorChanged;
     Workflow.CoordinatesManager.ImagePositionChanged += E_CoordinatesManager_ImagePositionChanged;
     Workflow.DrawingBoardSizeRequested += E_Workflow_DrawingBoardSizeRequested;
     Workflow.SelectionGlassRequested   += E_Workflow_SelectionGlassRequested;
 }
        /// <summary>
        /// Retrieves values passed to tool of effect and put them in controls. This is used when user changes active drawing board
        /// </summary>
        /// <param name="collectedValues">The collected VisualPropertyPage values saved in the tool or effect corresponding to the current drawing board</param>
        public void Fill(Engine.Workflow w)
        {
            Engine.Effects.VisualProperties vp = w.GraphicActivity.GetVisualProperties();

            if (vp == null)
            {
                return;
            }

            //t_properties = collectedValues;

            Dictionary <string, Engine.Effects.VisualPropertyItem> items = vp.GetItems();

            foreach (KeyValuePair <string, Engine.Effects.VisualPropertyItem> key in items)
            {
                FillControl(key);
            }
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="w"></param>
        /// <remarks>Called by the VisualPropertyPageManager</remarks>
        internal void Build(Engine.Workflow w)
        {
            Clear();

            t_workflow = w;

            if (w.GraphicActivity == null)
            {
                return;
            }

            Engine.Tools.IGraphicActivity   activity = w.GraphicActivity;
            Engine.Effects.VisualProperties vp       = activity.GetVisualProperties();


            // this can happen for tools or effects that have no visual properties
            if (vp == null)
            {
                return;
            }

            if (vp.Count == 0)
            {
                // ensure no properties are left from a previous workflow-document
                t_properties   = null;
                t_canAutoApply = false;

                return;
            }

            t_properties = new Engine.Attributes.AttributeCollection();

            Dictionary <string, Engine.Effects.VisualPropertyItem> items = vp.GetItems();

            foreach (KeyValuePair <string, Engine.Effects.VisualPropertyItem> key in items)
            {
                BuildControl(key);
            }

            t_canAutoApply = true;
        }