コード例 #1
0
 internal TaskContext(ICommandShell commandShell)
 {
     this.CommandShell       = commandShell;
     this.UniqueId           = Guid.NewGuid();
     this.CurrentObjectIndex = -1;
     this.Items     = new Dictionary <string, object>();
     this.ErrorInfo = new TaskErrorInfo();
 }
コード例 #2
0
        public override void OpenDatabase(ICommandShell shell, ICmdLineConnection conn)
        {
            string verstr = "Server version:";
            string pwdstr = "Enter password:"******"$"))
            {
                s = shell.ReadLineAndWait();
            }
            //m_shell.WriteLine("echo cau");
            shell.WriteLine("mysql -p -u " + conn.Params.Login);
            //System.Threading.Thread.Sleep(2000);
            //m_shell.WriteLine("echo cau");
            //int b = m_outstream.ReadByte();
            //string s = shell.ReadLineAndWait();
            s = shell.ReadLineAndWait();
            while (s != null && !s.Contains(verstr) && !s.StartsWith(pwdstr))
            {
                s = shell.ReadLineAndWait();
            }
            if (s != null && s.StartsWith(pwdstr))
            {
                shell.WriteLine(conn.Params.Password);
                s = shell.ReadLineAndWait();
            }
            while (s != null && !s.Contains(verstr))
            {
                s = shell.ReadLineAndWait();
            }
            if (s != null && s.Contains(verstr))
            {
                string version = s.Substring(verstr.Length).Trim();
                if (version.Contains(" "))
                {
                    version = version.Substring(0, version.IndexOf(" ")).Trim();
                }
                conn.SetVersion(version);
            }
        }
コード例 #3
0
 public KubernetesCluster(ICommandShell shell)
 {
     Guard.IsNotNull(shell, nameof(shell));
     Shell = shell;
 }
コード例 #4
0
ファイル: ICmdLineAdapter.cs プロジェクト: janproch/datadmin
 public abstract void OpenDatabase(ICommandShell shell, ICmdLineConnection conn);