コード例 #1
0
 public ImageSelection(IServiceProvider?serviceProvider, LayerContainerViewModel layer, ImageShapeViewModel shape, ShapeStyleViewModel style)
 {
     _serviceProvider = serviceProvider;
     _layer           = layer;
     _image           = shape;
     _styleViewModel  = style;
 }
コード例 #2
0
ファイル: ImageDrawNode.cs プロジェクト: wieslawsoltes/Core2D
 public ImageDrawNode(ImageShapeViewModel image, ShapeStyleViewModel style, IImageCache imageCache, ICache <string, IDisposable> bitmapCache)
     : base()
 {
     Style       = style;
     Image       = image;
     ImageCache  = imageCache;
     BitmapCache = bitmapCache;
     UpdateGeometry();
 }
コード例 #3
0
    public override object Copy(IDictionary <object, object>?shared)
    {
        var copy = new ImageShapeViewModel(ServiceProvider)
        {
            Name        = Name,
            State       = State,
            Style       = _style?.CopyShared(shared),
            IsStroked   = IsStroked,
            IsFilled    = IsFilled,
            Properties  = _properties.CopyShared(shared).ToImmutable(),
            Record      = _record,
            TopLeft     = _topLeft?.CopyShared(shared),
            BottomRight = _bottomRight?.CopyShared(shared),
            Key         = Key
        };

        return(copy);
    }
コード例 #4
0
        public async void BeginDown(InputArgs args)
        {
            var factory = _serviceProvider.GetService <IFactory>();
            var editor  = _serviceProvider.GetService <ProjectEditorViewModel>();

            (decimal sx, decimal sy) = editor.TryToSnap(args);
            switch (_currentState)
            {
            case State.TopLeft:
            {
                editor.IsToolIdle = false;

                if (editor.ImageImporter is null)
                {
                    editor.IsToolIdle = true;
                    return;
                }

                var key = await editor.ImageImporter.GetImageKeyAsync();

                if (key is null || string.IsNullOrEmpty(key))
                {
                    editor.IsToolIdle = true;
                    return;
                }

                var style = editor.Project.CurrentStyleLibrary?.Selected is { } ?
                editor.Project.CurrentStyleLibrary.Selected :
                editor.Factory.CreateShapeStyle(ProjectEditorConfiguration.DefaulStyleName);
                _image = factory.CreateImageShape(
                    (double)sx, (double)sy,
                    (ShapeStyleViewModel)style.Copy(null),
                    key,
                    false,
                    false);

                editor.SetShapeName(_image);

                var result = editor.TryToGetConnectionPoint((double)sx, (double)sy);
                if (result is { })
コード例 #5
0
ファイル: DataFlow.cs プロジェクト: ystallonne/Core2D
 public void Bind(ImageShapeViewModel image, object db, object r)
 {
 }
コード例 #6
0
 public IImageDrawNode CreateImageDrawNode(ImageShapeViewModel image, ShapeStyleViewModel style, IImageCache imageCache, ICache <string, IDisposable> bitmapCache)
 {
     return(new ImageDrawNode(image, style, imageCache, bitmapCache));
 }