public WpfPreview(ReportDesignerLoader loader,IViewContent content) : base(content) { LoggingService.Info("Create WpfPreview"); this.designerLoader = loader; TabPageText = "WpfPreview"; }
void LoadDesigner (Stream stream) { LoggingService.Info("ReportDesigner LoadDesigner_Start"); panel = CreatePanel(); defaultServiceContainer = CreateAndInitServiceContainer(); LoggingService.Info("Create DesignSurface and add event's"); designSurface = CreateDesignSurface(defaultServiceContainer); SetDesignerEvents(); var ambientProperties = new AmbientProperties(); defaultServiceContainer.AddService(typeof(AmbientProperties), ambientProperties); defaultServiceContainer.AddService(typeof(ITypeResolutionService), new TypeResolutionService()); defaultServiceContainer.AddService(typeof(ITypeDiscoveryService),new TypeDiscoveryService()); defaultServiceContainer.AddService(typeof(IMenuCommandService), new ICSharpCode.Reporting.Addin.Services.MenuCommandService(panel, designSurface)); defaultServiceContainer.AddService(typeof(MemberRelationshipService),new DefaultMemberRelationshipService()); defaultServiceContainer.AddService(typeof(OpenedFile),base.PrimaryFile); LoggingService.Info("Load DesignerOptionService"); var designerOptionService = CreateDesignerOptions(); defaultServiceContainer.AddService( typeof( DesignerOptionService ), designerOptionService ); LoggingService.Info("Create ReportDesignerLoader"); loader = new ReportDesignerLoader(generator, stream); designSurface.BeginLoad(this.loader); if (!designSurface.IsLoaded) { // throw new FormsDesignerLoadException(FormatLoadErrors(designSurface)); LoggingService.Error("designer not loaded"); } //------------- defaultServiceContainer.AddService(typeof(INameCreationService),new NameCreationService()); var selectionService = (ISelectionService)this.designSurface.GetService(typeof(ISelectionService)); selectionService.SelectionChanged += SelectionChangedHandler; /* undoEngine = new ReportDesignerUndoEngine(Host); */ var componentChangeService = (IComponentChangeService)this.designSurface.GetService(typeof(IComponentChangeService)); componentChangeService.ComponentChanged += OnComponentChanged; componentChangeService.ComponentAdded += OnComponentListChanged; componentChangeService.ComponentRemoved += OnComponentListChanged; componentChangeService.ComponentRename += OnComponentListChanged; this.Host.TransactionClosed += TransactionClose; UpdatePropertyPad(); hasUnmergedChanges = false; LoggingService.Info("ReportDesigner LoadDesigner_End"); }