public async void CompleteEntries(IConnection connection) { if (IsEntriesComplete) { return; } try { Trace($"Complete entries"); var entries = await connection.GetAccountEntries(AccountID); this.entries = new ModelCollection <AccountEntry>(entries); IsEntriesComplete = true; FirePropertyChanged(nameof(Entries)); FirePropertyChanged(nameof(IsEntriesComplete)); } catch (ServerException e) { Trace(e); } }
/// <summary> /// Get the model collection : /// SubModel are transformed as Module /// InlineModel are transformed as Group /// </summary> /// <param name="parentModel"></param> /// <returns></returns> //TODO change name SubModel into Module - InlineModel into Group public virtual ModelCollection GetModelCollection(Model parentModel) { var models = new ModelCollection(); foreach (var subModel in SubModels) { var modelCollection = subModel.GetModelCollection(null); Variables.AddRange(modelCollection.GetVariables()); Groups.AddRange(modelCollection.GetGroups()); // Add module Module.CreateInstance(this, subModel.Name); models.AddRange(modelCollection); } foreach (var subModel in InlineModels) { var modelCollection = subModel.GetModelCollection(this); var variables = modelCollection.GetVariables(); Variables.AddRange(variables); // Add group for each inline model // InlineModel.Name are the same as their parentModel, therefore we use the className var group = new Group(subModel.GetType().Name, Name, variables.Names); Groups.Add(group); } models[0] = this; return(models); }
public void RestoreBasket(HttpContextBase context, IUserInfo user) { ModelCollection <IBasketProduct> items = _productDataProvider.ListBasket(); ClearBasket(context, user); GetBasket(context).Add(items); }
public void UpdateModel(List <MDLTEXData> meshData, ItemData item) { disposed = false; disposing = false; mData = meshData; if (item.ItemName.Equals(Strings.Body)) { ModelTitle = "Note: This is not the default model when unequipped."; ModelSubTitle = "For the unequipped model, search for SmallClothes under the Gear category."; } else { ModelTitle = ""; ModelSubTitle = ""; } for (int i = 0; i < meshData.Count; i++) { ModelCollection.Add(setModel(i)); } Vector3 center = ((CustomGM3D)ModelCollection[0]).Geometry.BoundingSphere.Center; Camera.Position = new Media3D.Point3D(center.X, center.Y, center.Z + 2); Camera.LookDirection = new Media3D.Vector3D(0, 0, center.Z - 2); }
public void ShouldSyncItsContainerWithModelParents() { var model_a = new Model ("a"); var model_b = new Model ("b"); var model_container = new Model("container"); var models = new ModelCollection(model_container); models.AddRange(new [] {model_a, model_b}); Assert.That(models.Container, Is.EqualTo(model_container)); Assert.That(models.All(m => m.Parent == model_container)); models.Clear(); Assert.That(model_a.Parent, Is.Null); Assert.That(model_b.Parent, Is.Null); models.Add(model_a); Assert.That(model_a.Parent, Is.EqualTo(model_container)); models.Insert(0, model_b); Assert.That(model_b.Parent, Is.EqualTo(model_container)); models.Remove(model_a); Assert.That(model_a.Parent, Is.Null); }
private static void LoadDff() { using (new Timing("Loading DFFs into scene")) using (new MemoryCounter()) { var itemDefinitions = new DefinitionCollection(); var modelCollection = new ModelCollection(); var textureCollection = new TextureCollection(true); foreach (var obj in Selection.objects) { var objPath = AssetDatabase.GetAssetPath(obj); if (objPath.EndsWith(".dff", StringComparison.OrdinalIgnoreCase)) { var dff = new DffFile(objPath); modelCollection.Add(dff); itemDefinitions.Add(new ItemDefinition(dff.FileNameWithoutExtension)); } else if (objPath.EndsWith(".txd", StringComparison.OrdinalIgnoreCase)) { textureCollection.Add(new TxdFile(objPath)); } } using (new Loader(itemDefinitions, modelCollection, textureCollection)) foreach (var definition in itemDefinitions) { definition.GetObject(true); } } }
/// <summary> /// Security status manager, current user information /// </summary> private void Authenticate() { try { ViewBag.padlock = Settings.gt_secure_img_padlock; if (System.Web.HttpContext.Current.Session[Settings.gt_ticketAccess] != null) { isAuthenticate = (System.Web.HttpContext.Current.Session[Settings.gt_ticketAccess] == null ? false : true); if (gt.UserName == string.Empty) { ModelCollection modelcollection = new ModelCollection(); modelcollection.AddModel(infoUser); modelcollection.AddModel((System.Web.HttpContext.Current.Session[Settings.gt_ticketAccess].ToString())); gt.controlPopulation(ref modelcollection, invokeRoutine.sel_adm_user_authenticate); } } if (isAuthenticate) { ViewBag.padlock = Settings.gt_secure_img_padlock_unlock; ViewBag.UserName = infoUser.name; ViewBag.UserPermission = infoUser.permission_nick; } } catch (Exception ex) { Register.Log(this, ref ex); } }
public async Task <IActionResult> EventProcess(ModelCollection model) { NewEventModel modeltemp = model.evModel; if (modeltemp.Info == "" || modeltemp.Info == null) { return(RedirectToAction("Index")); } var user = await _usermanager.GetUserAsync(User); var e = new Event() { ID = _context.Events.ToList().Count() + 1, Info = modeltemp.Info, StartDate = Exdatetime, EndDate = Exdatetime, User = user }; _context.Events.Add(e); _context.SaveChanges(); return(RedirectToAction(nameof(ScheduleController.Index), "Schedule", new { day = ScheduleController.Exdatetime.Day, month = ScheduleController.Exdatetime.Month, year = ScheduleController.Exdatetime.Year })); }
/// <summary> Returns wind speed cross-prediction estimate index that used specified model. </summary> public int GetWS_PredIndOneModel(Model model, ModelCollection modelList) { int WS_PredInd = -1; bool gotWS_PredInd = false; for (int i = WS_PredCount - 1; i >= 0; i--) { int numRadii = WS_Pred.GetUpperBound(1) + 1; for (int j = 0; j <= numRadii - 1; j++) { bool isSameModel = modelList.IsSameModel(model, WS_Pred[i, j].model); if (isSameModel == true) { WS_PredInd = i; gotWS_PredInd = true; break; } } if (gotWS_PredInd == true) { break; } } return(WS_PredInd); }
public PublicModelCollectionSelect(T[] models) { foreach (var model in models) { ModelCollection.Add(model); } }
/// <summary> /// A command line tool for working with Parquet configuration files. /// </summary> /// <param name="args">Command line arguments passed in to the tool.</param> internal static int Main(string[] args) { var optionText = args.Length > 0 ? args[0].ToUpperInvariant() : ""; var property = args.Length > 1 ? args[1].ToUpperInvariant() : ""; var category = args.Length > 2 ? args[2].ToUpperInvariant() : ""; var command = ParseCommand(optionText); ModelCollection <Model> workload = null; if (command == ListPropertyForCategory) { command = ParseProperty(property); if (command != ListPronouns && command != DisplayBadArguments) { workload = ParseCategory(category); } } return((int)command(workload)); }
public override void Bind() { base.Bind(); _FireRateProperty = new P <Single>(this, "FireRate"); _ProjectilesProperty = new ModelCollection <BaseProjectileViewModel>(this, "Projectiles"); _ProjectilesProperty.CollectionChanged += ProjectilesCollectionChanged; }
public async Task <IActionResult> EntryProcess(ModelCollection model) { UploadDatetimeModel modeltemp = model.udModel; if (modeltemp.strUpload == "" || modeltemp.strUpload == null) { return(RedirectToAction("Index")); } DateTime today = DateTime.Now; var user = await _usermanager.GetUserAsync(User); var entry = new Entry() { ID = _context.Entries.ToList().Count() + 1, Content = modeltemp.strUpload, Date = today, User = user }; _context.Entries.Add(entry); _context.SaveChanges(); return(RedirectToAction(nameof(ScheduleController.Index), "Schedule", new { day = today.Day, month = today.Month, year = today.Year })); }
private void OnAddItem() { var model = new TModel(); PrepearNewItem(model); ModelCollection.Add(model); }
public LookupModel(string key, SectorModel sector, LookupRules rules, PlayerModel player, bool readOnly) : base(key) { this.Cards = new ModelCollection(this); this.Player = player; this.ReadOnly = readOnly; this.Sector = sector; this.Rules = rules; if(rules == null) this.Rules = new LookupRules(LookupStyle.All, -1, new List<string>()); int i = 0; switch(rules.Style) { case LookupStyle.All: case LookupStyle.KeepVisibleTop: case LookupStyle.Top: this.Sector.Cards.CollectionChanged += new CollectionChangedEventHandler(Cards_CollectionChanged); for(i = 0; i < sector.Cards.Count(); i++) { if(this.Rules.Style == LookupStyle.Top && i < Rules.Amount) visibleCards.Add(sector.Cards.ElementAt(i).Key); InsertCard(sector.Cards.ElementAt(i).Key, i); } break; } }
public ModelCollection <tbl_Demirbaslar> Listele2(bool yetki) { SQL_LISTE2 = @"SELECT DISTINCT demirbas_id , demirbas_tur_id , tbl_Demirbaslar.daire_no , demirbas_adet , demirbas_alis_tarihi , demirbas_fiyati , demirbas_aciklama , demirbas_kayit_tarihi , demirbas_kayit_eden_yonetici_id , demirbas_duzenleme_tarihi , demirbas_kayit_duzenleyen_yonetici_id FROM tbl_Demirbaslar WITH (NOLOCK) INNER JOIN tbl_Daireler ON tbl_Daireler.daire_no=tbl_Demirbaslar.daire_no INNER JOIN tbl_YoneticiBina ON tbl_YoneticiBina.bina_id=tbl_Daireler.bina_id"; if (!yetki) { SQL_LISTE2 = SQL_LISTE2 + " WHERE yonetici_id=" + frmYoneticiGirisi.yoneticiler.Yonetici_id; } SqlParameter[] parms = new SqlParameter[] { }; ModelCollection <tbl_Demirbaslar> liste = new ModelCollection <tbl_Demirbaslar>(); using (SqlDataReader reader = SQLHelper.ExecuteReader(SQLHelper.BilisimLibraryDbConnectionString, CommandType.Text, SQL_LISTE2, parms)) { liste.PopulateReader(reader); } return(liste); }
public void CreateOptions(ProductEntity product, ModelCollection <ProductOptionEntity> options) { ExecuteWithTransaction((transaction) => { CreateOptions(transaction, product, options); }); }
public ModelCollection <SaleEntity> ListSales(int page, int maxPerPage) { ModelCollection <SaleEntity> list = _productDataProvider.ListSales(page, maxPerPage); list.Paging.Page = page; list.Paging.MaxPerPage = maxPerPage; return(list); }
public static ModelCollection <User> GetList() { List <StatementCondition> conditions = new List <StatementCondition>(); var hs = new Hashtable(); ModelCollection <User> list = SqlMapper.SqlServerInstance.QueryCollection <User>("GetList", null, null, hs); return(list); }
public void CreateOptions(IDbTransaction transaction, ProductEntity product, ModelCollection <ProductOptionEntity> options) { foreach (ProductOptionEntity productOption in options) { // create it then set back the id productOption.ProductOptionId = transaction.Connection.Execute("dbo.SPCreateProductOption", new { productId = product.ProductId, description = productOption.Description, net = productOption.Detail.Net, tax = productOption.Detail.Tax, productDetailFlags = (int?)productOption.Detail.Flags, validFrom = productOption.Detail.ValidFrom }, transaction: transaction, commandType: CommandType.StoredProcedure); } }
public override void Delete(int id) { var list = ModelCollection.ToList(); var modelToRemove = Single(id); list.Remove(modelToRemove); _modelCollection = list; }
public PostCollection List(int page, int maxPerPage, int?categoryId = null) { ICategory category = categoryId.HasValue ? _categoryDataProvider.Read(categoryId.Value) : null; ModelCollection <PostEntity> list = _blogDataProvider.List(page, maxPerPage, categoryId); list.Paging.Page = page; list.Paging.MaxPerPage = maxPerPage; return(new PostCollection(list, category)); }
public override void Bind() { base.Bind(); this.Default = new Signal <DefaultCommand>(this); this.Apply = new Signal <ApplyCommand>(this); _ResolutionProperty = new P <ResolutionInformation>(this, "Resolution"); _VolumeProperty = new P <Single>(this, "Volume"); _AvailableResolutions = new ModelCollection <ResolutionInformation>(this, "AvailableResolutions"); }
public override void Bind() { base.Bind(); _CurrentWeaponIndexProperty = new P <Int32>(this, "CurrentWeaponIndex"); _CurrentWeaponProperty = new P <FPSWeaponViewModel>(this, "CurrentWeapon"); _WeaponsProperty = new ModelCollection <FPSWeaponViewModel>(this, "Weapons"); _WeaponsProperty.CollectionChanged += WeaponsCollectionChanged; this.ResetCurrentWeapon(); }
public ModelCollection <T> ListProperties <T>(PropertyQuery query, bool getCount = false) where T : PropertyEntity { ModelCollection <T> list = _propertyDataProvider.ListProperties <T>(query, getCount); list.Paging.Page = query.Page; list.Paging.MaxPerPage = query.MaxPerPage; return(list); }
public PlayerModel(GameModel parent, string key, PlayerInfo info, DeckItem deck, string password) : base(parent, null, key) { this.Info = info; this.Deck = deck; this.Points = new ObservableProperty<int, PlayerModel>(this, 0); this.Sectors = new ModelCollection(this); this.NumCounters = new ModelCollection(this); this.Password = password; }
public override void Bind() { base.Bind(); _CurrentPlayerProperty = new P <FPSPlayerViewModel>(this, "CurrentPlayer"); _ScoreProperty = new P <Int32>(this, "Score"); _KillsProperty = new P <Int32>(this, "Kills"); _String1Property = new P <String>(this, "String1"); _EnemiesProperty = new ModelCollection <FPSEnemyViewModel>(this, "Enemies"); _EnemiesProperty.CollectionChanged += EnemiesCollectionChanged; }
public GameModel(GameInfoItem gameItem) : base(Guid.NewGuid().ToString()) { this.GameItem = gameItem; this.Players = new ModelCollection(this); this.Lookups = new ModelCollection(this); this.Commands = new ModelCollection(this); this.CardDisplay = new CardDisplayModel(Guid.NewGuid().ToString()); this.Console = new ConsoleModel(Guid.NewGuid().ToString()); }
public async Task <IActionResult> EventProcess(ModelCollection model) { NewEventModel modeltemp = model.evModel; if (modeltemp.Info == "" || modeltemp.Info == null) { return(RedirectToAction(nameof(ScheduleController.Index), "Schedule", new { type = "event", day = ScheduleController.Exdatetime.Day, month = ScheduleController.Exdatetime.Month, year = ScheduleController.Exdatetime.Year })); } DateTime Start = modeltemp.StartDate.AddTicks(modeltemp.StartTime.TimeOfDay.Ticks); DateTime End = modeltemp.EndDate.AddTicks(modeltemp.EndTime.TimeOfDay.Ticks); if (Start >= End) { return(RedirectToAction(nameof(ScheduleController.Index), "Schedule", new { type = "event", day = ScheduleController.Exdatetime.Day, month = ScheduleController.Exdatetime.Month, year = ScheduleController.Exdatetime.Year })); } var user = await _usermanager.GetUserAsync(User); var e = new Event() { ID = _context.Events.ToList().Count() + 1, Info = modeltemp.Info, StartDate = Start, EndDate = End, Occurrence = modeltemp.Occurrence, User = user }; _context.Events.Add(e); _context.SaveChanges(); return(RedirectToAction(nameof(ScheduleController.Index), "Schedule", new { type = "event", day = ScheduleController.Exdatetime.Day, month = ScheduleController.Exdatetime.Month, year = ScheduleController.Exdatetime.Year })); }
/// <summary> /// Disposes of the model /// </summary> /// <param name="disposing"></param> protected override void Dispose(bool disposing) { if (!disposed) { if (disposing) { if (ModelCollection != null) { foreach (var model in modelCollection) { ((CustomPhongMaterial)((CustomGM3D)model).Material).Dispose(); ((CustomGM3D)model).Detach(); ((CustomGM3D)model).Dispose(); model.Dispose(); } foreach (var model in ModelCollection) { ((CustomPhongMaterial)((CustomGM3D)model).Material).Dispose(); ((CustomGM3D)model).Detach(); ((CustomGM3D)model).Dispose(); model.Dispose(); } modelCollection.Clear(); ModelCollection.Clear(); } if (diffuse != null) { diffuse.Dispose(); } if (normal != null) { normal.Dispose(); } if (specular != null) { specular.Dispose(); } if (mData != null) { mData.Clear(); mData = null; } } disposed = true; base.Dispose(disposing); } }
private void UpdateModelCollect(int nCamID) { ModelCollection.Clear(); foreach (var it in Vision.VisionDataHelper.GetTemplateListForSpecCamera(nCamID, ModelFileHelper.GetWorkDictoryProfileList(new string[] { "shm" }))) { ModelCollection.Add(new ModelItem() { StrName = it.Replace(string.Format("Cam{0}_", nCamID), ""), StrFullName = it }); } }
public static void Verify(this ModelCollection models, params Model[] expectedModels) { Assert.AreEqual(expectedModels.Length, models.Count); for (int i = 0; i < models.Count; i++) { var model = models[i]; var expectedModel = expectedModels[i]; Assert.AreEqual(expectedModel, model); Assert.AreEqual(i, expectedModel.Ordinal); } }
public ModelCollection <tbl_Musteriler> Listele() { SqlParameter[] parms = new SqlParameter[] { }; ModelCollection <tbl_Musteriler> liste = new ModelCollection <tbl_Musteriler>(); using (SqlDataReader reader = SQLHelper.ExecuteReader(SQLHelper.BilisimLibraryDbConnectionString, CommandType.Text, SQL_LISTE, parms)) { liste.PopulateReader(reader); } return(liste); }
public static int GetTaskCount(List <AI> ais) { int count = 0; foreach (AI ai in ais) { ModelCollection modelCollection = AiModels.GetModels(ai); count += modelCollection.models.Count; } return(count); }
private MetaRepository() { entries = new ModelCollection(this); serializer.KnownTypes.Add(typeof(INamespace)); serializer.KnownTypes.Add(typeof(Model)); var domain = AppDomain.CurrentDomain; domain.AssemblyLoad += domain_AssemblyLoad; var assemblies = domain.GetAssemblies(); for (int i = 0; i < assemblies.Length; i++) { RegisterAssembly(assemblies[i]); } }
public CardModel(string key, PlayerModel owner, CardItem data, bool isPawn) : base(owner, key) { Data = data; IsPawn = isPawn; Position = new ObservableProperty<CardPosition, CardModel>(this, new CardPosition(0, 0)); Visibility = new ObservableProperty<CardVisibility, CardModel>(this, CardVisibility.Visible); Reversed = new ObservableProperty<bool, CardModel>(this, false); Locked = new ObservableProperty<bool, CardModel>(this, false); Rotated = new ObservableProperty<bool, CardModel>(this, false); CustomCharacteristics = new ObservableProperty<string, CardModel>(this, string.Empty); Tokens = new ModelCollection(this); SaveState(); this.Visibility.Changed += new EventHandler<ChangedEventArgs<CardVisibility>>(Visibility_Changed); }
public override void Bind() { base.Bind(); _FireRateProperty = new P<Single>(this, "FireRate"); _ProjectilesProperty = new ModelCollection<BaseProjectileViewModel>(this, "Projectiles"); _ProjectilesProperty.CollectionChanged += ProjectilesCollectionChanged; }
public void DropAll() { _models = new ModelCollection(); _views = new Cameras.CameraCollection(); }
public override void Bind() { base.Bind(); _PlayerProperty = new P<PlayerShipViewModel>(this, "Player"); _SpawnPointProperty = new P<Vector3>(this, "SpawnPoint"); _GameOverProperty = new P<Boolean>(this, "GameOver"); _NotificationTextProperty = new P<String>(this, "NotificationText"); _ScoreProperty = new P<Int32>(this, "Score"); _AsteroidsProperty = new ModelCollection<AsteroidViewModel>(this, "Asteroids"); _AsteroidsProperty.CollectionChanged += AsteroidsCollectionChanged; this.ResetScore(); this.BindProperty(_PlayerProperty, p=> ResetScore()); }
public override void Bind() { base.Bind(); _CollectionProperty = new ModelCollection<String>(this, "Collection"); }
public SectorModel(string key, SectorItem sector) : base(key) { this.Cards = new ModelCollection(this); this.Data = sector; }
public override void Bind() { base.Bind(); _PlayerProperty = new P<CharacterViewModel>(this, "Player"); _GameFlowStateProperty = new GameFlowStateMachine(this, "GameFlowState"); _ScoreProperty = new P<Int32>(this, "Score"); _CoinsProperty = new ModelCollection<CoinViewModel>(this, "Coins"); _CoinsProperty.CollectionChanged += CoinsCollectionChanged; this.ResetScore(); this._LoseGame.Subscribe(_GameFlowStateProperty.Lose); this._WinGame.Subscribe(_GameFlowStateProperty.Win); this.BindProperty(_PlayerProperty, p=> ResetScore()); }
/// <summary> /// Initializes a new instance of the <see cref="Root"/> class. /// </summary> public Root() { AssemblySets = new ModelCollection<AssemblySet>(); Current = this; }
public override void Bind() { base.Bind(); _Cubes = new ModelCollection<CubeViewModel>(this, "Cubes"); }
public override void Bind() { base.Bind(); this.GoToMenu = new Signal<GoToMenuCommand>(this); this.Play = new Signal<PlayCommand>(this); this.GameOver = new Signal<GameOverCommand>(this); _GameStateProperty = new P<GameState>(this, "GameState"); _HexGridMatchingProperty = new P<String>(this, "HexGridMatching"); _SoldierCountProperty = new P<Int32>(this, "SoldierCount"); _EnemyCountProperty = new P<Int32>(this, "EnemyCount"); _Soldier = new ModelCollection<SoldierViewModel>(this, "Soldier"); _Enemy = new ModelCollection<EnemyViewModel>(this, "Enemy"); _Memebers = new ModelCollection<EntityViewModel>(this, "Memebers"); }
public override void Bind() { base.Bind(); this.ChangeActionStyle = new Signal<ChangeActionStyleCommand>(this); _SoldierStateProperty = new P<SoldierState>(this, "SoldierState"); _HealthHistory = new ModelCollection<Int32>(this, "HealthHistory"); }
public override void Bind() { base.Bind(); this.CreateAnimal = new Signal<CreateAnimalCommand>(this); this.RemoveAnimal = new Signal<RemoveAnimalCommand>(this); this.CreateAndDrop = new Signal<CreateAndDropCommand>(this); this.InitAllAnimal = new Signal<InitAllAnimalCommand>(this); this.RefreshSameCount = new Signal<RefreshSameCountCommand>(this); this.CalcAnimalsCount = new Signal<CalcAnimalsCountCommand>(this); _CanTapProperty = new P<Boolean>(this, "CanTap"); _ShouldCreateAndDropProperty = new P<Boolean>(this, "ShouldCreateAndDrop"); _MapInfoProperty = new P<MapInfo>(this, "MapInfo"); _RuleInfoProperty = new P<RuleInfo>(this, "RuleInfo"); _IdleAnimalsCountProperty = new P<Int32>(this, "IdleAnimalsCount"); _NullAnimalsCountProperty = new P<Int32>(this, "NullAnimalsCount"); _IsDroppingProperty = new P<Boolean>(this, "IsDropping"); _AnimalCollections = new ModelCollection<AnimalViewModel>(this, "AnimalCollections"); _InGameStateProperty = new InGameStateMachine(this, "InGameState"); ResetCanTap(); ResetShouldCreateAndDrop(); }
public ClientRestarterModel() : base(Guid.NewGuid().ToString()) { this.players = new ModelCollection(this); this.console = new ConsoleModel(Guid.NewGuid().ToString()); }
public override void Bind() { base.Bind(); this.SelectLevel = new Signal<SelectLevelCommand>(this); _AvailableLevels = new ModelCollection<LevelDescriptor>(this, "AvailableLevels"); }
public override void Bind() { base.Bind(); this.Apply = new Signal<ApplyCommand>(this); this.Default = new Signal<DefaultCommand>(this); _ResolutionProperty = new P<ResolutionInformation>(this, "Resolution"); _VolumeProperty = new P<Single>(this, "Volume"); _AvailableResolutions = new ModelCollection<ResolutionInformation>(this, "AvailableResolutions"); }
public override void Bind() { base.Bind(); _CurrentScreenTypeProperty = new P<Type>(this, "CurrentScreenType"); _Screens = new ModelCollection<SubScreenViewModel>(this, "Screens"); }