protected virtual void OnPonctCBModified(Ponctuation p) { logger.ConditionalDebug(ConfigBase.cultF, "OnPonctCBModified ponctuation: \'{0}\'", p); EventHandler <PonctModifiedEventArgs> eventHandler = PonctCBModified; eventHandler?.Invoke(this, new PonctModifiedEventArgs(p)); }
private void CheckAllP(PonctConfig pc, CharFormatting cf) { for (Ponctuation p = Ponctuation.point; p < Ponctuation.lastP; p++) { Assert.AreEqual(cf, pc.GetCF(p)); } }
/// <summary> /// Efface le CharFormatting pour la famille de signes indiquée. La checkbox correspondante /// est également mise à <c>false</c>. /// </summary> /// <param name="ponctS">La famille de signes à effacer.</param> public void ClearPonct(string ponctS) { Ponctuation p = PonctInT.Ponct4String(ponctS); UndoFactory.StartRecording("ClearPonct"); SetCF(p, CharFormatting.NeutralCF); SetCB(p, false); UndoFactory.EndRecording(); }
/// <summary> /// Définit le <see cref="CharFormatting"/> pour la famille de signes donnée et met /// également la Checkbox corrspondante à <c>true</c>. /// </summary> /// <param name="ponctS">La famille de signes visée.</param> /// <param name="toCF">Le nouveau <see cref="CharFormatting"/>.</param> public void SetCFandCB(string ponctS, CharFormatting toCF) { logger.ConditionalDebug("SetCFandCB {0} toCF: {1}", ponctS, toCF.ToString()); Ponctuation p = PonctInT.Ponct4String(ponctS); UndoFactory.StartRecording("SetCFandCB"); SetCF(p, toCF); SetCB(p, true); UndoFactory.EndRecording(); }
public void SetCB(Ponctuation p, bool toCB) { logger.ConditionalDebug("SetCF {0} to {1}", p.ToString(), toCB); if (toCB != GetCB(p)) { UndoFactory.StartRecording("Contrôle ponctuation"); SetCBwoState(p, toCB); MasterState = State.off; UndoFactory.EndRecording(); } }
/// <summary> /// Permet de mettre le CF pour une famille de ponctuation à la valeur souhaitée. /// </summary> /// <param name="p">La famille de ponctuation.</param> /// <param name="toCF">Le nouveau <see cref="CharFormatting"/>.</param> public void SetCF(Ponctuation p, CharFormatting toCF) { logger.ConditionalDebug("SetCF {0} to {1}", p.ToString(), toCF.ToString()); if (toCF != GetCF(p)) { UndoFactory.StartRecording("Format ponctuation"); SetCFwoState(p, toCF); MasterState = State.off; UndoFactory.EndRecording(); } }
/// <summary> /// Permet de mettre la "checkbox" pour une famille de ponctuation /// sans que la situation du mâître soit impactée. /// </summary> /// <remarks>Devrait être <c>private</c>, mais doit être visible pour la gestion des /// annulations. NE PAS UTILISER DANS UN AUTRE CONTEXTE!</remarks> /// <param name="p">La famille de ponctuation.</param> /// <param name="toCB">La nouvelle valeur de la checkbox.</param> public void SetCBwoState(Ponctuation p, bool toCB) { logger.ConditionalTrace("SetCBwoState p: {0}, toCB: {1}", p, toCB); if (toCB != checkBoxes[p]) { UndoFactory.ExceutingAction(new PonctAction("Contrôle ponct.", this, "ponctCB", p, checkBoxes[p], toCB)); checkBoxes[p] = toCB; OnPonctCBModified(p); } }
/// <summary> /// Permet de mettre le <see cref="CharFormatting"/> pour une famille de ponctuation /// sans que la situation du mâître soit impactée. /// </summary> /// <remarks>Devrait être <c>private</c>, mais doit être visible pour la gestion des /// annulations. NE PAS UTILISER DANS UN AUTRE CONTEXTE!</remarks> /// <param name="p">La famille de ponctuation.</param> /// <param name="toCF">Le nouveau <see cref="CharFormatting"/>.</param> public void SetCFwoState(Ponctuation p, CharFormatting toCF) { logger.ConditionalTrace("SetCFwoState, p: {0}, to: {1}", p, toCF.ToString()); if (toCF != charFormats[p]) { UndoFactory.ExceutingAction(new PonctAction("Format ponct.", this, "ponctCF", p, charFormats[p], toCF)); charFormats[p] = toCF; OnPonctFormattingModified(p); } }
/// <summary> /// Retourne le <see cref="CharFormatting"/> à utiliser pour le formatage des caractères. /// Tient compte de la checkbox pour déterminer le <see cref="CharFormatting"/> retourné. /// </summary> /// <remarks>Retourne <see cref="CharFormatting.NeutralCF"/> si la checkbox correspondante /// est à <c>false</c>.</remarks> /// <param name="p">La famille de signes pour laquelle on veut le /// <see cref="CharFormatting"/></param> /// <returns>le <see cref="CharFormatting"/> à utiliser.</returns> public CharFormatting GetCFtoApply(Ponctuation p) { if (checkBoxes[p]) { return(charFormats[p]); } else { return(CharFormatting.NeutralCF); } }
// ---------------------------------------------------------------------------------------- // ------------------------------------ Public Methods ----------------------------------- // ---------------------------------------------------------------------------------------- public PonctConfig() { UndoFactory.DisableUndoRegistration(); for (Ponctuation p = Ponctuation.firstP + 1; p < Ponctuation.lastP; p++) { charFormats[p] = CharFormatting.NeutralCF; checkBoxes[p] = false; } Reset(); UndoFactory.EnableUndoRegistration(); }
/// <summary> /// Efface le maître. Désactive tout formatage des signes. /// </summary> public void ClearMaster() { UndoFactory.StartRecording("Efface maître"); MasterCF = CharFormatting.NeutralCF; MasterState = State.off; for (Ponctuation p = Ponctuation.firstP + 1; p < Ponctuation.lastP; p++) { checkBoxes[p] = false; OnPonctCBModified(p); } UndoFactory.EndRecording(); }
/// <summary> /// Représente un signe de ponctuation dans <paramref name="tt"/>. il ne s'agit par définition /// que d'un seul caractère à la position <paramref name="pos"/> (zero based) dans le texte. /// </summary> /// <exception cref="ArgumentNullException"> si <paramref name="tt"/> est <c>null</c>. /// Provient de <see cref="TextEl"/>.</exception> /// <exception cref="ArgumentException"><paramref name="pos"/> >= /// <c>tt.S.Length</c>. Provient de <see cref="TextEl"/>.</exception> /// <param name="tt">Le texte dont on indique un signe de ponctuation.</param> /// <param name="pos">La position du signe de pnctuation dans <paramref name="tt"/> /// </param> /// <param name="inLast"></param> public PonctInT(TheText tt, int pos) : base(tt, pos, pos) { Ponctuation p; if (ponctu.TryGetValue(tt.S[pos], out p)) { ponct = p; } else { ponct = Ponctuation.autres; } }
public PonctAction(string name, PonctConfig pc, string inType, Ponctuation inP, bool inPrevCB, bool inNewCB) : base(name) { ponctConf = pc; type = inType; prevCB = inPrevCB; newCB = inNewCB; p = inP; // pour ne rien avoir de non défini: prevCF = null; newCF = null; }
public PonctAction(string name, PonctConfig pc, string inType, Ponctuation inP, CharFormatting inPrevCF, CharFormatting inNewCF) : base(name) { ponctConf = pc; type = inType; prevCF = inPrevCF; newCF = inNewCF; p = inP; // pour ne rien avoir de non défini: prevCB = false; newCB = false; }
public PonctAction(string name, PonctConfig pc, string inType, PonctConfig.State inPrevMasterState, PonctConfig.State inNewMasterState) : base(name) { ponctConf = pc; type = inType; prevMasterState = inPrevMasterState; newMasterState = inNewMasterState; // pour ne rien avoir de non défini: prevCF = null;; newCF = null; p = Ponctuation.firstP; prevCB = false; newCB = false; }
private void Start() { airplane = GameObject.FindObjectOfType <Airplane>(); pontuaction = GameObject.FindObjectOfType <Ponctuation>(); }
private void Start() { positionAirplane = GameObject.FindObjectOfType <Airplane>().transform.position; punctuation = GameObject.FindObjectOfType <Ponctuation>(); }
public bool GetCB(Ponctuation p) => checkBoxes[p];
/// <summary> /// Retourne le <see cref="CharFormatting"/> pour la famille de caractères /// <paramref name="p"/>. /// </summary> /// <param name="p">La famille de caractères de ponctuation dont on veut le CF.</param> /// <returns>Le <see cref="CharFormatting"/> souhaité.</returns> public CharFormatting GetCF(Ponctuation p) => charFormats[p];
public PonctModifiedEventArgs(Ponctuation inPonct) { p = inPonct; pName = p.ToString(); }
/// <summary> /// Retourne le nom de la famille de signes /// </summary> /// <param name="p">La famille de signes</param> /// <returns>Le nom en français de la famille de signes.</returns> public static string GetTexte(Ponctuation p) => texte[p];