public static void LoadEnvironment(InitialAction act) { ThemeUtil.Init(); OptionPreservePlace place = GetOptionPreservePlace(); _options = new ContainerOptions(); _history = new ConnectionHistory(); _macroManager = new MacroManager(); _container = new PoderosaContainer(); _globalCommandTarget = new ContainerGlobalCommandTarget(); _interThreadUIService = new ContainerInterThreadUIService(); _sshKnownHosts = new SSHKnownHosts(); //この時点ではOSの言語設定に合ったリソースをロードする。起動直前で必要に応じてリロード ReloadStringResource(); GEnv.Init(_container); GEnv.Options = _options; GEnv.GlobalCommandTarget = _globalCommandTarget; GEnv.InterThreadUIService = _interThreadUIService; GEnv.SSHKnownHosts = _sshKnownHosts; string dir = GetOptionDirectory(place); LoadConfigFiles(dir, act); _options.OptionPreservePlace = place; //ここまできたら言語設定をチェックし、必要なら読み直し if (GUtil.CurrentLanguage != _options.Language) { System.Threading.Thread.CurrentThread.CurrentUICulture = _options.Language == Language.Japanese? new CultureInfo("ja") : CultureInfo.InvariantCulture; ReloadStringResource(); } }
public CommandResult NewConnectionWithDialog(TCPTerminalParam param) { if (!CheckPaneCount()) { return(CommandResult.Denied); } ConnectionHistory hst = GApp.ConnectionHistory; LoginDialog dlg = new LoginDialog(); if (param != null) { dlg.ApplyParam(param); } else { dlg.ApplyParam(hst.TopTCPParam); } if (GCUtil.ShowModalDialog(_frame, dlg) == DialogResult.OK) //ダイアログを出さないなら無条件で接続を開く { AddNewTerminal(dlg.Result); return(CommandResult.Success); } else { return(CommandResult.Cancelled); } }
private void connectSSHToolStripMenuItem_Click(object sender, EventArgs e) { //Poderosa.Forms.MultiPaneControl mc = new Poderosa.Forms.MultiPaneControl(); //mc.Dock = DockStyle.Fill; //mc.BackColor = System.Drawing.Color.AliceBlue; //tabPage1.Controls.Add(mc); InitialAction a = new InitialAction(); //Poderosa.Forms.GFrame frame = new Poderosa.Forms.GFrame(a); ConnectionHistory hst = GApp.ConnectionHistory; Poderosa.Forms.LoginDialog dlg = new Poderosa.Forms.LoginDialog(); TCPTerminalParam param = hst.TopTCPParam; dlg.ApplyParam(param); dlg.StartPosition = FormStartPosition.CenterParent; //if (GCUtil.ShowModalDialog(_frame, dlg) == DialogResult.OK) //frame.Show(); //GCUtil.ShowModalDialog(frame, dlg); //dlg.ShowDialog(); dlg._hostBox.Text = "palm"; dlg._methodBox.SelectedIndex = 2; dlg._portBox.Text = "22"; dlg._userNameBox.Text = "bwilliam"; dlg._passphraseBox.Text = "lkmj9u"; dlg.OnOK(null, null); Connection.ConnectionTag ct = dlg.Result; }
public async Task <ConnectionHistory> Add(ConnectionHistory model) { var result = _myDbContext.ConnectionHistories.Add(model); await _myDbContext.SaveChangesAsync(); return(result); }
/// <summary> /// add new history item in todays list and/or perform full refresh, /// if day has changed since last refresh /// </summary> private void OnHistoryRecorded(ConnectionHistory sender, HistoryRecordedEventArgs args) { if (this.IsDayGone()) { this.RefreshAllExpanded(); } else { this.InsertRecordedNode(args); } }
public async Task <DbConnection> OpenConnectionAsync() { DbConnection cnt = Factory.CreateConnection(); cnt.ConnectionString = ConnectionString; await cnt.OpenAsync(); ConnectionHistory.Add(cnt); return(cnt); }
public DbConnection OpenConnection() { DbConnection cnt = Factory.CreateConnection(); cnt.ConnectionString = ConnectionString; cnt.Open(); ConnectionHistory.Add(cnt); return(cnt); }
/// <summary> /// For testing purpose allowes to inject internaly used services /// </summary> internal FilePersistence(PersistenceSecurity security, IDataFileWatcher fileWatcher, FavoriteIcons favoriteIcons, ConnectionManager connectionManager) { this.fileLocations = Settings.Instance.FileLocations; this.serializer = new FavoritesFileSerializer(connectionManager); this.InitializeSecurity(security); this.Dispatcher = new DataDispatcher(); this.storedCredentials = new StoredCredentials(security); this.groups = new Groups(this); this.favorites = new Favorites(this, favoriteIcons, connectionManager); this.connectionHistory = new ConnectionHistory(this.favorites); this.factory = new Factory(this.groups, this.Dispatcher, connectionManager); this.contextBuilder = new SerializationContextBuilder(this.groups, this.favorites, this.Dispatcher); this.InitializeFileWatch(fileWatcher); }
public LoginDialog() { _firstFlag = true; _initializing = true; _history = GApp.ConnectionHistory; // // Windows フォーム デザイナ サポートに必要です。 // InitializeComponent(); InitializeText(); // // InitializeLoginParams(); _initializing = false; }