本文整理汇总了C#中Border类的典型用法代码示例。如果您正苦于以下问题:C# Border类的具体用法?C# Border怎么用?C# Border使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Border类属于命名空间,在下文中一共展示了Border类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Run
public static void Run()
{
// ExStart:AddTextBoxField
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir_AsposePdf_Forms();
// Open document
Document pdfDocument = new Document(dataDir + "TextField.pdf");
// Create a field
TextBoxField textBoxField = new TextBoxField(pdfDocument.Pages[1], new Aspose.Pdf.Rectangle(100, 200, 300, 300));
textBoxField.PartialName = "textbox1";
textBoxField.Value = "Text Box";
// TextBoxField.Border = new Border(
Border border = new Border(textBoxField);
border.Width = 5;
border.Dash = new Dash(1, 1);
textBoxField.Border = border;
textBoxField.Color = Aspose.Pdf.Color.FromRgb(System.Drawing.Color.Green);
// Add field to the document
pdfDocument.Form.Add(textBoxField, 1);
dataDir = dataDir + "TextBox_out.pdf";
// Save modified PDF
pdfDocument.Save(dataDir);
// ExEnd:AddTextBoxField
Console.WriteLine("\nTextbox field added successfully.\nFile saved at " + dataDir);
}
示例2: AttachedToLogicalParent_Should_Be_Called_When_Added_To_Tree
public void AttachedToLogicalParent_Should_Be_Called_When_Added_To_Tree()
{
var root = new TestRoot();
var parent = new Border();
var child = new Border();
var grandchild = new Border();
var parentRaised = false;
var childRaised = false;
var grandchildRaised = false;
parent.AttachedToLogicalTree += (s, e) => parentRaised = true;
child.AttachedToLogicalTree += (s, e) => childRaised = true;
grandchild.AttachedToLogicalTree += (s, e) => grandchildRaised = true;
parent.Child = child;
child.Child = grandchild;
Assert.False(parentRaised);
Assert.False(childRaised);
Assert.False(grandchildRaised);
root.Child = parent;
Assert.True(parentRaised);
Assert.True(childRaised);
Assert.True(grandchildRaised);
}
示例3: Run
public static void Run()
{
// ExStart:AddAnnotation
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir_AsposePdf_Annotations();
// Open document
Document pdfDocument = new Document(dataDir + "AddAnnotation.pdf");
// Create annotation
TextAnnotation textAnnotation = new TextAnnotation(pdfDocument.Pages[1], new Aspose.Pdf.Rectangle(200, 400, 400, 600));
textAnnotation.Title = "Sample Annotation Title";
textAnnotation.Subject = "Sample Subject";
textAnnotation.State = AnnotationState.Accepted;
textAnnotation.Contents = "Sample contents for the annotation";
textAnnotation.Open = true;
textAnnotation.Icon = TextIcon.Key;
Border border = new Border(textAnnotation);
border.Width = 5;
border.Dash = new Dash(1, 1);
textAnnotation.Border = border;
textAnnotation.Rect = new Aspose.Pdf.Rectangle(200, 400, 400, 600);
// Add annotation in the annotations collection of the page
pdfDocument.Pages[1].Annotations.Add(textAnnotation);
dataDir = dataDir + "AddAnnotation_out.pdf";
// Save output file
pdfDocument.Save(dataDir);
// ExEnd:AddAnnotation
Console.WriteLine("\nAnnotation added successfully.\nFile saved at " + dataDir);
}
示例4: MergeBorders
/// <summary>
/// merges two borders together
/// the ccwBorder is kept, all connections to the cwBorder are re-set
/// </summary>
/// <param name="ccwBorder">the ccw border of the merge, this border remains</param>
/// <param name="cwBorder">the cw border of the merge, this border is knocked out</param>
public void MergeBorders(Border ccwBorder, Border cwBorder)
{
Debug.Log("MERGING: " + ccwBorder.transform + " and " + cwBorder.transform);
// set to the angle between the merged borders
ccwBorder.SetAngle(ccwBorder.currentAngle - ((ccwBorder.currentAngle - cwBorder.currentAngle) / 2));
// update screen border for missing one
foreach (Screen screen in allScreens)
{
if (screen.ccwBorder == cwBorder)
{
screen.ccwBorder = ccwBorder;
}
}
// update border list
allBorders.Remove(cwBorder);
// fix border neighbors for the one that's been merged
ccwBorder.cwBorder = cwBorder.cwBorder;
cwBorder.cwBorder.ccwBorder = ccwBorder;
// turn off merged border
cwBorder.gameObject.SetActive(false);
}
示例5: Main
public static void Main(string[] args)
{
// The path to the documents directory.
string dataDir = Path.GetFullPath("../../../Data/");
//Open document
Document pdfDocument = new Document(dataDir + "input.pdf");
//Create a field
TextBoxField textBoxField = new TextBoxField(pdfDocument.Pages[1], new Aspose.Pdf.Rectangle(100, 200, 300, 300));
textBoxField.PartialName = "textbox1";
textBoxField.Value = "Text Box";
//textBoxField.Border = new Border(
Border border = new Border(textBoxField);
border.Width = 5;
border.Dash = new Dash(1, 1);
textBoxField.Border = border;
textBoxField.Color = Aspose.Pdf.Color.FromRgb(System.Drawing.Color.Green);
//Add field to the document
pdfDocument.Form.Add(textBoxField, 1);
//Save modified PDF
pdfDocument.Save(dataDir + "output.pdf");
}
示例6: BringDescendentIntoView_Should_Handle_Child_Margin
public void BringDescendentIntoView_Should_Handle_Child_Margin()
{
Border border;
var target = new ScrollContentPresenter
{
Width = 100,
Height = 100,
Content = new Decorator
{
Margin = new Thickness(50),
Child = border = new Border
{
Width = 200,
Height = 200,
}
}
};
target.UpdateChild();
target.Measure(Size.Infinity);
target.Arrange(new Rect(0, 0, 100, 100));
target.BringDescendentIntoView(border, new Rect(200, 200, 0, 0));
Assert.Equal(new Vector(150, 150), target.Offset);
}
示例7: ToolbarButton
public ToolbarButton (String text, StyleSheet scheme, Border borders,
uint width, uint height) : base (scheme, width, height)
{
Text = text;
Borders = borders;
base.Initialize ();
}
示例8: LoadContent
protected override void LoadContent(PloobsEngine.Engine.GraphicInfo GraphicInfo, PloobsEngine.Engine.GraphicFactory factory, PloobsEngine.SceneControl.IContentManager contentManager)
{
tile = factory.GetTexture2D("Textures/tile");
FarseerWorld fworld = this.World.PhysicWorld as FarseerWorld;
///border
border = new Border(fworld, factory, GraphicInfo, factory.CreateTexture2DColor(1, 1, Color.Red));
///from texture
{
Texture2D tex = factory.GetTexture2D("Textures//goo");
tex = factory.GetScaledTexture(tex, new Vector2(4));
IModelo2D model = new SpriteFarseer(tex);
Basic2DTextureMaterial mat = new Basic2DTextureMaterial();
FarseerObject fs = new FarseerObject(fworld, model);
I2DObject o = new I2DObject(fs, mat, model);
o.OnHasMoved += new PloobsEngine.SceneControl._2DScene.OnHasMoved(o_OnHasMoved);
this.World.AddObject(o);
}
///camera
this.World.Camera2D = new Camera2D(GraphicInfo);
///Create the Particle System
DPFSParticleSystem ps = new DPFSParticleSystem("TESTE", new SpriteParticleSystem(null));
this.World.ParticleManager.AddAndInitializeParticleSystem(ps);
///updateable
JointUpdateable ju = new JointUpdateable(this, fworld, this.World.Camera2D);
base.LoadContent(GraphicInfo, factory, contentManager);
}
示例9: Run
public static void Run()
{
// ExStart:AddlnkAnnotation
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir_AsposePdf_Annotations();
Document doc = new Document();
Page pdfPage = doc.Pages.Add();
System.Drawing.Rectangle drect = new System.Drawing.Rectangle();
drect.Height = (int)pdfPage.Rect.Height;
drect.Width = (int)pdfPage.Rect.Width;
drect.X = 0;
drect.Y = 0;
Aspose.Pdf.Rectangle arect = Aspose.Pdf.Rectangle.FromRect(drect);
ArrayList inkList = new ArrayList();
Aspose.Pdf.Point[] arrpt = new Aspose.Pdf.Point[3];
inkList.Add(arrpt);
arrpt[0] = new Aspose.Pdf.Point(100, 800);
arrpt[1] = new Aspose.Pdf.Point(200, 800);
arrpt[2] = new Aspose.Pdf.Point(200, 700);
InkAnnotation ia = new InkAnnotation(pdfPage, arect, inkList);
ia.Title = "XXX";
ia.Color = Aspose.Pdf.Color.LightBlue; // (GetColorFromString(stroke.InkColor));
ia.CapStyle = CapStyle.Rounded;
Border border = new Border(ia);
border.Width = 25;
ia.Opacity = 0.5;
pdfPage.Annotations.Add(ia);
dataDir = dataDir + "AddlnkAnnotation_out.pdf";
// Save output file
doc.Save(dataDir);
// ExEnd:AddlnkAnnotation
Console.WriteLine("\nlnk annotation added successfully.\nFile saved at " + dataDir);
}
示例10: r_2_ctMethod
private static UIElement r_2_ctMethod(UIElement parent)
{
// e_0 element
Grid e_0 = new Grid();
e_0.Parent = parent;
e_0.Name = "e_0";
RowDefinition row_e_0_0 = new RowDefinition();
row_e_0_0.Height = new GridLength(20F, GridUnitType.Pixel);
e_0.RowDefinitions.Add(row_e_0_0);
RowDefinition row_e_0_1 = new RowDefinition();
e_0.RowDefinitions.Add(row_e_0_1);
// PART_WindowTitleBorder element
Border PART_WindowTitleBorder = new Border();
e_0.Children.Add(PART_WindowTitleBorder);
PART_WindowTitleBorder.Name = "PART_WindowTitleBorder";
PART_WindowTitleBorder.Background = new SolidColorBrush(new ColorW(255, 255, 255, 255));
// e_1 element
ContentPresenter e_1 = new ContentPresenter();
e_0.Children.Add(e_1);
e_1.Name = "e_1";
Grid.SetRow(e_1, 1);
Binding binding_e_1_Content = new Binding();
e_1.SetBinding(ContentPresenter.ContentProperty, binding_e_1_Content);
return e_0;
}
示例11: SetBorders
void SetBorders(Border ccw, Border cw)
{
ccwBorder = ccw;
cwBorder = cw;
this.enabled = true;
this.Start();
}
示例12: ToolbarToggleButton
public ToolbarToggleButton (String text_one, String text_two, bool auto_toggle, StyleSheet scheme, Border borders,
uint width, uint height) : base (text_one, scheme, borders, width, height)
{
toggle = auto_toggle;
CairoTexture texture = new CairoTexture (width, height);
StyleSheet s = scheme;
s.Foreground = scheme.Background;
s.Background = scheme.Foreground;
s.Standard = new Font () {
Family = scheme.Standard.Family,
Slant = scheme.Standard.Slant,
Weight = scheme.Standard.Weight,
Size = scheme.Standard.Size,
Color = scheme.Background
};
s.Border = scheme.Foreground;
Style = s;
Text = text_two;
Draw (texture);
Style = scheme;
Text = text_one;
textures.Add (texture);
texture.Hide ();
this.Add (texture);
InitializeHandlers ();
}
示例13: r_11_dtMethod
private static UIElement r_11_dtMethod(UIElement parent)
{
// e_69 element
Border e_69 = new Border();
e_69.Parent = parent;
e_69.Name = "e_69";
e_69.Background = new SolidColorBrush(new ColorW(0, 0, 255, 255));
// e_70 element
StackPanel e_70 = new StackPanel();
e_69.Child = e_70;
e_70.Name = "e_70";
// e_71 element
TextBlock e_71 = new TextBlock();
e_70.Children.Add(e_71);
e_71.Name = "e_71";
e_71.HorizontalAlignment = HorizontalAlignment.Center;
e_71.VerticalAlignment = VerticalAlignment.Center;
Binding binding_e_71_Text = new Binding("TextData");
e_71.SetBinding(TextBlock.TextProperty, binding_e_71_Text);
// e_72 element
Button e_72 = new Button();
e_70.Children.Add(e_72);
e_72.Name = "e_72";
e_72.Content = "Hide Window";
Binding binding_e_72_Command = new Binding("HideCommand");
e_72.SetBinding(Button.CommandProperty, binding_e_72_Command);
return e_69;
}
示例14: DetermineTextWidthAndHeightWindows8
private static void DetermineTextWidthAndHeightWindows8(out double textWidth, out double textHeight, Border border, TextBlock textblock)
{
const int bigEnough = 10000;
border.Measure(new XamlSize(double.PositiveInfinity, double.PositiveInfinity));
border.Arrange(new Rect(0, 0, bigEnough, bigEnough));
textWidth = textblock.ActualWidth;
textHeight = textblock.ActualHeight;
}
示例15: MenuManager
internal MenuManager(Game game, Score score, int screenWidth, int screenHeight)
: base(game)
{
_score = score;
_screenHeight = screenHeight;
_screenWidth = screenWidth;
Border = new Border(base.Game, _screenWidth - 45, _screenHeight - 95);
}