コード例 #1
0
ファイル: DesignerView.cs プロジェクト: krunalc/SharpDevelop
		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");
		}	
コード例 #2
0
ファイル: DesignerView.cs プロジェクト: krunalc/SharpDevelop
		static DefaultServiceContainer CreateAndInitServiceContainer()
		{
			LoggingService.Debug("ReportDesigner: CreateAndInitServiceContainer...");
			var serviceContainer = new DefaultServiceContainer();
			serviceContainer.AddService(typeof(IUIService), new UIService());
			serviceContainer.AddService(typeof(IToolboxService),new ToolboxService());
			serviceContainer.AddService(typeof(IHelpService), new HelpService());
			return serviceContainer;
		}