Ejemplo n.º 1
0
        public override void GetPosition(int currentFrame, out int offsetX, out int offsetY)
        {
            if (itemPaths.Count == 0)
            {
                offsetX = 0;
                offsetY = 0;
                return;
            }

            var       maxFrame         = 0;
            var       oldMaxFrame      = 0;
            IItemPath selectedItemPath = null;

            int x = 0;
            int y = 0;

            for (int i = 0; i < itemPaths.Count; i++)
            {
                selectedItemPath = itemPaths[i];

                oldMaxFrame = maxFrame;
                maxFrame   += selectedItemPath.MaximumFrame;

                if (currentFrame < maxFrame)
                {
                    break;
                }

                selectedItemPath.GetPosition(selectedItemPath.MaximumFrame, out var lastOffsetX, out var lastOffsetY);

                x += lastOffsetX;
                y += lastOffsetY;
            }

            // currentFrame est desormais relatif à l'itemPath
            currentFrame -= oldMaxFrame;

            selectedItemPath.GetPosition(currentFrame, out var currentOffsetX, out var currentOffsetY);

            offsetX = x + currentOffsetX;
            offsetY = y + currentOffsetY;
        }
Ejemplo n.º 2
0
        public void AddPath(IItemPath itemPath)
        {
            this.itemPaths.Add(itemPath);

            this.MaximumFrame += itemPath.MaximumFrame;
        }
Ejemplo n.º 3
0
        public virtual void NotifyCompletedAsync(Dispatcher dispatcher, IItemPath newItemPath, IItemProperties newItemProperties)
        {
            IDocumentCreatedCompletionArgs CompletionArgs = new DocumentCreatedCompletionArgs(newItemPath, newItemProperties);

            NotifyEventCompletedAsync(dispatcher, CompletionArgs);
        }
Ejemplo n.º 4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SolutionItem"/> class.
 /// </summary>
 /// <param name="path">The item path.</param>
 /// <param name="parent">The item parent.</param>
 /// <param name="properties">The item properties.</param>
 public SolutionItem(IItemPath path, ISolutionFolder parent, IItemProperties properties)
     : base(parent, path, properties)
 {
 }
Ejemplo n.º 5
0
 public AddItemOperation(ISolutionRoot root, IFolderPath destinationFolderPath, IItemPath newPath, IItemProperties newProperties)
     : base(root, destinationFolderPath, newPath, newProperties)
 {
 }
Ejemplo n.º 6
0
        protected virtual ISolutionItem CreateSolutionItem(ISolutionFolder parentFolder, IItemPath path, IItemProperties properties)
        {
            Assert.ValidateReference(parentFolder);
            Assert.ValidateReference(path);
            Assert.ValidateReference(properties);

            return(new SolutionItem(path, parentFolder, properties));
        }
Ejemplo n.º 7
0
 public DocumentCreatedCompletionArgs(IItemPath NewItemPath, IItemProperties NewItemProperties)
 {
     this.NewItemPath       = NewItemPath;
     this.NewItemProperties = NewItemProperties;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="DocumentCreatedCompletionArgs"/> class.
 /// </summary>
 /// <param name="newItemPath">The path to the created document item.</param>
 /// <param name="newItemProperties">The path to the created document properties.</param>
 public DocumentCreatedCompletionArgs(IItemPath newItemPath, IItemProperties newItemProperties)
 {
     NewItemPath       = newItemPath;
     NewItemProperties = newItemProperties;
 }
        /// <summary>
        /// Creates an item in a solution.
        /// </summary>
        /// <param name="parentFolder">The parent folder.</param>
        /// <param name="path">The item path.</param>
        /// <param name="properties">The item properties.</param>
        /// <returns>The created item.</returns>
        protected virtual ISolutionItem CreateSolutionItem(ISolutionFolder parentFolder, IItemPath path, IItemProperties properties)
        {
            if (parentFolder == null)
            {
                throw new ArgumentNullException(nameof(parentFolder));
            }
            if (path == null)
            {
                throw new ArgumentNullException(nameof(path));
            }
            if (properties == null)
            {
                throw new ArgumentNullException(nameof(properties));
            }

            return(new SolutionItem(path, parentFolder, properties));
        }