Esempio n. 1
0
 public SSHKnownHosts()
 {
     _dataForSSH1 = new TypedHashtable <string, string>();
     _dataForSSH2 = new TypedHashtable <string, string>();
     _modified    = false;
     _loaded      = false;
 }
Esempio n. 2
0
        private void OnOK(object sender, EventArgs args)
        {
            try {
                TypedHashtable <IShellScheme, IShellScheme> table = new TypedHashtable <IShellScheme, IShellScheme>();
                List <IShellScheme> newscheme  = new List <IShellScheme>();
                IShellScheme        newdefault = null;
                foreach (ItemTag tag in _tags)
                {
                    if (tag.Original != null)
                    {
                        table.Add(tag.Original, tag.ShellScheme);
                    }
                    newscheme.Add(tag.ShellScheme);
                    if (tag.ShellScheme.IsGeneric)
                    {
                        newdefault = tag.ShellScheme;
                    }
                }

                foreach (ItemTag tag in _removing)
                {
                    table.Add(tag.Original, newdefault);
                }

                _schemeCollection.UpdateAll(newscheme.ToArray(), table);
            }
            catch (Exception ex) {
                RuntimeUtil.ReportException(ex);
            }
        }
Esempio n. 3
0
        private void InitItems()
        {
            _idToWorkPreference = new TypedHashtable <string, WorkPreference>();
            IPreferences preferences = OptionDialogPlugin.Instance.RootPreferences;
            int          y           = 8;

            for (int i = 0; i < _entries.Length; i++)
            {
                IOptionPanelExtension e = _entries[i].Extension;
                foreach (string pref_id in e.PreferenceFolderIDsToEdit)
                {
                    WorkPreference wp = _idToWorkPreference[pref_id];
                    if (wp == null)   //add entry
                    {
                        IPreferenceFolder folder = preferences.FindPreferenceFolder(pref_id);
                        if (folder == null)
                        {
                            throw new Exception(pref_id + " not found");
                        }
                        _idToWorkPreference.Add(pref_id, new WorkPreference(folder));
                    }
                }
                PanelItem item = new PanelItem(this, i, e.Icon, e.Caption);
                item.Location = new Point(4, y);
                _categoryItems.Controls.Add(item);

                y += 52;
            }
            this.ClientSize = new Size(this.ClientSize.Width, y + 42); //項目が増えたら高さが増える
        }
Esempio n. 4
0
 public SSHKnownHosts()
 {
     _dataForSSH1 = new TypedHashtable<string, string>();
     _dataForSSH2 = new TypedHashtable<string, string>();
     _modified = false;
     _loaded = false;
 }
Esempio n. 5
0
 public override void InitializePlugin(IPoderosaWorld poderosa)
 {
     base.InitializePlugin(poderosa);
     _instance  = this;
     _idToHosts = new TypedHashtable <string, PlugInHost>();
     poderosa.PluginManager.FindExtensionPoint("org.poderosa.root").RegisterExtension(this);
     _extensionPoint = poderosa.PluginManager.CreateExtensionPoint(EXTENSIONPOINT_NAME, typeof(IPreferenceSupplier), this);
 }
Esempio n. 6
0
 //型から検索する。まあ個数は多くないだろうからリニアサーチでいいだろう。どうしても、という場合にはこの中でキャッシュするくらいか
 private ISerializeServiceElement FindServiceElement(string tag) {
     if (_nameToSerializer == null) {
         _nameToSerializer = new TypedHashtable<string, ISerializeServiceElement>();
         ISerializeServiceElement[] t = (ISerializeServiceElement[])_serviceElements.GetExtensions();
         foreach (ISerializeServiceElement e in t) {
             _nameToSerializer.Add(e.ConcreteType.FullName, e);
         }
     }
     return _nameToSerializer[tag];
 }
Esempio n. 7
0
        public override void InitializePlugin(IPoderosaWorld poderosa) {
            _instance = this;
            base.InitializePlugin(poderosa);
            _sessionMap = new TypedHashtable<ISession, SessionHost>();
            _documentMap = new TypedHashtable<IPoderosaDocument, DocumentHost>();
            _docViewRelationHandler = poderosa.PluginManager.CreateExtensionPoint("org.poderosa.core.sessions.docViewRelationHandler", typeof(IDocViewRelationEventHandler), this);
            _activeDocumentChangeListeners = new ListenerList<IActiveDocumentChangeListener>();
            _activeDocumentChangeListeners.Add(new WindowCaptionManager());

            _sessionListeners = new ListenerList<ISessionListener>();
        }
Esempio n. 8
0
        public override void InitializePlugin(IPoderosaWorld poderosa) {
            base.InitializePlugin(poderosa);
            _instance = this;
            _commands = new List<IGeneralCommand>();
            _idToCommand = new TypedHashtable<string, IGeneralCommand>();
            _keyBind = new KeyBindConfiguration();
            _keyBindChangeListener = new ListenerList<IKeyBindChangeListener>();

            BasicCommandImplementation.Build();

            poderosa.PluginManager.FindExtensionPoint(PreferencePlugin.EXTENSIONPOINT_NAME).RegisterExtension(this);
        }
Esempio n. 9
0
        public override void InitializePlugin(IPoderosaWorld poderosa)
        {
            _instance = this;
            base.InitializePlugin(poderosa);
            _sessionMap                    = new TypedHashtable <ISession, SessionHost>();
            _documentMap                   = new TypedHashtable <IPoderosaDocument, DocumentHost>();
            _docViewRelationHandler        = poderosa.PluginManager.CreateExtensionPoint("org.poderosa.core.sessions.docViewRelationHandler", typeof(IDocViewRelationEventHandler), this);
            _activeDocumentChangeListeners = new ListenerList <IActiveDocumentChangeListener>();
            _activeDocumentChangeListeners.Add(new WindowCaptionManager());

            _sessionListeners = new ListenerList <ISessionListener>();
        }
Esempio n. 10
0
 //型から検索する。まあ個数は多くないだろうからリニアサーチでいいだろう。どうしても、という場合にはこの中でキャッシュするくらいか
 private ISerializeServiceElement FindServiceElement(string tag)
 {
     if (_nameToSerializer == null)
     {
         _nameToSerializer = new TypedHashtable <string, ISerializeServiceElement>();
         ISerializeServiceElement[] t = (ISerializeServiceElement[])_serviceElements.GetExtensions();
         foreach (ISerializeServiceElement e in t)
         {
             _nameToSerializer.Add(e.ConcreteType.FullName, e);
         }
     }
     return(_nameToSerializer[tag]);
 }
Esempio n. 11
0
        public override void InitializePlugin(IPoderosaWorld poderosa)
        {
            base.InitializePlugin(poderosa);
            _instance              = this;
            _commands              = new List <IGeneralCommand>();
            _idToCommand           = new TypedHashtable <string, IGeneralCommand>();
            _keyBind               = new KeyBindConfiguration();
            _keyBindChangeListener = new ListenerList <IKeyBindChangeListener>();

            BasicCommandImplementation.Build();

            poderosa.PluginManager.FindExtensionPoint(PreferencePlugin.EXTENSIONPOINT_NAME).RegisterExtension(this);
        }
Esempio n. 12
0
        public void UpdateAll(IShellScheme[] values, TypedHashtable <IShellScheme, IShellScheme> table)
        {
            _data.Clear();
            foreach (IShellScheme ss in values)
            {
                _data.Add(ss);
                if (ss.IsGeneric)
                {
                    _defaultScheme = ss;
                }
            }

            //変更通知 これは_dataの更新後でないと、ハンドラから再検索等きたときに困る
            foreach (IShellSchemeDynamicChangeListener l in _listeners)
            {
                l.OnShellSchemeCollectionChanged(values, table);
            }
        }
Esempio n. 13
0
        private void Load()
        {
            _idToPlugin = new TypedHashtable <string, Plugin>();
            foreach (Plugin p in _allPlugins)
            {
                if (p.TryToLoad() == GenericResult.Failed)
                {
                    _tracer.Trace("PluginManager.Messages.BootWithoutThisPlugin", p.TypeName);
                    continue;
                }

                string id = p.PluginInfo.ID;
                if (_idToPlugin.Contains(id))
                {
                    _tracer.Trace("PluginManager.Messages.IDDuplication", p.TypeName, p.PluginInfo.ID);
                    continue;
                }

                _idToPlugin.Add(id, p);
            }
        }
Esempio n. 14
0
        private void InitItems()
        {
            _idToWorkPreference = new TypedHashtable <string, WorkPreference>();
            IPreferences preferences = OptionDialogPlugin.Instance.RootPreferences;
            int          y           = 8;

            for (int i = 0; i < _entries.Length; i++)
            {
                IOptionPanelExtension e = _entries[i].Extension;
                foreach (string pref_id in e.PreferenceFolderIDsToEdit)
                {
                    WorkPreference wp = _idToWorkPreference[pref_id];
                    if (wp == null)   //add entry
                    {
                        IPreferenceFolder folder = preferences.FindPreferenceFolder(pref_id);
                        if (folder == null)
                        {
                            throw new Exception(pref_id + " not found");
                        }
                        _idToWorkPreference.Add(pref_id, new WorkPreference(folder));
                    }
                }
                PanelItem item = new PanelItem(this, i, e.Icon, e.Caption);
                item.Location = new Point(3, y);
                _categoryItems.Controls.Add(item);

                y += 52;
            }

            // 項目が増えた場合はパネルにスクロールを表示させてパネル幅/フォーム幅を変更する
            // ※項目数が増えれば増えるほどフォーム自体が縦長になってしまい表示しきれない懸念がある
            // ※今後プラグインでどれだけ項目数を増やしてもスクロールを表示することで対応
            if (y > _categoryItems.ClientSize.Height)
            {
                _categoryItems.AutoScroll = true;
                _categoryItems.Width     += SystemInformation.VerticalScrollBarWidth;
                this.Width += SystemInformation.VerticalScrollBarWidth;
            }
        }
Esempio n. 15
0
        private void InitKeyConfigUI()
        {
            _keyConfigList.Items.Clear();

            //列挙してソート
            TypedHashtable <ICommandCategory, List <IGeneralCommand> > category_list = new TypedHashtable <ICommandCategory, List <IGeneralCommand> >();

            foreach (IGeneralCommand cmd in _keybinds.Commands)
            {
                ICommandCategory cat = cmd.CommandCategory;
                if (cat != null && cat.IsKeybindCustomizable)
                {
                    if (category_list.Contains(cat))
                    {
                        category_list[cat].Add(cmd);
                    }
                    else
                    {
                        List <IGeneralCommand> l = new List <IGeneralCommand>();
                        l.Add(cmd);
                        category_list.Add(cat, l);
                    }
                }
            }

            ICollection result = PositionDesignationSorter.SortItems(category_list.Keys);

            foreach (ICommandCategory cat in result)
            {
                foreach (IGeneralCommand cmd in category_list[cat])
                {
                    ListViewItem li = new ListViewItem(cat.Name);
                    li = _keyConfigList.Items.Add(li);
                    li.SubItems.Add(cmd.Description);
                    li.SubItems.Add(FormatKey(_keybinds.GetKey(cmd)));
                    li.Tag = cmd;
                }
            }
        }
Esempio n. 16
0
 public KeyBindConfiguration() {
     _data = new List<Tag>();
     _keyToTag = new TypedHashtable<Keys, Tag>();
     _commandToTag = new TypedHashtable<IGeneralCommand, Tag>();
 }
Esempio n. 17
0
 public TerminalToolBar()
 {
     _toolbarInstances = new TypedHashtable <IPoderosaMainWindow, TerminalToolBarInstance>();
 }
Esempio n. 18
0
 public KeyBindConfiguration()
 {
     _data         = new List <Tag>();
     _keyToTag     = new TypedHashtable <Keys, Tag>();
     _commandToTag = new TypedHashtable <IGeneralCommand, Tag>();
 }
Esempio n. 19
0
        public void UpdateAll(IShellScheme[] values, TypedHashtable<IShellScheme, IShellScheme> table) {
            _data.Clear();
            foreach (IShellScheme ss in values) {
                _data.Add(ss);
                if (ss.IsGeneric)
                    _defaultScheme = ss;
            }

            //変更通知 これは_dataの更新後でないと、ハンドラから再検索等きたときに困る
            foreach (IShellSchemeDynamicChangeListener l in _listeners)
                l.OnShellSchemeCollectionChanged(values, table);

        }
Esempio n. 20
0
        private void Load()
        {
            _idToPlugin = new TypedHashtable<string, Plugin>();
            foreach (Plugin p in _allPlugins) {
                if (p.TryToLoad() == GenericResult.Failed) {
                    _tracer.Trace("PluginManager.Messages.BootWithoutThisPlugin", p.TypeName);
                    continue;
                }

                string id = p.PluginInfo.ID;
                if (_idToPlugin.Contains(id)) {
                    _tracer.Trace("PluginManager.Messages.IDDuplication", p.TypeName, p.PluginInfo.ID);
                    continue;
                }

                _idToPlugin.Add(id, p);
            }
        }
Esempio n. 21
0
 public AdapterManager()
 {
     _classToFactoryList = new TypedHashtable <Type, List <IDualDirectionalAdapterFactory> >();
 }
Esempio n. 22
0
        public void UpdateAll(IShellScheme[] values, TypedHashtable<IShellScheme, IShellScheme> table)
        {
            _data.Clear();
            foreach (IShellScheme ss in values) {
                _data.Add(ss);
                if (ss.IsGeneric)
                    _defaultScheme = ss;
            }

            //�ύX�ʒm �����_data�̍X�V��łȂ��ƁA�n���h������Č����������Ƃ��ɍ���
            foreach (IShellSchemeDynamicChangeListener l in _listeners)
                l.OnShellSchemeCollectionChanged(values, table);
        }
Esempio n. 23
0
 public PluginManager(InternalPoderosaWorld pw)
 {
     _world = pw;
     _idToExtensionPoint = new TypedHashtable <string, ExtensionPoint>();
 }
Esempio n. 24
0
 public TerminalToolBar() {
     _toolbarInstances = new TypedHashtable<IPoderosaMainWindow, TerminalToolBarInstance>();
 }
Esempio n. 25
0
 /// <summary>
 /// 服务标准化的通用实现
 /// </summary>
 public void Initialize(IUserSession session, DateTime currentTime, TypedHashtable cachingStates)
 {
     _CurrentSession = session;
     _CurrentTime    = currentTime;
     _Cache          = cachingStates;
 }
Esempio n. 26
0
        private void InitItems() {
            _idToWorkPreference = new TypedHashtable<string, WorkPreference>();
            IPreferences preferences = OptionDialogPlugin.Instance.RootPreferences;
            int y = 8;

            for (int i = 0; i < _entries.Length; i++) {
                IOptionPanelExtension e = _entries[i].Extension;
                foreach (string pref_id in e.PreferenceFolderIDsToEdit) {
                    WorkPreference wp = _idToWorkPreference[pref_id];
                    if (wp == null) { //add entry
                        IPreferenceFolder folder = preferences.FindPreferenceFolder(pref_id);
                        if (folder == null)
                            throw new Exception(pref_id + " not found");
                        _idToWorkPreference.Add(pref_id, new WorkPreference(folder));
                    }
                }
                PanelItem item = new PanelItem(this, i, e.Icon, e.Caption);
                item.Location = new Point(4, y);
                _categoryItems.Controls.Add(item);

                y += 52;
            }
            this.ClientSize = new Size(this.ClientSize.Width, y + 42); //項目が増えたら高さが増える
        }
Esempio n. 27
0
        private void InitKeyConfigUI()
        {
            _keyConfigList.Items.Clear();

            //列挙してソート
            TypedHashtable<ICommandCategory, List<IGeneralCommand>> category_list = new TypedHashtable<ICommandCategory, List<IGeneralCommand>>();
            foreach (IGeneralCommand cmd in _keybinds.Commands) {
                ICommandCategory cat = cmd.CommandCategory;
                if (cat != null && cat.IsKeybindCustomizable) {
                    if (category_list.Contains(cat))
                        category_list[cat].Add(cmd);
                    else {
                        List<IGeneralCommand> l = new List<IGeneralCommand>();
                        l.Add(cmd);
                        category_list.Add(cat, l);
                    }
                }
            }

            ICollection result = PositionDesignationSorter.SortItems(category_list.Keys);
            foreach (ICommandCategory cat in result) {
                foreach (IGeneralCommand cmd in category_list[cat]) {
                    ListViewItem li = new ListViewItem(cat.Name);
                    li = _keyConfigList.Items.Add(li);
                    li.SubItems.Add(cmd.Description);
                    li.SubItems.Add(FormatKey(_keybinds.GetKey(cmd)));
                    li.Tag = cmd;
                }
            }
        }
Esempio n. 28
0
        private void InitItems()
        {
            _idToWorkPreference = new TypedHashtable<string, WorkPreference>();
            IPreferences preferences = OptionDialogPlugin.Instance.RootPreferences;
            int y = 8;

            for (int i = 0; i < _entries.Length; i++) {
                IOptionPanelExtension e = _entries[i].Extension;
                foreach (string pref_id in e.PreferenceFolderIDsToEdit) {
                    WorkPreference wp = _idToWorkPreference[pref_id];
                    if (wp == null) { //add entry
                        IPreferenceFolder folder = preferences.FindPreferenceFolder(pref_id);
                        if (folder == null)
                            throw new Exception(pref_id + " not found");
                        _idToWorkPreference.Add(pref_id, new WorkPreference(folder));
                    }
                }
                PanelItem item = new PanelItem(this, i, e.Icon, e.Caption);
                item.Location = new Point(3, y);
                _categoryItems.Controls.Add(item);

                y += 52;
            }

            // 項目が増えた場合はパネルにスクロールを表示させてパネル幅/フォーム幅を変更する
            // ※項目数が増えれば増えるほどフォーム自体が縦長になってしまい表示しきれない懸念がある
            // ※今後プラグインでどれだけ項目数を増やしてもスクロールを表示することで対応
            if (y > _categoryItems.ClientSize.Height) {
                _categoryItems.AutoScroll = true;
                _categoryItems.Width += SystemInformation.VerticalScrollBarWidth;
                this.Width += SystemInformation.VerticalScrollBarWidth;
            }
        }
Esempio n. 29
0
 public PassphraseCache()
 {
     _data = new TypedHashtable <string, string>();
 }
Esempio n. 30
0
 public void Clear()
 {
     _dataForSSH1 = new TypedHashtable <string, string>();
     _dataForSSH2 = new TypedHashtable <string, string>();
 }
Esempio n. 31
0
        private void OnOK(object sender, EventArgs args)
        {
            try {
                TypedHashtable<IShellScheme, IShellScheme> table = new TypedHashtable<IShellScheme, IShellScheme>();
                List<IShellScheme> newscheme = new List<IShellScheme>();
                IShellScheme newdefault = null;
                foreach (ItemTag tag in _tags) {
                    if (tag.Original != null)
                        table.Add(tag.Original, tag.ShellScheme);
                    newscheme.Add(tag.ShellScheme);
                    if (tag.ShellScheme.IsGeneric)
                        newdefault = tag.ShellScheme;
                }

                foreach (ItemTag tag in _removing) {
                    table.Add(tag.Original, newdefault);
                }

                _schemeCollection.UpdateAll(newscheme.ToArray(), table);
            }
            catch (Exception ex) {
                RuntimeUtil.ReportException(ex);
            }
        }
Esempio n. 32
0
 public PluginManager(InternalPoderosaWorld pw)
 {
     _world = pw;
     _idToExtensionPoint = new TypedHashtable<string, ExtensionPoint>();
 }
Esempio n. 33
0
 public void Clear()
 {
     _dataForSSH1 = new TypedHashtable<string, string>();
     _dataForSSH2 = new TypedHashtable<string, string>();
 }
Esempio n. 34
0
 public PassphraseCache()
 {
     _data = new TypedHashtable<string, string>();
 }