Converts tag layout guesses into final layouts.
Inheritance: ITagElementGuessVisitor
 /// <summary>
 /// Makes a layout from a layout guess.
 /// </summary>
 /// <param name="layout">The layout guess.</param>
 /// <param name="name">The name of the final layout.</param>
 /// <param name="groupTag">The group tag of the final layout. Can be <c>null</c>.</param>
 /// <returns></returns>
 public static TagLayout MakeLayout(TagLayoutGuess layout, string name, Tag groupTag)
 {
     var result = new TagLayout(name, layout.Size, groupTag);
     var finalizer = new LayoutGuessFinalizer(result, 0);
     finalizer.ProcessLayout(layout);
     return result;
 }
Esempio n. 2
0
        /// <summary>
        /// Makes a layout from a layout guess.
        /// </summary>
        /// <param name="layout">The layout guess.</param>
        /// <param name="name">The name of the final layout.</param>
        /// <param name="groupTag">The group tag of the final layout. Can be <c>null</c>.</param>
        /// <returns></returns>
        public static TagLayout MakeLayout(TagLayoutGuess layout, string name, Tag groupTag)
        {
            var result    = new TagLayout(name, layout.Size, groupTag);
            var finalizer = new LayoutGuessFinalizer(result, 0);

            finalizer.ProcessLayout(layout);
            return(result);
        }
 public void Visit(uint offset, TagBlockGuess guess)
 {
     var name = string.Format("Tag Block {0}", _nextTagBlock);
     _nextTagBlock++;
     var elementLayout = new TagLayout(name, guess.ElementLayout.Size, new Tag(0));
     var finalizer = new LayoutGuessFinalizer(elementLayout, _nextTagBlock);
     finalizer.ProcessLayout(guess.ElementLayout);
     var align = guess.Align;
     if ((guess.ElementLayout.Size & (guess.Align - 1)) != 0)
         align = 0;
     _nextTagBlock = finalizer._nextTagBlock;
     _result.Add(new TagBlockTagLayoutField(MakeName(offset), elementLayout) { DataAlign = align });
 }
Esempio n. 4
0
        public void Visit(uint offset, TagBlockGuess guess)
        {
            var name = string.Format("Tag Block {0}", _nextTagBlock);

            _nextTagBlock++;
            var elementLayout = new TagLayout(name, guess.ElementLayout.Size, new Tag(0));
            var finalizer     = new LayoutGuessFinalizer(elementLayout, _nextTagBlock);

            finalizer.ProcessLayout(guess.ElementLayout);
            var align = guess.Align;

            if ((guess.ElementLayout.Size & (guess.Align - 1)) != 0)
            {
                align = 0;
            }
            _nextTagBlock = finalizer._nextTagBlock;
            _result.Add(new TagBlockTagLayoutField(MakeName(offset), elementLayout)
            {
                DataAlign = align
            });
        }