本文整理汇总了C#中StrokeCollection类的典型用法代码示例。如果您正苦于以下问题:C# StrokeCollection类的具体用法?C# StrokeCollection怎么用?C# StrokeCollection使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
StrokeCollection类属于命名空间,在下文中一共展示了StrokeCollection类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SelectionMovedOrResizedStroke
public SelectionMovedOrResizedStroke(CommandStack commandStack, StrokeCollection selection, Rect newrect, Rect oldrect, int editingOperationCount)
: base(commandStack) {
_selection = selection;
_newrect = newrect;
_oldrect = oldrect;
_editingOperationCount = editingOperationCount;
}
示例2: CheckOutputValue
private void CheckOutputValue(Rect rect, String recognizedCharacter, bool isError, StrokeCollection removedStrokes)
{
//Check out if it is header box
if (!_truthTable.IsHeaderBox(rect))
{
if (recognizedCharacter.Equals("1") || recognizedCharacter.Equals("l")
|| recognizedCharacter.Equals("|"))
{
_truthTable.insertValue(rect, "1");
}
else if (recognizedCharacter.Equals("0") || recognizedCharacter.Equals("O"))
{
_truthTable.insertValue(rect, "0");
}
else
{
_truthTable.DisplayInputErrorInfo(rect, removedStrokes);
}
}else {
if (!isError)
{
if (_truthTable.default_terms_names.Contains(recognizedCharacter))
{
_truthTable.insertValue(rect, recognizedCharacter);
}
else {
_truthTable.DisplayInputErrorInfo(rect, removedStrokes);
}
}
else {
_truthTable.DisplayInputErrorInfo(rect, removedStrokes);
}
}
}
示例3: SelectionAdorner
public SelectionAdorner(StrokeCollection selectedStrokes, InkCanvas inkcanvas)
{
InitializeComponent();
referencedStrokes = selectedStrokes;
referencedCanvas = inkcanvas;
setupSelectionAdorner();
}
示例4: Representation
public StrokeCollection Representation()
{
StrokeCollection strokes = new StrokeCollection();
foreach (var data in stylusStrokes)
strokes.Add(data.Representation());
return strokes;
}
示例5: Empty_HitTest
public void Empty_HitTest ()
{
StrokeCollection sc = new StrokeCollection ();
Assert.Throws<ArgumentException> (delegate {
sc.HitTest (null);
}, "HitTest-null");
}
示例6: Empty_GetBounds
public void Empty_GetBounds ()
{
StrokeCollection sc = new StrokeCollection ();
Assert.Throws<ArgumentException> (delegate {
sc.GetBounds ();
}, "GetBounds");
}
示例7: UserDefinedShape
public UserDefinedShape()
{
if (_strokes == null) {
_strokes = new StrokeCollection();
}
(_strokes as INotifyCollectionChanged).CollectionChanged += StrokesChangedEventHandler;
}
示例8: updateStrokePrivacy
private void updateStrokePrivacy(object obj)
{
ClearAdorners();
var newStrokes = new StrokeCollection(Strokes.Select(s => (Stroke)new PrivateAwareStroke(s, target)));
Strokes.Clear();
Strokes.Add(newStrokes);
}
示例9: AddAllStrokesAtOriginalIndex
private void AddAllStrokesAtOriginalIndex(StrokeCollection toBeAdded) {
foreach (Stroke stroke in toBeAdded) {
int strokeIndex = (int)stroke.GetPropertyData(STROKE_INDEX_PROPERTY);
if (strokeIndex > _commandStack.StrokeCollection.Count)
strokeIndex = _commandStack.StrokeCollection.Count;
_commandStack.StrokeCollection.Insert(strokeIndex, stroke);
}
}
示例10: StrokesAddedOrRemovedStroke
public StrokesAddedOrRemovedStroke(CommandStack commandStack, InkCanvasEditingMode editingMode, StrokeCollection added, StrokeCollection removed, int editingOperationCount)
: base(commandStack) {
_editingMode = editingMode;
_added = added;
_removed = removed;
_editingOperationCount = editingOperationCount;
}
示例11: InkQueryRegionStruct
public InkQueryRegionStruct(StrokeCollection strokes)
{
_equalStrokes = strokes;
_children = new VisualCollection(this);
EqualRect = strokes.GetBounds();
LeftSideRegionRect = new Rect(new Point(EqualRect.TopLeft.X - EqualRect.Width * 5, EqualRect.TopLeft.Y - EqualRect.Height * 2), new Size(EqualRect.Width * 4, EqualRect.Height * 4));
RightSideRegionRect = new Rect(new Point(EqualRect.BottomRight.X + EqualRect.Width, EqualRect.BottomRight.Y - EqualRect.Height * 3), new Size(EqualRect.Width * 4, EqualRect.Height * 4));
}
示例12: StrokeCollectionChangedEventArgs
/// <summary>Constructor</summary>
public StrokeCollectionChangedEventArgs(StrokeCollection added, StrokeCollection removed)
{
if ( added == null && removed == null )
{
throw new ArgumentException(SR.Get(SRID.CannotBothBeNull, "added", "removed"));
}
_added = ( added == null ) ? null : new StrokeCollection.ReadOnlyStrokeCollection(added);
_removed = ( removed == null ) ? null : new StrokeCollection.ReadOnlyStrokeCollection(removed);
}
示例13: DoCommandStack
/// <summary>
/// Initialization.
/// </summary>
/// <param name="strokes"></param>
public DoCommandStack(StrokeCollection strokes)
{
if (strokes == null)
{
return;
}
_strokeCollection = strokes;
_undoStack = new Stack<CommandItem>();
_redoStack = new Stack<CommandItem>();
_disableChangeTracking = false;
}
示例14: RefreshPattern
public void RefreshPattern()
{
if (Pattern != null) {
StrokeCollection collection = new StrokeCollection();
for (int i = 0; i < Count; i++) {
foreach (var stroke in Pattern[i]) {
collection.Add(stroke);
}
}
inkPresenter.Strokes = collection;
}
}
示例15: extractGeomtry
//local calls only
public void extractGeomtry(StrokeCollection strokes, Rect bounds)
{
_bounds = bounds;
_strokes = strokes.Clone();
foreach (Stroke strk in strokes)
{
var brush = new SolidColorBrush(strk.DrawingAttributes.Color);
drawGrp.Children.Add( new GeometryDrawing( brush, null, strk.GetGeometry()) );
}
SetMarkers();
SetBounds();
}