예제 #1
0
        public DataContextProvider(IPathProvider pathProvider, CultureSettings cultureSettings)
        {
            if (pathProvider == null) throw new ArgumentNullException("pathProvider");
              if (cultureSettings == null) throw new ArgumentNullException("cultureSettings");

              this.pathProvider = pathProvider;
              this.cultureSettings = cultureSettings;
        }
예제 #2
0
        public YnabGateway(IFileAccess fileAccess, IPathProvider pathProvider, CultureSettings cultureSettings)
        {
            if (fileAccess == null) throw new ArgumentNullException("fileAccess");
              if (pathProvider == null) throw new ArgumentNullException("pathProvider");
              if (cultureSettings == null) throw new ArgumentNullException("cultureSettings");

              this.fileAccess = fileAccess;
              this.pathProvider = pathProvider;
              this.cultureSettings = cultureSettings;
        }
예제 #3
0
        internal string ToYnabString(CultureSettings cultureSettings)
        {
            var result = string.Format(
                cultureSettings.CultureInfo,
                "{1}{0}{2}{0}{3}{0}{4}{0}{5}{0}{6}",
                new object[]
            {
                cultureSettings.Separator,
                this.ValueDate.ToString(cultureSettings.DateTimeFormatString, cultureSettings.CultureInfo),
                "Import Statements",
                ReplaceSeparator(this.Payee, cultureSettings),
                ReplaceSeparator(this.Description, cultureSettings),
                this.AmountOut.ToString("0.00", CultureInfo.InvariantCulture),
                this.AmountIn.ToString("0.00", CultureInfo.InvariantCulture)
            });

            return(result);
        }
예제 #4
0
        internal string ToYnabString(CultureSettings cultureSettings)
        {
            var result = string.Format(
            cultureSettings.CultureInfo,
            "{1}{0}{2}{0}{3}{0}{4}{0}{5}{0}{6}",
            new object[]
              {
            cultureSettings.Separator,
            this.ValueDate.ToString(cultureSettings.DateTimeFormatString, cultureSettings.CultureInfo),
            "Import Statements",
            ReplaceSeparator(this.Payee, cultureSettings),
            ReplaceSeparator(this.Description, cultureSettings),
            this.AmountOut.ToString("0.00", CultureInfo.InvariantCulture),
            this.AmountIn.ToString("0.00", CultureInfo.InvariantCulture)
              });

              return result;
        }
예제 #5
0
        public YnabGateway(IFileAccess fileAccess, IPathProvider pathProvider, CultureSettings cultureSettings)
        {
            if (fileAccess == null)
            {
                throw new ArgumentNullException("fileAccess");
            }
            if (pathProvider == null)
            {
                throw new ArgumentNullException("pathProvider");
            }
            if (cultureSettings == null)
            {
                throw new ArgumentNullException("cultureSettings");
            }

            this.fileAccess      = fileAccess;
            this.pathProvider    = pathProvider;
            this.cultureSettings = cultureSettings;
        }
예제 #6
0
 internal IEnumerable <string> ToYnabStrings(CultureSettings cultureSettings)
 {
     return(new[] { GetHeaderLine(cultureSettings) }.Concat(this.ynabEntries.Select(entry => entry.ToYnabString(cultureSettings))));
 }
예제 #7
0
        private string GetHeaderLine(CultureSettings cultureSettings)
        {
            var result = string.Format(cultureSettings.CultureInfo, "Date{0}Category{0}Payee{0}Memo{0}Outflow{0}Inflow", new object[] { cultureSettings.Separator });

            return(result);
        }
예제 #8
0
 private string ReplaceSeparator(string s, CultureSettings cultureSettings)
 {
     return(s.Replace(cultureSettings.Separator, cultureSettings.ReplacementForSeparator));
 }
예제 #9
0
 private string GetHeaderLine(CultureSettings cultureSettings)
 {
     var result = string.Format(cultureSettings.CultureInfo, "Date{0}Category{0}Payee{0}Memo{0}Outflow{0}Inflow", new object[] { cultureSettings.Separator });
       return result;
 }
예제 #10
0
 internal IEnumerable<string> ToYnabStrings(CultureSettings cultureSettings)
 {
     return new[] { GetHeaderLine(cultureSettings) }.Concat(this.ynabEntries.Select(entry => entry.ToYnabString(cultureSettings)));
 }
예제 #11
0
 private string ReplaceSeparator(string s, CultureSettings cultureSettings)
 {
     return s.Replace(cultureSettings.Separator, cultureSettings.ReplacementForSeparator);
 }