示例#1
0
 public void LoadData(Hotspots hotspots)
 {
     drawPage.LoadData(hotspots);
 }
 public void SetCoverOwner(Hotspots c)
 {
     hotspots = c;
 }
        public override object EditValue(System.ComponentModel.ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            if (context != null && context.Instance != null && provider != null)
            {
                IWindowsFormsEditorService service = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));
                if (service != null)
                {
                    dlgDrawingBoard dlg = new dlgDrawingBoard();
                    DrawingLayer    lst = value as DrawingLayer;

                    Hotspots     hs   = null;
                    IDrawingPage page = null;
                    hs = context.Instance as Hotspots;
                    if (hs == null)
                    {
                        page = context.Instance as IDrawingPage;
                        if (page != null)
                        {
                            dlg.Attrs = page.PageAttributes;
                        }
                        Control cOwner = context.Instance as Control;
                        if (cOwner != null)
                        {
                            dlg.ImgBK = cOwner.BackgroundImage;
                        }
                        DrawingLayerCollection ls = value as DrawingLayerCollection;
                        dlg.LoadData(ls);
                    }
                    else
                    {
                        lst = (DrawingLayer)hs.Drawings.Clone();
                        dlg.LoadData(hs);
                        hs.clearBK();
                    }

                    try
                    {
                        if (service.ShowDialog(dlg) == System.Windows.Forms.DialogResult.OK)
                        {
                            if (hs != null)
                            {
                                value = dlg.lstShapes;
                                hs.InitBK();
                            }
                            else
                            {
                                value = dlg.DrawingLayers;
                                if (page != null)
                                {
                                    page.PageAttributes = dlg.Attrs;
                                }
                            }
                        }
                        else
                        {
                            if (hs != null)
                            {
                                hs.SetDrawings(lst);
                                hs.InitBK();
                            }
                        }
                    }
                    catch (Exception err)
                    {
                        DrawingItem.ShowMessage(err.Message);
                    }
                }
            }
            return(value);
        }
示例#4
0
 public void LoadData(Hotspots hotspots)
 {
 }