本文整理汇总了C#中FlowDirection类的典型用法代码示例。如果您正苦于以下问题:C# FlowDirection类的具体用法?C# FlowDirection怎么用?C# FlowDirection使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
FlowDirection类属于命名空间,在下文中一共展示了FlowDirection类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: VirtualKey
public VirtualKey(VirtualKeyboard keyboard, KeySet keySet, KeySetRow row, Key key)
{
_keyboard = keyboard;
_keySet = keySet;
_key = key;
if (row.IndexOf(key) < row.Count/2)
_popupFlowDirection = FlowDirection.LeftToRight;
else
_popupFlowDirection = FlowDirection.RightToLeft;
PrimaryAction = new VirtualKeyAction(keyboard, keySet, key.DefaultAction, key.Width);
Loaded += (s, e) =>
{
if (AlternativesPopup != null)
{
if (_popupFlowDirection == FlowDirection.LeftToRight)
{
AlternativesPopup.HorizontalOffset = -ActualWidth;
AlternativesPopup.Placement = PlacementMode.Right;
}
else
{
AlternativesPopup.HorizontalOffset = ActualWidth;
AlternativesPopup.Placement = PlacementMode.Left;
}
}
};
}
示例2: UpdateItemsSource
private void UpdateItemsSource(List<ApplicationBarIconButton> buttons, FlowDirection flowDirection)
{
try
{
if (buttons != null || buttons.Count == 0)
{
if (flowDirection == FlowDirection.RightToLeft)
buttons.Reverse();
Buttons.Dettach(SysAppBar);
Buttons.Clear();
foreach (ApplicationBarIconButton button in buttons)
{
Buttons.Add(button);
}
Buttons.Attach(DataContext, SysAppBar);
}
else
{
Buttons.Dettach(SysAppBar);
Buttons.Clear();
Buttons.Attach(DataContext, SysAppBar);
}
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
示例3: UpdateItemsSource
private void UpdateItemsSource(List<ApplicationBarIconButton> buttons, FlowDirection flowDirection)
{
if (buttons != null)
{
if (buttons.Count > 0)
{
if (flowDirection == FlowDirection.RightToLeft)
buttons.Reverse();
Buttons.Dettach(SysAppBar);
Buttons.Clear();
foreach (ApplicationBarIconButton button in buttons)
{
Buttons.Add(button);
}
Buttons.Attach(DataContext, SysAppBar);
}
}
else
{
Buttons.Dettach(SysAppBar);
Buttons.Clear();
Buttons.Attach(DataContext, SysAppBar);
}
}
示例4: FluentMenu
public FluentMenu(Action<IMenuRegister> completionAction, IMenuRegister parentMenu, string name)
{
_completionAction = completionAction;
_parentMenu = parentMenu;
_name = name;
_flowDirection = FlowDirection.LeftToRight;
}
示例5: WpfTextStringFormat
public WpfTextStringFormat(FlowDirection direction, TextTrimming trimming,
WpfTextAnchor anchor)
{
this.Direction = direction;
this.Trimming = trimming;
this.Anchor = anchor;
}
示例6: FlowLayoutSettings
internal FlowLayoutSettings (Control owner)
{
flow_breaks = new Dictionary<object, bool> ();
wrap_contents = true;
flow_direction = FlowDirection.LeftToRight;
this.owner = owner;
}
示例7: RenderToBitmap
public static BitmapSource RenderToBitmap(
this Visual visual,
PixelFormat pixelFormat,
FlowDirection flowDirection = FlowDirection.LeftToRight,
double dpiX = 96.0,
double dpiY = 96.0)
{
if (visual == null)
throw new ArgumentException("visual");
var cv = visual as ContainerVisual;
if (cv != null)
{
var bounds = cv.DescendantBounds;
var size = new Size(bounds.Right, bounds.Bottom);
return visual.RenderToBitmap(size, bounds.Location, bounds.Size, pixelFormat);
}
else
{
var bounds = VisualTreeHelper.GetDescendantBounds(visual);
var size = new Size(bounds.Right, bounds.Bottom);
return visual.RenderToBitmap(size, bounds.Location, bounds.Size, pixelFormat);
}
}
示例8: SetFlowDirection
/// <summary>
/// Sets the selectors and title flow direction.
/// </summary>
/// <param name="flowDirection">Flow direction to set.</param>
internal void SetFlowDirection(FlowDirection flowDirection)
{
HeaderTitle.FlowDirection = flowDirection;
PrimarySelector.FlowDirection = flowDirection;
SecondarySelector.FlowDirection = flowDirection;
TertiarySelector.FlowDirection = flowDirection;
}
示例9: SetFlowDirection
/// <summary>
/// Sets the selectors and title flow direction.
/// </summary>
/// <param name="flowDirection">Flow direction to set.</param>
public override void SetFlowDirection(FlowDirection flowDirection)
{
HeaderTitle.FlowDirection = flowDirection;
PrimarySelector.FlowDirection = flowDirection;
SecondarySelector.FlowDirection = flowDirection;
TertiarySelector.FlowDirection = flowDirection;
}
示例10: PlacementHelper
public PlacementHelper(Rect placementRect, Size popupSize, double horizontalOffset, double verticalOffset, Size viewPortSize, FlowDirection flowDirection)
{
this.popupSize = popupSize;
this.placementRect = placementRect;
this.viewPortRect = new Rect(0, 0, viewPortSize.Width, viewPortSize.Height);
this.offset = new Point(horizontalOffset, verticalOffset);
this.flowDirection = flowDirection;
}
示例11: Read
public static IGeometry Read(string text, Typeface font, double size, Point origin, FlowDirection flowDirection, IGeometryFactory geomFact)
{
var formattedText = new FormattedText(text, System.Globalization.CultureInfo.CurrentUICulture,
flowDirection, font, size, Brushes.Black);
var geom = formattedText.BuildGeometry(origin);
return WpfGeometryReader.Read(geom.GetFlattenedPathGeometry(FlatnessFactor, ToleranceType.Relative), geomFact);
}
示例12: SupportedCulture
public SupportedCulture(string cultureId, EventHandler isSelectedChangEventHandler)
{
CultureInfo = CultureInfo.GetCultureInfo(cultureId);
Flag = (ImageSource) App.Current.FindResource(cultureId);
XmlLanguage = XmlLanguage.GetLanguage(CultureInfo.Name);
FlowDirection = CultureInfo.TextInfo.IsRightToLeft ? FlowDirection.RightToLeft : FlowDirection.LeftToRight;
IsSelectedChanged += isSelectedChangEventHandler;
}
示例13: SetFlowDirection
public static void SetFlowDirection(IArrangedElement container, FlowDirection value)
{
if (!System.Windows.Forms.ClientUtils.IsEnumValid(value, (int) value, 0, 3))
{
throw new InvalidEnumArgumentException("value", (int) value, typeof(FlowDirection));
}
container.Properties.SetInteger(_flowDirectionProperty, (int) value);
LayoutTransaction.DoLayout(container, container, PropertyNames.FlowDirection);
}
示例14: TextBounds
/// <summary>
/// Constructing TextBounds object
/// </summary>
internal TextBounds(
Rect bounds,
FlowDirection flowDirection,
IList<TextRunBounds> runBounds
)
{
_bounds = bounds;
_flowDirection = flowDirection;
_runBounds = runBounds;
}
示例15: TextImageWidget
public TextImageWidget(string label, RGBA_Bytes fillColor, RGBA_Bytes borderColor, RGBA_Bytes textColor, double borderWidth, BorderDouble margin, ImageBuffer image = null, double fontSize = 12, FlowDirection flowDirection = FlowDirection.LeftToRight, double height = 40, double width = 0, bool centerText = false, double imageSpacing = 0)
: base()
{
this.image = image;
this.fillColor = fillColor;
this.borderColor = borderColor;
this.borderWidth = borderWidth;
this.Margin = new BorderDouble(0);
this.Padding = new BorderDouble(0);
TextWidget textWidget = new TextWidget(label, pointSize: fontSize);
ImageWidget imageWidget;
FlowLayoutWidget container = new FlowLayoutWidget(flowDirection);
if (centerText)
{
// make sure the contents are centered
GuiWidget leftSpace = new GuiWidget(0, 1);
leftSpace.HAnchor = Agg.UI.HAnchor.ParentLeftRight;
container.AddChild(leftSpace);
}
if (image != null && image.Width > 0)
{
imageWidget = new ImageWidget(image);
imageWidget.VAnchor = VAnchor.ParentCenter;
imageWidget.Margin = new BorderDouble(right: imageSpacing);
container.AddChild(imageWidget);
}
if (label != "")
{
textWidget.VAnchor = VAnchor.ParentCenter;
textWidget.TextColor = textColor;
textWidget.Padding = new BorderDouble(3, 0);
container.AddChild(textWidget);
}
if (centerText)
{
GuiWidget rightSpace = new GuiWidget(0, 1);
rightSpace.HAnchor = Agg.UI.HAnchor.ParentLeftRight;
container.AddChild(rightSpace);
container.HAnchor = Agg.UI.HAnchor.ParentLeftRight | Agg.UI.HAnchor.FitToChildren;
}
container.VAnchor = Agg.UI.VAnchor.ParentCenter;
container.MinimumSize = new Vector2(width, height);
container.Margin = margin;
this.AddChild(container);
HAnchor = HAnchor.ParentLeftRight | HAnchor.FitToChildren;
VAnchor = VAnchor.ParentCenter | Agg.UI.VAnchor.FitToChildren;
}