Exemple #1
0
 private void Init(PwEntry pe, PwDatabase pd, bool bAT, bool bCmdQuotes,
                   SprCompileFlags fl)
 {
     m_pe             = pe;
     m_pd             = pd;
     m_bMakeAT        = bAT;
     m_bMakeCmdQuotes = bCmdQuotes;
     m_flags          = fl;
 }
        /**
         * Replaces all placeholders with keepass compiling engine and replace os environment variables
         */
        protected String fillPlaceholders(String applicationOptions)
        {
            String resolvedPathOrOptions = String.Empty;

            //Resolv keepass variables
            Boolean         encodeAsAutoType           = false;
            Boolean         encodeQuotesForCommandline = true;
            SprCompileFlags compileFlags   = SprCompileFlags.All; // Which placeholders should be replaced
            SprContext      replaceContext = new SprContext(this.keepassEntry, this.keepassDatabase, compileFlags, encodeAsAutoType, encodeQuotesForCommandline);

            resolvedPathOrOptions = SprEngine.Compile(applicationOptions, replaceContext);

            //Resolv OS variables
            resolvedPathOrOptions = Environment.ExpandEnvironmentVariables(resolvedPathOrOptions);

            return(resolvedPathOrOptions);
        }
Exemple #3
0
 public SprContext(PwEntry pe, PwDatabase pd, SprCompileFlags fl,
                   bool bEncodeAsAutoTypeSequence, bool bEncodeQuotesForCommandLine)
 {
     Init(pe, pd, bEncodeAsAutoTypeSequence, bEncodeQuotesForCommandLine, fl);
 }
Exemple #4
0
 public SprContext(PwEntry pe, PwDatabase pd, SprCompileFlags fl)
 {
     Init(pe, pd, false, false, fl);
 }
Exemple #5
0
 public SprContext(PwEntry pe, PwDatabase pd, SprCompileFlags fl,
     bool bEncodeAsAutoTypeSequence, bool bEncodeQuotesForCommandLine)
 {
     Init(pe, pd, bEncodeAsAutoTypeSequence, bEncodeQuotesForCommandLine, fl);
 }
Exemple #6
0
 public SprContext(PwEntry pe, PwDatabase pd, SprCompileFlags fl)
 {
     Init(pe, pd, false, false, fl);
 }
Exemple #7
0
 private void Init(PwEntry pe, PwDatabase pd, bool bAT, bool bCmdQuotes,
     SprCompileFlags fl)
 {
     m_pe = pe;
     m_pd = pd;
     m_bMakeAT = bAT;
     m_bMakeCmdQuotes = bCmdQuotes;
     m_flags = fl;
 }