Example #1
0
 public AXAClaimController(IUnityContainer unityContainer, IClaimClientService claimClientService, IMetadataClientService metadataClientService, ApplicationModel applicationModel, AXAClaimModel claimModel, ClaimsPayloadManager claimPayloadManager, ClaimsRetrievalManager claimsRetrievalManager, IClaimNameSearchHandler claimNameSearchHandler, AppModel appModel, IClaimViewResolver viewResolver, AXAClaimAmountHistoryController claimAmountHistoryController, ISearchServiceHandler searchService, IClaimTreeviewResolver treeviewResolver, INameService nameService, IEventAggregator eventAggregator, IShellRulesHelper rulesHelper, IClaimsCodeLookupService claimscodelookupservice)
     : base(claimClientService, metadataClientService, claimModel, claimPayloadManager, claimsRetrievalManager, claimNameSearchHandler, appModel, viewResolver, claimAmountHistoryController, treeviewResolver, eventAggregator, rulesHelper, searchService, unityContainer, claimscodelookupservice)
 {
     this.appModel = appModel;
     this._gdiModel = Container.Resolve<AXAGenericDataItemModel>();
     this.claimModel = claimModel;
     this.claimModel.GenericDataItemModel = this._gdiModel;
     this._payloadManager = claimPayloadManager;
     this._nameSearchHandler = claimNameSearchHandler;
     this.claimModel.ReloadTotals += new EventHandler(this.Model_ReloadTotals);
     this.claimModel.ReloadClaimants += new EventHandler(this.ClaimModel_ReloadClaimants);
     this.claimModel.DuplicateClaimCheckClick += new EventHandler<XIAP.Frontend.Infrastructure.Events.CommandEventArgs<ClaimHeaderDto>>(this.ClaimModel_DuplicateClaimCheckClick);
     this.claimModel.CustomCoverageVerification += new EventHandler(this.ClaimModel_CustomCoverageVerification);
     this.claimModel.NameInvolvementModel.GetNameForNameInvolvement += new EventHandler(this.NameInvolvementModel_GetNameForNameInvolvement);
     this.searchService = searchService;
     this.claimModel.TargetHeaderStatusCodeChanged += new EventHandler(this.ClaimModel_TargetHeaderStatusCodeChanged);
     this._genericDataSetBuilder = new ClaimsDataBuilder(claimPayloadManager);
     this._gdsController = new AXAGenericDataSetController((ClaimControllerBase<ClaimModel>)this, claimModel, this._gdiModel, this.Container, metadataClientService, this._genericDataSetBuilder);
     this.SetNumberOfGenericDataItemNodesToBeLoaded();
     this._nameService = nameService;
     this.claimModel.ValidateClaim += new EventHandler(this.ClaimModel_ValidateClaim);
     this.claimAmountHistoryController = claimAmountHistoryController;
     this.claimAmountHistoryController.OnPaymentCancellation += new EventHandler(this.ClaimAmountHistoryController_OnPaymentCancellation);
     (this.claimModel.DocumentModel as AXADocumentModel).OnSaveClick += new EventHandler(this.AXAClaimController_OnSaveClick);
     this.retrievalManager = claimsRetrievalManager;
     (this.claimModel.DocumentModel as AXADocumentModel).RetrievalManager = claimsRetrievalManager;
     this.Model.HeaderPropertyChanged += new EventHandler<PropertyChangedEventArgs>(this.AXAClaimController_HeaderPropertyChanged);
     this.claimModel.OnINACTReviewClick += new EventHandler(this.ClaimModel_OnINACTReviewClick);
     this.claimModel.OnInactRecoveryReviewClick += new EventHandler(this.ClaimModel_OnInactRecoveryReviewClick);
 }
		public ClaimTaskInitialDueDateNavigatorPlugin(IUnityContainer unityContainer, TaskServiceHelper taskServiceHelper, AppModel appModel, ClaimTaskInitialDueDateController claimTaskInitialDueDateController)
		{
			this.unityContainer = unityContainer;
			this.taskServiceHelper = taskServiceHelper;
			this.appModel = appModel;
			this.claimTaskInitialDueDateController = claimTaskInitialDueDateController;
		}
 public AXAClaimCoverageVerificationController(ClaimCoverageVerificationModel claimCoverageVerificationModel, IClaimClientService claimClientService, IUnityContainer container, IMetadataClientService metaClientService, ClaimsPayloadManager payloadManager, AppModel appModel)
     : base(claimCoverageVerificationModel, claimClientService, metaClientService, payloadManager, container)
 {
     this._appModel = appModel;
     this._metadataService = metaClientService;
     this._payloadManager = payloadManager;
 }
Example #4
0
 public AXAClaimSearchBase(ClaimPreviewControllerBase previewController, ISearchServiceHandler searchService, IUnityContainer container, AppModel appModel)
 {
     this._searchService = searchService;
     this._container = container;
     this._appModel = appModel;
     this._previewController = previewController;
 }
 public AXAPolicyRiskController(IUnityContainer container, ApplicationModel applicationModel, IRiskService riskService, ISearchServiceHandler searchservicehandler, IUwNameSearchHandler uwNameSearchHandler, IMetadataClientService metadataService, AXARiskModel policyWizardModel, UwPayloadManager payloadManager, UwRetrievalManager retrievalManager, AppModel appModel, IUwViewResolver viewresolver, IEventAggregator eventAggregator, IShellRulesHelper rulesHelper, IConverter<Xiap.Metadata.Data.Enums.StaticValues.ClaimLinkLevel, PolicyAttachmentGroupingLevel> claimLinkLevelPolicyAttachmentLevelConverterParam)
     : base(applicationModel, riskService, searchservicehandler, uwNameSearchHandler, metadataService, policyWizardModel, payloadManager, retrievalManager, appModel, viewresolver, eventAggregator, rulesHelper, container, claimLinkLevelPolicyAttachmentLevelConverterParam)
 {
     this.riskModel = policyWizardModel;
     this.riskModel.OnUpdateFromGeniusClick += new EventHandler<CommandEventArgs<HeaderDto>>(this.RiskModel_OnUpdateFromGeniusClick);
     this.riskModel.OnPolicySummaryClick += new EventHandler<CommandEventArgs<HeaderDto>>(this.RiskModel_OnPolicySummaryClick);
     this._payloadManager = payloadManager;
 }
 public AXAManualAuthorisationController(IUnityContainer container, IClaimClientService claimClientService, ManualAuthorisationModel manualAuthorisationModel, ClaimsPayloadManager claimPayloadManager, INavigator navigator, ClaimPaymentRejectReasonModel paymentRejectReasonModel, AppModel appModel)
     : base(claimClientService, manualAuthorisationModel, claimPayloadManager, navigator, container, appModel)
 {
     this.claimClientService = claimClientService;
     this.payRejectmodel = paymentRejectReasonModel;
     this.Navigator = navigator;
     this.payRejectmodel.OnOk += this.OkClicked;
     this.payRejectmodel.OnCancel += this.CancelClicked; 
 }
Example #7
0
 public MainWindow()
 {
     Test();
     InitializeComponent();
     m_appModel = new AppModel();
     this.DataContext = m_appModel;
     ConnectEvents();
     m_appModel.Initialize();
 }
        /// <summary>
        /// Creates a new <see cref="SettingsController"/>.
        /// </summary>
        public SettingsController()
        {
            // Establish data context for the view
            m_dataContext = new DataContext(exceptionHandler: MvcApplication.LogException);
            ViewData.Add("DataContext", m_dataContext);

            // Set default model for pages used by layout
            m_appModel = new AppModel(m_dataContext);
            ViewData.Model = m_appModel;
        }
Example #9
0
        public MainWindow()
        {
            InitializeComponent();

            //initilize webrtc
            RTC.Init();

            rtcControl = new RTCControl();

            currParticipants = new List <CurrentParticipants>();

            //setup events
            rtcControl.ErrorConnectSignaling  += RtcControl_ErrorConnectSignaling;
            rtcControl.ConnectedToSignaling   += RtcControl_ConnectedToSignaling;
            rtcControl.RTCInitialized         += WebRTCInitialized;
            rtcControl.UserJoinedMeeting      += RtcControl_UserJoinedMeeting;
            rtcControl.UserLeftMeeting        += RtcControl_UserLeftMeeting;
            rtcControl.ILeftMeeting           += RtcControl_ILeftMeeting;
            rtcControl.IJoinedMeeting         += RtcControl_IJoinedMeeting;
            rtcControl.MeetingMessageReceived += RtcControl_MeetingMessageReceived;


            model = new AppModel();

            this.DataContext = model;

            model.PropertyChanged += Model_PropertyChanged;


            //set the initial signaling url .. this is where our signalr server is running from
            model.SignalingUrl = System.Configuration.ConfigurationManager.AppSettings["SignalingUrl"];

            rtcControl.SignalingType = SignalingTypes.Socketio; //SignalingTypes.SignalR; // SignalingTypes.Socketio;
            rtcControl.SignalingUrl  = model.SignalingUrl;

            SetupCommands();

            ShowMessage("Initializing WebRTC", System.Windows.Media.Brushes.MediumBlue, true);

            rtcControl.Width  = 480;
            rtcControl.Height = 360;

            //we add our own video to the list of videos
            videoList.Children.Add(rtcControl);

            //we initialize webrtc - mandatory call!
        }
Example #10
0
        /// <summary>
        /// Called every step of the program to listen to input commands for various features
        /// </summary>
        public override void Update()
        {
            if (ActiveRobot == null)
            {
                AppModel.ErrorToMenu("ROBOT_SELECT|Robot instance not valid.");
                return;
            }

            if (ActiveRobot.transform.GetChild(0).transform.position.y < -10 || ActiveRobot.transform.GetChild(0).transform.position.y > 60)
            {
                BeginRobotReset();
                EndRobotReset();
            }

            if (reset)
            {
                BeginRobotReset();
                reset = false;
            }

            //Spawn a new robot from the same path or switch active robot
            if (!ActiveRobot.IsResetting && ActiveRobot.ControlIndex == 0)
            {
                if (InputControl.GetButtonDown(Controls.Players[ActiveRobot.ControlIndex].GetButtons().duplicateRobot))
                {
                    LoadRobot(robotPath, ActiveRobot is MaMRobot);
                }
                if (InputControl.GetButtonDown(Controls.Players[ActiveRobot.ControlIndex].GetButtons().switchActiveRobot))
                {
                    SwitchActiveRobot(SpawnedRobots.IndexOf(ActiveRobot) + 1 < SpawnedRobots.Count() ? SpawnedRobots.IndexOf(ActiveRobot) + 1 : 0);
                }
            }

            // Toggles between the different camera states if the camera toggle button is pressed
            if ((InputControl.GetButtonDown(Controls.Global.GetButtons().cameraToggle)) &&
                DynamicCameraObject.activeSelf && DynamicCamera.ControlEnabled)
            {
                dynamicCamera.ToggleCameraState(dynamicCamera.ActiveState);
            }

            // Switches to replay mode
            if (!ActiveRobot.IsResetting && InputControl.GetButtonDown(Controls.Global.GetButtons().replayMode))
            {
                CollisionTracker.ContactPoints.Add(null);
                StateMachine.PushState(new ReplayState(fieldPath, CollisionTracker.ContactPoints));
            }
        }
Example #11
0
        public Task CreateSiteAsync(AppModel appModel)
        {
            return(Task.Run(async() =>
            {
                if (!Directory.Exists(appModel.PublishPath))
                {
                    publishService.Publish(appModel.ProjectPath, appModel.BuildConfiguration, appModel.PublishPath, appModel.Environment);

                    await WriteGitInfoFilesAsync(appModel.ProjectPath, appModel.PublishPath);
                }

                siteManagementService.Create(appModel.AppPoolName, appModel.SiteName, appModel.HttpPort, appModel.HttpsPort, appModel.CertificateThumbprint, appModel.PublishPath);
                siteManagementService.SetServerAutoStart(appModel.SiteName, true);

                await NotifySiteUpdateSubscribersAsync(appModel, false);
            }));
        }
Example #12
0
        public void NuevaCategoria()
        {
            var model = new AppModel();

            using (var unitOfWork = new AppUnitOfWork(model))
            {
                var categoria = new Categoria()
                {
                    Nombre = "Mouse",
                    Estado = true
                };

                unitOfWork.CategoriaRepository.Add(categoria);

                Assert.IsTrue(categoria.CategoriaID > 0);
            }
        }
Example #13
0
        public int Invoke(AppModel app)
        {
            if (!app.IsValid())
            {
                return(0);
            }

            var newApp = new DataAccess.Models.App()
            {
                Name = app.Name
            };

            appRepository.Add(newApp);
            appRepository.Save();

            return(newApp.Id);
        }
Example #14
0
        private async void AddMemberToCommittee()
        {
            try
            {
                var member = SelectedUser as MemberUser;
                member.MemberOf.Add(CurrentCommittee);
                AppModel.Entry(SelectedUser).State = EntityState.Modified;
                AppModel.SaveChanges();

                OnSuccess?.Invoke(member);
                MessengerInstance.Send(new ClosePopUpMessage(null));
            }
            catch (Exception e)
            {
                ImHereMessageBox.ShowError("Error Adding New Entry", e.Message);
            }
        }
Example #15
0
        private void OnLoaded(object sender, RoutedEventArgs routedEventArgs)
        {
            AppModel model = (AppModel)((Page)sender).DataContext;

            if (model.Servers != null && model.Servers.Any())
            {
                FilterBox.Focus();
            }
            else
            {
                ServerDefinitionGrid.Width = 320;
                ServerDefinitionGrid.Focus();

                AddServerBorder.Width = 200;
                AddServerBox.Focus();
            }
        }
Example #16
0
        private async Task <SecondaryTile> CreateTile(AppModel model)
        {
            var iconPath = await AppIconsManager.Current.CopyToLocalAppData(model.TileIconPath);

            var appTile = new SecondaryTile(
                model.TileId,
                model.Name,
                model.Id,
                new Uri(iconPath),
                TileSize.Default);

            appTile.RoamingEnabled = true;
            appTile.VisualElements.BackgroundColor             = (Windows.UI.Color)XamlBindingHelper.ConvertValue(typeof(Windows.UI.Color), model.AccentColor);
            appTile.VisualElements.ShowNameOnSquare150x150Logo = true;

            return(appTile);
        }
Example #17
0
        private IEnumerator ShootCoroutine()
        {
            if (IsPlayers)
            {
                AppModel.Player().Backpack.Ammo[AmmoKind]--;
            }
            _nextShotTime = Time.time + _shootRate;
            _animator.SetTrigger(ShootAnim);
            yield return(new WaitForSeconds(_shootDelay));

            SpawnProjectiles();
            State.bulletsLeft--;
            if (State.bulletsLeft <= 0)
            {
                Reload();
            }
        }
Example #18
0
        public Task <bool> CreateApp(AppModel model)
        {
            if (!model.IsValid())
            {
                return(Task.FromResult(false));
            }

            var user = Context.Set <User>().FirstOrDefault(x => x.Id == model.CreatedBy && x.IsActive);

            if (user == null)
            {
                Task.FromResult(false);
            }

            if (user.RoleName == ConstHelper.User)
            {
                Task.FromResult(false);
            }

            var key = Guid.NewGuid().ToNoDashString();
            var app = new App
            {
                Id          = model.Id,
                UserId      = user.Id,
                Name        = model.Name,
                Url         = model.Url,
                IsActive    = true,
                CreatedBy   = user.Id,
                Description = model.Description ?? string.Empty,
                Tokens      = new List <Token>
                {
                    new Token
                    {
                        CreatedBy   = user.Id,
                        Id          = key,
                        UsageCount  = 0,
                        IsAppActive = true,
                        IsActive    = true
                    }
                }
            };

            Context.Set <App>().Add(app);

            return(Task.FromResult(Context.SaveChanges() > 0));
        }
        public ActionResult DataFileSchema(string file, string type)
        {
            if (string.IsNullOrEmpty(file))
            {
                throw new ArgumentNullException("file");
            }

            if (string.IsNullOrEmpty(file))
            {
                throw new ArgumentNullException("type");
            }

            var pkg = AppModel.Get().ContentTypes[type];

            ViewBag.FileUri = new Uri(file);
            return(PartialView(pkg));
        }
Example #20
0
        public WebPage WebPage(string nodeName)
        {
            WebPage webPage = _pageCollections[nodeName] as WebPage;

            if (null == webPage)
            {
                webPage                    = new WebPage();
                webPage.ObjectName         = nodeName;
                _pageCollections[nodeName] = webPage;
                AppModel model = AppModel.Current;
                webPage.RelayObject = model.GetTestObject(nodeName) as SETestObject;
                // webPage.RelayObject.WebDriver = BrowserHoster.getInstance().WebDriver;
                // BrowserHoster.getInstance().SwithToURL(webPage.RelayObject.Properties[WebControlKeys.URL]);
                LPWebObjects.Controls.WebPage.SwitchTo(webPage);
            }
            return(webPage);
        }
Example #21
0
        public ResultModel AddApp(AppModel appModel)
        {
            Task <ResultModel> task = Task.Run(async() =>
            {
                try
                {
                    await _appManager.AddAppAsync(appModel);
                    return(ResultModel.Success("已添加应用"));
                }
                catch (InvalidOperationException ex)
                {
                    return(ResultModel.Fail(ex.Message));
                }
            });

            return(task.Result);
        }
Example #22
0
        public ActionResult Create(AppModel data)
        {
            try
            {
                appRepository.Create(data);

                return(Ok(new MessageModel {
                    Code = 1, Msg = "Ok"
                }));
            }
            catch (Exception ex)
            {
                return(BadRequest(new MessageModel {
                    Code = 2, Msg = ex.Message
                }));
            }
        }
        public void NuevaCategoria()
        {
            using (var model = new AppModel())
            {
                var categoria = new Categoria()
                {
                    Nombre = "Mouse",
                    Estado = true
                };

                model.Categoria.Add(categoria);
                model.SaveChanges();//Es requerido para confirmar la transacción en EF

                //Verificando que se esté creando la categoría
                Assert.IsTrue(categoria.CategoriaID > 0);
            }
        }
        public static AppModel LoadModelFile(string appModelPath, TestObjectNurse rootNurse)
        {
            _treeObjects = rootNurse.TreeView;

            AppModel model = AppModelManager.Load(appModelPath, ModelLoadLevel.Full);

            TestObjectToTreeNode(model.Items, rootNurse);

            AppEnvironment.CurrentModelPath = appModelPath;

            OnFileLoaded(appModelPath);

            AppEnvironment.CurrentModelPath = appModelPath;
            EnsureWatcherCreated(AppEnvironment.CurrentModelPath);

            return(model);
        }
Example #25
0
        public AppContext CreateAppContext(AppModel app)
        {
            Set(app.Key, app);
            //更新当前App
            var apps    = Get <List <AppModel> >(StaticString.AppsString) ?? new List <AppModel>();
            var current = apps.FirstOrDefault(item => item.Key == app.Key);

            if (current != null)
            {
                apps.Remove(current);
            }
            apps.Add(app);
            Set(StaticString.AppsString, apps);
            AppContext.Current     = new AppContext(this, app, CacheFactory.GetRedisCache(sectionName: StaticString.AppContextString));
            AppContext.Current.App = app;
            return(AppContext.Current);
        }
Example #26
0
        public AppModel Invoke(int id)
        {
            var app = appRepository.FindBy(x => x.Id == id).FirstOrDefault();

            if (app == null)
            {
                return(null);
            }

            var appModel = new AppModel()
            {
                Id   = app.Id,
                Name = app.Name,
            };

            return(appModel);
        }
Example #27
0
        public async Task OpenURL(string url, MethodEnum method = MethodEnum.GET, bool includeSessionCookie = false)
        {
            AM = DependencyService.Resolve <AppModel>();
            var client = new RestClient();

            if (includeSessionCookie)
            {
                var cookieJar = new CookieContainer();
                cookieJar.Add(new Uri(Constants.BASE_URI), new Cookie(AM.UserSessionCookie.Name, AM.UserSessionCookie.Value));
                client.CookieContainer = cookieJar;
            }

            var request = new RestRequest(url, (Method)method)
            {
                RequestFormat = DataFormat.Json
            };
            var cancellationTokenSource = new CancellationTokenSource();
            var response = await client.ExecuteTaskAsync(request, cancellationTokenSource.Token);

            if (response.Cookies.Count > 0)
            {
                foreach (var cookie in response.Cookies)
                {
                    if (cookie.Name == "_whitepaperbible_session")
                    {
                        UserSessionCookie = new SessionCookie
                        {
                            Name  = cookie.Name,
                            Value = cookie.Value
                        };
                    }
                }
            }

            ResponseText = response.Content;
            //			RemoveNetworkActivity (url);
            if (response.ResponseStatus == ResponseStatus.Error)
            {
                DispatchError();
            }
            else
            {
                DispatchComplete();
            }
        }
Example #28
0
        public static AppContext BuildAppContext(this PlatformContext platformContext)
        {
            var app = new AppModel
            {
                Id     = CoralConvert.Convert <long>(AppConfig.AppSettings["AppId"]),
                Key    = AppConfig.AppSettings["AppKey"],
                Secret = AppConfig.AppSettings["AppSecret"],
                Name   = AppConfig.AppSettings["AppName"],
                Code   = AppConfig.AppSettings["AppCode"],
                Domain = AppConfig.DllConfigs["Host"]["Servers"]["AppDomain"]
            };

            if (string.IsNullOrEmpty(app.Domain))
            {
                throw new ArgumentNullException("Domain", "请在Configs文件夹中Host配置文件的Servers节点配置AppDomain项的值");
            }
            return(platformContext.CreateAppContext(app));
        }
Example #29
0
        public async void LoadData()
        {
            if (UserHasExecutivePrivlliges)
            {
                await AppModel.Donations.LoadAsync();

                await AppModel.BasicUsers.LoadAsync();

                UserDonationsList = AppModel.Donations.Local;
            }
            else
            {
                AppModel.Entry(CurrentUser).State = EntityState.Unchanged;
                UserDonationsList = new ObservableCollection <Donation>(CurrentUser.Donations);
            }
            TotatDonationsAmount = UserDonationsList.Sum(d => d.Amount).ToString();
            LastDonationDate     = GetLastDonation()?.Date.ToLongDateString() ?? EmptyNumbersString;
        }
Example #30
0
        public string GenerateExportedText(AppModel appModel, ExportOptions options)
        {
            var sb = new StringBuilder();

            GenerateTitle(sb, options.ReviewsTitle);

            var areCompleteRankings = !appModel.Ranking.PendingEntries.Any();

            if (areCompleteRankings || options.ExportIncompleteRankings)
            {
                GenerateTop3(sb, appModel.Ranking);
                GenerateAwards(sb, appModel.Awards);
                GenerateRanking(sb, appModel.Ranking);
            }

            GenerateComments(sb, appModel.Ranking, options.EntryCommentTemplate);
            return(sb.ToString());
        }
Example #31
0
        public void Invoke_ValidData_AddAndSaveAreCalled()
        {
            // prepare
            var appToAdd = new AppModel()
            {
                Name = "test"
            };
            var mockedAppRepository = new Mock <IAppRepository>();

            var action = new AddNewApp(mockedAppRepository.Object);

            // action
            action.Invoke(appToAdd);

            // assert
            mockedAppRepository.Verify(r => r.Add(It.IsAny <DataAccess.Models.App>()), Times.Once());
            mockedAppRepository.Verify(r => r.Save(), Times.Once());
        }
 public ClaimSearchController(ApplicationModel applicationModel, IUnityContainer container, IClaimClientService claimService, AppModel appModel, ISearchServiceHandler searchService, SearchResultsModel searchFilterModel, IMetadataClientService metadataService, IEventAggregator eventAggregator, ClaimSearchModel searchModel)
     : base(eventAggregator, searchFilterModel, container)
 {
     this.ClaimSearchModel = searchModel;
     this._applicationModel = applicationModel;
     this._claimsService = claimService;
     this._metadataService = metadataService;
     this._claimContainer = container;
     this._eventAggregator = eventAggregator;
     this._searchManager = new SearchManager();
     // Close the search tab.
     this.ClaimSearchModel.OnCloseClick += new EventHandler(this._claimSearchModel_OnCloseClick);
     // Display the preview of the selected claim.
     this.ClaimSearchModel.SelectedRowChanged += new EventHandler<SelectedRowChangedEventArgs>(this._claimSearchModel_SelectedRowChanged);
     // Grid paging.
     this.ClaimSearchModel.NeedData += new EventHandler<SearchDataRequestEventArgs>(this._claimSearchModel_NeedData);
     this.ClaimSearchModel.RefreshView += new EventHandler(this._claimSearchModel_RefreshView);
 }
Example #33
0
        protected virtual void SpawnProjectiles()
        {
            var go = Instantiate(_projectile, _shootPoint.position, Quaternion.identity);

            go.transform.SetParent(AppModel.BulletContainer().transform);
            var projectile = go.GetComponent <Projectile>();

            projectile.IsPlayerBullet = IsPlayers;
            projectile.Weapon         = this;
            projectile.Speed          = _bulletSpeed;
            projectile.Impulse        = _impulse;

            projectile.Direction = DegreeToVector2(transform.rotation.eulerAngles.z);
            if (IsInverted)
            {
                projectile.Direction *= -1;
            }
        }
        public GitCommitDialog(string fileOrPath, bool commitRepo = false)
        {
            InitializeComponent();
            AppModel = mmApp.Model;

            CommitModel = new GitCommitModel(fileOrPath, commitRepo);
            if (!commitRepo)
            {
                CommitModel.CommitMessage = $"Update {System.IO.Path.GetFileName(fileOrPath)}";
            }

            CommitModel.CommitWindow = this;

            mmApp.SetThemeWindowOverride(this);

            Owner   = AppModel.Window;
            Loaded += GitCommitDialog_Loaded;
        }
Example #35
0
        public bool UpdateRecord(AppModel record, string attribute, string key, string collection = "")
        {
            collection = String.IsNullOrEmpty(collection) ? _collectionName : collection;

            // Find Query
            var mongoQuery = Query.EQ(attribute, key);

            // Finding Record to retrieve it's old Object ID
            AppModel oldRecord = FindMatch <AppModel> (mongoQuery).FirstOrDefault();

            // Re-setting Object ID of the object
            record._id = oldRecord._id;

            // Update Query
            var updateQuery = Update.Replace(record);

            return(_database.GetCollection <AppModel> (collection).Update(mongoQuery, updateQuery).Ok);
        }
Example #36
0
        /// <summary>Fills the page with content given during the navigation. Every saved sate is also given when the page
        /// is created again based on a previous session.<summary>
        /// /// <param name="sender">The source of the event; in general <see cref="NavigationHelper"/></param>
        /// <param name="e">Event data giving the first navigation parameter transmitted to
        /// <see cref="Frame.Navigate(Type, Object)"/> during the first request of the page and
        /// a state dictionnary saved by the page during a previous session.
        /// The state won't a Null value during the first visit of the page
        private void navigationHelper_LoadState(object sender, LoadStateEventArgs e)
        {
            if (e.NavigationParameter is AppModel)
            {
                this.model = (AppModel)e.NavigationParameter;
                this.model.AddView(this);

                this.shoppingListGroup.Clear();
                this.shoppingListGroup = new List <ShoppingListGroup>();
                foreach (ShoppingListGroup group in this.model.ShoppingList.Values)
                {
                    this.shoppingListGroup.Add(group);
                }
            }

            this.DefaultViewModel["Groups"] = this.shoppingListGroup;
            this.RegisterForPrinting();
        }
Example #37
0
        private void OnTriggerStay2D(Collider2D other)
        {
            if (other.CompareTag("Environment"))
            {
                other.GetComponent <Level.Environment>().DealDamage(AppModel.WeaponData().JetEngineDamage);
            }

            if (other.CompareTag("Enemy"))
            {
                var enemyController = other.GetComponent <EnemyController>();
                var direction       = Weapon.DegreeToVector2(transform.rotation.eulerAngles.z);
                if (Weapon.IsInverted)
                {
                    direction *= -1;
                }
                DamageManager.Hit(enemyController, Weapon, direction.normalized * AppModel.WeaponData().JetEngineImpulse);
            }
        }
Example #38
0
        public AppModel CreateApp(AppModel appModel)
        {
            ThrowOnInvalidAppModel(appModel);

            using (var session = _documentStore.OpenSession())
            {
                var contactEmails = TrimmedEmails(appModel.ContactEmails)
                                    .Select(
                    address => new ContactEmail
                {
                    EmailAddress     = address,
                    ConfirmationCode = KeyGenerator.Generate(),
                    Confirmed        = false
                })
                                    .ToList();
                foreach (var contactEmail in contactEmails)
                {
                    session.Store(contactEmail);
                }

                var newApp = new App
                {
                    Name   = appModel.Name.Trim(),
                    ApiKey = KeyGenerator.Generate(),
                    CreatedTimestampUtc = DateTime.UtcNow,
                    ContactEmailIds     = contactEmails.Select(ce => ce.Id).ToList()
                };
                session.Store(newApp);

                session.SaveChanges();

                // send confirmation emails
                _emailService.SendConfirmationEmails(contactEmails);

                // output new model
                return(new AppModel
                {
                    Id = newApp.Id,
                    Name = newApp.Name,
                    ContactEmails = contactEmails.Select(ce => ce.EmailAddress).ToList(),
                    ApiKey = newApp.ApiKey
                });
            }
        }
Example #39
0
        /// <summary>
        /// Fills the page with the previous elements while the navigation. Any state loaded is given when the page
        /// is recreated from a previous session.
        /// </summary>
        /// <param name="sender">
        /// The event source ; generaly <see cref="NavigationHelper"/>
        /// </param>
        /// <param name="e"> Event data that give the parameter of the navigation transmitted
        /// <see cref="Frame.Navigate(Type, Object)"/> during the initial request of this page and
        /// a state dictionnary preserved by this page during a previous session
        /// The state will not take the value Null when the first visit of this page.</param>
        private void navigationHelper_LoadState(object sender, LoadStateEventArgs e)
        {
            GoToModifyReceipeListEvent evnt = e.NavigationParameter as GoToModifyReceipeListEvent;

            if (evnt != null)
            {
                this.Model = evnt.AppModel;
                if (this.addedView == false)
                {
                    this.Model.AddView(this);
                    this.addedView = true;
                }
                Time time = evnt.Time;

                this.pageTitle.Text = "Liste de recette du " + time.Date;

                if (this.Model.ReceipeList.ContainsKey(time.Date))
                {
                    ReceipeDate receipeDate = this.Model.ReceipeList[time.Date];
                    this.date = receipeDate.Time.Date;

                    List <ItemReceipe> itemsMorning = new List <ItemReceipe>();
                    foreach (Receipe receipe in receipeDate.ReceipeTimeOfDay["Matin"].Receipes.Values)
                    {
                        itemsMorning.Add(ToolItem.CreateItemReceipe(receipe));
                    }
                    morningReceipeViewSource.Source = itemsMorning;

                    List <ItemReceipe> itemsNoon = new List <ItemReceipe>();
                    foreach (Receipe receipe in receipeDate.ReceipeTimeOfDay["Midi"].Receipes.Values)
                    {
                        itemsNoon.Add(ToolItem.CreateItemReceipe(receipe));
                    }
                    noonReceipeViewSource.Source = itemsNoon;

                    List <ItemReceipe> itemsEvenning = new List <ItemReceipe>();
                    foreach (Receipe receipe in receipeDate.ReceipeTimeOfDay["Soir"].Receipes.Values)
                    {
                        itemsEvenning.Add(ToolItem.CreateItemReceipe(receipe));
                    }
                    evenningReceipeViewSource.Source = itemsEvenning;
                }
            }
        }
Example #40
0
        public BootStrapRegistry(AppModel model)
        {
            ForSingletonOf<IWindowManager>().Use(new WindowManager());
            ForSingletonOf<ViewLocationManagement>().Use<ViewLocationManagement>();
            ForSingletonOf<ValueConverterManagement>().Use<ValueConverterManagement>();
            ForSingletonOf<ResourceService>().Use(new ResourceService(new CompositeResourceLoader(model.Assemblies.ToArray())));
            ForSingletonOf<XamlBuilder>().Use(ctx=>
            {
                var b = new XamlBuilder();
                b.GetResourcesFrom(ctx.GetInstance<ResourceService>());
                return b;
            });

            ForSingletonOf<DataTemplateService>().Use(ctx => new DataTemplateService(ctx.GetInstance<ResourceService>()));

            For<Application>().Use(Application.Current);
            Forward<Application, DispatcherObject>();
            ForSingletonOf<IDispatchServices>().Use<WpfDispatchService>();

            ForSingletonOf<IBus>().Use(()=>ConstructBus(model));
            For(typeof(IObservable<>)).Use(typeof(MessageObservable<>));
            Forward<IBus, IPublisher>();
            Forward<IBus, ISubscriber>();

            For(typeof(IExceptionHandler)).Use(model.ExceptionHandler);

            Scan(s =>
            {
                model.Assemblies.ForEach(s.Assembly);
                s.LookForRegistries();
                s.SingleImplementationsOfInterface();
                s.With(new AutoSubscriberRegistrationConvention(model));
                s.With(new MessageHubRegistrationConvention(model));
                s.AddAllTypesOf<IStartupTask>();
                s.AddAllTypesOf<IShutdownTask>();
            });
        }
Example #41
0
        protected override ClaimDocumentController<ClaimModel> GetClaimDocumentController(IUnityContainer container, AppModel appModel)
        {
            if (this.Model != null)
            {
                return new AXAClaimDocumentController(this, this.Model.DocumentModel as AXADocumentModel, this.RetrievalManager as ClaimsRetrievalManager, this.ClaimClientService, this.MetadataService, appModel, container, this.Model.DocumentModel.DocumentContainerModel);
            }

            return null;
        }
 public AXAClaimReopenCloseController(ApplicationModel applicationModel, IClaimClientService claimClientService, IMetadataClientService metadataService, AXAClaimReopenCloseModel model, IUnityContainer container, AppModel appModel)
     : base(applicationModel, claimClientService, metadataService, model, appModel, container)
 {
 }
 public AXASearchResultsModel(IDelayedEvent<SelectedRowChangedEventArgs> timer, AppModel appModel)
     : base(timer, appModel)
 {
     this._appModel = appModel;
 }
 public AXAStandaloneClaimEventController(IClaimClientService claimService, IMetadataClientService metadataService, StandaloneClaimEventModel model, AXAEventModel eventModel, IUnityContainer container, AppModel appModel, ClaimsRetrievalManager retrievalManager, ClaimsPayloadManager payloadManager, IStandaloneClaimEventViewResolver viewResolver)
     : base(claimService, metadataService, model, eventModel, appModel, retrievalManager, payloadManager, viewResolver, container)
 {
     this.Model  = model;
     this._axaEventModel = eventModel;
 }
 public AXABulkEventEntryController(IUnityContainer container, IClaimClientService claimService, AXABulkEventEntryModel model, AppModel appModel, ClaimsPayloadManager payloadManager, ClaimsRetrievalManager claimsRetrievalManager)
     : base(claimService, model, appModel, payloadManager, claimsRetrievalManager, container)
 {
     this.claimService = claimService;
 }
 public AXAFinancialAccountsAvailableBehaviour(AppModel appModel)
 {
     this._appModel = appModel;
 }
 public AXAPolicySearchController(ApplicationModel applicationModel, IUnityContainer container, IRiskService riskService, AppModel appModel, ISearchServiceHandler searchService, AXAPolicySearchModel searchFilterModel, IIDSearches idSearch)
     : base(applicationModel, riskService, appModel, searchService, searchFilterModel, container, idSearch)
 {
     this._model = searchFilterModel;
     this.SetUnderwritingStage();
 }
Example #48
0
 public AXAPersonController(IUnityContainer container, IdPayloadManager idManager, ApplicationModel applicationModel, IInsuranceDirectoryServiceHandler insuranceDirectoryService, PersonModel personModel, IdRetrievalManager retrievalManager, AppModel appModel, IInsuranceDirectoryViewResolver viewresolver, IShellRulesHelper rulesHelper, IMetadataClientService metadataService)
     : base(idManager, applicationModel, insuranceDirectoryService, personModel, retrievalManager, appModel, viewresolver, rulesHelper, container, metadataService, null)
 {
 }
Example #49
0
 private static IBus ConstructBus(AppModel model)
 {
     var setup = BusSetup.StartWith<Conservative>();
     setup.Apply(model.MemBusSetups.ToArray());
     return setup.Construct();
 }
Example #50
0
 public ValueConverterManagement(AppModel model)
 {
     ConventionManager.ApplyValueConverter = ApplyConverter;
     _converters =  model.Converters.ToDictionary(k => Tuple.Create(k.Item1, k.Item2), v => v.Item3);
 }
Example #51
0
 protected override ClaimEventController<ClaimModel> GetClaimEventController(IUnityContainer container, AppModel appModel, IEventAggregator eventAggregator)
 {
     return new AXAClaimEventController(this, this.Model, this.Model.EventModel, container, this.ClaimClientService, this.MetadataService, appModel, this.eventAggregator);
 }
 public AXADocumentDataController(IUnityContainer container, DocumentDataModel model, INameService nameService, AppModel appModel, IShellRulesHelper rulesHelper)
     : base(model, nameService, appModel, rulesHelper, container)
 { 
 }
Example #53
0
 public AXAClaimSearch(ClaimPreviewController previewController, ISearchServiceHandler searchService, IUnityContainer container, AppModel appModel)
     : base(previewController, searchService, container, appModel)
 {
     this._searchTypeName = CLAIMS_SEARCH_TYPE;
 }
 public AutoSubscriberRegistrationConvention(AppModel appModel)
 {
     _appModel = appModel;
 }
        private ObservableCollection<INotificationViewModel> GetNotification(ObservableCollection<NotificacionModel> notifications, AppModel app)
        {
            ObservableCollection<INotificationViewModel> nvm = new ObservableCollection<INotificationViewModel>();

            (from o in notifications
             where o.App.IdApp==app.IdApp
             select o).ToList<NotificacionModel>().ForEach(o =>
             {
                 nvm.Add(new NotificationViewModel()
                 {
                     Notification=o
                 });
             });

            return nvm;
        }
        private void SetFriendBindings(AppModel appModel)
        {
            //ToolTip
            this.SetValue(ToolTipService.ToolTipProperty, Friend.Info.Name);

            //Friend Image
            if (!string.IsNullOrEmpty(Friend.Info.Pic_Sqaure_Url))
                PicSource = new BitmapImage(new Uri(Friend.Info.Pic_Sqaure_Url, UriKind.RelativeOrAbsolute));

            Binding bindSelected = new Binding(appModel.CurrentSelectedFriendPropertyName);
            bindSelected.Source = appModel;
            bindSelected.Mode = BindingMode.TwoWay;
            this.SetBinding(CurrentSelectedFriendProperty, bindSelected);

            Binding bindTarget = new Binding(appModel.CurrentPathTargetPropertyName);
            bindTarget.Source = appModel;
            bindTarget.Mode = BindingMode.TwoWay;
            this.SetBinding(CurrentPathTargetProperty, bindTarget);
        }
 public AXAClaimPopupSearchController(ApplicationModel applicationModel, IUnityContainer container, IClaimClientService claimService, AppModel appModel, ISearchServiceHandler searchService, ClaimSearchModel searchFilterModel, IMetadataClientService metadataService)
     : base(applicationModel, claimService, appModel, searchService, searchFilterModel, metadataService,container)
 {
     this.claimSearchModel = searchFilterModel;
     this.appModel = appModel;
 }
Example #58
0
 public OverrideCaliburnSystems(ViewLocationManagement mgm, AppModel model, IContainer container)
 {
     _mgm = mgm;
     _model = model;
     _container = container;
 }
        // Attempts to start the web UI and logs startup errors.
        private bool TryStartWebUI()
        {
            try
            {
                CategorizedSettingsElementCollection systemSettings = ConfigurationFile.Current.Settings["systemSettings"];
                CategorizedSettingsElementCollection securityProvider = ConfigurationFile.Current.Settings["securityProvider"];

                systemSettings.Add("DataProviderString", "AssemblyName={System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089}; ConnectionType=System.Data.SqlClient.SqlConnection; AdapterType=System.Data.SqlClient.SqlDataAdapter", "Configuration database ADO.NET data provider assembly type creation string used when ConfigurationType=Database");
                systemSettings.Add("NodeID", "00000000-0000-0000-0000-000000000000", "Unique Node ID");
                systemSettings.Add("CompanyName", "Grid Protection Alliance", "The name of the company who owns this instance of the openMIC.");
                systemSettings.Add("CompanyAcronym", "GPA", "The acronym representing the company who owns this instance of the openMIC.");
                systemSettings.Add("WebHostURL", "http://+:8989", "The web hosting URL for remote system management.");
                systemSettings.Add("DefaultWebPage", "index.cshtml", "The default web page for the hosted web server.");
                systemSettings.Add("DateFormat", "MM/dd/yyyy", "The default date format to use when rendering timestamps.");
                systemSettings.Add("TimeFormat", "HH:mm.ss.fff", "The default time format to use when rendering timestamps.");
                systemSettings.Add("BootstrapTheme", "Content/bootstrap.min.css", "Path to Bootstrap CSS to use for rendering styles.");

                securityProvider.Add("ConnectionString", "Eval(systemSettings.ConnectionString)", "Connection connection string to be used for connection to the backend security datastore.");
                securityProvider.Add("DataProviderString", "Eval(systemSettings.DataProviderString)", "Configuration database ADO.NET data provider assembly type creation string to be used for connection to the backend security datastore.");

                ValidateAccountsAndGroups(new AdoDataConnection("securityProvider"));

                DefaultWebPage = systemSettings["DefaultWebPage"].Value;

                Model = new AppModel();
                Model.Global.CompanyName = systemSettings["CompanyName"].Value;
                Model.Global.CompanyAcronym = systemSettings["CompanyAcronym"].Value;
                Model.Global.ApplicationName = "openXDA";
                Model.Global.ApplicationDescription = "open eXtensible Disturbance Analytics";
                Model.Global.ApplicationKeywords = "open source, utility, software, meter, interrogation";
                Model.Global.DateFormat = systemSettings["DateFormat"].Value;
                Model.Global.TimeFormat = systemSettings["TimeFormat"].Value;
                Model.Global.DateTimeFormat = $"{Model.Global.DateFormat} {Model.Global.TimeFormat}";
                Model.Global.BootstrapTheme = systemSettings["BootstrapTheme"].Value;

                // Attach to default web server events
                WebServer webServer = WebServer.Default;
                webServer.StatusMessage += WebServer_StatusMessage;

                // Define types for Razor pages - self-hosted web service does not use view controllers so
                // we must define configuration types for all paged view model based Razor views here:
                webServer.PagedViewModelTypes.TryAdd("Config/Users.cshtml", new Tuple<Type, Type>(typeof(UserAccount), typeof(SecurityHub)));
                webServer.PagedViewModelTypes.TryAdd("Config/Groups.cshtml", new Tuple<Type, Type>(typeof(SecurityGroup), typeof(SecurityHub)));
                webServer.PagedViewModelTypes.TryAdd("Config/Settings.cshtml", new Tuple<Type, Type>(typeof(Setting), typeof(DataHub)));
                webServer.PagedViewModelTypes.TryAdd("Config/XSLTemplate.cshtml", new Tuple<Type, Type>(typeof(XSLTemplate), typeof(DataHub)));
                webServer.PagedViewModelTypes.TryAdd("Assets/Meters.cshtml", new Tuple<Type, Type>(typeof(Meter), typeof(DataHub)));
                webServer.PagedViewModelTypes.TryAdd("Assets/Sites.cshtml", new Tuple<Type, Type>(typeof(MeterLocation), typeof(DataHub)));
                webServer.PagedViewModelTypes.TryAdd("Config/MeterGroups.cshtml", new Tuple<Type, Type>(typeof(MeterGroup), typeof(DataHub)));
                webServer.PagedViewModelTypes.TryAdd("Config/MeterMeterGroupView.cshtml", new Tuple<Type, Type>(typeof(MeterMeterGroup), typeof(DataHub)));
                webServer.PagedViewModelTypes.TryAdd("Assets/Lines.cshtml", new Tuple<Type, Type>(typeof(LineView), typeof(DataHub)));
                webServer.PagedViewModelTypes.TryAdd("Assets/MeterLines.cshtml", new Tuple<Type, Type>(typeof(MeterLine), typeof(DataHub)));
                webServer.PagedViewModelTypes.TryAdd("Assets/Channels.cshtml", new Tuple<Type, Type>(typeof(Channel), typeof(DataHub)));
                webServer.PagedViewModelTypes.TryAdd("Config/DashSettings.cshtml", new Tuple<Type, Type>(typeof(DashSettings), typeof(DataHub)));
                webServer.PagedViewModelTypes.TryAdd("Config/AlarmSettings.cshtml", new Tuple<Type, Type>(typeof(AlarmRangeLimitView), typeof(DataHub)));
                webServer.PagedViewModelTypes.TryAdd("Config/DefaultAlarmSettings.cshtml", new Tuple<Type, Type>(typeof(DefaultAlarmRangeLimitView), typeof(DataHub)));
                webServer.PagedViewModelTypes.TryAdd("Config/UserAccountMeterGroupView.cshtml", new Tuple<Type, Type>(typeof(UserAccountMeterGroup), typeof(DataHub)));
                webServer.PagedViewModelTypes.TryAdd("Config/EmailTypes.cshtml", new Tuple<Type, Type>(typeof(EmailType), typeof(DataHub)));
                webServer.PagedViewModelTypes.TryAdd("Config/EmailGroups.cshtml", new Tuple<Type, Type>(typeof(EmailGroup), typeof(DataHub)));
                webServer.PagedViewModelTypes.TryAdd("Config/EmailGroupType.cshtml", new Tuple<Type, Type>(typeof(EmailGroupType), typeof(DataHub)));
                webServer.PagedViewModelTypes.TryAdd("Config/EmailGroupMeterGroup.cshtml", new Tuple<Type, Type>(typeof(EmailGroupMeterGroup), typeof(DataHub)));
                webServer.PagedViewModelTypes.TryAdd("Config/EmailGroupUserAccount.cshtml", new Tuple<Type, Type>(typeof(EmailGroupUserAccount), typeof(DataHub)));
                webServer.PagedViewModelTypes.TryAdd("Workbench/Filters.cshtml", new Tuple<Type, Type>(typeof(WorkbenchFilter), typeof(DataHub)));
                // Create new web application hosting environment
                m_webAppHost = WebApp.Start<Startup>(systemSettings["WebHostURL"].Value);

                // Initiate pre-compile of base templates
                if (AssemblyInfo.EntryAssembly.Debuggable)
                {
                    RazorEngine<CSharpDebug>.Default.PreCompile(HandleException);
                    RazorEngine<VisualBasicDebug>.Default.PreCompile(HandleException);
                }
                else
                {
                    RazorEngine<CSharp>.Default.PreCompile(HandleException);
                    RazorEngine<VisualBasic>.Default.PreCompile(HandleException);
                }

                return true;
            }
            catch (TargetInvocationException ex)
            {
                string message;

                // Log the exception
                message = "Failed to start web UI due to exception: " + ex.InnerException.Message;
                HandleException(new InvalidOperationException(message, ex));

                return false;
            }
            catch (Exception ex)
            {
                string message;

                // Log the exception
                message = "Failed to start web UI due to exception: " + ex.Message;
                HandleException(new InvalidOperationException(message, ex));

                return false;
            }
        }
        public VertexControl(FriendsVertex friend, AppModel appModel)
        {
            DefaultStyleKey = typeof(VertexControl);
            this.Friend = friend;

            SetFriendBindings(appModel);
            SetLayoutBindings();
            SetStateBindings();

            ////Mouse Over
            //this.MouseEnter += new MouseEventHandler(VertexControl_MouseEnter);
            //this.MouseLeave += new MouseEventHandler(VertexControl_MouseLeave);

            ////Select Vertex
            this.MouseLeftButtonDown += new MouseButtonEventHandler(VertexControl_MouseLeftButtonDown);
            this.MouseRightButtonDown += new MouseButtonEventHandler(VertexControl_MouseRightButtonDown);
        }