예제 #1
0
        public static void InvokeAction(string @event, params object[] args)
        {
            switch (@event.ToLower())
            {
            case "clear":
                ClearPlace?.Invoke();
                break;

            case "exit":
                ExitApplication?.Invoke();
                break;

            case "ended":
                OnCommandEnded?.Invoke(args[0] as Socket);
                break;

            case "sleep":
                OnCommandSleep?.Invoke((Task)args[0]);
                break;

            case "before":
                CommandBeforeStart?.Invoke();
                break;

            default:
                throw new Exception("Unknown action!");
            }
        }
예제 #2
0
        public MainViewModel(IPortalPersistence model, PublisherDTO author)
        {
            _model     = model ?? throw new ArgumentNullException("model");
            _isLoaded  = false;
            _publisher = author;

            EditArticleCommand = new DelegateCommand(param => EditArticleAction((int)param));

            ExitCommand = new DelegateCommand(_ => ExitApplication?.Invoke(this, EventArgs.Empty));

            CreateArticleCommand = new DelegateCommand(_ => CreateArticleAction());

            Refresh();
        }
예제 #3
0
        public Updater(string version, string projectId, string publicKey, string updateUrl)
        {
            _updateUrl = updateUrl;
            _version   = version.ToString();
            _projectId = projectId;
            _publicKey = publicKey;

            m_Controller           = new updateController(_updateUrl, _version, _publicKey);
            m_Controller.projectId = _projectId;

            m_Controller.updateInstallerStarted += (s, e) =>
            {
                if (ExitApplication != null)
                {
                    ExitApplication.Invoke(this, EventArgs.Empty);
                }
            };
        }
예제 #4
0
 private void OnExitApplication()
 {
     ExitApplication?.Invoke(this, EventArgs.Empty);
 }
예제 #5
0
 private void ButtonExit_Click(object sender, RoutedEventArgs e)
 {
     ExitApplication?.Invoke(sender, EventArgs.Empty);
 }
예제 #6
0
 public void OnExitApplication()
 {
     ExitApplication?.Invoke();
 }
예제 #7
0
 protected virtual void OnExitApplication(EventArgs e)
 {
     ExitApplication?.Invoke(this, e);
 }