コード例 #1
0
		public virtual void Visit (ExportContainer exportContainer) {
			foreach (var element in exportContainer.ExportedItems) {
				
				var ac = element as IAcceptor;
				ac.Accept(this);
			}
		}
コード例 #2
0
ファイル: WpfVisitor.cs プロジェクト: Rpinski/SharpDevelop
		public override void Visit(ExportContainer exportContainer){
			
			sectionCanvas = FixedDocumentCreator.CreateContainer(exportContainer);
			sectionCanvas.Name = exportContainer.Name;
			CanvasHelper.SetPosition(sectionCanvas,new Point(exportContainer.Location.X,exportContainer.Location.Y));
			PerformList(sectionCanvas,exportContainer.ExportedItems);
		}
コード例 #3
0
 public void ContainerNoChildren()
 {
     var param = new ExportContainer();
     var size = param.Size;
     strategy.Arrange(param);
     Assert.That(param.Size, Is.EqualTo(size));
 }
コード例 #4
0
		public static Canvas CreateContainer(ExportContainer container)	{
			var canvas = CreateCanvas(container);
			var size = container.DesiredSize.ToWpf();
			canvas.Measure(size);
			canvas.Arrange(new Rect(new Point(),size ));
			canvas.UpdateLayout();
			return canvas;
		}
コード例 #5
0
 ExportText Evaluate(string script)
 {
     collection[0].Text = script;
     var exportContainer = new ExportContainer();
     exportContainer.ExportedItems.Add(collection[0]);
     expressionVisitor.Visit(exportContainer);
     var resultColumn = (ExportText)exportContainer.ExportedItems[0];
     return resultColumn;
 }
コード例 #6
0
		public static Canvas CreateContainer(ExportContainer container)	{
			var canvas = CreateCanvas(container);
			var size = container.DesiredSize.ToWpf();
			CanvasHelper.SetPosition(canvas,new Point(container.Location.X,container.Location.Y));
			canvas.Measure(size);
			canvas.Arrange(new Rect(new Point(),size ));
			canvas.UpdateLayout();
			return canvas;
		}
コード例 #7
0
ファイル: AstExtensions.cs プロジェクト: fanyjie/SharpDevelop
		public static void AddCurrentContainer (this ReportingExpressionEvaluator app,ExportContainer container){
			if (container == null)
				throw new ArgumentNullException("container");
			if (!app.Globals.ContainsKey("CurrentContainer")) {
				app.Globals.Add("CurrentContainer",container);
			} else {
				app.Globals["CurrentContainer"] = container;
			}
		}
コード例 #8
0
ファイル: FormatVisitor.cs プロジェクト: fanyjie/SharpDevelop
		public override void Visit(ExportContainer exportContainer)
		{
			foreach (var element in exportContainer.ExportedItems) {
				var te = element as ExportText;
				if (te != null) {
					Visit(te);
				}
			}
		}
コード例 #9
0
ファイル: WpfVisitor.cs プロジェクト: lvv83/SharpDevelop
		Canvas RenderSectionContainer (ExportContainer container) {
			var canvas = FixedDocumentCreator.CreateContainer(container);
			foreach (var element in container.ExportedItems) {
				if (IsContainer(element)) {
					RenderRow(canvas, (IExportContainer)element);
				} else {
					AsAcceptor(element).Accept(this);
					canvas.Children.Add(UIElement);
				}
			}
			canvas.Background = FixedDocumentCreator.ConvertBrush(container.BackColor);
			return canvas;
		}
コード例 #10
0
ファイル: PdfVisitor.cs プロジェクト: lvv83/SharpDevelop
		public override void Visit(ExportContainer exportContainer){
			foreach (var element in exportContainer.ExportedItems) {
				if (IsContainer(element)) {
					var container = element as ExportContainer;
					containerLocation = PdfHelper.LocationRelToParent(container);
					RenderRow(container);
				} else {
					containerLocation = PdfHelper.LocationRelToParent(exportContainer);
					var acceptor = element as IAcceptor;
					acceptor.Accept(this);
				}
			}
		}
コード例 #11
0
 public override IExportColumn CreateExportColumn()
 {
     var export = new ExportContainer();
     export.ToExportItem(this);
     return export;
     //			return new ExportContainer(){
     //			Name = this.Name,
     //			Size = this.Size,
     //			Location = this.Location,
     //			CanGrow = this.CanGrow,
     //			BackColor = this.BackColor,
     //			DesiredSize = this.Size
     //			};
 }
コード例 #12
0
ファイル: PdfVisitor.cs プロジェクト: Rpinski/SharpDevelop
		public override void Visit(ExportContainer exportContainer)
		{
			foreach (var element in exportContainer.ExportedItems) {
				var container = element as ExportContainer;
				if (container != null) {
					containerLocation = PdfHelper.LocationRelToParent(container);
					var r = new Rectangle(containerLocation,container.DisplayRectangle.Size);
					PdfHelper.FillRectangle(r,container.BackColor,gfx);
					Visit(container);
				}
				containerLocation = PdfHelper.LocationRelToParent(exportContainer);
				var ac = element as IAcceptor;
				ac.Accept(this);
			}
		}
コード例 #13
0
		public void SumAllGroups () {
			var container = new ExportContainer();
			container.ExportedItems.AddRange(collection);

			var visitor = new ExpressionVisitor (reportSettings);
			visitor.SetCurrentDataSource(dataSource.GroupedList);
			foreach (var group in dataSource.GroupedList) {
				var script = "= sum('randomint')";
				collection[0].Text = script;
				visitor.SetCurrentDataSource(group);
				visitor.Visit(container);
				
				var result = list.Where(k => k.GroupItem == group.Key.ToString()).Sum(x => x.RandomInt);
				Assert.That(Convert.ToDouble(collection[0].Text),Is.EqualTo(result));
			}
		}
コード例 #14
0
        public void FieldNotExist()
        {
            var script = "=Fields!myfieldNotExist";
            collection[0].Text = script;
            collection.Add(new ExportText()
                           {
                           	Text = "Sharpdevelop",
                           	Name = "myfield1"
                           });

            var exportContainer = new ExportContainer();
            exportContainer.ExportedItems.Add(collection[0]);
            exportContainer.ExportedItems.Add(collection[1]);

            visitor.Visit(exportContainer);
            Assert.That (collection[0].Text.StartsWith("Missing"));
            Assert.That (collection[0].Text.Contains("myfieldNotExist"));
        }
コード例 #15
0
		public  UIElement CreateContainer(ExportContainer container)
		{
//			http://tech.pro/tutorial/736/wpf-tutorial-creating-a-custom-panel-control
			
			var canvas = CreateCanvas(container);
//			canvas.Measure(new Size(reportSettings.PageSize.Width,reportSettings.PageSize.Height));
			
			var size = new Size(container.DesiredSize.Width,container.DesiredSize.Height);
			
			canvas.Measure(size);
			
//			canvas.Arrange(new Rect(new System.Windows.Point(),new Size(reportSettings.PageSize.Width,reportSettings.PageSize.Height) ));
			
			canvas.Arrange(new Rect(new System.Windows.Point(),size ));

			canvas.UpdateLayout();
			
			return canvas;
			
		}
コード例 #16
0
        public void SimpleStringHandlingInContainer()
        {
            var script = "='Sharpdevelop' + ' is great'";

            collection[0].Text = script;
            var exportContainer = new ExportContainer();
            exportContainer.ExportedItems.Add(collection[0]);
            expressionVisitor.Visit(exportContainer);

            var resultColumn = (ExportText)exportContainer.ExportedItems[0];
            Assert.That(resultColumn.Text,Is.EqualTo("Sharpdevelop is great"));
        }
コード例 #17
0
ファイル: WpfVisitor.cs プロジェクト: lvv83/SharpDevelop
		Canvas RenderDataRow (ExportContainer row) {
			var rowCanvas = FixedDocumentCreator.CreateContainer(row);
			var childCanvas = CreateItemsInContainer(row.ExportedItems);
			rowCanvas.Children.Add(childCanvas);
			return rowCanvas;
		}
コード例 #18
0
ファイル: WpfVisitor.cs プロジェクト: krunalc/SharpDevelop
		void DrawRectangleAsContainer(ExportContainer container)
		{
			var rect = container as ExportRectangle;
			if (rect != null) {
				Visit(rect);
			}
		}
コード例 #19
0
ファイル: WpfVisitor.cs プロジェクト: lvv83/SharpDevelop
		public override void Visit(ExportContainer exportContainer){
			
			sectionCanvas = FixedDocumentCreator.CreateContainer(exportContainer);
			sectionCanvas = RenderSectionContainer(exportContainer);
		}
コード例 #20
0
		public override void Visit(ExportContainer exportContainer)
		{
			evaluator.AddCurrentContainer(exportContainer);
			base.Visit(exportContainer);
		}
コード例 #21
0
ファイル: WpfVisitor.cs プロジェクト: kristjan84/SharpDevelop
		public override void Visit(ExportContainer exportColumn)
		{
//			Console.WriteLine("Wpf-Visit ExportContainer {0} - {1} - {2}", exportColumn.Name,exportColumn.Size,exportColumn.Location);
			var canvas = documentCreator.CreateContainer(exportColumn);
			UIElement = canvas;
		}
コード例 #22
0
ファイル: DataPageBuilder.cs プロジェクト: Rew/SharpDevelop
		List<IExportColumn> FillAndConvert(ExportContainer parent, object current, List<IPrintableObject> dataItems, IContainerConverter converter)
		{
			DataSource.Fill(dataItems, current);
			var convertedItems = converter.CreateConvertedList(dataItems.ToList());
			converter.SetParent(parent, convertedItems);
			return convertedItems;
		}
コード例 #23
0
ファイル: DataPageBuilder.cs プロジェクト: Rew/SharpDevelop
		void EvaluateExpressionsInGroups(ExportContainer sectionContainer, IGrouping<object, object> grouping){
			ExpressionRunner.Visitor.SetCurrentDataSource(grouping);
			ExpressionRunner.Visitor.Visit(sectionContainer);
		}
コード例 #24
0
ファイル: DebugVisitor.cs プロジェクト: ichengzi/SharpDevelop
 public override void Visit(ExportContainer exportContainer)
 {
     base.Visit(exportContainer);
 }
コード例 #25
0
		Canvas CreateCanvas(ExportContainer container)
		{
			var canvas = new Canvas();
			SetDimension(canvas, container);
			SetPosition(canvas,container);
			canvas.Background = ConvertBrush(System.Drawing.Color.Red);
			return canvas;
		}
コード例 #26
0
		public abstract void Visit(ExportContainer exportColumn);
コード例 #27
0
        IExportContainer CreateContainer()
        {
            var container = new ExportContainer(){
                Size = new Size (720,60),
                Location = new Point(50,50),
                Name ="Section"
            };

            var item1 = new ExportText(){
                Name = "Item1",
                Location = new Point(10,10),
                Size = new Size (60,20),
                Parent = container
            };

            container.ExportedItems.Add(item1);
            return container;
        }
コード例 #28
0
ファイル: DataPageBuilder.cs プロジェクト: Rew/SharpDevelop
		void InsertContainer(ExportContainer sectionContainer){
			if (Pages.Count == 0) {
				CurrentPage.ExportedItems.Insert(2, sectionContainer);
			} else {
				CurrentPage.ExportedItems.Insert(1, sectionContainer);
			}
		}
コード例 #29
0
        static Canvas CreateCanvas(ExportContainer container)
        {
            var canvas = new Canvas();
            SetPositionAndSize(canvas,container);

            canvas.Name = container.Name;
            canvas.Background = ConvertBrush(container.BackColor);
            return canvas;
        }
コード例 #30
0
        public void FieldsInContainer()
        {
            var script = "=Fields!myfield1 + Fields!myfield2";
            collection[0].Text = script;
            collection.Add(new ExportText()
                           {
                           	Text = "Sharpdevelop",
                           	Name = "myfield1"
                           });
            collection.Add(new ExportText()
                           {
                           	Text = " is great",
                           	Name = "myfield2"
                           });

            var exportContainer = new ExportContainer();
            exportContainer.ExportedItems.Add(collection[0]);
            exportContainer.ExportedItems.Add(collection[1]);
            exportContainer.ExportedItems.Add(collection[2]);

            visitor.Visit(exportContainer);
            Assert.That (collection[0].Text,Is.EqualTo("Sharpdevelop is great"));
        }