public CHelpData GetHelpToView(Control ctrl) { CHelpData help = CHelpData.GetHelp(ctrl, ""); while (!help.DejaEnregistre) { Type tp = ctrl.GetType(); if (ctrl is CHelpData.CtrlPartiel) { tp = ((CHelpData.CtrlPartiel)ctrl).Type; } while (tp != null) { help = CHelpData.GetHelp(tp, ""); if (help.DejaEnregistre) { return(help); } tp = tp.BaseType; } ctrl = ctrl.Parent; if (ctrl == null) { return(null); } help = CHelpData.GetHelp(ctrl, ""); } return(help); }
public List <CHelpData> GetVoirAussiHeritages(bool modeCreation) { List <CHelpData> lst = new List <CHelpData>(); Type t = GetTypeSelonLiaison(); if (t == null) { return(lst); } Type tparent = t.BaseType; while (tparent != null) { CHelpData hlp = GetVoirAussiType(tparent, modeCreation); if (hlp != null) { lst.Add(hlp); } tparent = tparent.BaseType; } return(lst); }
public void Initialiser(CHelpData hlp, string preselec) { txt_nom.Text = preselec; _hlp = hlp; _initialise = false; string[] props = Enum.GetNames(typeof(EProprieteSourcePourNom)); foreach (string prop in props) { cmb_prop.Items.Add(prop); } if (preselec == "") { rbt_perso.Checked = false; txt_nom.Enabled = false; cmb_prop.Enabled = true; } else { rbt_perso.Checked = true; txt_nom.Enabled = true; cmb_prop.Enabled = false; } _initialise = true; }
public CHelpData GetHelp(string strCle) { CResultAErreur result = CResultAErreur.True; CHelpData help = null; if (m_tableAides.Contains(strCle)) { return((CHelpData)m_tableAides[strCle]); } string strFile = RepertoireDeBase + GetFileTitle(strCle); if (!File.Exists(strFile)) { return(null); } help = new CHelpData(); help.HelpKey = strCle; m_tableAides[strCle] = help; result = CSerializerObjetInFile.ReadFromFile(help, c_cleFichier, strFile); return(help); }
//--------------------------------------------------------- public CResultAErreur SaveHelp(CHelpData help) { CResultAErreur result = CResultAErreur.True; string strFileTitle = GetFileTitle(help); // >> Créé une instance au niveau de l'index if (!help.HasData) { try { if (File.Exists(RepertoireDeBase + strFileTitle)) { File.Delete(RepertoireDeBase + strFileTitle); m_tableAides.Remove(help.HelpKey); } } catch { } return(result); } //S'assure que le chemin du fichier existe string strFichier = RepertoireDeBase + strFileTitle; m_tableAides[help.HelpKey] = help; SaveFichierIndex(); return(CSerializerObjetInFile.SaveToFile(help, c_cleFichier, strFichier)); }
public List <CHelpData> GetVoirAussiAttributs(bool modeCreation) { List <CHelpData> lst = new List <CHelpData>(); Type t = GetTypeSelonLiaison(); if (t == null) { return(lst); } object[] atts = t.GetCustomAttributes(false); List <Type> tps = new List <Type>(); foreach (object att in atts) { tps.Add(att.GetType()); } foreach (Type tatt in tps) { CHelpData hlp = GetVoirAussiType(tatt, modeCreation); if (hlp != null) { lst.Add(hlp); } } return(lst); }
private static int OnHook(int nCode, int wParam, int lParam) { try { if (nCode == 0) { if (wParam == (int)Keys.F1) { if (lParam < 0) { Process process = Process.GetProcessById(m_nIdProcess); Control ctrl = null; if (process != null) { ctrl = System.Windows.Forms.Form.ActiveForm; } if (ctrl != null) { m_lastControl = ctrl; ctrl = FindFocused(ctrl); m_nNbFormvisible++; try { if (m_nNbFormvisible == 1) { Control pere = ctrl; while (pere != null) { //if (pere.GetType() == typeof(MdiClient)) // pere = null; //else //{ CHelpData.FenetreActive = pere; pere = pere.Parent; //} } CHelpData help = CHelpData.GetHelp(ctrl, ""); CFormAide.ShowHelp(help, ctrl); } } catch { //MessageBox.Show(e.Message); } finally { m_nNbFormvisible--; } } } } } } catch { } return(0); }
private void PopupHelp(CHelpData help) { Point pt = Cursor.Position; pt.Offset(0, 5); CWebViewerPopup.Popup(pt, help); }
void Navigation(object sender, WebBrowserNavigatingEventArgs e) { if (_navigationEnCour) { e.Cancel = true; } else { string strURL = e.Url.ToString(); if (strURL.Length > 6 && strURL.Substring(0, 6).ToUpper() == "HLP://") { string strKey = strURL.Substring(6); if (strKey[strKey.Length - 1] == '/') { strKey = strKey.Substring(0, strKey.Length - 1); } CHelpData hlp = CHelpData.SourceAide.GetHelp(strKey); if (hlp != null) { _navigationEnCour = true; if (ClickLienVersAide != null) { ClickLienVersAide(sender, new ArgumentsEvenementNavigationVersAide(hlp)); } if (_liensVersHelpActifs) { DocumentText = hlp.FullTexteHtml; } _navigationEnCour = false; e.Cancel = true; } } } }
private void EditeHelp(CHelpData help) { CFormEditHelp form = new CFormEditHelp(); form.Initialiser(help); form.ShowDialog(); m_helpData = form.HelpSelectionne; }
public void Initialiser(CHelpData hlp, bool editionPossible) { m_hlp = hlp; m_bModeClignotement = true; m_bEdition = editionPossible; m_bPlusDeSeparateur = false; ConstruireMenu(); }
private void ctrl_voirAussi_ClicSurElement(object sender, EventArgs e) { CHelpData hlp = ctrl_voirAussi.HelpSelectionne; if (hlp != null) { Initialiser(hlp); } }
private void SetHelpAssociee(CHelpData help) { m_lblHelpLiee.Text = help == null ? "" : help.NomCourt; if (help != null) { txt_nom.Text = help.NomCourt; } m_helpAssociee = help; }
private void Initialiser() { m_strNom = ""; m_strDescrip = ""; m_strID = ""; m_strHelpId = ""; m_help = null; m_menuParent = null; }
private void AjouterHelp(CHelpData hlp) { ListViewItem itm = new ListViewItem(hlp.Titre); itm.SubItems.Add(hlp.NomCourt); itm.SubItems.Add(hlp.TypeLiaison.ToString()); itm.Tag = hlp; lv_hlps.Items.Add(itm); }
public static void FaireClignoterControl(CHelpData.CtrlPartiel ctrl) { Control c = CHelpData.GetControl(ctrl); if (c != null) { FaireClignoterControl(c); } }
private void Afficher(CHelpData help) { m_helpData = help; visualiseur.Initialiser(help); //Titre SetTitre(help); if (help == null) { if (Visible) { Visible = false; } return; } int nState = GetKeyState(0x11); if (nState < 0 && CHelpExtender.AutoriseModeEdition) { EditeHelp(help); return; } //if (!m_bAutoriseEdition || help.VisualisationAide == EVisualisationAide.Popup) //{ // while ((!help.HasData || help.VisualisationAide == EVisualisationAide.Popup) && help.Controle != null && help.Controle.Parent != null) // { // help = CHelpData.SourceAide.GetHelp(help.Controle.Parent, help.Contexte); // if (help == null) // return; // } //} if (!help.HasData && !CHelpExtender.ModeEdition) { Visible = false; return; } //Menu Voir aussi ctrl_voirAussi.Initialiser(help, CHelpExtender.ModeEdition); m_lblTitre.Text = help.Titre; //Disponibilité du bouton d'edition m_btnEditer.Visible = CHelpExtender.AutoriseModeEdition; m_chkModeEdition.Visible = CHelpExtender.AutoriseModeEdition; pan_separateur2.Visible = CHelpExtender.AutoriseModeEdition; Visible = true; Focus(); BringToFront(); }
//---------------------------------------------------------------------- private void m_btnSelectHelp_Click(object sender, EventArgs e) { CHelpData help = CFormSelectHelpPage.SelectHelp(); if (help != null) { SetHelpAssociee(help); ValideModifs(); } }
public static CHelpData GetHelp(string strCle) { if (m_sourceAide == null) { throw new Exception("Source d'aide non initialisée"); } CHelpData help = m_sourceAide.GetHelp(strCle); return(help); }
public CHelpData GetHelp(string strCle, string strContexte) { CHelpData help = GetHelp(CHelpData.GetCle(strContexte)); if (help != null) { help.Contexte = strContexte; } return(help); }
public CHelpData GetHelp(Type tp, string strContexte) { CHelpData help = GetHelp(CHelpData.GetCle(tp, strContexte)); if (help != null) { help.TypeLie = tp; help.Contexte = strContexte; } return(help); }
public CHelpData GetHelp(Control ctrl, string strContexte) { CHelpData help = GetHelp(CHelpData.GetCle(ctrl, strContexte)); //if (help != null) //{ // help.Controle = ctrl; // help.Contexte = strContexte; //} return(help); }
//--------------------------------------------------------- public CResultAErreur DeleteHelp(CHelpData help) { CResultAErreur result = CResultAErreur.True; Directory.Delete(RepertoireDeBase + GetDirectoryOf(help)); File.Delete(RepertoireDeBase + GetFileTitle(help)); m_tableAides.Remove(help.HelpKey); return(result); }
public string GetDirectoryOf(CHelpData hlp) { string strFichier = GetFileTitle(hlp); string strPathDirectory = RepertoireDeBase + strFichier.Substring(0, strFichier.LastIndexOf('.')); if (!Directory.Exists(strPathDirectory)) { Directory.CreateDirectory(strPathDirectory); } return(strPathDirectory); }
public static CHelpData SelectHelp(ETypeSelection typeSelection) { CFormSelectHelpPage form = new CFormSelectHelpPage(); form.Initialiser(typeSelection); CHelpData help = null; if (form.ShowDialog() == DialogResult.OK) { help = form.HelpSelectionne; } form.Dispose(); return(help); }
private void lv_annexes_SelectedIndexChanged(object sender, EventArgs e) { if (lv_annexes.SelectedItems.Count == 1) { CHelpData hlp = (CHelpData)lv_annexes.SelectedItems[0].Tag; if (NavigationVersHelp != null) { NavigationVersHelp(sender, new ArgumentsEvenementNavigationVersAide(hlp)); } Initialiser(hlp); } }
public static bool EditeLink(ref string strTexte, ref CHelpData helpData) { CFormEditLink form = new CFormEditLink(); form.m_helpData = helpData; form.m_txtLinkText.Text = strTexte; if (form.ShowDialog() == DialogResult.OK) { helpData = form.m_helpData; strTexte = form.m_txtLinkText.Text; return(true); } return(false); }
public static CHelpData GetHelp(Control ctrl, string strContexte) { if (m_sourceAide == null) { throw new Exception("Source d'aide non initialisée"); } CHelpData help = m_sourceAide.GetHelp(ctrl, strContexte); if (help == null) { help = new CHelpData(ctrl, strContexte); } return(help); }
private void lv_hlps_SelectedIndexChanged(object sender, EventArgs e) { if (lv_hlps.SelectedItems.Count == 1) { CHelpData hlp = (CHelpData)lv_hlps.SelectedItems[0].Tag; if (hlp.TypeLiaison == ETypeLiaisonAide.Control) { CHelpExtender.FaireClignoterControl(hlp.Controle); } else { CHelpExtender.ArreterClignotementControl(); } } }
private void btn_changerctrl_Click(object sender, EventArgs e) { if (m_help.Controle != null) { Control ctrl = CFormSelectControl.GetControl(m_help.Controle); if (ctrl != null) { if (AssureSave()) { m_help = CHelpData.GetHelp(ctrl, m_help.Contexte); Initialiser(m_help); } } } }