コード例 #1
0
        public PhoneTypeModel GetById(int id)
        {
            phoneType      entity = this._repository.GetById(id);
            PhoneTypeModel model  = this.ConvertEntityToModel(entity);

            return(model);
        }
コード例 #2
0
ファイル: s3dDeviceManager.cs プロジェクト: n1ckfg/FOV2GO
 public s3dDeviceManager()
 {
     this.phoneLayout      = phoneType.iPhone4_LandLeft;
     this.use3dCursor      = true;
     this.movePadPosition  = controlPos.left;
     this.turnPadPosition  = controlPos.center;
     this.pointPadPosition = controlPos.right;
 }
コード例 #3
0
ファイル: s3dDeviceManager.cs プロジェクト: n1ckfg/FOV2GO
 public virtual void checkForChanges()
 {
     // only run in edit mode
     if (this.prevPhoneLayout != this.phoneLayout)
     {
         this.setPhoneLayout();
     }
     this.prevPhoneLayout = this.phoneLayout;
 }
コード例 #4
0
        public phoneType GetById(Int64 id)
        {
            using (var context = this._context)
            {
                phoneType entity = context.phoneType.AsNoTracking()
                                   .Where(x => x.id == id)
                                   .FirstOrDefault();

                return(entity);
            }
        }
コード例 #5
0
        public void GetById_Test()
        {
            // Arrange
            TestKolgraphEntities context = new TestKolgraphEntities();
            var repository = new PhoneTypeRepository(context);
            int id         = 1;

            // Act
            phoneType result = repository.GetById(id);

            // Assert
            Assert.IsNotNull(result);
            Assert.AreEqual(id, result.id);
        }
コード例 #6
0
        public void ConvertModelToEntity_Test()
        {
            // Arrange
            TestKolgraphEntities context = new TestKolgraphEntities();
            var            service       = new PhoneTypeService();
            PhoneTypeModel model         = GetTestModel();

            // Act
            phoneType entity = service.ConvertModelToEntity(model);

            // Assert
            Assert.IsNotNull(entity);
            Assert.AreEqual(entity.name, model.Name);
        }
コード例 #7
0
        public PhoneTypeModel ConvertEntityToModel(phoneType entity)
        {
            if (entity == null)
            {
                return(null);
            }

            var model = new PhoneTypeModel()
            {
                Id   = entity.id,
                Name = entity.name.Trim(),
            };

            return(model);
        }
コード例 #8
0
        public void ConvertEntityToModel_Test()
        {
            // Arrange
            TestKolgraphEntities context = new TestKolgraphEntities();
            //var repository = new PhoneTypeRepository(context);
            var       service = new PhoneTypeService();
            phoneType entity  = context.phoneType.Where(x => x.id == 1).FirstOrDefault();

            // Act
            PhoneTypeModel model = service.ConvertEntityToModel(entity);

            // Assert
            Assert.IsNotNull(model);
            Assert.AreEqual(model.Id, entity.id);
            Assert.AreEqual(model.Name, entity.name);
        }
コード例 #9
0
        public phoneType ConvertModelToEntity(PhoneTypeModel model, int userId = -1)
        {
            phoneType entity = new phoneType();

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

            entity.name = model.Name;

            if (model.Id > 0)
            {
                entity.id = model.Id;
            }

            return(entity);
        }
コード例 #10
0
ファイル: s3dDeviceManager.cs プロジェクト: n1ckfg/FOV2GO
 public virtual void Start()
 {
     this.findS3dCamera();
     this.prevPhoneLayout = this.phoneLayout;
     this.setPhoneLayout();
 }
コード例 #11
0
ファイル: s3dDeviceManager.cs プロジェクト: n1ckfg/FOV2GO
 // called from Editor script
 public virtual void forceUpdate()
 {
     this.setPhoneLayout();
     this.prevPhoneLayout = this.phoneLayout;
     this.camera3D.initStereoCamera();
 }
コード例 #12
0
 public void MarkAsModified(phoneType item)
 {
 }
コード例 #13
0
 public int Update(phoneType entity)
 {
     return(-1);
 }
コード例 #14
0
 public int Insert(phoneType entity)
 {
     return(-1);
 }