public void Container_PerformLayoutBeforeRender() { // Purpose: Verify that if PerformLayout is NOT called before Render() // is called then an exception will be thrown bool caught = false; var layout = new ContainerLayout(); var doc = this.GetNewDoc(); try { var c1 = layout.AddContainer("A"); var i1 = c1.Add("A1"); // layout.PerformLayout(); IVisio.Page page = layout.Render(doc); page.Delete(0); } catch (System.ArgumentException) { caught = true; } doc.Close(true); if (caught == false) { Assert.Fail("Did not catch expected exception"); } }
public void Container_Diagram2() { // Make sure that empty containers can be drawn var doc = this.GetNewDoc(); var layout1 = new ContainerLayout(); var l1_c1 = layout1.AddContainer("L1/C1"); var l1_c1_i1 = l1_c1.Add("L1/C1/I1"); var l1_c2 = layout1.AddContainer("L1/C2"); // this is the empty container layout1.PerformLayout(); var page1 = layout1.Render(doc); page1.Delete(0); doc.Close(true); }
public void Container_Diagram1() { // Purpose: Simple test to make sure that both Containers and Non-Container // rendering are supported. The diagram is a single container having a single // container item var doc = this.GetNewDoc(); var layout1 = new ContainerLayout(); var l1_c1 = layout1.AddContainer("L1/C1"); var l1_c1_i1 = l1_c1.Add("L1/C1/I1"); layout1.PerformLayout(); var page1 = layout1.Render(doc); page1.Delete(0); doc.Close(true); }
public RelativeRatingEntryView() : base("") { this.TitleLayout.AlignVertically(TextAlignment.Center); this.mainDisplayGrid = GridLayout.New(new BoundProperty_List(2), new BoundProperty_List(1), LayoutScore.Zero); this.scaleBox = new Editor(); this.scaleBox.Keyboard = Keyboard.Numeric; this.scaleBox.TextChanged += this.ScaleBlock_TextChanged; this.scaleBoxLayout = new TextboxLayout(this.scaleBox); ContainerLayout scaleBoxHolder = new ContainerLayout(null, this.scaleBoxLayout, false); // The fact that the rating is relative to the previous participation is really important, so we put this text into its own text block. // Additionally, the timesBlock might be able to fit into the same line as the text box into which the user types the rating ratio. // Also, if there's enough space then we spell out the exact meaning more clearly LayoutChoice_Set conciseTimesBlock = new ScoreShifted_Layout(new TextblockLayout("x prev:").AlignVertically(TextAlignment.Center).AlignHorizontally(TextAlignment.Center), LayoutScore.Get_ReducedContent_Score(1)); LayoutChoice_Set fullTimesBlock = new TextblockLayout("times previous:").AlignVertically(TextAlignment.Center).AlignHorizontally(TextAlignment.Center); LayoutChoice_Set timesBlock = new LayoutUnion(fullTimesBlock, conciseTimesBlock); LayoutChoice_Set horizontalBox = new Horizontal_GridLayout_Builder() .AddLayout(scaleBoxHolder) .AddLayout(timesBlock) .BuildAnyLayout(); LayoutChoice_Set verticalBox = new Vertical_GridLayout_Builder() .AddLayout(scaleBoxHolder) .AddLayout(timesBlock) .BuildAnyLayout(); this.Clear(); this.mainDisplayGrid.AddLayout(new LayoutUnion(horizontalBox, verticalBox)); // We try to use large font for the name layout and we also try to use as many clarifying words as possible this.fullNameLayout = new TextblockLayout(); this.mainDisplayGrid.AddLayout( this.fullNameLayout ); this.Placeholder("(Optional)"); }
public static void SimpleContainer() { var m = new ContainerLayout(); var c1 = m.AddContainer("Container 1"); var c2 = m.AddContainer("Container 2"); c1.Add("A"); c1.Add("B"); c1.Add("C"); c2.Add("1"); c2.Add("2"); c2.Add("3"); m.LayoutOptions = new LayoutOptions(); m.LayoutOptions.ContainerFormatting.ShapeFormatCells.FillForeground = "rgb(0,176,240)"; m.LayoutOptions.ContainerItemFormatting.ShapeFormatCells.FillForeground = "rgb(250,250,250)"; m.LayoutOptions.ContainerItemFormatting.ShapeFormatCells.LinePattern = "0"; m.PerformLayout(); m.Render(SampleEnvironment.Application.ActiveDocument); }
internal Flags(ContainerLayout layout, KeySorting keySorting, Mutability mutability) { _value = (byte)((byte)layout | (byte)keySorting | (byte)mutability); }