コード例 #1
0
ファイル: LocalizeItemDlg.cs プロジェクト: gmartin7/l10nsharp
        /// ------------------------------------------------------------------------------------
        internal static DialogResult ShowDialog(ILocalizationManagerInternal <T> callingManager,
                                                string id, bool runInReadonlyMode)
        {
            if (callingManager != null && !callingManager.CanCustomizeLocalizations)
            {
                runInReadonlyMode = true;
            }

            var viewModel = new LocalizeItemDlgViewModel <T>(runInReadonlyMode);

            using (var dlg = new LocalizeItemDlg <T>(viewModel, id, callingManager))
                return(dlg.ShowDialog());
        }
コード例 #2
0
ファイル: LocalizeItemDlg.cs プロジェクト: vkarthim/l10nsharp
        /// ------------------------------------------------------------------------------------
        internal static DialogResult ShowDialog(LocalizationManager callingManager, IComponent component, bool runInReadonlyMode)
        {
            if (callingManager != null && !callingManager.CanCustomizeLocalizations)
            {
                runInReadonlyMode = true;
            }

            var viewModel = new LocalizeItemDlgViewModel(runInReadonlyMode);

            var id = (callingManager == null ? viewModel.GetObjIdFromAnyCache(component) :
                      callingManager.ComponentCache.FirstOrDefault(kvp => kvp.Key == component).Value);

            using (var dlg = new LocalizeItemDlg(viewModel, id, callingManager))
                return(dlg.ShowDialog());
        }
コード例 #3
0
ファイル: LocalizeItemDlg.cs プロジェクト: vkarthim/l10nsharp
        /// ------------------------------------------------------------------------------------
        private LocalizeItemDlg(LocalizeItemDlgViewModel viewModel, string id, LocalizationManager callingManager) : this()
        {
            _viewModel      = viewModel;
            _callingManager = callingManager;

            Initialize();

            if (id == null)
            {
                return;
            }

            var node = _viewModel.FindNode(id, _treeView.Nodes);

            if (node == null)
            {
                return;
            }

            _viewModel.CurrentNode = node;
            _treeView.SelectedNode = node;
            UpdateSingleItemView();
        }