public UserApiForwardViewModel(IHexApiService aHexApi, User aUser, ApiSite aApiSite)
        {
            mHexApi  = aHexApi;
            mUser    = aUser;
            mApiSite = aApiSite;

            mMessagesToForward = new ObservableCollection <EMessageType>(aApiSite.SupportedMessages);
            mMessagesToIgnore  = new ObservableCollection <EMessageType>();

            foreach (var theUserApiForward in aUser.Forwards)
            {
                if (theUserApiForward.Type == aApiSite.Type)
                {
                    mForwardToThis = theUserApiForward.ForwardToThis;
                    mApiKey        = theUserApiForward.ApiKey;

                    foreach (var theMessageType in aApiSite.SupportedMessages)
                    {
                        if (!theUserApiForward.Messages.Contains(theMessageType))
                        {
                            mMessagesToIgnore.Add(theMessageType);
                            mMessagesToForward.Remove(theMessageType);
                        }
                    }
                }
            }

            SendToRightCommand    = new RelayCommand <EMessageType>(SendToRight);
            SendToLeftCommand     = new RelayCommand <EMessageType>(SendToLeft);
            SendAllToRightCommand = new RelayCommand(SendAllToRight, () => MessagesToForward.Any());
            SendAllToLeftCommand  = new RelayCommand(SendAllToLeft, () => MessagesToIgnore.Any());
        }
Exemple #2
0
        public MainViewModel(IHexApiService aHexApi, IDialogService aDialogs)
        {
            mHexApi = aHexApi;

            if (!IsInDesignMode)
            {
                OpenSettingsCommand  = new RelayCommand(OpenSettings, () => !SettingsVisible);
                CloseSettingsCommand = new RelayCommand(CloseSettings, () => SettingsVisible);
            }
        }
Exemple #3
0
        public MessageViewModel(IHexApiService aHexService, IFileService aFileService, IDialogService aDialogs)
        {
            mHexApi  = aHexService;
            mFile    = aFileService;
            mDialogs = aDialogs;

            ShowMessageCommand = new RelayCommand <IMessage>(ShowMessage);
            PickMessageCommand = new RelayCommand(PickMessage);

            mHexApi.InitializationCompleted += HandleInitializationCompleted;
        }
        public SettingsViewModel(IHexApiService aHexApi)
        {
            mHexApi = aHexApi;

            mHexApi.InitializationCompleted += HandleInitializationCompleted;
        }
Exemple #5
0
        public AuctionHouseViewModel(IHexApiService aHexApi)
        {
            mHexApi = aHexApi;

            mHexApi.InitializationCompleted += HandleInitializationCompleted;
        }