private static IObjectProfile GenerateObjectProfile(ObjectAlign align) { var objectProfileMock = new Mock <IObjectProfile>(); objectProfileMock.Setup(p => p.align).Returns(align); return(objectProfileMock.Object); }
private static void GenerateAndAddObjectProfile(LineProfile parentProfile, ObjectAlign align, bool skip = false) { if (!skip) { parentProfile.Add(GenerateObjectProfile(align)); } }
/// <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); }
public override void Prepare(IElementProfile profile, IMenuHandler handler) { base.Prepare(profile, handler); var objProfile = (IObjectProfile)profile; this.id = objProfile.label; this.alignment = objProfile.align; }
public IObjectProfileWithText GenerateProfile(ObjectAlign preferredAlignment) { return new EditBoxProfile() { align = preferredAlignment, label = this.Id, text = this.Title + ":", }; }
private static JustifyH GetJustifyH(ObjectAlign align) { switch (align) { case ObjectAlign.c: return(JustifyH.CENTER); case ObjectAlign.r: return(JustifyH.RIGHT); default: return(JustifyH.LEFT); } }
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); } }
/// <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>(); }
public PanelProfile(ObjectAlign align, string label) { this.align = align; this.label = label; }
public PanelProfile(ObjectAlign align) { this.align = align; }