コード例 #1
0
        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);
            }
        }
コード例 #2
0
        /// <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);
        }
コード例 #3
0
        public void RestoreBasket(HttpContextBase context, IUserInfo user)
        {
            ModelCollection <IBasketProduct> items = _productDataProvider.ListBasket();

            ClearBasket(context, user);
            GetBasket(context).Add(items);
        }
コード例 #4
0
        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);
        }
コード例 #5
0
        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);
        }
コード例 #6
0
        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);
                        }
                }
        }
コード例 #7
0
        /// <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);
            }
        }
コード例 #8
0
        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
            }));
        }
コード例 #9
0
        /// <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);
        }
コード例 #10
0
 public PublicModelCollectionSelect(T[] models)
 {
     foreach (var model in models)
     {
         ModelCollection.Add(model);
     }
 }
コード例 #11
0
ファイル: Roller.cs プロジェクト: mxashlynn/Scribe
        /// <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));
        }
コード例 #12
0
 public override void Bind()
 {
     base.Bind();
     _FireRateProperty    = new P <Single>(this, "FireRate");
     _ProjectilesProperty = new ModelCollection <BaseProjectileViewModel>(this, "Projectiles");
     _ProjectilesProperty.CollectionChanged += ProjectilesCollectionChanged;
 }
コード例 #13
0
        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
            }));
        }
コード例 #14
0
        private void OnAddItem()
        {
            var model = new TModel();

            PrepearNewItem(model);
            ModelCollection.Add(model);
        }
コード例 #15
0
        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;
              }
        }
コード例 #16
0
        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);
     });
 }
コード例 #18
0
        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);
        }
コード例 #19
0
        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);
     }
 }
コード例 #21
0
        public override void Delete(int id)
        {
            var list          = ModelCollection.ToList();
            var modelToRemove = Single(id);

            list.Remove(modelToRemove);
            _modelCollection = list;
        }
コード例 #22
0
        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));
        }
コード例 #23
0
 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");
 }
コード例 #24
0
 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();
 }
コード例 #25
0
        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);
        }
コード例 #26
0
 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;
 }
コード例 #27
0
 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;
 }
コード例 #28
0
ファイル: GameModel.cs プロジェクト: calvinkwong/pol-the-game
 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());
 }
コード例 #29
0
        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
            }));
        }
コード例 #30
0
        /// <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);
            }
        }
コード例 #31
0
 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
         });
     }
 }
コード例 #32
0
 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);
     }
 }
コード例 #33
0
ファイル: tbl_Musteriler.cs プロジェクト: burakportakal/Apart
        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);
        }
コード例 #34
0
        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);
        }
コード例 #35
0
ファイル: MetaRepository.cs プロジェクト: NMFCode/NMF
        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]);
            }
        }
コード例 #36
0
ファイル: CardModel.cs プロジェクト: calvinkwong/pol-the-game
        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);
        }
コード例 #37
0
 public override void Bind()
 {
     base.Bind();
     _FireRateProperty = new P<Single>(this, "FireRate");
     _ProjectilesProperty = new ModelCollection<BaseProjectileViewModel>(this, "Projectiles");
     _ProjectilesProperty.CollectionChanged += ProjectilesCollectionChanged;
 }
コード例 #38
0
ファイル: Scene.cs プロジェクト: 628426/Strive.NET
		public void DropAll() {
			_models = new ModelCollection();
			_views = new Cameras.CameraCollection();
		}
コード例 #39
0
 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());
 }
コード例 #40
0
 public override void Bind()
 {
     base.Bind();
     _CollectionProperty = new ModelCollection<String>(this, "Collection");
 }
コード例 #41
0
 public SectorModel(string key, SectorItem sector)
     : base(key)
 {
     this.Cards = new ModelCollection(this);
       this.Data = sector;
 }
コード例 #42
0
 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());
 }
コード例 #43
0
ファイル: Root.cs プロジェクト: bszafko/Monoflector
 /// <summary>
 /// Initializes a new instance of the <see cref="Root"/> class.
 /// </summary>
 public Root()
 {
     AssemblySets = new ModelCollection<AssemblySet>();
     Current = this;
 }
コード例 #44
0
 public override void Bind()
 {
     base.Bind();
     _Cubes = new ModelCollection<CubeViewModel>(this, "Cubes");
 }
コード例 #45
0
 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");
 }
コード例 #46
0
 public override void Bind() {
     base.Bind();
     this.ChangeActionStyle = new Signal<ChangeActionStyleCommand>(this);
     _SoldierStateProperty = new P<SoldierState>(this, "SoldierState");
     _HealthHistory = new ModelCollection<Int32>(this, "HealthHistory");
 }
コード例 #47
0
 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();
 }
コード例 #48
0
 public ClientRestarterModel()
     : base(Guid.NewGuid().ToString())
 {
     this.players = new ModelCollection(this);
       this.console = new ConsoleModel(Guid.NewGuid().ToString());
 }
コード例 #49
0
 public override void Bind()
 {
     base.Bind();
     this.SelectLevel = new Signal<SelectLevelCommand>(this);
     _AvailableLevels = new ModelCollection<LevelDescriptor>(this, "AvailableLevels");
 }
コード例 #50
0
 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");
 }
コード例 #51
0
 public override void Bind()
 {
     base.Bind();
     _CurrentScreenTypeProperty = new P<Type>(this, "CurrentScreenType");
     _Screens = new ModelCollection<SubScreenViewModel>(this, "Screens");
 }