本文整理汇总了C#中Border类的典型用法代码示例。如果您正苦于以下问题:C# Border类的具体用法?C# Border怎么用?C# Border使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Border类属于命名空间,在下文中一共展示了Border类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
}
开发者ID:aspose-pdf,项目名称:Aspose.Pdf-for-.NET,代码行数:32,代码来源:TextBox.cs
示例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);
}
开发者ID:alimbada,项目名称:Perspex,代码行数:27,代码来源:ControlTests.cs
示例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);
}
开发者ID:aspose-pdf,项目名称:Aspose.Pdf-for-.NET,代码行数:32,代码来源:AddAnnotation.cs
示例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);
}
开发者ID:Ashen-Vaults,项目名称:SPROJ_Prototyping_UnityProject,代码行数:32,代码来源:ScreenManager.cs
示例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");
}
开发者ID:Ravivishnubhotla,项目名称:Aspose_Pdf_NET,代码行数:27,代码来源:Program.cs
示例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);
}
开发者ID:randydotnet,项目名称:Perspex,代码行数:25,代码来源:ScrollContentPresenterTests.cs
示例7: ToolbarButton
public ToolbarButton (String text, StyleSheet scheme, Border borders,
uint width, uint height) : base (scheme, width, height)
{
Text = text;
Borders = borders;
base.Initialize ();
}
开发者ID:h0rm,项目名称:No.Noise,代码行数:7,代码来源:ToolbarButton.cs
示例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);
}
开发者ID:brunoduartec,项目名称:port-ploobsengine,代码行数:34,代码来源:Basic2DParticleScreen.cs
示例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);
}
开发者ID:aspose-pdf,项目名称:Aspose.Pdf-for-.NET,代码行数:35,代码来源:AddlnkAnnotation.cs
示例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;
}
开发者ID:EmptyKeys,项目名称:UI_Examples,代码行数:25,代码来源:Dictionary.xaml.cs
示例11: SetBorders
void SetBorders(Border ccw, Border cw)
{
ccwBorder = ccw;
cwBorder = cw;
this.enabled = true;
this.Start();
}
开发者ID:Ashen-Vaults,项目名称:SPROJ_Prototyping_UnityProject,代码行数:7,代码来源:Screen.cs
示例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 ();
}
开发者ID:h0rm,项目名称:No.Noise,代码行数:31,代码来源:ToolbarToggleButton.cs
示例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;
}
开发者ID:Mike-EEE,项目名称:UI_Examples,代码行数:28,代码来源:Dictionary.xaml.cs
示例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;
}
开发者ID:jdeksup,项目名称:Mapsui.Net4,代码行数:8,代码来源:SingleLabelRenderer.cs
示例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);
}
开发者ID:jacol,项目名称:LudumDare25YouAreTheVillain,代码行数:8,代码来源:MenuManager.cs
示例16: 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, scale usage sample
{
Texture2D tex = factory.GetTexture2D("Textures//goo");
tex = factory.GetScaledTexture(tex, new Vector2(3));
IModelo2D model = new SpriteFarseer(tex);
Basic2DTextureMaterial mat = new Basic2DTextureMaterial();
FarseerObject fs = new FarseerObject(fworld, tex);
fs.Position = new Vector2(0, 50);
partobj = new I2DObject(fs, mat, model);
partobj.OnHasMoved += new PloobsEngine.SceneControl._2DScene.OnHasMoved(o_OnHasMoved);
this.World.AddObject(partobj);
}
Vertices verts = PolygonTools.CreateRectangle(150, 150);
{
IModelo2D model = new SpriteFarseer(factory, verts, Color.Green);
Basic2DTextureMaterial mat = new Basic2DTextureMaterial();
FarseerObject fs = new FarseerObject(fworld, model, 1, BodyType.Dynamic);
I2DObject o = new I2DObject(fs, mat, model);
///the origin of the created object will be in the center of it, this mean: if we draw it, the center of mass of it will be on the midle of the screen
///We need to translate it a bit down
o.PhysicObject.Position = new Vector2(100, 100);
this.World.AddObject(o);
}
//circle
verts = PolygonTools.CreateCircle(150, 150);
{
IModelo2D model = new SpriteFarseer(factory, verts, Color.Orange);
Basic2DTextureMaterial mat = new Basic2DTextureMaterial();
FarseerObject fs = new FarseerObject(fworld, model, 1, BodyType.Dynamic);
I2DObject o = new I2DObject(fs, mat, model);
o.PhysicObject.Position = new Vector2(-100, -100);
this.World.AddObject(o);
}
///camera
this.World.Camera2D = new Camera2D(GraphicInfo);
DPFSParticleSystem ps = new DPFSParticleSystem("TESTE", new SpriteParticleSystem(null));
this.World.ParticleManager.AddAndInitializeParticleSystem(ps);
///updateable
ju = new JointUpdateable(this, fworld, this.World.Camera2D);
base.LoadContent(GraphicInfo, factory, contentManager);
}
开发者ID:brunoduartec,项目名称:port-ploobsengine,代码行数:57,代码来源:Basic2DScreen.cs
示例17: Content_Control_Should_Appear_In_LogicalChildren
public void Content_Control_Should_Appear_In_LogicalChildren()
{
var target = new Border();
var child = new Control();
target.Content = child;
Assert.Equal(new[] { child }, ((ILogical)target).LogicalChildren.ToList());
}
开发者ID:MarkWalls,项目名称:Perspex,代码行数:9,代码来源:BorderTests.cs
示例18: CopyTo
/// <summary>
/// Copy the border's settings into the target border.
/// </summary>
/// <param name="border">The border to copy settings from.</param>
/// <param name="target">The border to copy settings to.</param>
public static void CopyTo(this Border border, Border target)
{
target.Color = border.Color;
target.DistanceFromText = border.DistanceFromText;
//other.IsVisible = self.IsVisible;
target.LineStyle = border.LineStyle;
target.LineWidth = border.LineWidth;
target.Shadow = border.Shadow;
}
开发者ID:vc3,项目名称:ExoMerge,代码行数:14,代码来源:BorderExtensions.cs
示例19: OnCountryBorderStay
public void OnCountryBorderStay(Border border, Agent agent)
{
if(agent == null){
Debug.Log (string.Format ("Agent {0} stays on {1} border!", null, border.GetCountry()));
return;
}
Debug.Log (string.Format ("Agent {0} stays on {1} border!", agent, border.GetCountry()));
}
开发者ID:kunalegendo,项目名称:game,代码行数:9,代码来源:BorderHandler.cs
示例20: Should_Set_Childs_Parent_To_Itself_Outside_Template
public void Should_Set_Childs_Parent_To_Itself_Outside_Template()
{
var content = new Border();
var target = new ContentPresenter { Content = content };
target.UpdateChild();
Assert.Same(target, content.Parent);
}
开发者ID:KvanTTT,项目名称:Perspex,代码行数:9,代码来源:ContentPresenterTests.cs
注:本文中的Border类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论