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; }
public void AddPath(IItemPath itemPath) { this.itemPaths.Add(itemPath); this.MaximumFrame += itemPath.MaximumFrame; }
public virtual void NotifyCompletedAsync(Dispatcher dispatcher, IItemPath newItemPath, IItemProperties newItemProperties) { IDocumentCreatedCompletionArgs CompletionArgs = new DocumentCreatedCompletionArgs(newItemPath, newItemProperties); NotifyEventCompletedAsync(dispatcher, CompletionArgs); }
/// <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) { }
public AddItemOperation(ISolutionRoot root, IFolderPath destinationFolderPath, IItemPath newPath, IItemProperties newProperties) : base(root, destinationFolderPath, newPath, newProperties) { }
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)); }
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)); }