Esempio n. 1
0
        private bool MRUItemEquality(MRUItem item1, MRUItem item2)
        {
            ITerminalParameter p1 = item1.TerminalParameter;
            ITerminalParameter p2 = item2.TerminalParameter;

            return(p1.UIEquals(p2));
        }
Esempio n. 2
0
        public static string FormatItemDescription(MRUItem item)
        {
            ITerminalParameter param  = item.TerminalParameter;
            string             suffix = "";
            ICygwinParameter   cygwin = (ICygwinParameter)param.GetAdapter(typeof(ICygwinParameter));

            if (cygwin != null)
            {
                suffix = "- Cygwin";
            }

            ISSHLoginParameter ssh = (ISSHLoginParameter)param.GetAdapter(typeof(ISSHLoginParameter));
            ITCPParameter      tcp = (ITCPParameter)param.GetAdapter(typeof(ITCPParameter));

            if (ssh != null)
            {
                suffix = String.Format("- {0}", ssh.Method.ToString());
            }
            else if (tcp != null)
            {
                suffix = "- Telnet";
            }

            return(String.Format("{0} {1}", item.TerminalSettings.Caption, suffix));
        }
Esempio n. 3
0
        public StructuredText Serialize(object obj)
        {
            MRUItem        item = (MRUItem)obj;
            StructuredText t    = new StructuredText(this.ConcreteType.FullName);

            t.AddChild(_serializeService.Serialize(item.TerminalParameter));
            t.AddChild(_serializeService.Serialize(item.TerminalSettings));
            return(t);
        }
Esempio n. 4
0
        private void AssureContent()
        {
            if (_lateBindContent == null)
            {
                return;
            }

            MRUItem temp = MRUItemSerializer.Instance.Deserialize(_lateBindContent) as MRUItem;

            Debug.Assert(temp != null); //型チェックくらいはロード時にしている
            _terminalParam    = temp._terminalParam;
            _terminalSettings = temp._terminalSettings;
            _lateBindContent  = null; //これで遅延する
        }
Esempio n. 5
0
        public CommandResult InternalExecute(ICommandTarget target, params IAdaptable[] args)
        {
            Debug.Assert(args != null && args.Length == 1);
            MRUItem item = (MRUItem)args[0].GetAdapter(typeof(MRUItem));

            //コマンド実行時点でIsolateする。
            //なぜなら、TerminalSettingsはSessionごとにコピーを持たないといけない(セッション間の共有はNG)し、
            //しかしSettingを接続後に変更したらそれは保存するMRUに反映したい。
            //結果として、同じMRUItemを複数回インスタンシエートしたら、最後に開いた接続のTerminalSettingsがMRUデータとして保存される。
            item.IsolateSettings();
            ITerminalSession ts = MRUPlugin.Instance.TerminalSessionsService.TerminalSessionStartCommand.StartTerminalSession(target, item.TerminalParameter, item.TerminalSettings);

            return(ts != null ? CommandResult.Succeeded : CommandResult.Failed);
        }
Esempio n. 6
0
 public MRUMenuItem(int index, MRUItem item)
 {
     _index   = index;
     _mruItem = item;
 }
Esempio n. 7
0
        public static string FormatItemDescription(MRUItem item) {
            ITerminalParameter param = item.TerminalParameter;
            string suffix = "";
            ICygwinParameter cygwin = (ICygwinParameter)param.GetAdapter(typeof(ICygwinParameter));
            if (cygwin != null)
                suffix = "- Cygwin";

            ISSHLoginParameter ssh = (ISSHLoginParameter)param.GetAdapter(typeof(ISSHLoginParameter));
            ITCPParameter tcp = (ITCPParameter)param.GetAdapter(typeof(ITCPParameter));
            if (ssh != null)
                suffix = String.Format("- {0}", ssh.Method.ToString());
            else if (tcp != null)
                suffix = "- Telnet";

            return String.Format("{0} {1}", item.TerminalSettings.Caption, suffix);
        }
Esempio n. 8
0
 public MRUMenuItem(int index, MRUItem item) {
     _index = index;
     _mruItem = item;
 }
Esempio n. 9
0
        private bool MRUItemEquality(MRUItem item1, MRUItem item2) {
            ITerminalParameter p1 = item1.TerminalParameter;
            ITerminalParameter p2 = item2.TerminalParameter;

            return p1.UIEquals(p2);
        }