Beispiel #1
0
        private static IObjectProfile GenerateObjectProfile(ObjectAlign align)
        {
            var objectProfileMock = new Mock <IObjectProfile>();

            objectProfileMock.Setup(p => p.align).Returns(align);
            return(objectProfileMock.Object);
        }
Beispiel #2
0
 private static void GenerateAndAddObjectProfile(LineProfile parentProfile, ObjectAlign align, bool skip = false)
 {
     if (!skip)
     {
         parentProfile.Add(GenerateObjectProfile(align));
     }
 }
Beispiel #3
0
        /// <summary>
        /// Generates a <see cref="LineProfile"/> with all elements fitting a given alignment.
        /// </summary>
        /// <param name="profile">The <see cref="LineProfile"/> with elements in it.</param>
        /// <param name="align">The alignment to fit.</param>
        /// <returns>The generated <see cref="LineProfile"/>.</returns>
        private static LineProfile GenerateAlignedProfile(LineProfile profile, ObjectAlign align)
        {
            var newProfile = new LineProfile();

            newProfile.AddRange(profile.Where(p => p.align == align));
            return(newProfile);
        }
Beispiel #4
0
        public override void Prepare(IElementProfile profile, IMenuHandler handler)
        {
            base.Prepare(profile, handler);
            var objProfile = (IObjectProfile)profile;

            this.id        = objProfile.label;
            this.alignment = objProfile.align;
        }
Beispiel #5
0
 public IObjectProfileWithText GenerateProfile(ObjectAlign preferredAlignment)
 {
     return new EditBoxProfile()
     {
         align = preferredAlignment,
         label = this.Id,
         text = this.Title + ":",
     };
 }
Beispiel #6
0
        private static JustifyH GetJustifyH(ObjectAlign align)
        {
            switch (align)
            {
            case ObjectAlign.c:
                return(JustifyH.CENTER);

            case ObjectAlign.r:
                return(JustifyH.RIGHT);

            default:
                return(JustifyH.LEFT);
            }
        }
Beispiel #7
0
        private static double SelectFromTuple(Tuple <double, double, double> tuple, ObjectAlign align)
        {
            switch (align)
            {
            case ObjectAlign.l:
                return(tuple.Item1);

            case ObjectAlign.c:
                return(tuple.Item2);

            default:
                return(tuple.Item3);
            }
        }
Beispiel #8
0
        /// <summary>
        /// Generates and Prepares a <see cref="IAlignedBlock"/>.
        /// </summary>
        /// <param name="profile">The profile used to prepare the block.</param>
        /// <param name="align">The alignment of the block.</param>
        /// <param name="handler">The menu handler.</param>
        /// <returns>The generated block.</returns>
        private static IAlignedBlock GenerateAndPrepareBlock(LineProfile profile, ObjectAlign align, IMenuHandler handler)
        {
            var blockProfile = GenerateAlignedProfile(profile, align);

            if (blockProfile.Count == 0)
            {
                return(null);
            }

            var block = (IAlignedBlock)handler.CreateRegion(blockProfile, false, typeof(AlignedBlock));

            block.Prepare(blockProfile, handler);
            return(block);
        }
 public void Start()
 {
     OpenConnection();
     H      = new Matrix4x4();
     objAlg = reference.GetComponent <ObjectAlign>();
 }
Beispiel #10
0
 public PanelProfile(ObjectAlign align, string label)
 {
     this.align = align;
     this.label = label;
 }
Beispiel #11
0
 public PanelProfile(ObjectAlign align)
 {
     this.align = align;
 }