private void FillPropertyRadioButtons(Engine.Effects.VisualPropertyItem pi)
        {
            PaintualUI.Controls.PropertyPage.TPropertyRadioButtons prb = (PaintualUI.Controls.PropertyPage.TPropertyRadioButtons) this.FlowPanelContainer.Children[pi.Index];

            // get collected values from tool or effects
            Engine.Attributes.IAttribute attr = t_properties.Get(pi.ActualPropertyName);
            prb.DefaultValue = attr.Value;
            prb.UpdateVisual();
        }
        private void FillPropertyFolderSelector(Engine.Effects.VisualPropertyItem pi)
        {
            PaintualUI.Controls.PropertyPage.TPropertyFolderSelector pfs = (PaintualUI.Controls.PropertyPage.TPropertyFolderSelector) this.FlowPanelContainer.Children[pi.Index];

            // get collected values from tool or effect
            Engine.Attributes.IAttribute attr = t_properties.Get(pi.ActualPropertyName);

            pfs.DefaultValue = (string)attr.Value;
            pfs.UpdateVisual();
        }
        private void FillPropertyDoubleBox(Engine.Effects.VisualPropertyItem pi)
        {
            PaintualUI.Controls.PropertyPage.TPropertyDoubleBox pdb = (PaintualUI.Controls.PropertyPage.TPropertyDoubleBox) this.FlowPanelContainer.Children[pi.Index];

            // get collected values from tool or effect
            Engine.Attributes.IAttribute attr = t_properties.Get(pi.ActualPropertyName);

            pdb.DefaultValue = ((double)attr.Value).ToString();
            pdb.UpdateVisual();
        }
Exemple #4
0
        public static Engine.Surface.Canvas GetDefaultImage(Engine.Attributes.IAttribute attr)
        {
            Engine.Surface.Canvas img;
            if (attr.GetType() == typeof(Engine.Attributes.ImageAttribute))
            {
                img = ((Engine.Attributes.ImageAttribute)attr).Value;
            }
            else if (attr.GetType() == typeof(Engine.Attributes.MultiImageAttribute))
            {
                img = (Engine.Surface.Canvas)attr.Property(Properties.DefaultImage);

                //img = ((Engine.Attributes.MultiImageAttribute)attr).DefaultImage;
            }
            else
            {
                throw new ArgumentException(String.Format("Unsupported type format {0} in Engine.Tools.Attributes.Helper", attr.GetType().ToString()));
            }

            return(img);
        }