Esempio n. 1
0
        public static void Shutdown(int exitCode)
        {
#if !SILVERLIGHT
            CurrentApplication.Shutdown(exitCode);
#else
#endif
        }
Esempio n. 2
0
 public void TestTeardown()
 {
     if (CurrentApplication != null)
     {
         CurrentApplication.Close();
         CurrentApplication.Dispose();
     }
 }
Esempio n. 3
0
        public ActionResult Index(ErrorCriteriaPostModel postModel)
        {
            var viewModel = new ErrorPageViewModel
            {
                ErrorsViewModel = new ErrorCriteriaViewModel
                {
                    Action     = "index",
                    Controller = "errors"
                }
            };

            var applications  = Core.GetApplications();
            var pagingRequest = GetSinglePagingRequest();

            if (applications.PagingStatus.TotalItems > 0)
            {
                var request = new GetApplicationErrorsRequest
                {
                    ApplicationId  = CurrentApplication.IfPoss(a => a.Id),
                    Paging         = pagingRequest,
                    Query          = postModel.Query,
                    OrganisationId = Core.AppContext.CurrentUser.OrganisationId,
                };

                if (postModel.DateRange.IsNotNullOrEmpty())
                {
                    string[] dates = postModel.DateRange.Split('|');

                    DateTime startDate;
                    DateTime endDate;

                    if (DateTime.TryParse(dates[0], out startDate) && DateTime.TryParse(dates[1], out endDate))
                    {
                        request.StartDate = startDate;
                        request.EndDate   = endDate;
                        viewModel.ErrorsViewModel.DateRange = "{0} - {1}".FormatWith(startDate.ToString("MMMM d, yyyy"), endDate.ToString("MMMM d, yyyy"));
                    }
                }

                var errors = _getApplicationErrorsQuery.Invoke(request);

                viewModel.ErrorsViewModel.Paging = _pagingViewModelGenerator.Generate(PagingConstants.DefaultPagingId, errors.Errors.PagingStatus, pagingRequest);
                viewModel.ErrorsViewModel.Errors = errors.Errors.Items.Select(e => new ErrorInstanceViewModel
                {
                    Error = e,
                    //IsGetMethod = e.ContextData.ContainsKey("Request.HttpMethod") && e.ContextData["Request.HttpMethod"].ToLowerInvariant() == "get"
                }).ToList();
            }
            else
            {
                ErrorNotification(Resources.Application.No_Applications);
                return(Redirect(Url.AddApplication()));
            }

            return(View(viewModel));
        }
Esempio n. 4
0
        public ActionResult Index(string q)
        {
            var viewModel = new SearchViewModel
            {
                Query = q
            };

            var applications = Core.GetApplications();

            if (applications.PagingStatus.TotalItems > 0)
            {
                int searchedIssueId;
                if (int.TryParse(q, out searchedIssueId))
                {
                    var issue = _session.Raven.Load <Issue>(searchedIssueId);
                    if (issue != null)
                    {
                        return(Redirect(Url.Issue(searchedIssueId.ToString())));
                    }
                }

                var issues = _getApplicationIssuesQuery.Invoke(new GetApplicationIssuesRequest
                {
                    Paging = new PageRequestWithSort(1, 10)
                    {
                        Sort = nameof(Errordite.Core.Domain.Error.Error.TimestampUtc), SortDescending = true
                    },
                    OrganisationId = Core.AppContext.CurrentUser.OrganisationId,
                    Query          = q,
                    ApplicationId  = CurrentApplication.IfPoss(a => a.Id),
                }).Issues;

                var errors = _getApplicationErrorsQuery.Invoke(new GetApplicationErrorsRequest
                {
                    Paging = new PageRequestWithSort(1, 10)
                    {
                        Sort = nameof(Errordite.Core.Domain.Error.Error.TimestampUtc), SortDescending = true
                    },
                    OrganisationId = Core.AppContext.CurrentUser.OrganisationId,
                    Query          = q,
                    ApplicationId  = CurrentApplication.IfPoss(a => a.Id),
                }).Errors;

                viewModel.IssueTotal = issues.PagingStatus.TotalItems;
                viewModel.ErrorTotal = errors.PagingStatus.TotalItems;
                viewModel.Issues     = IssueItemViewModel.ConvertSimple(issues.Items, Core.GetUsers().Items, Core.AppContext.CurrentUser.ActiveOrganisation.TimezoneId, true);
                viewModel.Errors     = errors.Items.Select(e => new ErrorInstanceViewModel
                {
                    Error           = e,
                    ApplicationName = GetApplicationName(applications.Items, e.ApplicationId)
                }).ToList();
            }

            return(View(viewModel));
        }
Esempio n. 5
0
        public void UpdateAndRender()
        {
            if (time.FPSGoal != 0)
            {
                time.Sleep();
            }
            time.Update();

            CurrentApplication.Update(time);
            CurrentApplication.Render(time);
        }
 public static CurrentApplication GetApplication(Application applicationDb)
 {
     return(new CurrentApplication()
     {
         TeamId = applicationDb.TeamId,
         Id = applicationDb.ApplicationId,
         Accepted = applicationDb.IsAccepted,
         Paid = applicationDb.HasPaid,
         TeamName = applicationDb.Team.Name,
         Players = CurrentApplication.PlayersHelper(applicationDb.Players)
     });
 }
 public static List <CurrentApplication> GetApplications(DbSet <Application> applicationsDb)
 {
     return(applicationsDb.Select(a => new CurrentApplication()
     {
         Id = a.ApplicationId,
         TeamId = a.TeamId,
         TeamName = a.Team.Name,
         Accepted = a.IsAccepted,
         Paid = a.HasPaid,
         Players = CurrentApplication.PlayersHelper(a.Players)
     })
            .ToList());
 }
        private static string GetVersionedContentUrl(UrlHelper helper, string contentPath)
        {
            var contentUrl = helper.Content(contentPath);
            var version    = CurrentApplication.GetVersion();

            if (!string.IsNullOrEmpty(version))
            {
                var webResourceUrl = new WebResourceUrl(contentUrl);
                webResourceUrl.Parameters.Add("ver", version);
                return(webResourceUrl.ToPathAndQuery());
            }
            return(contentUrl);
        }
Esempio n. 9
0
 public IEnumerable <Statistics> GetCurrentStatistics()
 {
     if (CurrentApplication != null)
     {
         foreach (string app in ApplicationUsage.Keys)
         {
             if (CurrentApplication.Contains(app))
             {
                 yield return(ApplicationUsage[app]);
             }
         }
     }
 }
Esempio n. 10
0
        public ActionResult Index(IssueCriteriaPostModel postModel)
        {
            var viewModel    = new IssueCriteriaViewModel();
            var applications = Core.GetApplications();

            if (applications.PagingStatus.TotalItems > 0)
            {
                var pagingRequest = GetSinglePagingRequest();

                if (postModel.Status == null || postModel.Status.Length == 0)
                {
                    postModel.Status = Enum.GetNames(typeof(IssueStatus)).ToArray();
                }
                else if (postModel.Status.Length == 1 && postModel.Status[0].Contains(","))
                {
                    //this is a fix up for when the url gets changed to contain the statuses in a single query parameter
                    postModel.Status = postModel.Status[0].Split(',');
                }

                var request = new GetApplicationIssuesRequest
                {
                    ApplicationId  = CurrentApplication.IfPoss(a => a.Id),
                    Paging         = pagingRequest,
                    AssignedTo     = postModel.AssignedTo,
                    Status         = postModel.Status,
                    Query          = postModel.Name,
                    OrganisationId = Core.AppContext.CurrentUser.OrganisationId,
                };

                var issues = _getApplicationIssuesQuery.Invoke(request).Issues;
                var users  = Core.GetUsers();

                viewModel.AssignedTo     = postModel.AssignedTo;
                viewModel.Status         = postModel.Status;
                viewModel.Name           = postModel.Name;
                viewModel.Paging         = _pagingViewModelGenerator.Generate(PagingConstants.DefaultPagingId, issues.PagingStatus, pagingRequest);
                viewModel.Users          = users.Items.ToSelectList(u => u.FriendlyId, u => u.FullName, u => u.FriendlyId == postModel.AssignedTo);
                viewModel.Statuses       = Enum.GetNames(typeof(IssueStatus)).ToSelectList(s => s, s => s, s => s.IsIn(postModel.Status));
                viewModel.Issues         = IssueItemViewModel.Convert(issues.Items, applications.Items, users.Items);
                viewModel.NoApplications = applications.PagingStatus.TotalItems == 0;
            }
            else
            {
                ErrorNotification(Resources.Application.No_Applications);
                return(Redirect(Url.AddApplication()));
            }

            return(View(viewModel));
        }
Esempio n. 11
0
        protected override Result Work()
        {
            var dash = CurrentApplication.GetDockablePane(BardWebClient.Id);

            if (dash.IsShown())
            {
                dash.Hide();
            }
            else
            {
                dash.Show();
            }

            return(Result.Succeeded);
        }
        public void UI_Android_AddWithPageObjects(double firstNumber, double secondNumber, double expectedResult)
        {
            // Arrange
            // from inline data as parameters

            // Act
            var calculationsPanel = CurrentApplication.NavigateToCalculations();

            calculationsPanel
            .EnterFirstNumber(firstNumber)
            .EnterSecondNumber(secondNumber)
            .PressAdd();

            var result = calculationsPanel.GetResultFieldValue();

            // Assert
            Assert.AreEqual(expectedResult, result);
        }
Esempio n. 13
0
        /// <inheritdoc/>
        public string ToDelimitedString()
        {
            CultureInfo culture = CultureInfo.CurrentCulture;

            return(string.Format(
                       culture,
                       StringHelper.StringFormatSequence(0, 10, Configuration.FieldSeparator),
                       Id,
                       ApplicationChangeType?.ToDelimitedString(),
                       CurrentCpu,
                       CurrentFileserver,
                       CurrentApplication?.ToDelimitedString(),
                       CurrentFacility?.ToDelimitedString(),
                       NewCpu,
                       NewFileserver,
                       NewApplication?.ToDelimitedString(),
                       NewFacility?.ToDelimitedString()
                       ).TrimEnd(Configuration.FieldSeparator.ToCharArray()));
        }
        public CPackConsoleViewModel(string projectRootDirectory)
        {
            ConsoleMessages      = new ObservableCollection <string>();
            Service              = new CPackService();
            ProjectRootDirectory = projectRootDirectory;

            ConsoleMessages.Add("Connecting...");

            TextBoxEnabled = false;

            Task <int> task = CurrentApplication.CheckNewWebServiceVersionAsync();

            task.ContinueWith(version =>
            {
                if (version.Result == 0)
                {
                    ConsoleMessages.Add("Failed to contact server " + CurrentApplication.TypeSqfDomain + ".");
                    ConsoleMessages.Add(">");
                    TextBoxEnabled = true;
                }
                else if (version.Result == CurrentWebService.Version)
                {
                    ConsoleMessages.Clear();
                    ConsoleMessages.Add("Please use any of the following commands:");
                    ConsoleMessages.Add(" Install <packagename> [-version <version>] [-beta]");
                    ConsoleMessages.Add(" Update <packagename> [-version <version>] [-beta]");
                    ConsoleMessages.Add(" Remove <packagename>");
                    ConsoleMessages.Add(" List [-beta]");
                    ConsoleMessages.Add(" Exit");
                    TextBoxEnabled = true;
                }
                else
                {
                    ConsoleMessages.Add("CPack version has changed and need to be updated before use. Pleast update TypeSqf to latest version and try again.");
                    ConsoleMessages.Add(">");
                }
            }, TaskScheduler.FromCurrentSynchronizationContext());
        }
Esempio n. 15
0
        private async Task SavePropertiesAsync()
        {
            _semaphoreForDeserializer.Wait();
            try
            {
                if (CurrentApplication != null)
                {
                    await CurrentApplication.SavePropertiesAsync();

                    loggerService.Info("Saved using Application.Current.Properties");
                }
                else
                {
                    await Deserializer.SerializePropertiesAsync(Properties);

                    loggerService.Info("Saved using self-created serializer");
                }
            }
            finally
            {
                _semaphoreForDeserializer.Release();
            }
        }
Esempio n. 16
0
 private static void naclHandleMiddleMouseDownEvent(int cursorX, int cursorY)
 {
     CurrentApplication.handleMiddleMouseDownEvent(cursorX, cursorY);
 }
Esempio n. 17
0
 private static void naclHandleRightMouseUpEvent(int cursorX, int cursorY)
 {
     CurrentApplication.handleRightMouseUpEvent(cursorX, cursorY);
 }
 public Task <RestApplication> GetCurrentApplicationAsync(RestRequestOptions options = null)
 => CurrentApplication.FetchAsync(options);
 public override Task <Page> CreateDetailPage()
 => CurrentApplication.CreatePage <DetailPage, DetailViewModel>(true);
Esempio n. 20
0
 /// <summary>
 /// Meldet alle Erweiterungen, die sich im <i>Administration PlugIns</i> Unterverzeichnis
 /// der aktuellen Anwendung befinden.
 /// </summary>
 /// <remarks>Die Liste der Erweiterungen.</remarks>
 public static PlugIn[] CreateFactories()
 {
     // Forward
     return(CurrentApplication.CreatePlugInFactories <PlugIn>("Administration PlugIns"));
 }
 public override Task <Page> CreateMasterPage()
 => CurrentApplication.CreatePage <MasterPage, MasterViewModel>(true);
Esempio n. 22
0
 public Task <RestApplication> GetCurrentApplicationAsync()
 => CurrentApplication.DownloadAsync();