Ejemplo n.º 1
0
        public void OnMenuItemClick(string name, MainViewContext context)
        {
            if (name != SHOW_SUB_MENU && name != GO_SUB_MENU)
            {
                return;
            }

            Regex rgx           = new Regex(GUID_PATTERN, RegexOptions.IgnoreCase);
            var   clipboardText = Clipboard.GetText(TextDataFormat.Text);
            var   match         = rgx.Match(clipboardText);

            if (match.Success == false)
            {
                return;
            }
            var id = new Guid(match.Groups[1].Value);

            //var obj = (await _objectsRepository.GetObjectsAsync(new Guid[] { id }, o => o, System.Threading.CancellationToken.None)).FirstOrDefault();
            //if (obj == null) return;
            if (name == SHOW_SUB_MENU)
            {
                DialogService.ShowInfo(id, _objectsRepository, _fileProvider, _tabServiceProvider, _fileModifier);
            }
            if (name == GO_SUB_MENU)
            {
                _tabServiceProvider.ShowElement(id);
            }
        }
Ejemplo n.º 2
0
        private void DialogOnClosing(object sender, CancelEventArgs cancelEventArgs)
        {
            _dataObjectService?.Dispose();
            var result = (bool)((PureWindow)sender).GetValue(Ascon.Pilot.Theme.Controls.Windows.Tools.WindowExtensions.CloseNonModalWindowResultProperty);

            if (_creationInfo.ObjectIdToShow != default(Guid) && _creationInfo.Exception == null && result)
            {
                _tabServiceProvider.ShowElement(_creationInfo.ObjectIdToShow);
            }
        }
Ejemplo n.º 3
0
 private void DoGoTo(object obj)
 {
     _tabServiceProvider.ShowElement(Id);
 }