Ejemplo n.º 1
0
        /// ------------------------------------------------------------------------------------
        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());
        }
Ejemplo n.º 2
0
        /// ------------------------------------------------------------------------------------
        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());
        }
Ejemplo n.º 3
0
        /// ------------------------------------------------------------------------------------
        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();
        }