public void OnCloseRequestDelegatesFromActivePage(bool expectCancel)
        {
            var application = new ApplicationViewModel(Repository, ApplicationContext, WindowManager);
            application.ActivePage = new PageTestViewModel(application) {IsCancelOnClose = expectCancel};

            Assert.That(application.OnClosingRequest(), Is.EqualTo(expectCancel));
        }
示例#2
0
 public LobbyViewModel(IChatClient client, ApplicationViewModel applicationViewModel)
 {
     m_client = client;
      m_applicationViewModel = applicationViewModel;
      m_dispatcher = Dispatcher.CurrentDispatcher;
      Rooms = new ObservableCollection<IChatRoom>();
 }
        private Page CreateDetailPage(ApplicationViewModel applicationViewModel)
        {
            applicationViewModel.PropertyChanged += HandleSelectedBlogPostChanged;

            if (applicationViewModel.SelectedBlogPost == null)
            {
                return new ContentPage
                {
                   Content = new Label
                   {
                       Text = "There is no selected blog post",
                       VerticalOptions = LayoutOptions.CenterAndExpand,
                       HorizontalOptions = LayoutOptions.CenterAndExpand
                   }
                };
            }

            return new ContentPage
            {
                Content = new StackLayout
                {
                    Children =
                    {
                        new Label {Text = "Title"},
                        new Entry {Placeholder = "Specify title here ..."}
                    }
                }
            };
        }
 public static ApplicationMessage Edit(ApplicationViewModel editThis)
 {
     return new ApplicationMessage()
     {
         Action = ActionType.Edit,
         Application = editThis
     };
 }
示例#5
0
        protected override void OnStartup(StartupEventArgs e)
        {
            var mainWindow = new MainWindow();
            var applicationViewModel = new ApplicationViewModel(new PlatformServiceImp());

            MainWindow = mainWindow;
            MainWindow.DataContext = applicationViewModel;
            MainWindow.Show();
        }
        public void InitialState()
        {
            var application = new ApplicationViewModel(Repository, ApplicationContext, WindowManager);

            Assert.That(application.Repository, Is.SameAs(Repository));
            Assert.That(application.ApplicationContext, Is.SameAs(ApplicationContext));
            Assert.That(application.WindowManager, Is.SameAs(WindowManager));
            Assert.That(application.ActivePage, Is.Null);
        }
 public static ApplicationMessage Move(ApplicationViewModel moveThis, TabViewModel moveToThis)
 {
     return new ApplicationMessage()
     {
         Action = ActionType.Move,
         Application = moveThis,
         Tab = moveToThis
     };
 }
        public App()
        {
            var repository = new MemoryBlogPostRepository();
            var applicationViewModel = new ApplicationViewModel(repository);
            var defaultFactory = new BlogPostSelectorPageFactory();
            var factory = new DummyBlogPostSelectorPageFactory(defaultFactory);

            MainPage = new ApplicationMasterDetailPage(applicationViewModel, defaultFactory);
        }
 public static ApplicationMessage Add(ApplicationViewModel addThis, TabViewModel addToThis, bool suppressMessage)
 {
     return new ApplicationMessage()
     {
         Action = ActionType.Add,
         Application = addThis,
         Tab = addToThis,
         SuppressMessage = suppressMessage
     };
 }
        public RequestDialogViewModel(ApplicationViewModel application, int year, int month, Action<RequestDialogViewModel> onOk)
        {
            if (month < 1 || month > 12) throw new ArgumentException(@"Month index must be in range 1 to 12", "month");

            InitializeViewModel(application, year, month, null, onOk);

            DateProperty.Value = new DateTime(year, month, 1);
            IsEditingExistingRequest = false;
            CreateCommandCaption = Properties.Resources.RequestDialog_ButtonCreate;
            CancelCommandCaption = Properties.Resources.RequestDialog_ButtonClose;
        }
        protected override void LoadApplications(object sender, System.ComponentModel.DoWorkEventArgs e)
        {
            foreach (string key in new[] { InstalledApps32Bit, InstalledApps64Bit })
            {
                RegistryKey registryKey = Registry.LocalMachine.OpenSubKey(key);

                if (registryKey == null)
                    continue; // The InstalledApps64Bit registry key won't exist on 32 bit machines

                for (int i = 0; i < registryKey.GetSubKeyNames().Length; i++)
                {
                    string subKey = registryKey.GetSubKeyNames()[i];

                    if (_loadWorker.CancellationPending)
                    {
                        e.Cancel = true;
                        return;
                    }

                    // Only care about steam applications (i.e. "Steam App 10143")
                    Match match = Regex.Match(subKey, "^Steam App ([0-9]*)");
                    if (!match.Success)
                        continue;

                    RegistryKey propertyKey = registryKey.OpenSubKey(subKey);
                    if (propertyKey == null)
                        continue;

                    string title = propertyKey.GetValue("DisplayName", null) as string;
                    string icon = propertyKey.GetValue("DisplayIcon", null) as string;

                    if (title.IsNullOrWhiteSpace())
                        continue;

                    try
                    {
                        int appNumber = Int32.Parse(match.Groups[1].Value);

                        ApplicationModel applicationModel = ApplicationModel.FromSteamApp(title, appNumber, icon, SelectedTab.Title);
                        ApplicationViewModel application = new ApplicationViewModel(applicationModel);

                        // Ignore applications already added to the dock
                        if (!Tabs.Any(obj => obj.Applications.Contains(application)))
                        {
                            AddApplication(application);
                        }
                    }
                    catch (FileNotFoundException ex)
                    {
                        Log.DebugFormat("Failed to add steam application to search view - {0}", ex.Message);
                    }
                } // for
            } // foreach
        }
 public ExportAdmTemplateCommand(CommandAttribute commandAttribute,
                                 ApplicationViewModel applicationViewModel,
                                 IUIServiceWpf uiService,
                                 ElementViewModel element,
                                 AssemblyLocator assemblyLocator)
     : base(commandAttribute, uiService)
 {
     this.applicationViewModel = applicationViewModel;
     this.element = element;
     this.attributeRetriever = new ConfigurationManageabilityProviderAttributeRetriever(assemblyLocator);
 }
示例#13
0
        protected override void Run()
        {
            Engine.Log(LogLevel.Verbose, "Launching Workshare Install Wizard");
            Dispatcher = Dispatcher.CurrentDispatcher;
            
            var model = CreateModel();
            try
            {
                var prerequisiteChecks = new PrerequisiteChecks(model);
                prerequisiteChecks.Evaluate();

                if (model.Command.Display == Display.Passive ||
                    model.Command.Display == Display.Full)
                {
                    if (model.PlannedAction == LaunchAction.Uninstall)
                    {
                        if (MessageBoxResult.No ==
                            MessageBox.Show("Are you sure you want to uninstall ?", "Workshare",
                                MessageBoxButton.YesNo, MessageBoxImage.Question))
                        {
                            Engine.Quit(-1);
                            return;
                        }
                    }
                    var viewModel = new ApplicationViewModel(model);
                    View = new ApplicationView { DataContext = viewModel };
                    View.Closed += (sender, e) => Dispatcher.InvokeShutdown();
                    View.Show();
                }
                else
                {
                    ApplyComplete += (sender, args) => Dispatcher.InvokeShutdown();
                    var installationView = new InstallationViewModel(model);
                    installationView.InstallCommand.Execute(null);
                }

                Dispatcher.Run();
            }
            catch (Exception e)
            {
                Engine.Log(LogLevel.Error, e.Message);
                Engine.Log(LogLevel.Error, e.StackTrace);

                if (model.Command.Display == Display.Passive ||
                    model.Command.Display == Display.Full)
                {
                    MessageBox.Show(e.Message, "Workshare Installation", MessageBoxButton.OK, MessageBoxImage.Error);
                }
                model.Result = -1;
            }

            Engine.Quit(model.Result);
        }
示例#14
0
        public virtual void Setup()
        {
            Repository = Substitute.For<Repository>();
            Repository.Name.Returns("DefaultRepositoryName");
            Repository.FilePath.Returns(@"C:\Test.mmdb");

            ApplicationContext = Substitute.For<ApplicationContext>();
            ApplicationContext.Now.Returns(new DateTime(CurrentYear, CurrentMonth, CurrentDay));
            WindowManager = Substitute.For<WindowManager>();

            Application = new ApplicationViewModel(Repository, ApplicationContext, WindowManager);
        }
        public ActionResult Create(ApplicationViewModel _application, string [] Departments)
        {
            if (ModelState.IsValid)
            {
                if (Departments == null)
                {
                    //return RedirectToAction("Upload", new { id = _application.Application.ID });
                    ModelState.AddModelError(string.Empty, "Please choose a department.");
                }
                else
                {

                    _application.Application.Date = DateTime.Now;
                    _application.Application.IsDecided = false;

                    db.Application.Add(_application.Application);
                    db.SaveChanges();

                    foreach (string s in Departments)
                    {
                        db.ApplicationDepartment.Add(new ApplicationDepartment() { DepartmentID = Int32.Parse(s), ApplicationID = _application.Application.ID });
                    }

                    foreach (string file in Request.Files)
                    {
                        HttpPostedFileBase hpf = Request.Files[file] as HttpPostedFileBase;
                        if (hpf.ContentLength > 0)
                        {
                            var fileName = Path.GetFileName(hpf.FileName);
                            var path = Path.Combine(Server.MapPath("~/Uploads/"), fileName);

                            //copy path url to db
                            PDFurlModel _upload = new PDFurlModel() { Url = path, Name = "", ApplicationID = _application.Application.ID };
                            db.PDFurlModel.Add(_upload);
                            hpf.SaveAs(path);
                        }
                    }
                    db.SaveChanges();
                    //return RedirectToAction("Upload", new { id = _application.Application.ID });
                    return RedirectToAction("Index");
                }
            }

            //ViewBag.TermID = new SelectList(db.Term, "ID", "Name", application.Application.TermID);
            ViewBag.termList = avm.TermList;
            ViewBag.departmentList = avm.DepartmentNamesList;

            //number of elements in DepartmentList
            ViewBag.DepartmentListCounter = avm.NumberofElementsDepartmentNamesList;
            //number of elements in TermList
            ViewBag.TermListCounter = avm.NumberofElementsTermList;
            return View(_application);
        }
        public ApplicationMasterDetailPage(ApplicationViewModel applicationViewModel, IBlogPostSelectorPageFactory blogPostSelectorFactory)
        {
            if (applicationViewModel == null)
                throw new ArgumentNullException(nameof(applicationViewModel));
            if (blogPostSelectorFactory == null)
                throw new ArgumentNullException(nameof(blogPostSelectorFactory));

            this.applicationViewModel = applicationViewModel;
            this.blogPostSelectorFactory = blogPostSelectorFactory;

            Master = CreateMasterPage(applicationViewModel);
            Detail = CreateDetailPage(applicationViewModel);
        }
        public RequestDialogViewModel(ApplicationViewModel application, string persistentId, Action<RequestDialogViewModel> onOk)
        {
            var request = application.Repository.QueryRequest(persistentId);
            var selectedCategoryId = request.Category != null ? request.Category.PersistentId : null;
            InitializeViewModel(application, request.Date.Year, request.Date.Month, selectedCategoryId, onOk);

            DescriptionProperty.Value = request.Description;
            ValueProperty.Value = Math.Abs(request.Value);
            DateProperty.Value = request.Date;
            RequestKind.Value = request.Value > 0 ? RequestManagement.RequestKind.Earning : RequestManagement.RequestKind.Expenditure;
            IsEditingExistingRequest = true;
            CreateCommandCaption = Properties.Resources.RequestDialog_ButtonApply;
            CancelCommandCaption = Properties.Resources.RequestDialog_ButtonCancel;
        }
        public CategoryManagementDialogViewModel(ApplicationViewModel application, Action<CategoryManagementDialogViewModel> ok)
        {
            CategoriesToDelete = new List<CategoryEditViewModel>();
            Categories = new EnumeratedSingleValuedProperty<CategoryEditViewModel>();
            Categories.PropertyChanged += CategoriesOnPropertyChanged;

            foreach (var categoryViewModel in application.Repository.QueryAllCategories().Select(c => new CategoryEditViewModel(c.PersistentId, c.Name, OnDeleteCategory)))
            {
                Categories.AddValue(categoryViewModel);
            }

            OkCommand = new CommandViewModel(() => ok(this));
            NewCategoryCommand = new CommandViewModel(OnNewCategoryCommand);

            UpdateCommandStates();
        }
        public AccountManagementPageViewModel(ApplicationViewModel application)
            : base(application)
        {
            _accounts = new ObservableCollection<RecentAccountViewModel>();
            Accounts = new ReadOnlyObservableCollection<RecentAccountViewModel>(_accounts);
            CreateAccountsEntries();

            NewAccountNameProperty = new SingleValuedProperty<string>();
            CreateNewAccountCommand = new CommandViewModel(OnCreateNewAccountCommand);
            OpenAccountCommand = new CommandViewModel(OnOpenAccountCommand);
            SelectFileCommand = new CommandViewModel(OnSelectFileCommand);

            NewAccountNameProperty.OnValueChanged += UpdateCommandStates;

            UpdateCommandStates();

            Caption = Properties.Resources.AccountManagementPageCaption;
        }
示例#20
0
        public TreeElementViewModel(ApplicationViewModel application, string name, TreeElementType? treeElementType = null)
        {
            _application = application;
            Name = name;
            Type = treeElementType.GetValueOrDefault(GuessElementTypeByFileExtension(name));
            _children = new ObservableCollection<TreeElementViewModel>();
            Children = new ReadOnlyObservableCollection<TreeElementViewModel>(_children);

            _commands = new ObservableCollection<CommandViewModel>();
            Commands = new ReadOnlyObservableCollection<CommandViewModel>(_commands);

            if (treeElementType.GetValueOrDefault(TreeElementType.Folder) != TreeElementType.Folder)
            {
                DefaultActionCommand = new CommandViewModel(OnDefaultActionCommand, "Open");

                _commands.Add(DefaultActionCommand);
            }
        }
        public ActionResult ApplicationsUpdate([DataSourceRequest]DataSourceRequest request, ApplicationViewModel application)
        {
            ApplicationViewModel result = null;

            if (this.ModelState.IsValid)
            {
                var entity = this.Mapper.Map<Application>(application);
                this.applications.Update(entity);

                result = this.Mapper.Map<ApplicationViewModel>(this.applications.GetById(application.Id));
            }

            if (result != null)
            {
                return this.Json(new[] { result }.ToDataSourceResult(request, this.ModelState));
            }

            return this.Json(new[] { application }.ToDataSourceResult(request, this.ModelState));
        }
示例#22
0
 private void OnLoggedInMessageReceived(string username)
 {
     if (username == "un_authorized_user")
     {
         login = new LoginView();
         var loginVM = new LoginViewModel(authoService);
         login.DataContext = loginVM;
         login.Show();
         app.Close();
     }
     else
     {
         app = new ApplicationView();
         var appVM = new ApplicationViewModel();
         app.DataContext = appVM;
         app.Show();
         login.Close();
     }
 }
        public RequestManagementPageViewModel(ApplicationViewModel application, int year, int month)
            : base(application)
        {
            Months = new EnumeratedSingleValuedProperty<MonthNameViewModel>();
            Months.AddValue(new MonthNameViewModel(Properties.Resources.MonthNameJanuary, 1));
            Months.AddValue(new MonthNameViewModel(Properties.Resources.MonthNameFebuary, 2));
            Months.AddValue(new MonthNameViewModel(Properties.Resources.MonthNameMarch, 3));
            Months.AddValue(new MonthNameViewModel(Properties.Resources.MonthNameApril, 4));
            Months.AddValue(new MonthNameViewModel(Properties.Resources.MonthNameMay, 5));
            Months.AddValue(new MonthNameViewModel(Properties.Resources.MonthNameJune, 6));
            Months.AddValue(new MonthNameViewModel(Properties.Resources.MonthNameJuly, 7));
            Months.AddValue(new MonthNameViewModel(Properties.Resources.MonthNameAugust, 8));
            Months.AddValue(new MonthNameViewModel(Properties.Resources.MonthNameSeptember, 9));
            Months.AddValue(new MonthNameViewModel(Properties.Resources.MonthNameOctober, 10));
            Months.AddValue(new MonthNameViewModel(Properties.Resources.MonthNameNovember, 11));
            Months.AddValue(new MonthNameViewModel(Properties.Resources.MonthNameDecember, 12));

            Requests = new EnumeratedSingleValuedProperty<RequestViewModel>();

            _year = year;
            Months.Value = Months.SelectableValues.Single(m => m.Index == month);

            AddRequestCommand = new CommandViewModel(OnAddRequestCommand);
            DeleteRequestCommand = new CommandViewModel(OnDeleteRequestCommand);
            PreviousMonthCommand = new CommandViewModel(OnPreviousMonthCommand);
            NextMonthCommand = new CommandViewModel(OnNextMonthCommand);
            EditRequestCommand = new CommandViewModel(OnEditRequestCommand);
            SwitchAccountCommand = new CommandViewModel(OnSwitchAccountCommand);
            EditCategoriesCommand = new CommandViewModel(OnEditCategoriesCommand);
            GotoCurrentMonthCommand = new CommandViewModel(OnGotoCurrentMonthCommand);
            EditStandingOrdersCommand = new CommandViewModel(OnEditStandingOrdersCommand);

            Months.PropertyChanged += OnMonthsPropertyChanged;
            Requests.PropertyChanged += OnSelectedRequestChanged;

            UpdateCurrentMonth();
            UpdateCommandStates();
            UpdateSaldoAsString();
            UpdateMonthsIsEnabled();

            Caption = string.Format(Properties.Resources.RequestManagementPageCaptionFormat, Application.Repository.Name);
        }
        public BlogPostSelectorPage(ApplicationViewModel applicationViewModel)
        {
            if (applicationViewModel == null) throw new ArgumentNullException(nameof(applicationViewModel));

            Title = "Blog posts";
            BindingContext = applicationViewModel;
            listView = new ListView
            {
                ItemsSource = applicationViewModel.BlogPosts,
                ItemTemplate = new DataTemplate(() =>
                {
                    var textCell = new TextCell();
                    textCell.SetBinding(TextCell.TextProperty, nameof(BlogPostViewModel.Title));
                    return textCell;
                })
            };

            listView.SetBinding(ListView.SelectedItemProperty, nameof(ApplicationViewModel.SelectedBlogPost));

            Content = listView;
        }
        public StandingOrderManagementViewModel(ApplicationViewModel application, Action onStandingOrderUpdated)
        {
            _application = application;
            _onStandingOrderUpdated = onStandingOrderUpdated;
            StandingOrders = new EnumeratedSingleValuedProperty<StandingOrderEntityViewModel>();
            StandingOrders.OnValueChanged += OnStandingOrdersValueChangd;

            _allStandingOrders =
                application.Repository.QueryAllStandingOrderEntities()
                    .Select(r => new StandingOrderEntityViewModel(application, r.PersistentId)).ToList();

            _allStandingOrders.ForEach(s => s.Refresh());
            CreateStandingOrderCommand = new CommandViewModel(OnCreateStandingOrderCommand);
            DeleteStandingOrderCommand = new CommandViewModel(OnDeleteStandingOrderCommand);
            ShowFinishedProperty = new SingleValuedProperty<bool>();

            ShowFinishedProperty.OnValueChanged += ShowFinishedPropertyOnOnValueChanged;

            UpdateStandingOrdersWithFiltering();
            UpdateCommandStates();
        }
        public Page CreatePage(ApplicationViewModel applicationViewModel)
        {
            var innerPage = factory.CreatePage(applicationViewModel) as ContentPage;

            return new ContentPage
            {
                Title = "Debug Blog Posts View",
                Content = new StackLayout
                {
                    Children =
                    {
                        new Label
                        {
                            Text = applicationViewModel.BlogPosts.Count().ToString()
                        },

                        (innerPage ?? new ContentPage()).Content
                    }
                }
            };
        }
        public StandingOrderDetailsViewModel(ApplicationViewModel application, Action<StandingOrderEntityData> onSave, Action<StandingOrderDetailsViewModel> onCancel)
        {
            _application = application;
            SaveCommand = new CommandViewModel(() => onSave(CreateStandingOrderEntityData()));
            CancelCommand = new CommandViewModel(() => onCancel(this));
            PaymentsProperty = new SingleValuedProperty<int> { Value = 1 };
            ValueProperty = new SingleValuedProperty<double>();
            IsEndingTransactionProperty = new SingleValuedProperty<bool>();
            MonthPeriods = new EnumeratedSingleValuedProperty<MonthPeriod>();
            Categories = new EnumeratedSingleValuedProperty<CategoryViewModel>();
            FirstBookDateProperty = new SingleValuedProperty<DateTime>();
            DescriptionProperty = new SingleValuedProperty<string>();
            RequestKind = new EnumeratedSingleValuedProperty<RequestKind>();

            IsEndingTransactionProperty.OnValueChanged += OnIsEndingTransactionPropertyChanged;
            MonthPeriods.OnValueChanged += OnMonthPeriodsPropertyChanged;
            PaymentsProperty.OnValueChanged += OnPaymentsPropertyChanged;
            RequestKind.OnValueChanged += RequestKindOnOnValueChanged;
            ValueProperty.OnIsValidChanged += ValuePropertyOnOnIsValidChanged;
            ValueProperty.OnValueChanged += ValuePropertyOnOnValueChanged;
            ValueProperty.Validate = ValidateValueProperty;

            foreach (MonthPeriod value in Enum.GetValues(typeof(MonthPeriod)))
            {
                MonthPeriods.AddValue(value);
            }

            var allCategoryViewModels = application.Repository.QueryAllCategories().Select(c => new CategoryViewModel(application, c.PersistentId)).ToList();
            allCategoryViewModels.ForEach(a => a.Refresh());
            Categories.SetRange(allCategoryViewModels.OrderBy(c => c.Name));
            FirstBookDateProperty.Value = application.ApplicationContext.Now.Date;

            RequestKind.SetRange(Enum.GetValues(typeof(RequestKind)).Cast<RequestKind>());
            RequestKind.Value = RequestManagement.RequestKind.Expenditure;

            UpdateCommandStates();
            UpdateCaption();
        }
        public void ActivateRequestManagementScreen(bool hasRequests)
        {
            var application = new ApplicationViewModel(Repository, ApplicationContext, WindowManager);

            application.ActivateRequestmanagementPage(hasRequests ? new [] {"TestEntity"} : null);

            var currentDateTime = ApplicationContext.Now;

            Assert.That(application.ActivePage, Is.InstanceOf<RequestManagementPageViewModel>());

            var activeScreen = (RequestManagementPageViewModel) application.ActivePage;
            Assert.That(activeScreen.Year, Is.EqualTo(currentDateTime.Year));
            Assert.That(activeScreen.Month, Is.EqualTo(currentDateTime.Month));

            if (hasRequests)
            {
                WindowManager.Received(1).ShowDialog(Arg.Is<CreatedRequestsDialogViewModel>(r => r.CreatedRequests.Count == 1 && r.CreatedRequests[0].EntityId == "TestEntity"));
            }
            else
            {
                WindowManager.DidNotReceiveWithAnyArgs().ShowDialog(Arg.Any<object>());
            }
        }
示例#29
0
 public ActionResult Create()
 {
     var models = new ApplicationViewModel();
     return View(models);
 }
示例#30
0
 public ClientStats(ref ApplicationViewModel vm)
 {
     viewModel = vm;
     InitializeComponent();
     DataContext = vm;
 }
示例#31
0
 public MainWindow()
 {
     InitializeComponent();
     a           = new ApplicationViewModel(new DefaultDialogService(), new EFClientRepository());
     DataContext = a;
 }
示例#32
0
 public OpenEnvironmentConfigurationDeltaCommand(IUIServiceWpf uiService, ApplicationViewModel sourceModel, bool canExecute)
     : base(uiService)
 {
     this.sourceModel = sourceModel;
     this.canExecute  = canExecute;
 }
示例#33
0
 /// <summary>
 /// Gets a view control that can edit the given object
 /// </summary>
 /// <param name="viewModel">The ViewModel that the view control will target</param>
 /// <returns>A single view control for the given view model</returns>
 public static IViewControl GetViewControl(object viewModel, IEnumerable <Type> requestedTabTypes, ApplicationViewModel appViewModel, PluginManager manager)
 {
     return(GetViewControlTabs(viewModel, requestedTabTypes, appViewModel, manager).FirstOrDefault());
 }
示例#34
0
        public ActionResult Index(ApplicationViewModel applicationViewModel)
        {
            try
            {
                CommonFunctions comfuns = new CommonFunctions();

                if (ModelState.IsValid)
                {
                    applicationViewModel.ApplicationName = applicationViewModel.ApplicationName.Trim();
                    bool isDuplicate = false;
                    isDuplicate = applicationViewModel.CheckDuplicate(applicationViewModel);

                    if(isDuplicate)
                    {
                        applicationViewModel.GetApplicationDetails(applicationViewModel.ProjectID);
                        applicationViewModel.GetScreenAccessRights("Application Details");
                        ViewBag.Message = "Application Already Exists";
                        ViewData["Applicationviewmodel1"] = (IEnumerable<ApplicationViewModel>)from u in applicationViewModel.lstApplication
                                                                                               join b in applicationViewModel.lstAppVersion on u.AppVersion equals b.Id
                                                                                               join bp in applicationViewModel.BankTypeList on u.BankType equals bp.Value
                                                                                               select new ApplicationViewModel { ApplicationID = u.ApplicationID, ApplicationName = u.ApplicationName, AppVersion = b.AppVersion, BankTypeName = bp.Key };
                    

                        comfuns.GetProjectNameForDuplicateCheck(applicationViewModel.ProjectID, applicationViewModel.ClientId, applicationViewModel.ProjectName);
                       

                        applicationViewModel.ClientName = comfuns.GetClientName(applicationViewModel.ClientId);

                        return View(applicationViewModel);

                    }
                    else
                    {
                        applicationViewModel.AddApplication(applicationViewModel);
                        TempData["ProjectId"] = applicationViewModel.ProjectID;
                        applicationViewModel.GetApplicationDetails(applicationViewModel.ProjectID);
                        applicationViewModel.GetScreenAccessRights("Application Details");
                        ViewBag.Message = "New Application Added Successfully";
                        ViewData["Applicationviewmodel1"] = (IEnumerable<ApplicationViewModel>)from u in applicationViewModel.lstApplication
                                                                                               join b in applicationViewModel.lstAppVersion on u.AppVersion equals b.Id
                                                                                               join bp in applicationViewModel.BankTypeList on u.BankType equals bp.Value
                                                                                               select new ApplicationViewModel { ApplicationID = u.ApplicationID, ApplicationName = u.ApplicationName, AppVersion = b.AppVersion, BankTypeName = bp.Key };
                        
                        comfuns.GetProjectNameForDuplicateCheck(applicationViewModel.ProjectID, applicationViewModel.ClientId, applicationViewModel.ProjectName);


                        applicationViewModel.ClientName = comfuns.GetClientName(applicationViewModel.ClientId);



                        return View(applicationViewModel);
                    }
                  
                }
                applicationViewModel.GetApplicationDetails(applicationViewModel.ProjectID);
                applicationViewModel.GetScreenAccessRights("Application Details");

                ViewData["Applicationviewmodel1"] = (IEnumerable<ApplicationViewModel>)from u in applicationViewModel.lstApplication
                                                                                       join b in applicationViewModel.lstAppVersion on u.AppVersion equals b.Id
                                                                                       join bp in applicationViewModel.BankTypeList on u.BankType equals bp.Value
                                                                                       select new ApplicationViewModel { ApplicationID = u.ApplicationID, ApplicationName = u.ApplicationName, AppVersion = b.AppVersion, BankTypeName = bp.Key };
             

                comfuns.GetProjectNameForDuplicateCheck(applicationViewModel.ProjectID, applicationViewModel.ClientId, applicationViewModel.ProjectName);


                applicationViewModel.ClientName = comfuns.GetClientName(applicationViewModel.ClientId);

                int clientId;
                string projectName;


                comfuns.GetProjectName(applicationViewModel.ProjectID, out clientId, out projectName);
                applicationViewModel.ClientId = clientId;
                applicationViewModel.ProjectName = projectName;

                applicationViewModel.ClientName = comfuns.GetClientName(clientId);
                return View(applicationViewModel);
            }
            catch (Exception ex)
            {
                errorlogviewmodel = new ErrorLogViewModel();
                errorlogviewmodel.LogError(ex);
                return View("Error");
            }
        }
示例#35
0
        private void App_Startup(object sender, StartupEventArgs e)
        {
            Global.StartupDateTime = DateTime.Now;

            //Unhandled Exceptions.
            AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
            AppDomain.CurrentDomain.AssemblyResolve    += CurrentDomain_AssemblyResolve;

            //Increases the duration of the tooltip display.
            ToolTipService.ShowDurationProperty.OverrideMetadata(typeof(DependencyObject), new FrameworkPropertyMetadata(int.MaxValue));

            var version = FrameworkHelper.GetFrameworkVersion();

            if (version > new Version(4, 7, 2))
            {
                SetSecurityProtocol();
            }

            //Parse arguments.
            Arguments.Prepare(e.Args);

            LocalizationHelper.SelectCulture(UserSettings.All.LanguageCode);
            ThemeHelper.SelectTheme(UserSettings.All.MainTheme);

            //Listen to changes in theme.
            SystemEvents.UserPreferenceChanged += SystemEvents_UserPreferenceChanged;

            #region Download mode

            if (Arguments.IsInDownloadMode)
            {
                var downloader = new Downloader
                {
                    DownloadMode    = Arguments.DownloadMode,
                    DestinationPath = Arguments.DownloadPath
                };
                downloader.ShowDialog();

                Environment.Exit(90);
                return;
            }

            #endregion

            #region Settings persistence mode

            if (Arguments.IsInSettingsMode)
            {
                SettingsPersistenceChannel.RegisterServer();
                return;
            }

            #endregion

            #region If set, it allows only one instance per user

            //The singleton works on a per-user and per-executable mode.
            //Meaning that a different user and/or a different executable intances can co-exist.
            //Part of this code wont work on debug mode, since the SetForegroundWindow() needs focus on the foreground window calling the method.
            if (UserSettings.All.SingleInstance && !Arguments.NewInstance)
            {
                try
                {
                    using (var thisProcess = Process.GetCurrentProcess())
                    {
                        var user      = System.Security.Principal.WindowsIdentity.GetCurrent().User;
                        var name      = thisProcess.MainModule?.FileName ?? Assembly.GetEntryAssembly()?.Location ?? "ScreenToGif";
                        var location  = Convert.ToBase64String(Encoding.UTF8.GetBytes(name));
                        var mutexName = (user?.Value ?? Environment.UserName) + "_" + location;

                        _mutex = new Mutex(true, mutexName, out _accepted);

                        //If the mutext failed to be accepted, it means that another process already openned it.
                        if (!_accepted)
                        {
                            var warning = true;

                            //Switch to the other app (get only one, if multiple available). Use name of assembly.
                            using (var process = Process.GetProcessesByName(thisProcess.ProcessName).FirstOrDefault(f => f.MainWindowHandle != thisProcess.MainWindowHandle))
                            {
                                if (process != null)
                                {
                                    var handles = Util.Native.GetWindowHandlesFromProcess(process);

                                    //Show the window before setting focus.
                                    Util.Native.ShowWindow(handles.Count > 0 ? handles[0] : process.Handle, Util.Native.ShowWindowEnum.Show);

                                    //Set user the focus to the window.
                                    Util.Native.SetForegroundWindow(handles.Count > 0 ? handles[0] : process.Handle);
                                    warning = false;

                                    InstanceSwitcherChannel.SendMessage(e.Args);
                                }
                            }

                            //If no window available (app is in the system tray), display a warning.
                            if (warning)
                            {
                                Dialog.Ok(LocalizationHelper.Get("S.Warning.Single.Title"), LocalizationHelper.Get("S.Warning.Single.Header"), LocalizationHelper.Get("S.Warning.Single.Message"), Icons.Info);
                            }

                            Environment.Exit(0);
                            return;
                        }

                        //If this is the first instance, register the inter process channel to listen for other instances.
                        InstanceSwitcherChannel.RegisterServer();
                    }
                }
                catch (Exception ex)
                {
                    LogWriter.Log(ex, "Impossible to check if another instance is running");
                }
            }

            #endregion

            //Render mode.
            RenderOptions.ProcessRenderMode = UserSettings.All.DisableHardwareAcceleration ? RenderMode.SoftwareOnly : RenderMode.Default;

            #region Net Framework

            if (version < new Version(4, 8))
            {
                var ask = Dialog.Ask(LocalizationHelper.Get("S.Warning.Net.Title"), LocalizationHelper.Get("S.Warning.Net.Header"), LocalizationHelper.Get("S.Warning.Net.Message"));

                if (ask)
                {
                    Process.Start("http://go.microsoft.com/fwlink/?LinkId=2085155");
                    return;
                }
            }

            #endregion

            if (version > new Version(4, 7))
            {
                SetWorkaroundForDispatcher();
            }

            #region Net Framework HotFixes

            //Only runs on Windows 7 SP1.
            if (Environment.OSVersion.Version.Major == 6 && Environment.OSVersion.Version.Minor == 1)
            {
                Task.Factory.StartNew(() =>
                {
                    try
                    {
                        var search = new ManagementObjectSearcher("SELECT HotFixID FROM Win32_QuickFixEngineering WHERE HotFixID = 'KB4055002'").Get();
                        Global.IsHotFix4055002Installed = search.Count > 0;
                    }
                    catch (Exception ex)
                    {
                        LogWriter.Log(ex, "Error while trying to know if a hot fix was installed.");
                    }
                });
            }

            #endregion

            #region Tray icon and view model

            NotifyIcon = (NotifyIcon)FindResource("NotifyIcon");

            if (NotifyIcon != null)
            {
                NotifyIcon.Visibility = UserSettings.All.ShowNotificationIcon || UserSettings.All.StartMinimized || UserSettings.All.StartUp == 5 ? Visibility.Visible : Visibility.Collapsed;

                //Replace the old option with the new setting.
                if (UserSettings.All.StartUp == 5)
                {
                    UserSettings.All.StartMinimized       = true;
                    UserSettings.All.ShowNotificationIcon = true;
                    UserSettings.All.StartUp = 0;
                }

                //using (var iconStream = GetResourceStream(new Uri("pack://application:,,,/Resources/Logo.ico"))?.Stream)
                //{
                //    if (iconStream != null)
                //        NotifyIcon.Icon = new System.Drawing.Icon(iconStream);
                //}
            }

            MainViewModel = (ApplicationViewModel)FindResource("AppViewModel") ?? new ApplicationViewModel();

            RegisterShortcuts();

            #endregion

            //var test = new TestField(); test.ShowDialog(); Environment.Exit(1); return;
            //var test = new Windows.EditorEx(); test.ShowDialog(); return;
            //var test = new Windows.NewWebcam(); test.ShowDialog(); return;
            //var test = Settings.UserSettings.All.StartupTop;

            #region Tasks

            Task.Factory.StartNew(MainViewModel.ClearTemporaryFiles, TaskCreationOptions.LongRunning);
            Task.Factory.StartNew(MainViewModel.CheckForUpdates, TaskCreationOptions.LongRunning);
            Task.Factory.StartNew(MainViewModel.SendFeedback, TaskCreationOptions.LongRunning);

            #endregion

            #region Startup

            if (Arguments.Open)
            {
                MainViewModel.Open.Execute(Arguments.WindownToOpen, true);
            }
            else
            {
                MainViewModel.Open.Execute(UserSettings.All.StartUp);
            }

            #endregion
        }
 public MainWindow()
 {
     InitializeComponent();
     DataContext = new ApplicationViewModel(new DefaultDialogService());
 }
示例#37
0
 /// <summary>
 /// Gets the currently registered MenuActions in heiarchy form
 /// </summary>
 /// <param name="isDevMode">Whether or not to get the dev-only menu items</param>
 /// <param name="appViewModel">Instance of the current application ViewModel</param>
 /// <returns>A list of <see cref="MenuItemInfo"/> with each item's <see cref="MenuItemInfo.Children"/> correctly initialized</returns>
 public static async Task <List <MenuItemInfo> > GetMenuItemInfo(ApplicationViewModel appViewModel, PluginManager manager, bool isDevMode = false)
 {
     return(await GetMenuItemInfo(false, isDevMode, null, appViewModel, manager));
 }
示例#38
0
 public AddViewMadel(ApplicationViewModel mainWinVm)
 {
     mainWinVM = mainWinVm;
 }
示例#39
0
        /// <summary>
        /// Returns a list of IObjectControl that edit the given ObjectToEdit.
        /// </summary>
        /// <param name="model">Object the IObjectControl should edit.</param>
        /// <param name="requestedTabTypes">Limits what types of iObjectControl should be returned.  If the iObjectControl is not of any type in this IEnumerable, it will not be used.  If empty or nothing, no constraints will be applied, which is not recommended because the iObjectControl could be made for a different environment (for example, a Windows Forms user control being used in a WPF environment).</param>
        /// <param name="manager">Instance of the current plugin manager.</param>
        /// <returns>An IEnumerable of object controls for the given model.</returns>
        /// <remarks>This version of <see cref="GetRefreshedTabs(Object, IEnumerable(Of Type), PluginManager)"/> searches for view models, then finds paths to the views.</remarks>
        private static IEnumerable <IViewControl> GetViewControlsByViewModel(object model, IEnumerable <Type> requestedTabTypes, ApplicationViewModel appViewModel, PluginManager manager)
        {
            Dictionary <object, List <IViewControl> > targetTabs = new Dictionary <object, List <IViewControl> >();
            var modelType = model.GetType().GetTypeInfo();

            List <object> viewModels = new List <object>();

            viewModels.AddRange(appViewModel.GetViewModelsForModel(model));
            viewModels.Add(model); // We'll consider the model itself a view model, if anything directly targets it

            // Get all tabs that could be used for the model, given the RequestedTabTypes constraint
            var availableTabs = (from viewModel in viewModels
                                 from view in GetViewControls(manager)
                                 let viewModelSortOrder = viewModel is GenericViewModel ? ((viewModel as GenericViewModel).SortOrder) : 0
                                                          where requestedTabTypes.Any(x => ReflectionHelpers.IsOfType(view, x.GetTypeInfo())) &&
                                                          view.GetSupportedTypes().Any(x => ReflectionHelpers.IsOfType(viewModel.GetType().GetTypeInfo(), x)) &&
                                                          view.SupportsObject(viewModel)
                                                          orderby viewModelSortOrder, view.GetSortOrder(modelType, true)
                                 select new { viewModel, view, viewModelSortOrder = viewModel is GenericViewModel ? ((viewModel as GenericViewModel).SortOrder) : 0 })
                                .ToList();

            var realTabs = availableTabs.Where(x => !x.view.GetIsBackupControl()).ToList();

            foreach (var item in realTabs)
            {
                if (!targetTabs.ContainsKey(item.viewModel))
                {
                    targetTabs.Add(item.viewModel, new List <IViewControl>());
                }
                targetTabs[item.viewModel].Add(item.view);
            }

            // Find the supported backup controls
            foreach (var item in availableTabs.Where(x => x.view.GetIsBackupControl()).Select(x => x.viewModel).Distinct())
            {
                if (!realTabs.Where(x => x.view.SupportsObject(item)).Any())
                {
                    var usableBackup = availableTabs.Where(x => x.view.SupportsObject(item)).OrderByDescending(x => x.view.GetSortOrder(item.GetType().GetTypeInfo(), true)).FirstOrDefault();
                    if (usableBackup != null)
                    {
                        if (!targetTabs.ContainsKey(item))
                        {
                            targetTabs.Add(item, new List <IViewControl>());
                        }
                        targetTabs[item].Add(usableBackup.view);
                    }
                }
            }

            // Create new instances and set targets
            var newTabs = new List <IViewControl>();

            foreach (var item in targetTabs)
            {
                foreach (var view in item.Value)
                {
                    var tab = manager.CreateNewInstance(view) as IViewControl;

                    //Set the appropriate object
                    tab.ViewModel = item.Key;

                    newTabs.Add(tab);
                }
            }

            return(newTabs);
        }
示例#40
0
        /// <summary>
        /// Gets view controls that edit the given ViewModel.
        /// </summary>
        /// <param name="model">Object the IObjectControl should edit.</param>
        /// <param name="requestedTabTypes">Limits what types of iObjectControl should be returned.  If the iObjectControl is not of any type in this IEnumerable, it will not be used.  If empty or nothing, no constraints will be applied, which is not recommended because the iObjectControl could be made for a different environment (for example, a Windows Forms user control being used in a WPF environment).</param>
        /// <returns>An enumerable of view controls that target the given view model</returns>
        public static IEnumerable <IViewControl> GetViewControlTabs(object viewModel, IEnumerable <Type> requestedTabTypes, ApplicationViewModel appViewModel, PluginManager manager)
        {
            var viewModels = appViewModel.GetViewModelsForModel(viewModel);

            if (viewModels != null && viewModels.Any())
            {
                // Use the new method
                return(GetViewControlsByViewModel(viewModel, requestedTabTypes, appViewModel, manager));
            }
            else
            {
                // Use the legacy method
                return(GetViewControlsByView(viewModel, requestedTabTypes, appViewModel, manager));
            }
        }
示例#41
0
        /// <summary>
        /// Generates MenuItems from the given IEnumerable of MenuItemInfo.
        /// </summary>
        /// <param name="menuItemInfo">IEnumerable of MenuItemInfo that will be used to create the MenuItems.</param>
        /// <param name="appViewModel">Instance of the current application ViewModel</param>
        /// <param name="targets">Direct targets of the action, if applicable.  If Nothing, the application ViewModel will control the targets</param>
        /// <returns>A list of <see cref="ActionMenuItem"/> corresponding to the given menu item info (<paramref name="menuItemInfo"/>)</returns>
        public static List <ActionMenuItem> GenerateLogicalMenuItems(IEnumerable <MenuItemInfo> menuItemInfo, ApplicationViewModel appViewModel, PluginManager manager, IEnumerable <object> targets)
        {
            if (menuItemInfo == null)
            {
                throw (new ArgumentNullException(nameof(menuItemInfo)));
            }
            if (appViewModel == null)
            {
                throw new ArgumentNullException(nameof(appViewModel));
            }

            List <ActionMenuItem> output = new List <ActionMenuItem>();

            // Create the menu items
            foreach (var item in from m in menuItemInfo orderby m.SortOrder, m.Header select m)
            {
                var m = new ActionMenuItem();
                m.Header = item.Header;
                m.CurrentApplicationViewModel = appViewModel;
                m.ContextTargets = targets;
                foreach (var action in item.ActionTypes)
                {
                    m.Actions.Add(manager.CreateInstance(action) as MenuAction);
                }
                foreach (var child in GenerateLogicalMenuItems(item.Children, appViewModel, manager, targets))
                {
                    m.Children.Add(child);
                }
                output.Add(m);
            }

            return(output);
        }
示例#42
0
        public Welcom(ApplicationViewModel mainWinVm)
        {
            InitializeComponent();

            DataContext = new WelcomViewModel(mainWinVm);
        }
示例#43
0
 public App()
 {
     DataContext = new ApplicationViewModel();
 }
示例#44
0
 private void PriceAsc(object sender, RoutedEventArgs e)
 {
     DataContext = new ApplicationViewModel(ApplicationViewModel.Tables.Goods,
                                            ApplicationViewModel.FilterAction.ByPrice, ApplicationViewModel.FilterParameter.Decs);
 }
示例#45
0
 public SaveContactCommand(ApplicationViewModel _avm) : base(_avm)
 {
 }
示例#46
0
        /// <summary>
        /// Gets the currently registered MenuActions in heiarchy form.
        /// </summary>
        /// <param name="isContextBased">Whether or not the desired menu item info is for context menus.</param>
        /// <param name="isDevMode">Whether or not to get the dev-only menu items.</param>
        /// <param name="target">Target of the menu item, or null if there is no target</param>
        /// <param name="pluginManager">Instance of the current application ViewModel.</param>
        /// <returns>A list of <see cref="MenuItemInfo"/> with each item's <see cref="MenuItemInfo.Children"/> correctly initialized</returns>
        private static async Task <List <MenuItemInfo> > GetMenuItemInfo(bool isContextBased, bool isDevMode, object target, ApplicationViewModel appViewModel, PluginManager manager)
        {
            if (appViewModel == null)
            {
                throw (new ArgumentNullException(nameof(appViewModel)));
            }

            var menuItems = new List <MenuItemInfo>();

            foreach (var actionInstance in manager.GetRegisteredObjects <MenuAction>())
            {
                //1: If this is a context menu, only get actions that support the target and are context based
                //2: Ensure menu actions are only visible based on their environment: non-context in regular menu, context in context menu
                //3: DevOnly menu actions are only supported if we're in dev mode.
                if ((!isContextBased || (await actionInstance.SupportsObject(target) && actionInstance.IsContextBased)) &&
                    (isContextBased == actionInstance.IsContextBased) &&
                    (isDevMode || !actionInstance.DevOnly))
                {
                    // Generate the MenuItem
                    if (actionInstance.ActionPath.Count >= 1)
                    {
                        // Find or Create parent menu items
                        var parent = menuItems.Where(x => x.Header == actionInstance.ActionPath[0]);

                        // - Find or create root parent
                        MenuItemInfo current = null;
                        if (parent.Any())
                        {
                            // Find
                            current = parent.First();
                            if (current.ActionTypes.Count == 0)
                            {
                                // Sort order of parent menu items depends on current menu action
                                current.SortOrder = Math.Min(current.SortOrder, actionInstance.SortOrder);
                            }
                        }
                        else
                        {
                            // Create
                            var m = new MenuItemInfo();
                            m.Header      = actionInstance.ActionPath[0];
                            m.Children    = new List <MenuItemInfo>();
                            m.ActionTypes = new List <TypeInfo>();
                            m.SortOrder   = actionInstance.SortOrder;
                            if (actionInstance.ActionPath.Count == 1)
                            {
                                m.ActionTypes.Add(actionInstance.GetType().GetTypeInfo());
                            }
                            menuItems.Add(m);
                            current = m;
                        }

                        // - Find or create non-root parents
                        for (var i = 1; i <= actionInstance.ActionPath.Count - 2; i++)
                        {
                            var index = i; //To avoid potential issues with using the below linq expression.  Might not be needed, but it's probably best to avoid potential issues.
                            parent = from MenuItemInfo m in current.Children where m.Header == actionInstance.ActionPath[index] select m;
                            if (parent.Any())
                            {
                                // Find
                                current = parent.First();
                                if (current.ActionTypes.Count == 0)
                                {
                                    // Sort order of parent menu items depends on current menu action
                                    current.SortOrder = Math.Min(current.SortOrder, actionInstance.SortOrder);
                                }
                            }
                            else
                            {
                                // Create
                                MenuItemInfo m = new MenuItemInfo();
                                m.Header    = actionInstance.ActionPath[i];
                                m.Children  = new List <MenuItemInfo>();
                                m.SortOrder = actionInstance.SortOrder;
                                if (i == 0)
                                {
                                    menuItems.Add(m);
                                }
                                else
                                {
                                    current.Children.Add(m);
                                }
                                current = m;
                            }
                        }

                        // Find or create the desired menu item
                        if (actionInstance.ActionPath.Count > 1)
                        {
                            // Check to see if the menu item exists
                            parent = current.Children.Where(x => x.Header == actionInstance.ActionPath.Last());

                            if (parent.Any())
                            {
                                // Add action to existing menu item
                                var m = parent.First();
                                m.ActionTypes = new List <TypeInfo>();
                                m.ActionTypes.Add(actionInstance.GetType().GetTypeInfo());
                            }
                            else
                            {
                                // Create the menu item, and give it a proper tag
                                MenuItemInfo m = new MenuItemInfo();
                                m.Children    = new List <MenuItemInfo>();
                                m.Header      = actionInstance.ActionPath.Last();
                                m.SortOrder   = actionInstance.SortOrder;
                                m.ActionTypes = new List <TypeInfo>();
                                m.ActionTypes.Add(actionInstance.GetType().GetTypeInfo());
                                current.Children.Add(m);
                            }
                        }
                    }
                    else //Count=0
                    {
                        throw (new ArgumentException(Properties.Resources.UI_ErrorActionMenuPathEmpty));
                    }
                }
            }
            return(menuItems);
        }
示例#47
0
        private void Application_Startup(object sender, StartupEventArgs e)
        {
            Global.StartupDateTime = DateTime.Now;

            //Unhandled Exceptions.
            AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;

            //Increases the duration of the tooltip display.
            ToolTipService.ShowDurationProperty.OverrideMetadata(typeof(DependencyObject), new FrameworkPropertyMetadata(int.MaxValue));

            //Parse arguments.
            if (e.Args.Length > 0)
            {
                Argument.Prepare(e.Args);
            }

            LocalizationHelper.SelectCulture(UserSettings.All.LanguageCode);
            ThemeHelper.SelectTheme(UserSettings.All.MainTheme.ToString());

            if (UserSettings.All.DisableHardwareAcceleration)
            {
                RenderOptions.ProcessRenderMode = RenderMode.SoftwareOnly;
            }

            #region Net Framework

            var array  = Type.GetType("System.Array");
            var method = array?.GetMethod("Empty");

            if (array == null || method == null)
            {
                var ask = Dialog.Ask("Missing Dependency", "Net Framework 4.6.1 is not present", "In order to properly use this app, you need to download the correct version of the .Net Framework. Open the web page to download?");

                if (ask)
                {
                    Process.Start("https://www.microsoft.com/en-us/download/details.aspx?id=49981");
                    return;
                }
            }

            #endregion

            #region Net Framework HotFixes

            //Only runs on Windows 7 SP1.
            if (Environment.OSVersion.Version.Major == 6 && Environment.OSVersion.Version.Minor == 1)
            {
                Task.Factory.StartNew(() =>
                {
                    try
                    {
                        var search = new ManagementObjectSearcher("SELECT HotFixID FROM Win32_QuickFixEngineering WHERE HotFixID = 'KB4055002'").Get();
                        Global.IsHotFix4055002Installed = search.Count > 0;
                    }
                    catch (Exception ex)
                    {
                        LogWriter.Log(ex, "Error while trying to know if a hot fix was installed.");
                    }
                });
            }

            #endregion

            #region Tray icon and view model

            NotifyIcon = (NotifyIcon)FindResource("NotifyIcon");

            if (NotifyIcon != null)
            {
                NotifyIcon.Visibility = UserSettings.All.ShowNotificationIcon || UserSettings.All.StartUp == 5 ? Visibility.Visible : Visibility.Collapsed;
            }

            MainViewModel = (ApplicationViewModel)FindResource("AppViewModel") ?? new ApplicationViewModel();

            RegisterShortcuts();

            #endregion

            //var select = new SelectFolderDialog(); select.ShowDialog(); return;
            //var select = new TestField(); select.ShowDialog(); return;
            //var select = new Encoder(); select.ShowDialog(); return;

            #region Tasks

            Task.Factory.StartNew(MainViewModel.ClearTemporaryFilesTask, TaskCreationOptions.LongRunning);
            Task.Factory.StartNew(MainViewModel.UpdateTask, TaskCreationOptions.LongRunning);
            Task.Factory.StartNew(MainViewModel.SendFeedback, TaskCreationOptions.LongRunning);

            #endregion

            #region Startup

            if (UserSettings.All.StartUp == 4 || Argument.FileNames.Any())
            {
                MainViewModel.OpenEditor.Execute(null);
                return;
            }

            if (UserSettings.All.StartUp == 0)
            {
                MainViewModel.OpenLauncher.Execute(null);
                return;
            }

            if (UserSettings.All.StartUp == 1)
            {
                MainViewModel.OpenRecorder.Execute(null);
                return;
            }

            if (UserSettings.All.StartUp == 2)
            {
                MainViewModel.OpenWebcamRecorder.Execute(null);
                return;
            }

            if (UserSettings.All.StartUp == 3)
            {
                MainViewModel.OpenBoardRecorder.Execute(null);
            }

            #endregion
        }
示例#48
0
 public ApplicationPage()
 {
     InitializeComponent();
     ViewModel = new ApplicationViewModel(IoC.Get <MainPageViewModel>().SelectedApplication, IoC.Get <ModConfigService>());
     this.AnimateOutStarted += Dispose;
 }
示例#49
0
 private void WarrantyDesc(object sender, RoutedEventArgs e)
 {
     DataContext = new ApplicationViewModel(ApplicationViewModel.Tables.Goods,
                                            ApplicationViewModel.FilterAction.ByWarranty, ApplicationViewModel.FilterParameter.Acs);
 }
 public MainWindow()
 {
     InitializeComponent();
     DataContext = new ApplicationViewModel();
 }
        /// <summary>
        /// Create the view models for the views to databind - these provide the logic for the Views/UI and themselves
        /// access the underlying model by utilizing the services created.
        /// </summary>
        private void SetupViewModels()
        {
            // Get the prefered culture name before setting up the cultures.
            // Changes in culture selection (even automatic ones) will be stored in the Isolated Storage
            var preferedCultureName = LiteIsolatedStorageManager.Instance.CultureName;

            // The application view model holds some basic information on the application, like resources and mechanisms
            // to change the current culture.
            ApplicationViewModel = new ApplicationViewModel()
            {
                ApplicationId = APPLICATIONID
            };
            ApplicationViewModel.Resources = new Lite.Resources.Localization.ApplicationResources();

            // Add (additional) cultures you want to use in the application
            foreach (var culture in _supportedCultures)
            {
                ApplicationViewModel.Cultures.Add(new ApplicationCultureViewModel(culture, true));
            }

            // Now try to set the previously used culture as the current one
            var preferedCulture = ApplicationViewModel.Culture(preferedCultureName);

            if (preferedCulture != null)
            {
                // Set the prefered culture (the last one used)
                ApplicationViewModel.CurrentCulture = preferedCulture;
            }
            else
            {
                // Try to select the OS culture as the application culture
                // if the OS culture is not in the available application cultures it defaults to "en-us", the neutral culture
                ApplicationViewModel.SelectDefaultCulture();
            }

            // Create the client settings view model that provides typed access to
            // the client settings that are defined in the application and set via
            // the management client.
            this.ClientSettingsViewModel = new LiteClientSettingsViewModel();

            // Set up the LiteTraceLogger, capable of processing log messages
            this.TraceLogger = new LiteTraceLogger()
            {
                LogLevel = 5
            };

            // Store the TraceLogger, so all Framework's log messages use our logger
            SpatialEye.Framework.Client.Diagnostics.TraceLogger.SetLogger(TraceLogger);

            // Use the base authentication view model using our ApplicationId
            this.AuthenticationViewModel = new AuthenticationViewModel(APPLICATIONID)
            {
                // Set to true, in case you want to ask the user 'are you sure...' upon signing out
                AskConfirmationOnSignOut = false,

                // In case the server is not running, this flag indicates whether we want the server
                // address to be included in the error message on the dialog.
                // false: 'Can not connect to Server'
                // true :
                IncludeServerAddressInConnectionErrorMessage = true
            };

            // Set up an opacity animator that we will be using upon signing-in/out; it allows views to
            // bind to an animated opacity value.
            this.AuthenticationOpacity = new OpacityAnimator();

            // MessageBox view model dedicated to the toolbox area; is bound to a MessageBoxView
            // that is displayed on top of the Toolbox for those viewModels that want to display
            // messages just in the toolbox area
            this.ToolboxMessageBoxViewModel = new LiteMessageBoxViewModel();

            // The view model responsible for getting Server info in a decent format
            ServerInfoViewModel = new LiteServerInfoViewModel(MainXYServiceProvider);

            // Set up the specific MapsViewModel that is capable of setting
            // up the default maps, as well as get user defined maps/layers from
            // the isolated storage (manager).
            this.MapsViewModel = new LiteMapsViewModel()
            {
                MessageBoxService = this.ToolboxMessageBoxViewModel,

                // Only use a Single Backdrop layer (ie Bing) that is switched on,
                // instead of all available Backdrop layers (with the first one on).
                UseSingleBackdropLayer = true,

                // The minimum zoom level that will be requested for any map. This means
                // the user can not zoom any more out than the value specified here.
                // Valid range = [1, 15]. The default is 1.
                MinZoomLevel = 1,

                // The maximum zoom level that will be requested for any map. This means
                // the user can not zoom any deeper than the value specified here.
                // Valid range = [19, 23], although sensibly the maximum zoom level should be
                // in the range [21, 23]. The default value is 22.
                MaxZoomLevel = 22
            };

            // The map hover event tracker
            this.MapHoverViewModel = new LiteMapHoverViewModel();

            // The map select-hover event tracker
            this.MapSelectHoverViewModel = new LiteMapSelectHoverViewModel();

            // The handler for custom selection in case a mouse press didn't result in selection
            // The TableName and FieldName properties can be used to indicate the custom selection
            // required. The MaxDistance (in meters) can be used to specify the maximum distance
            // used for searching the elements with.
            this.MapCustomSelectionViewModel = new LiteMapCustomSelectionViewModel();

            // The viewModel controlling the behavior of the MapBar, also set the units used by the scalebar based on the application units
            this.MapBarViewModel = new LiteMapBarViewModel();

            // A variable specifying the single layer to be used for the overview map
            // It needs to refer to the name of a provider that is either directly
            // added or retrieved from the main service-provider via its reference providers.
            string overviewMapLayerProviderName = "MyPreferedProvider";

            // The viewModel handling the logic for the overview map
            this.OverviewMapViewModel = new LiteOverviewMapViewModel()
            {
                // Indicate the extra zoom levels to use; with each zoom level
                // introducing an extra factor of 2 to be used in the extent ratio
                ExtraZoomLevels = 4,

                // Is the user allowed to move the rectangle to define a new extent
                // for the source map
                AllowMovingSourceRectangle = true,

                // Do we allow the scroll wheel to control the extraZoomLevels further
                AllowScrollWheel = true,

                // Indicates whether the overview needs to keep tracking dynamically
                // during animated zooms
                AllowTrackingDuringZoomAnimation = true,

                // Indicate whether you prefer to only use backdrop layers in the overview map
                BackdropOnly = false,

                // The stroke of the source rectangle in the overview map
                RectangleStroke = new SolidColorBrush(Color.FromArgb(204, 66, 97, 145)),

                // The stroke width of the source rectangle in the overview map
                RectangleStrokeWidth = 2.0,

                // The fill of the source rectangle in the overview map
                RectangleFill = new SolidColorBrush(Color.FromArgb(20, 140, 185, 249)),

                // Do we want to animate the Rectangle with the Overview animation, when
                // the user has moved the animation rectangle. In case this is true, the
                // rectangle will be moved together with the moving map; otherwise, it
                // will immediately display in the centre
                RectangleUseAnimation = true,

                // The stroke of the source rectangle in the overview map in case we are
                // animating the rectangle back to the centre after it has been moved
                // by the user. Only in effect when RectangleUseAnimation is set to true.
                RectangleAnimationStroke = new SolidColorBrush(Color.FromArgb(102, 66, 97, 145)),

                // The stroke width to use in case we are animating the rectangle back to
                // the centre after it has been moved by the user. Only in effect when
                // RectangleUseAnimation is set to true.
                RectangleAnimationStrokeWidth = 1.0,

                // The fill of the source rectangle in the overview map in case of animating
                // back to the centre. Only in effect when RectangleUseAnimation is set to true.
                RectangleAnimationFill = new SolidColorBrush(Color.FromArgb(26, 140, 185, 249)),

                // The dimensions of the overview map
                Width  = 200,
                Height = 200,

                // The opacity of the overview map, in the range <0.0, 100.0]
                Opacity = 100.0,

                // Indicates whether changes in the On/Off state of layers should
                // be tracked in the overview map as well. If not, the initial
                // on/off states of the layers will be used in the overview map
                TrackLayerOnOffChanges = true,

                // Indicates whether changes in the Selected Mode of (backdrop) layers
                // should be tracked in the overview map as well. Otherwise, the
                // default modes will be picked of the layer definitions and will
                // not change.
                // Note: in case a SingleLayerDeterminator is used, the resulting
                // layer of that view model will be used for all situations and
                // this flag has no effect.
                TrackLayerSelectedModeChanges = true,

                // In case a fixed layer needs to be used, set up a function
                // that yields the single layer from the set of available layers
                SingleLayerDeterminator = (layers) => layers.Where(l => l.ServiceProvider != null && l.ServiceProvider.Name == overviewMapLayerProviderName).FirstOrDefault()
            };

            // The viewModel handling the active mode of backdrop layers, it is used to
            // display a mode-selector on the Map.
            this.MapBackdropLayerModeSelectionViewModel = new LiteMapBackdropLayerModeSelectionViewModel()
            {
                // Indicate which maps are allowed to have their layer selection
                // be carried out via this viewModel
                MapFilter = map => UseBackdropLayerSelector,

                // Allow all backdrop layers (of allowed maps) to be used
                MapLayerFilter = layer => true

                                 // Use this line if you want to show only layers that have multiple modes defined
                                 // MapLayerFilter = layer => layer.LayerDefinition != null && layer.LayerDefinition.Modes.Count > 1
            };


            // The themes view model holds the information needed to display
            // the layers of the MapsViewModel's current map
            this.MapThemesViewModel = new LiteMapThemesViewModel()
            {
                MapLayerFilter = layer => layer.Name != LiteMapsViewModel.RestrictionMapLayerName
            };

            // The measure view model is responsible for the measure interaction modes
            this.MapMeasureViewModel = new LiteMapMeasureViewModel()
            {
                // Indicate whether we want to show a checkbox for actively selecting the default mode.
                ShowDefaultMode = false,

                // Take care of the extra height of the Map Bar
                TopMargin = 40
            };

            this.MapMeasureISViewModel = new LiteMapMeasureISViewModel()
            {
                // Indicate whether we want to show a checkbox for actively selecting the default mode.
                ShowDefaultMode = false,

                // Take care of the extra height of the Map Bar
                TopMargin = 40
            };

            // Create the MapTrail ViewModel for interaction with the trail
            this.MapTrailViewModel   = new LiteMapTrailViewModel();
            this.MapTrailISViewModel = new MapTrailISViewModel();
            this.MapPointISViewModel = new MapPointISViewModel();

            // Create the Edit Geometry ViewModel for interaction with editable geometry
            this.MapEditGeometryViewModel = new LiteMapEditGeometryViewModel();

            // Create the view model responsible for the RMC popup menu
            this.MapPopupViewModel = new LiteMapPopupMenuViewModel();

            // Create the Street View ViewModel for interacting with Google Street View.
            // This interaction will only be available/visible in case a Google map is shown on the active map.
            this.StreetViewViewModel = new StreetViewViewModel();

            // The feature details view model is a PropertyGrid that displays
            // the content of a (selected) feature
            this.FeatureDetailsViewModel = new LiteFeatureDetailsViewModel()
            {
                MessageBoxService = this.ToolboxMessageBoxViewModel
            };

            // The feature insert view model, responsible for getting and managing the insertable features
            this.FeatureInsertViewModel = new LiteFeatureInsertViewModel();

            // Set up a default way to categorize the fields by using the FieldDescriptorType (alpha/geom/smartlink/relation)
            this.FeatureDetailsViewModel.Properties.FieldToCategoryConverter = FeatureDetailsViewModelProperties.FieldDescriptorTypeCategoryConverter;

            // The collection restriction view model that is responsible for restricting collections' content
            // before using them. This viewModel is a template that can be filled out further. The viewModel
            // is loosely coupled (via messenger requests) and other viewModels use its restriction capabilities
            // by just placing a LiteRestrictFeatureCollectionRequestMessage request on the messenger.

            // Set up the default restrictions (which means that default geometry-restrictions will be set up for those
            // tables for which no explicit table/field key-value pair has been set up.
            bool includeDefaultRestrictions = true;

            FeatureCollectionRestrictionViewModel = new LiteFeatureCollectionRestrictionViewModel(Messenger, includeDefaultRestrictions,
                                                                                                  new LiteFeatureCollectionRestrictionViewModel.TableFieldRestrictions
            {
                // Add table/geomfield pairs for indicating an explicit geometry-field selection
                // To leave a table out explicitly, include it with an empty field
                // { "table1", "field1" },
                // { "table2", ""}
            });

            // The collection result view model is capable of displaying results of queries and followed joins
            this.FeatureCollectionResultViewModel = new LiteFeatureCollectionResultViewModel();
            this.FeatureCollectionResultViewModel.Properties.TrackSelectionInFeatureDetails = true;
            this.FeatureCollectionResultViewModel.Properties.TrackSelectionInMap            = false;

            // Set a default batch size - this can be determined per table (descriptor) as well,
            // by using the TableProperties API (for the Properties for the active table) or
            // via the TablePropertiesCache where tableProperties can be accessed for any
            // table.
            this.FeatureCollectionResultViewModel.GridProperties.DefaultBatchSize = 200;

            // Create a viewModel that will be responsible for all feature values that are activated,
            // meaning clicking on a Geometry, SmartLink or Relation Field. The values that are placed
            // on the databus will be picked up by this viewModel and acted upon accordingly.
            this.FeatureValueActivationViewModel = new LiteFeatureValueActivationViewModel();

            // The view model containing all the queries
            this.QueriesViewModel = new LiteQueriesViewModel()
            {
                MessageBoxService = this.ToolboxMessageBoxViewModel
            };

            // The Place Finder ViewModel
            this.PlaceFinderViewModel = new LiteMapPlaceFinderViewModel()
            {
                // Set the typing delay to 500 ms; all characters typed within this
                // timespan will still be used in one call to the active geoLocator
                TypingDelayBeforeSendingRequest = 500,

                // The maximum number of results
                MaximumNumberOfResults = 10
            };

            // Print View Model holds all information to print, including the
            // client-side templates that have been set up for Lite
            this.PrintViewModel = new LitePrintViewModel();

            // FMEJIA: Se agrega instancia de Factibilidad
            FactibilidadViewModel   = new Lite.LiteFactibilidadView();
            MapMarkViewModel        = new Lite.LiteMapMarkViewModel();
            InventarioCajaViewModel = new Lite.LiteInventarioCajaViewModel();

            EdicionSwViews             = new Lite.EdicionSwView();
            MapMarkISViewModel         = new Lite.LiteMapMarkISViewModel();
            MapTrailISVM               = new Lite.MapTrailISViewModel();
            this.MapTrailISViewModel   = new MapTrailISViewModel();
            this.MapPointISViewModel   = new MapPointISViewModel();
            this.EdicionFeatureDetails = new EdicionSwViewModel();


            //MapBarIS = new Lite.LiteMapBarIS();

            // The viewModel responsible for the long polling for checking changes
            this.MapLayerChangeRetriever = new LiteMapLayerChangesRetriever();
        }
示例#52
0
 public MainWindow(ApplicationViewModel applicationViewModel)
 {
     this.DataContext = applicationViewModel;
     this.InitializeComponent();
 }
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            ApplicationViewModel viewmodel = IoC.IoCContainer.Get <ApplicationViewModel>();

            return(viewmodel);
        }
示例#54
0
 public AdminPendingOffersPage(ref ApplicationViewModel viewModel)
 {
     this.viewModel = viewModel;
     DataContext    = viewModel;
     InitializeComponent();
 }
        public MainWindow(DataCoordinator dataCoordinator)
        {
            DataContext = new ApplicationViewModel(dataCoordinator);

            InitializeComponent();
        }
示例#56
0
 public ViewModelManager(ApplicationViewModel applicationViewModel, IDependencyContainer container)
 {
     _applicationViewModel = applicationViewModel;
     _container            = container;
 }
示例#57
0
 public ActionResult ApplyNoMenu()
 {
     var model = new ApplicationViewModel();
     return View(model);
 }
 /// <inheritdoc />
 public NonReloadedPageViewModel(ApplicationViewModel appViewModel)
 {
     ApplicationViewModel = appViewModel;
     ApplicationViewModel.SelectedProcess!.EnableRaisingEvents = true;
     ApplicationViewModel.SelectedProcess.Exited += SelectedProcessOnExited;
 }
示例#59
0
        /// <summary>
        /// Returns a list of view controls that edit the given ViewModel.
        /// </summary>
        /// <param name="viewModel">ViewModel for which to find view controls</param>
        /// <param name="requestedTabTypes">Limits what types of iObjectControl should be returned.  If the iObjectControl is not of any type in this IEnumerable, it will not be used.  If empty or nothing, no constraints will be applied, which is not recommended because the iObjectControl could be made for a different environment (for example, a Windows Forms user control being used in a WPF environment).</param>
        /// <param name="appViewModel">Instance of the current application ViewModel.</param>
        /// <returns>An IEnumerable of object controls for the given model.</returns>
        /// <remarks>This version of <see cref="GetViewControls(Object, IEnumerable(Of Type), PluginManager)"/> searches for views, then finds paths to the model.</remarks>
        private static IEnumerable <IViewControl> GetViewControlsByView(object viewModel, IEnumerable <Type> RequestedTabTypes, ApplicationViewModel appViewModel, PluginManager manager)
        {
            if (viewModel == null)
            {
                throw (new ArgumentNullException(nameof(viewModel)));
            }

            var modelType   = viewModel.GetType().GetTypeInfo();
            var allTabs     = new List <IViewControl>();
            var objControls = GetViewControls(manager);

            foreach (var etab in objControls.Where(x => RequestedTabTypes.Any(y => ReflectionHelpers.IsOfType(x, y.GetTypeInfo()))).OrderBy(x => x.GetSortOrder(modelType, true)))
            {
                bool             isMatch          = false;
                GenericViewModel currentViewModel = null;

                //Check to see if the tab support the type of the given object
                var supportedTypes = etab.GetSupportedTypes();

                foreach (var typeInfo in supportedTypes)
                {
                    if (typeInfo.IsInterface)
                    {
                        //The target is an interface.  Check to see if there's a view model that implements it.
                        //Otherwise, check the model

                        //Get the view model for the model from the IOUI mangaer
                        var viewmodelsForModel = appViewModel.GetViewModelsForModel(viewModel);

                        //If there are none, and the model is a FileViewModel, get the view models that way
                        if (ReferenceEquals(viewmodelsForModel, null) && viewModel is FileViewModel)
                        {
                            viewmodelsForModel = (viewModel as FileViewModel).GetViewModels(appViewModel);
                        }

                        //If we still can't find anything, set viewModelsForModel to an empty enumerable
                        if (ReferenceEquals(viewmodelsForModel, null))
                        {
                            viewmodelsForModel = Array.Empty <GenericViewModel>();
                        }

                        // Of the view models that support the model, select the ones that the current view supports
                        var availableViewModels = viewmodelsForModel.Where(x => ReflectionHelpers.IsOfType(x, typeInfo));

                        if (availableViewModels != null && availableViewModels.Any())
                        {
                            // This view model fits the critera
                            var first = availableViewModels.First();
                            isMatch          = etab.SupportsObject(first);
                            currentViewModel = first;
                            if (isMatch)
                            {
                                break;
                            }
                        }
                        else if (ReflectionHelpers.IsOfType(viewModel, typeInfo))
                        {
                            // The model implements this interface
                            isMatch = etab.SupportsObject(viewModel);
                            if (isMatch)
                            {
                                break;
                            }
                        }
                    }
                    else if (ReflectionHelpers.IsOfType(viewModel, typeInfo))
                    {
                        // The model is the same type as the target
                        isMatch = etab.SupportsObject(viewModel);
                        if (isMatch)
                        {
                            break;
                        }
                    }
                    else if (ReflectionHelpers.IsOfType(typeInfo, typeof(GenericViewModel).GetTypeInfo()))
                    {
                        // The object control is targeting a view model

                        // First, check to see if there's any view models for this model (i.e., is this an open file?)
                        var viewmodelsForModel = appViewModel.GetViewModelsForModel(viewModel);

                        if (ReferenceEquals(viewmodelsForModel, null) && viewModel is FileViewModel)
                        {
                            viewmodelsForModel = (viewModel as FileViewModel).GetViewModels(appViewModel);
                        }

                        //If there are, check to see if the target view supports the view model
                        if (viewmodelsForModel != null)
                        {
                            var potentialViewModel = viewmodelsForModel.FirstOrDefault(x => ReflectionHelpers.IsOfType(x, typeInfo)) as GenericViewModel;
                            if (potentialViewModel != null)
                            {
                                //This view model supports our model
                                isMatch          = etab.SupportsObject(potentialViewModel);
                                currentViewModel = potentialViewModel;
                                if (isMatch)
                                {
                                    break;
                                }
                            }
                        }
                    }
                }

                // This is a supported tab.  We're adding it!
                if (isMatch)
                {
                    // Create another instance of etab, since etab is our cached, search-only instance.
                    var tab = manager.CreateNewInstance(etab) as IViewControl;

                    // Set the appropriate object
                    if (currentViewModel != null)
                    {
                        //We have a view model that the view wants
                        tab.ViewModel = currentViewModel;
                    }
                    else if (tab.SupportsObject(viewModel))
                    {
                        // This model is what the view wants
                        tab.ViewModel = viewModel;
                    }

                    allTabs.Add(tab);
                }
            }

            var backupTabs = new List <IViewControl>();
            var notBackup  = new List <IViewControl>();

            //Sort the backup vs non-backup tabs
            foreach (var item in allTabs)
            {
                if (item.GetIsBackupControl())
                {
                    backupTabs.Add(item);
                }
                else
                {
                    notBackup.Add(item);
                }
            }

            //And use the non-backup ones if available
            if (notBackup.Count > 0)
            {
                return(notBackup);
            }
            else
            {
                var toUse = backupTabs.OrderBy(x => x.GetSortOrder(modelType, true)).FirstOrDefault();
                if (toUse == null)
                {
                    return(Array.Empty <IViewControl>());
                }
                else
                {
                    return(new[] { toUse });
                }
            }
        }
示例#60
0
 /// <summary>
 /// Gets the currently registered MenuActions in heiarchy form.
 /// </summary>
 /// <param name="isDevMode">Whether or not to get the dev-only menu items.</param>
 /// <param name="target">Target of the menu item, or null if there is no target</param>
 /// <param name="appViewModel">Instance of the current application ViewModel</param>
 /// <returns>A list of <see cref="MenuItemInfo"/> with each item's <see cref="MenuItemInfo.Children"/> correctly initialized</returns>
 public static async Task <List <MenuItemInfo> > GetContextMenuItemInfo(object target, ApplicationViewModel appViewModel, PluginManager manager, bool isDevMode = false)
 {
     return(await GetMenuItemInfo(true, isDevMode, target, appViewModel, manager));
 }