コード例 #1
0
        protected override void Initialize(bool initData)
        {
            base.Initialize(initData);

            if (initData)
            {
                _embeddedController = new EmbeddedObjectRenderingOptionsController()
                {
                    UseDocumentCopy = UseDocument.Directly
                };
                _embeddedController.InitializeDocument(_doc);
                Current.Gui.FindAndAttachControlTo(_embeddedController);

                _imageFormat = new SelectableListNodeList();
                foreach (ImageFormat item in ImageFormats)
                {
                    _imageFormat.Add(new SelectableListNode(item.ToString(), item, _doc.DropFileImageFormat == item));
                }

                _pixelFormat = new SelectableListNodeList();
                var hasMatched = false; // special prog to account for doubling of items in PixelFormats
                foreach (PixelFormat item in PixelFormats)
                {
                    var select = _doc.DropFileBitmapPixelFormat == item;
                    _pixelFormat.Add(new SelectableListNode(item.ToString(), item, !hasMatched && select));
                    hasMatched |= select;
                }
            }

            if (null != _view)
            {
                _view.EmbeddedRenderingOptionsView = _embeddedController.ViewObject;

                _view.RenderDropfile       = _doc.RenderDropFile;
                _view.RenderEmbeddedObject = _doc.RenderEmbeddedObject;
                _view.RenderLinkedObject   = _doc.RenderLinkedObject;

                _view.SetDropFileImageFormat(_imageFormat);
                _view.SetDropFilePixelFormat(_pixelFormat);
            }
        }
コード例 #2
0
 public override IEnumerable <ControllerAndSetNullMethod> GetSubControllers()
 {
     yield return(new ControllerAndSetNullMethod(_embeddedController, () => _embeddedController = null));
 }