Example #1
0
 public HelpWindow()
 {
     InitializeComponent();
     _dataContext = new HelpViewModel(Token);
     DataContext = _dataContext;
     Closed += HelpWindow_Closed;
     AddKeyBindings<BaseEntity>();
 }
Example #2
0
 public void HelpViewModel_OnViewLoaded_HelpViewIsNull_IsViewAvailableIsFalse()
 {
     //------------Setup for test--------------------------
     //const string uri = "http://community.warewolf.io/";
     var networkHelper = new Mock<INetworkHelper>();
     var helpViewModel = new HelpViewModel(networkHelper.Object,null, false);
     //------------Execute Test---------------------------
     helpViewModel.OnViewisLoaded(null);
     //------------Assert Results-------------------------
     Assert.AreEqual(null, helpViewModel.HelpViewWrapper);
     Assert.IsFalse(helpViewModel.IsViewAvailable);
 }
Example #3
0
 public void HelpViewModel_OnViewLoaded_ValidHelpView_HelpViewIsSet()
 {
     //------------Setup for test--------------------------
    // const string uri = "http://community.warewolf.io/";
     var networkHelper = new Mock<INetworkHelper>();
     var helpViewModel = new HelpViewModel(networkHelper.Object,null, true);// { Uri = uri };
     var helpViewWrapper = new Mock<IHelpViewWrapper>(); 
     //------------Execute Test---------------------------
     helpViewModel.OnViewisLoaded(helpViewWrapper.Object);
     //------------Assert Results-------------------------
     Assert.AreEqual(helpViewWrapper.Object, helpViewModel.HelpViewWrapper);
     Assert.IsTrue(helpViewModel.IsViewAvailable);
 }
Example #4
0
 public ActionResult API(string version, string service)
 {
     HelpViewModel model = new HelpViewModel();
     if (string.IsNullOrEmpty(version) && string.IsNullOrEmpty(service))
     {
         ViewBag.Title = "API Help - " + Config.Title;
         return View("~/Areas/Help/Views/Help/API/API.cshtml", model);
     }
     else if(!string.IsNullOrEmpty(version) && !string.IsNullOrEmpty(service))
     {
         ViewBag.Title = service + " API " + version + " Help - " + Config.Title;
         return View("~/Areas/Help/Views/Help/API/" + version + "/" + service + ".cshtml", model);
     }
     return RedirectToRoute("*.Error.Http404");
 }
Example #5
0
        public void HelpViewModel_Handle_TabClosedMessageContextIsThisInstance_IsDisposed()
        {
            //------------Setup for test--------------------------
            var        helpViewWrapper = new Mock <IHelpViewWrapper>();
            WebBrowser webBrowser      = new WebBrowser();

            helpViewWrapper.SetupGet(m => m.WebBrowser).Returns(webBrowser);
            helpViewWrapper.Setup(m => m.Navigate(It.IsAny <string>())).Verifiable();
            var      helpViewModel = new HelpViewModel(null, helpViewWrapper.Object, false);
            HelpView helpView      = new HelpView();

            helpViewWrapper.SetupGet(m => m.HelpView).Returns(helpView);
            //------------Execute Test---------------------------
            helpViewModel.Handle(new TabClosedMessage(helpViewModel));
            //------------Assert Results-------------------------
            Assert.IsTrue(helpViewModel.HelpViewDisposed);
        }
        public async Task <IActionResult> Index()
        {
            var model = new HelpViewModel()
            {
                IsSignedIn = User.Identity.IsAuthenticated,
            };

            if (model.IsSignedIn)
            {
                var user = await _userManager.GetUserAsync(User);

                model.HasFavorites    = user?.FavoriteLines?.Count > 0;
                model.IsLinkedToAlexa = !string.IsNullOrEmpty(user?.AlexaToken);
            }

            return(View(model));
        }
Example #7
0
        /// <summary>
        /// Registers the instances.
        /// </summary>
        private void ShowOverlays(int processId)
        {
            Execute.OnUIThread(() =>
            {
                this._currentDockingHelper = new DockingHelper(processId, this._settingsService);

                // Keyboard
                var keyboarHelper    = new PoeKeyboardHelper(processId);
                this._keyboardLurker = new KeyboardLurker(processId, this._settingsService, keyboarHelper);

                // Mouse
                this._mouseLurker          = new MouseLurker(processId, this._settingsService);
                this._mouseLurker.Newitem += this.MouseLurker_Newitem;

                // Clipboard
                this._clipboardLurker = new ClipboardLurker();

                this._container.RegisterInstance(typeof(ProcessLurker), null, this._processLurker);
                this._container.RegisterInstance(typeof(ClientLurker), null, this._currentLurker);
                this._container.RegisterInstance(typeof(ClipboardLurker), null, this._clipboardLurker);
                this._container.RegisterInstance(typeof(DockingHelper), null, this._currentDockingHelper);
                this._container.RegisterInstance(typeof(PoeKeyboardHelper), null, keyboarHelper);

                this._incomingTradeBarOverlay = this._container.GetInstance <TradebarViewModel>();
                this._outgoingTradeBarOverlay = this._container.GetInstance <OutgoingbarViewModel>();
                this._lifeBulbOverlay         = this._container.GetInstance <LifeBulbViewModel>();
                this._manaBulbOverlay         = this._container.GetInstance <ManaBulbViewModel>();
                this._afkService     = this._container.GetInstance <AfkService>();
                this._hideoutOverlay = this._container.GetInstance <HideoutViewModel>();
                this._helpOverlay    = this._container.GetInstance <HelpViewModel>();
                this._helpOverlay.Initialize(this.ToggleBuildHelper);
                this._buildViewModel = this._container.GetInstance <BuildViewModel>();

                if (this._settingsService.BuildHelper)
                {
                    this.ActivateItem(this._helpOverlay);
                }

                this.ActivateItem(this._incomingTradeBarOverlay);
                this.ActivateItem(this._outgoingTradeBarOverlay);
                this.ActivateItem(this._lifeBulbOverlay);
                this.ActivateItem(this._manaBulbOverlay);
                this.ActivateItem(this._hideoutOverlay);
            });
        }
Example #8
0
        public ActionResult Edit(HelpViewModel model)
        {
            if (ModelState.IsValid)
            {
                try
                {
                    dl.Update(model);
                    return(RedirectToAction("Index", new { groupId = model.HelpGroupId }));
                }
                catch (Exception err)
                {
                    ModelState.AddModelError("", err.Message);
                }
            }

            ViewBag.Group = dl.GetHelpGroupsDdl(model.HelpGroupId);
            return(View(model));
        }
Example #9
0
        public ActionResult ChangeContent(HelpViewModel help)
        {
            if (ModelState.IsValid)
            {
                try
                {
                    Mapper.CreateMap <HelpViewModel, Help>();
                    Help content = Mapper.Map <HelpViewModel, Help>(help);

                    var contentdb = _helpBusiness.GetListWT(c => c.ContentType == help.ContentType).FirstOrDefault();
                    if (contentdb == null)
                    {
                        content.TokenKey = GlobalMethods.GetToken();
                        _helpBusiness.Insert(content);
                        _unitOfWork.SaveChanges();
                    }
                    else
                    {
                        contentdb.Contents = content.Contents;
                        _helpBusiness.Update(contentdb);
                        _unitOfWork.SaveChanges();
                    }
                    TempData["Success"]   = "Content changed Successfully!!";
                    TempData["isSuccess"] = "true";
                    return(RedirectToAction("Index", new { helpType = help.ContentType }));
                }
                catch (Exception ex)
                {
                    TempData["Success"]   = "Failed to change Content!!";
                    TempData["isSuccess"] = "false";
                    return(RedirectToAction("Index", new { helpType = help.ContentType }));

                    throw ex;
                }
            }
            else
            {
                TempData["Success"]   = ModelState.Values.SelectMany(m => m.Errors).FirstOrDefault().ErrorMessage;
                TempData["isSuccess"] = "false";
            }
            return(RedirectToAction("Index"));
        }
        public MainViewModel()
        {
            var navigationState = new NavigationStateViewModel();

            _dialog        = new DialogViewModel();
            _walletManager = new WalletManagerViewModel(navigationState, "Add Wallet");

            var helpViewModel           = new HelpViewModel(navigationState);
            var walletExplorerViewModel = new WalletExplorerViewModel(navigationState, _walletManager);
            var settingsViewModel       = new SettingsViewModel(navigationState);

            HomeCommand = ReactiveCommand.Create(() => navigationState.Screen().Router.NavigateAndReset.Execute(walletExplorerViewModel));

#if !USE_DIALOG
            HelpCommand = ReactiveCommand.Create(() => navigationState.Screen().Router.Navigate.Execute(helpViewModel));
#else
            HelpCommand = ReactiveCommand.Create(() => navigationState.Dialog().Router.Navigate.Execute(helpViewModel));
#endif

#if !USE_DIALOG
            AddWalletCommand = ReactiveCommand.Create(() => navigationState.Screen().Router.Navigate.Execute(walletManager));
#else
            AddWalletCommand = ReactiveCommand.Create(() => navigationState.Dialog().Router.Navigate.Execute(_walletManager));
#endif

#if !USE_DIALOG
            SettingsCommand = ReactiveCommand.Create(() => navigationState.Screen().Router.Navigate.Execute(settingsViewModel));
#else
            SettingsCommand = ReactiveCommand.Create(() => navigationState.Dialog().Router.Navigate.Execute(settingsViewModel));
#endif
            _walletManager.Home = walletExplorerViewModel;

            navigationState.Screen     = () => this;
            navigationState.Dialog     = () => _dialog;
            navigationState.NextView   = () => walletExplorerViewModel;
            navigationState.CancelView = () => walletExplorerViewModel;

            Router.NavigateAndReset.Execute(walletExplorerViewModel);

            // Router.NavigateAndReset.Execute(new HomeViewModel(this));
        }
Example #11
0
 public ActionResult Help(HelpViewModel query)
 {
     ViewBag.FixedFooter = false;
     if (ModelState.IsValid)
     {
         MailAddress from    = new MailAddress(ConfigurationManager.AppSettings["EmailSender"]);
         MailAddress to      = new MailAddress(ConfigurationManager.AppSettings["EmailReceiver"]);
         MailMessage message = new MailMessage(from, to);
         message.Subject    = query.Title;
         message.Body       = "<h2>E-mail отправителя: " + query.Email + "</h2>" + "<p><b>Текст запроса: </b>" + query.Comment + "</p>";
         message.IsBodyHtml = true;
         SmtpClient smtp = new SmtpClient("smtp.mail.ru", 587);
         smtp.Credentials = new NetworkCredential(ConfigurationManager.AppSettings["EmailSender"], ConfigurationManager.AppSettings["SenderPass"]);
         smtp.EnableSsl   = true;
         smtp.Send(message);
         ViewBag.SuccessSend = true;
         return(View());
     }
     ViewBag.SuccessSend = false;
     return(View(query));
 }
Example #12
0
 public async Task HelpViewModel_LoadBrowserUri_HasNoInternetConnection_NavigatesToOnDiskResource()
 {
     //------------Setup for test--------------------------
     const string uri = "http://community.warewolf.io/";
     var networkHelper = new Mock<INetworkHelper>();
     var task = new Task<bool>(() => false);
     task.RunSynchronously();
     networkHelper.Setup(m => m.HasConnectionAsync(It.IsAny<string>()))
         .Returns(task);
     var helpViewWrapper = new Mock<IHelpViewWrapper>(); 
     helpViewWrapper.Setup(m => m.Navigate(It.IsAny<string>())).Verifiable();
     var helpViewModel = new HelpViewModel(networkHelper.Object,helpViewWrapper.Object, false);
     HelpView helpView = new HelpView();
     helpViewWrapper.SetupGet(m => m.HelpView).Returns(helpView);
     //------------Execute Test---------------------------
     await helpViewModel.LoadBrowserUri(uri);
     //------------Assert Results-------------------------
     helpViewWrapper.Verify(m => m.Navigate(It.IsAny<string>()), Times.Once());
     Assert.IsNotNull(helpViewModel.Uri);
     Assert.IsNotNull(helpViewModel.ResourcePath);
 }
Example #13
0
        /// <summary>
        /// create new window or show it on top
        /// </summary>
        /// <param name="topic"></param>
        private void OpenHelpWIndow(string topic)
        {
            if (help == null)
            {
                help = new HelpViewModel(topic);
                help.PropertyChanged += (s, e1) =>
                {
                    if (e1.PropertyName == "IsClosed")
                    {
                        help = null;
                    }
                };
                // to access help form modal dialog
                // https://eprystupa.wordpress.com/2008/07/28/running-wpf-application-with-multiple-ui-threads/
                var thread = new Thread(() =>
                {
                    var window = new HelpWindow();
                    ShowWindow(help, window, false);

                    this.Closed += (s, e1) =>
                    {
                        window.Dispatcher.Invoke((Action)(() =>
                        {
                            window.Close();
                        }));
                    };
                    window.Closed += (s, e2) => window.Dispatcher.InvokeShutdown();
                    System.Windows.Threading.Dispatcher.Run();
                });

                thread.SetApartmentState(ApartmentState.STA);
                thread.Start();
            }
            else
            {
                help.Topic    = topic;
                help.IsActive = true;
            }
        }
Example #14
0
        /// <summary>
        /// Initializes a new instance of the HelpWindow class.
        /// </summary>
        /// <param name="helpObject">The object with help information.</param>
        public HelpWindow(PSObject helpObject)
        {
            InitializeComponent();
            this.viewModel = new HelpViewModel(helpObject, this.DocumentParagraph);
            CommonHelper.SetStartingPositionAndSize(
                this,
                HelpWindowSettings.Default.HelpWindowTop,
                HelpWindowSettings.Default.HelpWindowLeft,
                HelpWindowSettings.Default.HelpWindowWidth,
                HelpWindowSettings.Default.HelpWindowHeight,
                double.Parse((string)HelpWindowSettings.Default.Properties["HelpWindowWidth"].DefaultValue, CultureInfo.InvariantCulture.NumberFormat),
                double.Parse((string)HelpWindowSettings.Default.Properties["HelpWindowHeight"].DefaultValue, CultureInfo.InvariantCulture.NumberFormat),
                HelpWindowSettings.Default.HelpWindowMaximized);

            this.ReadZoomUserSetting();

            this.viewModel.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(this.ViewModel_PropertyChanged);
            this.DataContext = this.viewModel;

            this.Loaded += new RoutedEventHandler(this.HelpDialog_Loaded);
            this.Closed += new System.EventHandler(this.HelpDialog_Closed);
        }
Example #15
0
        //Help Action
        public ActionResult Help(int id = 0)
        {
            ViewBag.Message = "Available Commands";

            if (id == 0)
            {
                var gameId = Session["gameId"] as int?;

                story  = (Story)FindInDatabase("story", gameId.Value);
                player = (Player)FindInDatabase("player", gameId.Value);
                map    = (Map)FindInDatabase("map", gameId.Value);
            }
            else
            {
                story  = (Story)FindInDatabase("story", id);
                player = (Player)FindInDatabase("player", id);
                map    = (Map)FindInDatabase("map", id);
            }

            HelpViewModel helpViewModel = new HelpViewModel(player);

            return(View(helpViewModel));
        }
        public ApplicationController(Lazy<ShellViewModel> shellViewModelLazy,
            Lazy<SettingsViewModel> settingsViewModelLazy,
            Lazy<AboutViewModel> aboutViewModelLazy, Lazy<HelpViewModel> helpViewModelLazy,
            Lazy<LogViewModel> logViewModelLazy,
            Lazy<ShellService> shellServiceLazy, CompositionContainer compositionContainer,
            Lazy<IAccountAuthenticationService> accountAuthenticationServiceLazy, IShellController shellController,
            Lazy<SystemTrayNotifierViewModel> lazySystemTrayNotifierViewModel,
            IGuiInteractionService guiInteractionService, ILogController logController)
        {
            //ViewModels
            _shellViewModel = shellViewModelLazy.Value;
            _settingsViewModel = settingsViewModelLazy.Value;
            _aboutViewModel = aboutViewModelLazy.Value;
            _helpViewModel = helpViewModelLazy.Value;
            _logViewModel = logViewModelLazy.Value;
            _systemTrayNotifierViewModel = lazySystemTrayNotifierViewModel.Value;
            //Commands
            _shellViewModel.Closing += ShellViewModelClosing;
            _exitCommand = new DelegateCommand(Close);

            //Services
            AccountAuthenticationService = accountAuthenticationServiceLazy.Value;

            _shellService = shellServiceLazy.Value;
            _shellService.ShellView = _shellViewModel.View;
            _shellService.SettingsView = _settingsViewModel.View;
            _shellService.AboutView = _aboutViewModel.View;
            _shellService.HelpView = _helpViewModel.View;
            _shellService.LogView = _logViewModel.View;
            _shellController = shellController;
            _guiInteractionService = guiInteractionService;
            _logController = logController;
            if (_shellViewModel.IsSettingsVisible)
            {
                _settingsViewModel.Load();
            }
        }
        public ApplicationController(Lazy <ShellViewModel> shellViewModelLazy,
                                     Lazy <SettingsViewModel> settingsViewModelLazy,
                                     Lazy <AboutViewModel> aboutViewModelLazy, Lazy <HelpViewModel> helpViewModelLazy,
                                     Lazy <LogViewModel> logViewModelLazy,
                                     Lazy <ShellService> shellServiceLazy, CompositionContainer compositionContainer,
                                     Lazy <IAccountAuthenticationService> accountAuthenticationServiceLazy, IShellController shellController,
                                     Lazy <SystemTrayNotifierViewModel> lazySystemTrayNotifierViewModel,
                                     IGuiInteractionService guiInteractionService, ILogController logController)
        {
            //ViewModels
            _shellViewModel              = shellViewModelLazy.Value;
            _settingsViewModel           = settingsViewModelLazy.Value;
            _aboutViewModel              = aboutViewModelLazy.Value;
            _helpViewModel               = helpViewModelLazy.Value;
            _logViewModel                = logViewModelLazy.Value;
            _systemTrayNotifierViewModel = lazySystemTrayNotifierViewModel.Value;
            //Commands
            _shellViewModel.Closing += ShellViewModelClosing;
            _exitCommand             = new DelegateCommand(Close);

            //Services
            AccountAuthenticationService = accountAuthenticationServiceLazy.Value;

            _shellService              = shellServiceLazy.Value;
            _shellService.ShellView    = _shellViewModel.View;
            _shellService.SettingsView = _settingsViewModel.View;
            _shellService.AboutView    = _aboutViewModel.View;
            _shellService.HelpView     = _helpViewModel.View;
            _shellService.LogView      = _logViewModel.View;
            _shellController           = shellController;
            _guiInteractionService     = guiInteractionService;
            _logController             = logController;
            if (_shellViewModel.IsSettingsVisible)
            {
                _settingsViewModel.Load();
            }
        }
        public async Task HelpViewModel_LoadBrowserUri_HasInternetConnection_NavigatesToUrl()
        {
            //------------Setup for test--------------------------
            const string uri  = "http://community.warewolf.io/";
            var          task = new Task <bool>(() => true);

            task.RunSynchronously();
            var helpViewWrapper = new Mock <IHelpViewWrapper>();
            var webBrowser      = new Frame();

            helpViewWrapper.SetupGet(m => m.WebBrowser).Returns(webBrowser);
            helpViewWrapper.Setup(m => m.Navigate(It.IsAny <string>())).Verifiable();
            var helpViewModel = new HelpViewModel(helpViewWrapper.Object, false);
            var helpView      = new HelpView();

            helpViewWrapper.SetupGet(m => m.HelpView).Returns(helpView);
            //------------Execute Test---------------------------
            await helpViewModel.LoadBrowserUri(uri);

            //------------Assert Results-------------------------
            helpViewWrapper.Verify(m => m.Navigate(It.IsAny <string>()), Times.Once());
            Assert.IsNotNull(helpViewModel.Uri);
            Assert.IsNull(helpViewModel.ResourcePath);
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            AndroidApplication = Application as AndroidApplication;
            AndroidApplication.Logger.Debug(() => $"HelpActivity:OnCreate");

            base.OnCreate(savedInstanceState);
            Xamarin.Essentials.Platform.Init(this, savedInstanceState);
            SetContentView(Resource.Layout.activity_help);

            HelpTextScroller = FindViewById <ScrollView>(Resource.Id.help_scroller);
            HelpText         = FindViewById <TextView>(Resource.Id.help_text);
            // make links clickable
            HelpText.MovementMethod = LinkMovementMethod.Instance;

            var factory = AndroidApplication.IocContainer.Resolve <ViewModelFactory>();

            ViewModel = new ViewModelProvider(this, factory).Get(Java.Lang.Class.FromType(typeof(HelpViewModel))) as HelpViewModel;
            Lifecycle.AddObserver(ViewModel);
            SetupViewModelObservers();

            ViewModel.Initialise();

            AndroidApplication.Logger.Debug(() => $"HelpActivity:OnCreate - end");
        }
Example #20
0
 public ActionResult Git()
 {
     ViewBag.Title = "Git Service Help - " + Config.Title;
     HelpViewModel model = new HelpViewModel();
     return View("~/Areas/Help/Views/Help/Git.cshtml", model);
 }
Example #21
0
 public ActionResult RSS()
 {
     ViewBag.Title = "RSS Help - " + Config.Title;
     HelpViewModel model = new HelpViewModel();
     return View("~/Areas/Help/Views/Help/RSS.cshtml", model);
 }
Example #22
0
 private void Help_clicked(object sender, RoutedEventArgs e)
 {
     DataContext             = new HelpViewModel();
     ChangingContent.Content = new HelpViewModel();
 }
Example #23
0
 public ActionResult Blog()
 {
     ViewBag.Title = "Blogging Help - " + Config.Title;
     HelpViewModel model = new HelpViewModel();
     return View("~/Areas/Help/Views/Help/Blog.cshtml", model);
 }
Example #24
0
 public ActionResult Upload()
 {
     ViewBag.Title = "Upload Service Help - " + Config.Title;
     HelpViewModel model = new HelpViewModel();
     return View("~/Areas/Help/Views/Help/Upload.cshtml", model);
 }
Example #25
0
 private void FirstHelpCommand_Execute()
 {
     HelpViewModel vm     = new HelpViewModel("Allgemeine Bedinung", "Um eine neue Datei anzulegen gehen sie auf Datei>Neu\nUm einer geöffneten Datei ein Snippet hinzuzufügen, gehen sie auf Snippet>Neu");
     HelpDialog    dialog = new HelpDialog(vm); dialog.ShowDialog();
 }
Example #26
0
 public void HelpViewModel_Constructor_WorkSurfaceContextIsInitializedToHelp()
 {
     //------------Execute Test---------------------------
     var helpViewModel = new HelpViewModel();
     //------------Assert Results-------------------------
     Assert.AreEqual(WorkSurfaceContext.Help, helpViewModel.WorkSurfaceContext);
 }
Example #27
0
 public HelpPage()
 {
     InitializeComponent();
     viewModel      = new HelpViewModel();
     BindingContext = viewModel;
 }
Example #28
0
 public void InstantiateViewModel()
 {
     _deviceWrapper = new Mock <IDeviceWrapper>();
     _viewModel     = new HelpViewModel(_deviceWrapper.Object);
 }
Example #29
0
 public ActionResult Tools()
 {
     ViewBag.Title = "Tool Help - " + Config.Title;
     HelpViewModel model = new HelpViewModel();
     return View("~/Areas/Help/Views/Help/Tools.cshtml", model);
 }
Example #30
0
        // GET
        public IActionResult Index()
        {
            var vModel = new HelpViewModel();

            return(View(vModel));
        }
        public void Navigate(NavigateTypes navigateTypes, object context = null)
        {
            ViewModelBase viewModel = null;

            switch (navigateTypes)
            {
            case NavigateTypes.Back:
                if (_History.Count > 0)
                {
                    viewModel = _History.Pop();
                }

                if (viewModel == null)
                {
                    viewModel = _ProfessionsViewModel;
                }

                break;

            case NavigateTypes.Help:
                if (_HelpViewModel == null)
                {
                    _HelpViewModel = new HelpViewModel();
                }

                viewModel = _HelpViewModel;

                if (_CurrentViewModel != null)
                {
                    _History.Push(_CurrentViewModel);
                }

                break;

            case NavigateTypes.Error:
                var exception = (Exception)context;

                viewModel = new ErrorViewModel(exception);
                break;

            case NavigateTypes.Profession:
                var professionName = (string)context;
                ProfessionViewModel professionViewModel;

                if (!_ProfessionViewModels.TryGetValue(professionName, out professionViewModel))
                {
                    var profession = BulkOrderDeedManager.Instance.Professions.FirstOrDefault(p => String.Compare(professionName, p.Name, true) == 0);

                    if (profession != null)
                    {
                        professionViewModel = new ProfessionViewModel(profession);
                        _ProfessionViewModels[professionName] = professionViewModel;
                        viewModel = professionViewModel;
                    }
                }
                else
                {
                    viewModel = professionViewModel;
                }

                if (viewModel != null && _CurrentViewModel != null)
                {
                    _History.Push(_CurrentViewModel);
                }

                break;

            case NavigateTypes.BulkOrderDeedsForReward:
                var professionRewardSearchCriteria = (ProfessionRewardSearchCriteria)context;
                BulkOrderDeedsForRewardViewModel bulkOrderDeedsForRewardViewModel;

                if (!_BulkOrderDeedsForRewardViewModels.TryGetValue(professionRewardSearchCriteria, out bulkOrderDeedsForRewardViewModel))
                {
                    bulkOrderDeedsForRewardViewModel = new BulkOrderDeedsForRewardViewModel(professionRewardSearchCriteria);
                    _BulkOrderDeedsForRewardViewModels[professionRewardSearchCriteria] = bulkOrderDeedsForRewardViewModel;
                }

                viewModel = bulkOrderDeedsForRewardViewModel;

                if (viewModel != null && _CurrentViewModel != null)
                {
                    _History.Push(_CurrentViewModel);
                }

                break;

            case NavigateTypes.BulkOrderDeedCollection:
                if (_CollectionViewModel == null)
                {
                    _CollectionViewModel = new CollectionViewModel();
                }

                _CollectionViewModel.RefreshIfNecessary();
                viewModel = _CollectionViewModel;

                if (_CurrentViewModel != null)
                {
                    _History.Push(_CurrentViewModel);
                }

                break;

            case NavigateTypes.AddBulkOrderDeedToCollection:
                var collectionBulkOrderDeed = (CollectionBulkOrderDeed)context;

                viewModel = new AddBulkOrderDeedToCollectionViewModel(collectionBulkOrderDeed);

                if (_CurrentViewModel != null)
                {
                    _History.Push(_CurrentViewModel);
                }

                break;

            default:
            case NavigateTypes.Professions:
                try
                {
                    if (_ProfessionsViewModel == null)
                    {
                        _ProfessionsViewModel = new ProfessionsViewModel();
                    }

                    viewModel = _ProfessionsViewModel;
                }
                catch (Exception ex)
                {
                    Navigate(NavigateTypes.Error, ex);
                }

                _History.Clear();

                break;
            }

            if (viewModel != null)
            {
                _CurrentViewModel = viewModel;
                App.Current.MainWindow.DataContext = _CurrentViewModel;
            }
        }
Example #32
0
 // Prywatne pola poszczególnych modeli widoków są przekazywane w konstruktorze
 // Widokiem domyślnym jest widok z pomocą
 public ShellViewModel(SlotsViewModel slotsVM, RouletteViewModel rouletteVM, BlackjackViewModel blackjackVM, HelpViewModel helpVM)
 {
     _slotsVM     = slotsVM;
     _rouletteVM  = rouletteVM;
     _blackjackVM = blackjackVM;
     _helpVM      = helpVM;
     ActivateItem(_helpVM);
 }
Example #33
0
 public HelpWindow(Settings settings)
 {
     DataContext = new HelpViewModel(settings);
     InitializeComponent();
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="HelpView" />
 /// </summary>
 public HelpView()
 {
     InitializeComponent();
     DataContext = new HelpViewModel(Browser, Close);
 }
Example #35
0
 public CharSelectViewModel()
 {
     GameSettings.HelpIsOpen = false;
     this.HelpViewModel      = new HelpViewModel();
 }
Example #36
0
        /// <summary>
        /// Handles the OnSave event of the SettingsService control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="EventArgs" /> instance containing the event data.</param>
        private async void SettingsService_OnSave(object sender, EventArgs e)
        {
            await this.CheckPledgeStatus();

            if (this._settingsService.BuildHelper)
            {
                if (this._helpOverlay == null && PoeApplicationContext.IsRunning)
                {
                    this._helpOverlay = this._container.GetInstance <HelpViewModel>();
                    this._helpOverlay.Initialize(this.ToggleBuildHelper);
                    this.ActivateItem(this._helpOverlay);
                    this.ActivateItem(this._buildViewModel);

                    if (this._skillTimelineOverlay != null && this._settingsService.TimelineEnabled)
                    {
                        this.ActivateItem(this._skillTimelineOverlay);
                    }
                }
            }
            else
            {
                if (this._helpOverlay != null)
                {
                    this.DeactivateItem(this._helpOverlay, true);
                    this._helpOverlay = null;
                }

                if (this._buildViewModel != null)
                {
                    this.DeactivateItem(this._buildViewModel, true);
                }

                if (this._skillTimelineOverlay != null)
                {
                    this.DeactivateItem(this._skillTimelineOverlay, true);
                }
            }

            if (this._settingsService.IncomingTradeEnabled)
            {
                this.ActivateItem(this._incomingTradeBarOverlay);
            }
            else
            {
                this.DeactivateItem(this._incomingTradeBarOverlay, true);
            }

            if (this._settingsService.OutgoingTradeEnabled)
            {
                this.ActivateItem(this._outgoingTradeBarOverlay);
            }
            else
            {
                this.DeactivateItem(this._outgoingTradeBarOverlay, true);
            }

            if (this._settingsService.HideoutEnabled)
            {
                this.ActivateItem(this._hideoutOverlay);
            }
            else
            {
                this.DeactivateItem(this._hideoutOverlay, true);
            }
        }
Example #37
0
 private void ShowAddRemoveHelpCommand_Execute()
 {
     HelpViewModel vm     = new HelpViewModel("Sprachen hinzufügen und löschen", "Um eine Sprache zu löschen, dürfen keine Verweise mehr auf ihr liegen. \nBedenke, dass die Sprachen nur für die atuelle Datei gelten.");
     HelpDialog    dialog = new HelpDialog(vm); dialog.ShowDialog();
 }
Example #38
0
 public HelpView()
 {
     InitializeComponent();
     DataContext = new HelpViewModel();
 }
Example #39
0
        /// <summary>
        /// Registers the instances.
        /// </summary>
        private void ShowOverlays(int processId)
        {
            Execute.OnUIThread(() =>
            {
                this._currentDockingHelper = new DockingHelper(processId, this._settingsService);

                // Keyboard
                var keyboarHelper    = new PoeKeyboardHelper(processId);
                this._keyboardLurker = new KeyboardLurker(processId, this._settingsService, this._keyCodeService, keyboarHelper);
                this._keyboardLurker.BuildToggled    += this.KeyboardLurker_BuildToggled;
                this._keyboardLurker.OpenWikiPressed += this.KeyboardLurker_OpenWikiPressed;

                // Mouse
                this._mouseLurker                 = new MouseLurker(processId, this._settingsService);
                this._mouseLurker.ItemDetails    += this.ShowItemDetails;
                this._mouseLurker.ItemIdentified += this.ShowMap;

                // Clipboard
                this._clipboardLurker = new ClipboardLurker();

                this._container.RegisterInstance(typeof(ProcessLurker), null, this._processLurker);
                this._container.RegisterInstance(typeof(MouseLurker), null, this._mouseLurker);
                this._container.RegisterInstance(typeof(ClientLurker), null, this._currentLurker);
                this._container.RegisterInstance(typeof(PlayerService), null, this._currentCharacterService);
                this._container.RegisterInstance(typeof(ClipboardLurker), null, this._clipboardLurker);
                this._container.RegisterInstance(typeof(DockingHelper), null, this._currentDockingHelper);
                this._container.RegisterInstance(typeof(PoeKeyboardHelper), null, keyboarHelper);
                this._container.RegisterInstance(typeof(KeyboardLurker), null, this._keyboardLurker);

                this._skillTimelineOverlay    = this._container.GetInstance <BuildTimelineViewModel>();
                this._incomingTradeBarOverlay = this._container.GetInstance <TradebarViewModel>();
                this._outgoingTradeBarOverlay = this._container.GetInstance <OutgoingbarViewModel>();
                this._popup           = this._container.GetInstance <PopupViewModel>();
                this._lifeBulbOverlay = this._container.GetInstance <LifeBulbViewModel>();
                this._manaBulbOverlay = this._container.GetInstance <ManaBulbViewModel>();
                this._afkService      = this._container.GetInstance <AfkService>();
                this._hideoutOverlay  = this._container.GetInstance <HideoutViewModel>();
                this._helpOverlay     = this._container.GetInstance <HelpViewModel>();
                this._helpOverlay.Initialize(this.ToggleBuildHelper);
                this._buildViewModel = this._container.GetInstance <BuildViewModel>();

                if (this._settingsService.BuildHelper)
                {
                    this.ActivateItem(this._buildViewModel);
                }

                if (this._settingsService.BuildHelper)
                {
                    if (this._settingsService.TimelineEnabled)
                    {
                        this.ActivateItem(this._skillTimelineOverlay);
                    }

                    this.ActivateItem(this._helpOverlay);
                }

                if (this._settingsService.IncomingTradeEnabled)
                {
                    this.ActivateItem(this._incomingTradeBarOverlay);
                }

                if (this._settingsService.OutgoingTradeEnabled)
                {
                    this.ActivateItem(this._outgoingTradeBarOverlay);
                }

                if (this._settingsService.HideoutEnabled)
                {
                    this.ActivateItem(this._hideoutOverlay);
                }

                this.ActivateItem(this._lifeBulbOverlay);
                this.ActivateItem(this._manaBulbOverlay);
            });
        }
Example #40
0
 public ActionResult Mumble()
 {
     ViewBag.Title = "Mumble Server Help - " + Config.Title;
     HelpViewModel model = new HelpViewModel();
     return View("~/Areas/Help/Views/Help/Mumble.cshtml", model);
 }
Example #41
0
 public ActionResult Markdown()
 {
     ViewBag.Title = "Markdown Help - " + Config.Title;
     HelpViewModel model = new HelpViewModel();
     return View("~/Areas/Help/Views/Help/Markdown.cshtml", model);
 }
Example #42
0
 public void HelpViewModel_Constructor_IsViewAvailableIsInitializedToTrue()
 {
     //------------Execute Test---------------------------
     var helpViewModel = new HelpViewModel();
     //------------Assert Results-------------------------
     Assert.IsTrue(helpViewModel.IsViewAvailable);
 }
Example #43
0
 public ActionResult IRC()
 {
     ViewBag.Title = "IRC Server Help - " + Config.Title;
     HelpViewModel model = new HelpViewModel();
     return View("~/Areas/Help/Views/Help/IRC.cshtml", model);
 }
Example #44
0
 public void HelpViewModel_Handle_TabClosedMessageContextIsAnotherInstance_IsNotDisposed()
 {
     //------------Setup for test--------------------------
     var helpViewWrapper = new Mock<IHelpViewWrapper>();
     WebBrowser webBrowser = new WebBrowser();
     helpViewWrapper.SetupGet(m => m.WebBrowser).Returns(webBrowser);
     helpViewWrapper.Setup(m => m.Navigate(It.IsAny<string>())).Verifiable();
     var helpViewModel = new HelpViewModel(null, helpViewWrapper.Object, false);
     HelpView helpView = new HelpView();
     helpViewWrapper.SetupGet(m => m.HelpView).Returns(helpView);
     //------------Execute Test---------------------------
     helpViewModel.Handle(new TabClosedMessage(new HelpViewModel()));
     //------------Assert Results-------------------------
     Assert.IsFalse(helpViewModel.HelpViewDisposed);
 }
Example #45
0
 public HelpView(HelpViewModel helpViewModel)
 {
     InitializeComponent();
     this.DataContext = helpViewModel;
 }
Example #46
0
 public ActionResult Index()
 {
     ViewBag.Title = "Help - " + Config.Title;
     HelpViewModel model = new HelpViewModel();
     return View(model);
 }
Example #47
0
        public override IDock CreateLayout()
        {
            // - В будущем текущий язык среды будет подгружаться с файла
            Localizer.GetInstance().LoadLanguage("en-EN");
            var Dict = Semantic.Scripts.Localizer.GetInstance().Strings;

            // - Подготовка панелей для объединения в layout
            // - Страница "Добро пожаловать"
            var welcome = new WelcomeViewModel
            {
                Id    = "Welcome",
                Title = Dict["WelcomePage"]
            };

            // - Панель "Проект"
            var project = new ProjectViewModel
            {
                Id    = "Project",
                Title = Dict["Project"]
            };

            // - Панель "Задачник"
            var taskbook = new TaskbookViewModel
            {
                Id    = "Taskbook",
                Title = Dict["Taskbook"]
            };

            // - Панель "Документация"
            var help = new HelpViewModel
            {
                Id    = "Help",
                Title = Dict["Help"]
            };

            // - Панель "Ошибки"
            var errors = new ErrorsViewModel
            {
                Id    = "Errors",
                Title = Dict["ErrorsList"]
            };

            // - Панель "Журнал команд"
            var commandLog = new CommandLogViewModel
            {
                Id    = "CommandLog",
                Title = Dict["CommandLog"]
            };

            // - Панель "Консоль"
            var console = new ConsoleViewModel
            {
                Id    = "Console",
                Title = Dict["Console"]
            };

            // - Делим layout на две части: нижнюю и верхнюю
            var mainLayout = new ProportionalDock
            {
                Id               = "MainLayout",
                Title            = "MainLayout",
                Proportion       = double.NaN,
                Orientation      = Orientation.Vertical,
                ActiveDockable   = null,
                VisibleDockables = CreateList <IDockable>
                                   (
                    // - Верхняя часть содержит проект, задачник, докум-ю и редактор кода
                    new ProportionalDock
                {
                    Id               = "UpperPart",
                    Title            = "UpperPart",
                    Proportion       = double.NaN,
                    Orientation      = Orientation.Horizontal,
                    ActiveDockable   = null,
                    VisibleDockables = CreateList <IDockable>
                                       (
                        new ToolDock
                    {
                        Id               = "UpperTool1",
                        Title            = "UpperTool1",
                        Proportion       = double.NaN,
                        ActiveDockable   = project,
                        VisibleDockables = CreateList <IDockable>
                                           (
                            project,            // - Вкладка со структурой проекта
                            taskbook,           // - Вкладка с задачами
                            help                // - Вкладка с документацией
                                           )
                    },
                        new SplitterDock
                    {
                        Id    = "UpperSplitter",
                        Title = "UpperSplitter"
                    },
                        new DocumentDock
                    {
                        Id               = "DocumentPane",
                        Title            = "DocumentPane",
                        Proportion       = double.NaN,
                        ActiveDockable   = welcome,
                        VisibleDockables = CreateList <IDockable>(welcome)
                    }
                                       )
                },
                    // - Разделитель частей
                    new SplitterDock
                {
                    Id    = "LayoutSplitter",
                    Title = "LayoutSplitter"
                },
                    // - Нижняя часть содержит ошибки, журнал команд и консоль
                    new ProportionalDock
                {
                    Id               = "LowerPart",
                    Title            = "LowerPart",
                    Proportion       = double.NaN,
                    Orientation      = Orientation.Horizontal,
                    ActiveDockable   = null,
                    VisibleDockables = CreateList <IDockable>
                                       (
                        new ToolDock
                    {
                        Id               = "LowerTool1",
                        Title            = "LowerTool1",
                        Proportion       = double.NaN,
                        ActiveDockable   = errors,
                        VisibleDockables = CreateList <IDockable>
                                           (
                            errors,
                            commandLog
                                           )
                    },
                        new SplitterDock
                    {
                        Id    = "LowerSplitter",
                        Title = "LowerSplitter"
                    },
                        new ToolDock
                    {
                        Id               = "LowerTool2",
                        Title            = "LowerTool2",
                        Proportion       = double.NaN,
                        ActiveDockable   = console,
                        VisibleDockables = CreateList <IDockable>(console)
                    }
                                       )
                }
                                   )
            };

            var mainView = new MainViewModel
            {
                Id               = "MainView",
                Title            = "MainView",
                ActiveDockable   = mainLayout,
                VisibleDockables = CreateList <IDockable>(mainLayout)
            };

            var root = CreateRootDock();

            root.Id               = "Root";
            root.Title            = "Root";
            root.ActiveDockable   = mainView;
            root.DefaultDockable  = mainView;
            root.VisibleDockables = CreateList <IDockable>(mainView);

            return(root);
        }
Example #48
0
 public Help()
 {
     InitializeComponent();
     BindingContext = new HelpViewModel(Navigation);
 }
Example #49
0
 void HelpWindow_Closed(object sender, EventArgs e)
 {
     _dataContext.CleanUp();
     _dataContext = null;
     DataContext = null;
 }