コード例 #1
0
        public async Task Initialize()
        {
            _variable = await Variable.CreateVariable <Variable>("0", string.Empty, "STEP(1,5)");

            _variable1 = await Variable.CreateVariable <Variable>("1", string.Empty, "STEP(1,5)");

            _model.Variables.Add(_variable);
            _model1.Variables.Add(_variable1);
            _models.Add(_model);
            _models.Add(_model1);
        }
コード例 #2
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);
        }
コード例 #3
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);
        }
コード例 #4
0
 public PublicModelCollectionSelect(T[] models)
 {
     foreach (var model in models)
     {
         ModelCollection.Add(model);
     }
 }
コード例 #5
0
        private void OnAddItem()
        {
            var model = new TModel();

            PrepearNewItem(model);
            ModelCollection.Add(model);
        }
コード例 #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
        internal void AddAccount(Account account)
        {
            Trace($"Add {account}");

            account.Changed += OnAccountChanged;
            account.SetManager(this);

            accounts.Add(account);

            FirePropertyChanged(nameof(Accounts));
        }
コード例 #8
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
         });
     }
 }
コード例 #9
0
        internal void AddEntry(AccountEntry entry)
        {
            if (entry != null)
            {
                entries.Add(entry);

                if (EntryAdded != null)
                {
                    var task = ExecuteSynchronized(() => EntryAdded(entry));
                }
            }

            FirePropertyChanged(nameof(Entries));
        }
コード例 #10
0
        internal void AddPending(Change change)
        {
            Trace($"Add pending: {change}");

            pendingChanges.Add(change);

            if (pendingChanges.Count == 1)
            {
                FirePropertyChanged(nameof(HasPendingChanges));
            }

            FirePropertyChanged(nameof(PendingChanges));
            FirePropertyChanged(nameof(AmountPending));
        }
コード例 #11
0
        public void UpdateModel(List <MDLTEXData> meshData)
        {
            disposed  = false;
            disposing = false;

            mData = meshData;

            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);
        }
コード例 #12
0
ファイル: XmlParser.cs プロジェクト: lmorisse/Symu.SysDyn
        public async Task <ModelCollection> ParseModels()
        {
            if (_xDoc.Root == null)
            {
                throw new NullReferenceException(nameof(_xDoc.Root));
            }

            var models = _xDoc.Root.Elements(_ns + "model");

            var modelCollection = new ModelCollection();

            foreach (var model in models)
            {
                modelCollection.Add(await ParseModel(model));
            }

            return(modelCollection);
        }
コード例 #13
0
        public override void Setup()
        {
            base.Setup();

            var jsonConetnt = PlayerPrefs.GetString("TODO_LIST_ITEMS");

            Debug.Log("jsonConetnt: " + jsonConetnt);


            TodoItemsViewModels = new ModelCollection <TodoItemViewModel>();
            List <TodoItem> todoItems = String.IsNullOrEmpty(jsonConetnt)
                ? new List <TodoItem>()
                : JsonConvert.DeserializeObject <List <TodoItem> >(jsonConetnt);

            todoItems.ForEach(todoItem =>
            {
                var todoItemViewModel      = this.CreateViewModel <TodoItemViewModel>();
                todoItemViewModel.Content  = todoItem.Content;
                todoItemViewModel.Finished = todoItem.Finished;
                TodoItemsViewModels.Add(todoItemViewModel);
            });
        }
コード例 #14
0
        private void UpdateModelCollect(int nCamID)
        {
            ModelCollection.Clear();
            AllModelCollection.Clear();
            var FileList = ModelFileHelper.GetWorkDictoryProfileList(new string[] { "shm" });

            foreach (var it in FileList)
            {
                AllModelCollection.Add(new ModelItem()
                {
                    StrName = it, StrFullName = it
                });
            }
            foreach (var it in Vision.VisionDataHelper.GetTemplateListForSpecCamera(nCamID, FileList))
            {
                ModelCollection.Add(new ModelItem()
                {
                    StrName = it.Replace(string.Format("Cam{0}_", nCamID), ""), StrFullName = it
                });
            }
            RaisePropertyChanged("ModelCollection");
            RaisePropertyChanged("AllModelCollection");
        }
コード例 #15
0
 public PublicModelCollectionSelect(List <T> models)
 {
     models.ForEach(x => ModelCollection.Add(x));
     Enumerable.Range(2020, DateTime.Today.Year - 2019).ToList().ForEach(y => CollectionYear.Add(y));
 }