Example #1
0
 public bool LoadSetting(string settingPath)
 {
     var result = false;
     var obj = new RectifierSetting();
     if (File.Exists(settingPath)) {
         FileStream fileStream = new FileStream(settingPath, FileMode.Open);
         try {
             XmlSerializer serializer = new XmlSerializer(typeof(RectifierSetting));
             obj = (RectifierSetting)serializer.Deserialize(fileStream);
             if (obj != null) {
                 Capitalize = obj.Capitalize;
                 ViewPrefix = obj.ViewPrefix;
                 TablePrefix = obj.TablePrefix;
                 ViewPostfix = obj.ViewPostfix;
                 TablePostfix = obj.TablePostfix;
                 TablePostfix = obj.TablePostfix;
                 IgnoredPrefix = obj.IgnoredPrefix;
                 IgnoredPostfix = obj.IgnoredPostfix;
                 RemoveUnderscore = obj.RemoveUnderscore;
             } else {
                 result = false;
             }
             result = true;
         } catch (Exception ex) {
             AppException.LogException(ex);
             result = false;
         } finally {
             fileStream.Close();
         }
     }
     return result;
 }
Example #2
0
 private void InitializeRectifierSetting()
 {
     _rectifierSetting = new RectifierSetting {
         Capitalize = true,
         IgnoredPostfix = "_tbl,_vw",
         IgnoredPrefix = "tbl_,vw",
         RemoveUnderscore = true,
         TablePostfix = "Model",
         TablePrefix = "tbl",
         ViewPostfix = "Model",
         ViewPrefix = "vw"
     };
 }