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

            objectProfileMock.Setup(p => p.align).Returns(align);
            return(objectProfileMock.Object);
        }
コード例 #2
0
 private static void GenerateAndAddObjectProfile(LineProfile parentProfile, ObjectAlign align, bool skip = false)
 {
     if (!skip)
     {
         parentProfile.Add(GenerateObjectProfile(align));
     }
 }
コード例 #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);
        }
コード例 #4
0
ファイル: BaseObject.cs プロジェクト: kakjelsb/Gryphonheart
        public override void Prepare(IElementProfile profile, IMenuHandler handler)
        {
            base.Prepare(profile, handler);
            var objProfile = (IObjectProfile)profile;

            this.id        = objProfile.label;
            this.alignment = objProfile.align;
        }
コード例 #5
0
ファイル: TextField.cs プロジェクト: kakjelsb/Gryphonheart
 public IObjectProfileWithText GenerateProfile(ObjectAlign preferredAlignment)
 {
     return new EditBoxProfile()
     {
         align = preferredAlignment,
         label = this.Id,
         text = this.Title + ":",
     };
 }
コード例 #6
0
ファイル: TextObject.cs プロジェクト: kakjelsb/Gryphonheart
        private static JustifyH GetJustifyH(ObjectAlign align)
        {
            switch (align)
            {
            case ObjectAlign.c:
                return(JustifyH.CENTER);

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

            default:
                return(JustifyH.LEFT);
            }
        }
コード例 #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);
            }
        }
コード例 #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);
        }
コード例 #9
0
 public void Start()
 {
     OpenConnection();
     H      = new Matrix4x4();
     objAlg = reference.GetComponent <ObjectAlign>();
 }
コード例 #10
0
 public PanelProfile(ObjectAlign align, string label)
 {
     this.align = align;
     this.label = label;
 }
コード例 #11
0
 public PanelProfile(ObjectAlign align)
 {
     this.align = align;
 }