コード例 #1
0
ファイル: CMemoObjetDonnee.cs プロジェクト: ykebaili/sc2idlls
        private void Save()
        {
            CStringSerializer ser = new CStringSerializer(ModeSerialisation.Ecriture);

            if (ser.TraiteListe <CReferenceObjetDonneeAvecLibelle>(m_listeObjets))
            {
                C2iRegistre.SetValueInRegistreApplication("Preferences", "UserMemo", ser.String);
            }
        }
コード例 #2
0
 //------------------------------------------------
 private void SaveStateInRegistre()
 {
     if (m_strPreserveStateKey != null && m_strPreserveStateKey.Length > 0)
     {
         CStringSerializer serializer = new CStringSerializer(ModeSerialisation.Ecriture);
         CResultAErreur    result     = SerializeState(serializer);
         string            strVal     = serializer.String;
         if (!result)
         {
             strVal = "";
         }
         C2iRegistre.SetValueInRegistreApplication(c_strCleRegistre, m_strPreserveStateKey, strVal);
     }
 }
コード例 #3
0
        public static IEnumerable <CActionCopierMultiLocalDansGed.CInfoFichierToGed> GetInfosToAdd(
            IEnumerable <int> lstIdsCategories)
        {
            using (CFormAddMultipleToGed frm = new CFormAddMultipleToGed())
            {
                List <CCategorieGED> lstCats       = new List <CCategorieGED>();
                StringBuilder        blKeyMultiEDM = new StringBuilder();
                if (lstIdsCategories != null)
                {
                    foreach (int nId in lstIdsCategories)
                    {
                        CCategorieGED categorie = new CCategorieGED(CSc2iWin32DataClient.ContexteCourant);
                        if (categorie.ReadIfExists(nId))
                        {
                            lstCats.Add(categorie);
                            blKeyMultiEDM.Append(nId);
                            blKeyMultiEDM.Append("_");
                        }
                    }
                }
                frm.m_strKeyRepertoire = "MEDOC_" + blKeyMultiEDM.ToString();

                string strRep = C2iRegistre.GetValueInRegistreApplication("Preferences", frm.m_strKeyRepertoire, "");
                if (strRep != "")
                {
                    frm.m_browser.StartUpDirectory      = sc2i.win32.common.folderbrowser.SpecialFolders.Other;
                    frm.m_browser.StartUpDirectoryOther = strRep;
                }
                frm.Init(lstCats);
                if (frm.ShowDialog() == DialogResult.OK)
                {
                    strRep = frm.m_browser.CurrentFolderKey;
                    if (strRep != null)
                    {
                        C2iRegistre.SetValueInRegistreApplication("Preferences", frm.m_strKeyRepertoire, strRep);
                    }
                    return(frm.GetInfosToAdd());
                }
            }
            return(null);
        }
コード例 #4
0
 //---------------------------------
 public void SavePreference()
 {
     C2iRegistre.SetValueInRegistreApplication("Preferences\\AutoHide", RegistreKey, AutoHide ? "1" : "0");
 }