Esempio n. 1
0
 public bool LoadSetting(string settingPath)
 {
     var result = false;
     var obj = new ProjectSetting();
     if (File.Exists(settingPath)) {
         FileStream fileStream = new FileStream(settingPath, FileMode.Open);
         try {
             XmlSerializer serializer = new XmlSerializer(typeof(ProjectSetting));
             obj = (ProjectSetting)serializer.Deserialize(fileStream);
             if (obj != null) {
                 ProjectName = obj.ProjectName;
                 GenerationPath= obj.GenerationPath;
                 SelectedPattern= obj.SelectedPattern;
                 DefaultNameSpace= obj.DefaultNameSpace;
             } else {
                 result = false;
             }
             result = true;
         } catch (Exception ex) {
             AppException.LogException(ex);
             result = false;
         } finally {
             fileStream.Close();
         }
     }
     return result;
 }
Esempio n. 2
0
 private void InitializeProjectSetting()
 {
     _projectSetting = new ProjectSetting {
         ProjectName = "Movie",
         DefaultNameSpace = "MovieDB",
         GenerationPath = "D:\\MovieDb",
         SelectedPattern = "d:\\efpoco.ptn"
     };
 }