コード例 #1
0
ファイル: FullHost.cs プロジェクト: mauve/Pash
        public FullHost(bool interactive)
        {
            _interactive = interactive;
            LocalHost = new LocalHost(true);
            _currentRunspace = RunspaceFactory.CreateRunspace(LocalHost);
            _currentRunspace.Open();
            _ctrlStmtKeywordLength = Parser.ControlStatementKeywords.Max(s => s.Length);

            LoadProfiles();
        }
コード例 #2
0
ファイル: FullHost.cs プロジェクト: b333z/Pash
        public FullHost()
        {
            myHost = new LocalHost();
            myRunSpace = RunspaceFactory.CreateRunspace(myHost);
            myRunSpace.Open();

            string exePath = Assembly.GetCallingAssembly().Location;
            string configPath = Path.Combine(Path.GetDirectoryName(exePath), "config.ps1");

            Execute(configPath);
        }
コード例 #3
0
ファイル: FullHost.cs プロジェクト: Ventero/Pash
        public FullHost(bool interactive)
        {
            _interactive = interactive;
            LocalHost = new LocalHost(true);
            _currentRunspace = RunspaceFactory.CreateRunspace(LocalHost);
            _currentRunspace.Open();

            // TODO: check user directory for a config script and fall back to the default one of the installation
            // need to use .CodeBase property, as .Location gets the wrong path if the assembly was shadow-copied
            var localAssemblyPath = new Uri(Assembly.GetCallingAssembly().CodeBase).LocalPath;
            Execute(FormatConfigCommand(localAssemblyPath));
        }
コード例 #4
0
        public LocalHostUserInterface(LocalHost parent)
        {
            UseUnixLikeInput = Environment.OSVersion.Platform != System.PlatformID.Win32NT && Console.WindowWidth > 0;
            _parentHost = parent;

            // Set up the control-C handler.
            try
            {
                Console.CancelKeyPress += new ConsoleCancelEventHandler(HandleControlC);
                Console.TreatControlCAsInput = false;
            }
            catch (IOException)
            {
                // don't mind. if it doesn't work we're likely in a condition where stdin/stdout was redirected
            }
        }
コード例 #5
0
        public LocalHostUserInterface(LocalHost parent)
        {
            UseUnixLikeInput = Environment.OSVersion.Platform != System.PlatformID.Win32NT && Console.WindowWidth > 0;
            _parentHost      = parent;

            // Set up the control-C handler.
            try
            {
                Console.CancelKeyPress      += new ConsoleCancelEventHandler(HandleControlC);
                Console.TreatControlCAsInput = false;
            }
            catch (IOException)
            {
                // don't mind. if it doesn't work we're likely in a condition where stdin/stdout was redirected
            }
        }
コード例 #6
0
ファイル: RunspaceFactory.cs プロジェクト: mauve/Pash
 public static Runspace CreateRunspace(InitialSessionState initialSessionState)
 {
     PSHost host = new LocalHost(); // DefaultHost(Thread.CurrentThread.CurrentCulture, Thread.CurrentThread.CurrentUICulture);
     return RunspaceFactory.CreateRunspace(host, initialSessionState);
 }
コード例 #7
0
 protected LocalHostUserInterface()
 {
     UseUnixLikeInput = false;
     _parentHost      = null;
     InteractiveIO    = false;
 }
コード例 #8
0
ファイル: LocalHostUserInterface.cs プロジェクト: mauve/Pash
 protected LocalHostUserInterface()
 {
     UseUnixLikeInput = false;
     _parentHost = null;
     InteractiveIO = false;
 }