当前位置: 首页>>代码示例>>C#>>正文


C# IDataReader.GetFloat方法代码示例

本文整理汇总了C#中IDataReader.GetFloat方法的典型用法代码示例。如果您正苦于以下问题:C# IDataReader.GetFloat方法的具体用法?C# IDataReader.GetFloat怎么用?C# IDataReader.GetFloat使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IDataReader的用法示例。


在下文中一共展示了IDataReader.GetFloat方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: StarStart

    public static void StarStart()
    {
        ///////////////////////////////////////////////////////////////////[DB Query]
        dbcmd = dbconn.CreateCommand();
        string sqlQuery = "SELECT * FROM userTable";
        dbcmd.CommandText = sqlQuery;
        ///////////////////////////////////////////////////////////////////[DB Query]

        int cnt = 0;
        reader = dbcmd.ExecuteReader();
        while (reader.Read())
        {
            StarSingleTon.Instance.cPlanet = reader.GetInt32(cnt++);
            StarSingleTon.Instance.cFood = reader.GetInt32(cnt++);
            StarSingleTon.Instance.cTitanium = reader.GetInt32(cnt++);
            StarSingleTon.Instance.cRE = reader.GetInt32(cnt++);
            StarSingleTon.Instance.cYE = reader.GetInt32(cnt++);
            StarSingleTon.Instance.cBE = reader.GetInt32(cnt++);
            StarSingleTon.Instance.cOE = reader.GetInt32(cnt++);
            StarSingleTon.Instance.cGE = reader.GetInt32(cnt++);
            StarSingleTon.Instance.cVE = reader.GetInt32(cnt++);
            StarSingleTon.Instance.cPE = reader.GetInt32(cnt++);
            StarSingleTon.Instance.shipNum = reader.GetInt32(cnt++);

            cnt = 0;
        }
        cnt = 0;

        reader.Close();
        reader = null;

        sqlQuery = "SELECT * FROM zodiacTable WHERE rowid =" + StarSingleTon.Instance.rowid;

        dbcmd.CommandText = sqlQuery;
        reader = dbcmd.ExecuteReader();
        while (reader.Read())
        {
            StarSingleTon.Instance.zID = reader.GetString(cnt++);
            StarSingleTon.Instance.zodiac = reader.GetString(cnt++);
            StarSingleTon.Instance.zName = reader.GetString(cnt++);
            StarSingleTon.Instance.locationX = reader.GetFloat(cnt++);
            StarSingleTon.Instance.locationY = reader.GetFloat(cnt++);
            StarSingleTon.Instance.locationZ = reader.GetFloat(cnt++);
            StarSingleTon.Instance.zOpen = reader.GetBoolean(cnt++);
            StarSingleTon.Instance.zFind = reader.GetBoolean(cnt++);
            StarSingleTon.Instance.needPE = reader.GetInt32(cnt++);
            StarSingleTon.Instance.nowPE = reader.GetInt32(cnt++);
            StarSingleTon.Instance.zActive = reader.GetBoolean(cnt++);

            cnt = 0;
        }
        cnt = 0;
        reader.Close();
        reader = null;

        StarSingleTon.Instance.setMainText();
        StarSingleTon.Instance.setPointlight();
    }
开发者ID:Gibom,项目名称:Unity3D,代码行数:58,代码来源:StarSceneSql.cs

示例2: GetValueByIndex

        /// <summary>
        /// Gets a column value by the index
        /// </summary>
        /// <param name="mapping"></param>
        /// <param name="dataReader"></param>
        /// <returns></returns>
		public override object GetValueByIndex(ResultProperty mapping, IDataReader dataReader)
        {
            if (dataReader.IsDBNull(mapping.ColumnIndex))
			{
				return DBNull.Value;
			}
            return dataReader.GetFloat(mapping.ColumnIndex);
        }
开发者ID:techvenky,项目名称:mybatisnet,代码行数:14,代码来源:SingleTypeHandler.cs

示例3: MapAppliance

        public static SignatureResponse MapAppliance(IDataReader reader)
        {
            SignatureResponse applianceSignature = new SignatureResponse();
            applianceSignature.EnergyConsumed = reader.GetFloat(0);
            applianceSignature.Appliance = reader.GetString(1);
            applianceSignature.SignalDate = DateTime.Parse(reader.GetString(2));

            return applianceSignature;
        }
开发者ID:unionthugface,项目名称:hackathons-energy,代码行数:9,代码来源:EnergyService.cs

示例4: GetValueByName

        /// <summary>
        /// Gets a column value by the name
        /// </summary>
        /// <param name="mapping"></param>
        /// <param name="dataReader"></param>
        /// <returns></returns>
		public override object GetValueByName(ResultProperty mapping, IDataReader dataReader)
		{
			int index = dataReader.GetOrdinal(mapping.ColumnName);

			if (dataReader.IsDBNull(index))
			{
				return DBNull.Value;
			}
            return dataReader.GetFloat(index);
		}
开发者ID:techvenky,项目名称:mybatisnet,代码行数:16,代码来源:SingleTypeHandler.cs

示例5: ParseWorldStateJoint

    public GoapWorldState ParseWorldStateJoint(IDataReader reader)
    {
        int c_id = reader.GetInt32(0);
        string c_desc = reader.GetString(1);
        bool isBool = (reader.GetInt32(2) == 1);
        WorldStateOperator op = (WorldStateOperator)Enum.Parse(typeof(WorldStateOperator), reader.GetString(5));

        bool valBool = (reader.GetInt32(6) == 1);
        float valFloat = reader.GetFloat(6);
        object value;
        if(isBool)
        {
            value = valBool;
        }
        else
        {
            value = valFloat;
        }

        GoapWorldState state = new GoapWorldState(c_id, c_desc, op, value);

        return state;
    }
开发者ID:tegates,项目名称:Warzone,代码行数:23,代码来源:GOAPEditor.cs

示例6: getRealValue

        private static object getRealValue(IDataReader datareader, int ordinal, Type t)
        {

            if (t == typeof(Int16)) return !datareader.IsDBNull(ordinal) ? (object)datareader.GetInt16(ordinal) : null;
            
            if (t == typeof(Int32)) return !datareader.IsDBNull(ordinal) ? (object)datareader.GetInt32(ordinal) : null;
            
            if (t == typeof(Int64)) return !datareader.IsDBNull(ordinal) ? (object)datareader.GetInt32(ordinal) : null;
            
            if (t == typeof(Byte[]))
            {
                if (datareader.IsDBNull(ordinal)) return null;
                int bufferSize = 1024;
                int startIndex = 0;
                byte[] outbyte = new byte[bufferSize];
                ByteBuilder bb = new ByteBuilder();
                long retval = datareader.GetBytes(ordinal, startIndex, outbyte, 0, bufferSize);
                while (retval == bufferSize)
                {
                    bb.Append(outbyte);
                    startIndex += bufferSize;
                    retval = datareader.GetBytes(ordinal, startIndex, outbyte, 0, bufferSize);
                }
                if (retval > 0)
                    bb.Append(outbyte);
                return bb.GetBytes();
            }
            
            if (t == typeof(String)) return !datareader.IsDBNull(ordinal) ? datareader.GetString(ordinal) : null;
            
            if (t == typeof(DateTime)) return !datareader.IsDBNull(ordinal) ? (object)datareader.GetDateTime(ordinal) : null;
            
            if (t == typeof(Boolean)) return !datareader.IsDBNull(ordinal) ? (object)datareader.GetBoolean(ordinal) : null;

            if (t == typeof(Double)) return !datareader.IsDBNull(ordinal) ? (object)datareader.GetDouble(ordinal) : null;

            if (t == typeof(Single)) return !datareader.IsDBNull(ordinal) ? (object)datareader.GetFloat(ordinal) : null;

            if (t == typeof(Guid)) return !datareader.IsDBNull(ordinal) ? (object)datareader.GetGuid(ordinal) : null;

            if (t == typeof(Decimal)) return !datareader.IsDBNull(ordinal) ? (object)datareader.GetDecimal(ordinal) : null;

            if (t == typeof(Byte)) return !datareader.IsDBNull(ordinal) ? (object)datareader.GetByte(ordinal) : null;

            return null;
        }
开发者ID:HaKDMoDz,项目名称:eStd,代码行数:46,代码来源:ModelMapper.cs

示例7: settingInfo

    void settingInfo()
    {
        ///////////////////////////////////////////////////////////////////[DB Query]
        dbcmd = dbconn.CreateCommand();
        string sqlQuery = "SELECT * FROM userTable";
        dbcmd.CommandText = sqlQuery;
        ///////////////////////////////////////////////////////////////////[DB Query]
        int cnt = 0;
        ///////////////////////////////////////////////////////////////////[Data Read]
        reader = dbcmd.ExecuteReader();
        while (reader.Read())
        {

            MainSingleTon.Instance.cPlanet = reader.GetInt32(cnt++);
            MainSingleTon.Instance.cFood = reader.GetInt32(cnt++);
            MainSingleTon.Instance.cTitanium = reader.GetInt32(cnt++);
            MainSingleTon.Instance.cRE = reader.GetInt32(cnt++);
            MainSingleTon.Instance.cYE = reader.GetInt32(cnt++);
            MainSingleTon.Instance.cBE = reader.GetInt32(cnt++);
            MainSingleTon.Instance.cOE = reader.GetInt32(cnt++);
            MainSingleTon.Instance.cGE = reader.GetInt32(cnt++);
            MainSingleTon.Instance.cVE = reader.GetInt32(cnt++);
            MainSingleTon.Instance.cPE = reader.GetInt32(cnt++);
            MainSingleTon.Instance.shipNum = reader.GetInt32(cnt++);

        }
        reader.Close();
        reader = null;

        sqlQuery = "select rowid, * from managePlanetTable where rowid = " + MainSingleTon.Instance.cPlanet;
        dbcmd.CommandText = sqlQuery;
        reader = dbcmd.ExecuteReader();
        cnt = 0;
        while (reader.Read())
        {
            MainSingleTon.Instance.rowid = reader.GetInt32(cnt++);
            MainSingleTon.Instance.pName = reader.GetString(cnt++);
            MainSingleTon.Instance.size = reader.GetInt32(cnt++);
            MainSingleTon.Instance.color = reader.GetInt32(cnt++);
            MainSingleTon.Instance.mat = reader.GetInt32(cnt++);
            MainSingleTon.Instance.mFood = reader.GetInt32(cnt++);
            MainSingleTon.Instance.mTitanium = reader.GetInt32(cnt++);
            MainSingleTon.Instance.locationX = reader.GetFloat(cnt++);
            MainSingleTon.Instance.locationY = reader.GetFloat(cnt++);
            MainSingleTon.Instance.locationZ = reader.GetFloat(cnt++);
            MainSingleTon.Instance.le_persec = reader.GetInt32(cnt++);
            MainSingleTon.Instance.position_house = reader.GetBoolean(cnt++);
            MainSingleTon.Instance.state = reader.GetInt32(cnt++);
            MainSingleTon.Instance.user = reader.GetBoolean(cnt++);
            MainSingleTon.Instance.neighbor = reader.GetInt32(cnt++);
            MainSingleTon.Instance.lFood = reader.GetInt32(cnt++);
            MainSingleTon.Instance.lTitanium = reader.GetInt32(cnt++);

            MainSingleTon.Instance.planetTouchT = reader.GetString(cnt++) ;
            MainSingleTon.Instance.titaniumTouchT = reader.GetString(cnt++);
            MainSingleTon.Instance.treeTouchT = reader.GetString(cnt++);
            MainSingleTon.Instance.breaktime = reader.GetString(cnt++);

            MainSingleTon.Instance.tree1 = reader.GetInt32(cnt++);
            MainSingleTon.Instance.tree2 = reader.GetInt32(cnt++);
            MainSingleTon.Instance.tree3 = reader.GetInt32(cnt++);
            MainSingleTon.Instance.tree4 = reader.GetInt32(cnt++);
            MainSingleTon.Instance.tree5 = reader.GetInt32(cnt++);
            MainSingleTon.Instance.tree6 = reader.GetInt32(cnt++);

        }

        reader.Close();
        reader = null;
        //dbClose();
        MainSingleTon.Instance.callPlanet();
        MainSingleTon.Instance.callShip();
        MainSingleTon.Instance.callTree();
        MainSingleTon.Instance.callNeighber();
        MainSingleTon.Instance.callStation();
        MainSingleTon.Instance.callPlanet();
        MainSingleTon.Instance.callPostBox();
        MainSingleTon.Instance.setVisibleEnergyBtn();
        MainSingleTon.Instance.setVisibleMoveBtn();
    }
开发者ID:Gibom,项目名称:Unity3D,代码行数:80,代码来源:MainSceneSQL.cs

示例8: GetItem


//.........这里部分代码省略.........
                if (!reader.IsDBNull(9))
                {
                    hasProgramAttributes.IsSeries = reader.GetBoolean(9);
                }

                if (!reader.IsDBNull(10))
                {
                    hasProgramAttributes.IsLive = reader.GetBoolean(10);
                }

                if (!reader.IsDBNull(11))
                {
                    hasProgramAttributes.IsNews = reader.GetBoolean(11);
                }

                if (!reader.IsDBNull(12))
                {
                    hasProgramAttributes.IsPremiere = reader.GetBoolean(12);
                }

                if (!reader.IsDBNull(13))
                {
                    hasProgramAttributes.EpisodeTitle = reader.GetString(13);
                }

                if (!reader.IsDBNull(14))
                {
                    hasProgramAttributes.IsRepeat = reader.GetBoolean(14);
                }
            }

            if (!reader.IsDBNull(15))
            {
                item.CommunityRating = reader.GetFloat(15);
            }

            if (!reader.IsDBNull(16))
            {
                item.CustomRating = reader.GetString(16);
            }

            if (!reader.IsDBNull(17))
            {
                item.IndexNumber = reader.GetInt32(17);
            }

            if (!reader.IsDBNull(18))
            {
                item.IsLocked = reader.GetBoolean(18);
            }

            if (!reader.IsDBNull(19))
            {
                item.PreferredMetadataLanguage = reader.GetString(19);
            }

            if (!reader.IsDBNull(20))
            {
                item.PreferredMetadataCountryCode = reader.GetString(20);
            }

            if (!reader.IsDBNull(21))
            {
                item.IsHD = reader.GetBoolean(21);
            }
开发者ID:paul-777,项目名称:Emby,代码行数:66,代码来源:SqliteItemRepository.cs

示例9: setPlayerValues

        public void setPlayerValues()
        {
            UInt32 charID = Store.currentClient.playerData.getCharID();
            string sqlQuery="Select handle,x,y,z,rotation,healthC,healthM,innerStrC,innerStrM,level,profession,alignment,pvpflag,firstName,lastName,exp,cash,district,districtId,factionId,crewId from characters where charId='"+charID+"'";
            queryExecuter= conn.CreateCommand();
            queryExecuter.CommandText = sqlQuery;
            dr= queryExecuter.ExecuteReader();

            while(dr.Read()){

                Store.currentClient.playerInstance.CharacterID.setValue(charID);
                Store.currentClient.playerInstance.CharacterName.setValue(dr.GetString(0));

                double x = (double)(dr.GetFloat(1));
                double y = (double)(dr.GetFloat(2));
                double z = (double)(dr.GetFloat(3));

                Store.currentClient.playerInstance.Position.setValue(NumericalUtils.doublesToLtVector3d(x,y,z));
                Store.currentClient.playerInstance.YawInterval.setValue((byte)dr.GetDecimal(4));
                Store.currentClient.playerInstance.Health.setValue((UInt16)dr.GetDecimal(5));
                Store.currentClient.playerInstance.MaxHealth.setValue((UInt16)dr.GetDecimal(6));

                Store.currentClient.playerInstance.InnerStrengthAvailable.setValue((UInt16)dr.GetDecimal(7));
                Store.currentClient.playerInstance.InnerStrengthMax.setValue((UInt16)dr.GetDecimal(8));

                Store.currentClient.playerInstance.Level.setValue((byte)dr.GetDecimal(9));

               				Store.currentClient.playerInstance.TitleAbility.setValue((UInt32) dr.GetDecimal(10));
                Store.currentClient.playerInstance.OrganizationID.setValue((byte)dr.GetDecimal(11));

                //data.setPlayerValue("pvpFlag",(int)dr.GetDecimal(12));
                Store.currentClient.playerInstance.RealFirstName.setValue(dr.GetString(13));
                Store.currentClient.playerInstance.RealLastName.setValue(dr.GetString(14));

                Store.currentClient.playerData.setExperience((long)dr.GetDecimal(15));
                Store.currentClient.playerData.setInfo((long)dr.GetDecimal(16));
                Store.currentClient.playerData.setDistrict(dr.GetString(17));
                Store.currentClient.playerData.setDistrictId((uint)dr.GetInt16(18));
                Store.currentClient.playerInstance.FactionID.setValue((uint)dr.GetInt16(19));
                Store.currentClient.playerInstance.CrewID.setValue((uint)dr.GetInt16(20));

            }

            dr.Close();
        }
开发者ID:hdneo,项目名称:mxo-hd,代码行数:45,代码来源:MyWorldDbAccess.cs

示例10: settingInfo

    void settingInfo()
    {
        ///////////////////////////////////////////////////////////////////[DB Query]
        dbcmd = dbconn.CreateCommand();
        string sqlQuery = "SELECT count(*) FROM managePlanetTable";
        dbcmd.CommandText = sqlQuery;
        ///////////////////////////////////////////////////////////////////[DB Query]
        int cnt = 0;
        ///////////////////////////////////////////////////////////////////[Data Read]
        reader = dbcmd.ExecuteReader();
        //행성갯수 카운트
        while (reader.Read())
        {
            MovePlanet.Instance.planetCount = reader.GetInt32(cnt++);
        }

        reader.Close();
        reader = null;

        //각 행성 리스트로
        //sqlQuery = "select * from managePlanetTableTest where rowid = " + MainSingleTon.Instance.cPlanet;
        sqlQuery = "select rowid, name, size, color, mat, mFood, mTitanium, locationX, locationY, locationZ, le_persec, position_house, state, user, neighbor, lFood, lTitanium, tree1, tree2, tree3, tree4, tree5, tree6 FROM managePlanetTable WHERE user =0";
        dbcmd.CommandText = sqlQuery;
        reader = dbcmd.ExecuteReader();
        cnt = 0;
        while (reader.Read())
        {
            int rowid = reader.GetInt32(cnt++);
            string pName = reader.GetString(cnt++);
            int size = reader.GetInt32(cnt++);
            int color = reader.GetInt32(cnt++);
            int mat = reader.GetInt32(cnt++);
            int mFood = reader.GetInt32(cnt++);
            int mTitanium = reader.GetInt32(cnt++);
            float locationX = reader.GetFloat(cnt++);
            float locationY = reader.GetFloat(cnt++);
            float locationZ = reader.GetFloat(cnt++);
            int le_persec = reader.GetInt32(cnt++);
            bool position_house = reader.GetBoolean(cnt++);
            int state = reader.GetInt32(cnt++);
            bool user = reader.GetBoolean(cnt++);
            int neighbor = reader.GetInt32(cnt++);
            int lFood = reader.GetInt32(cnt++);
            int lTitanium = reader.GetInt32(cnt++);

            //MainSingleTon.Instance.planetTouchT = ;
            //MainSingleTon.Instance.titaniumTouchT = ;
            //MainSingleTon.Instance.treeTouchT = ;
            //MainSingleTon.Instance.breaktime = ;

            int tree1 = reader.GetInt32(cnt++);
            int tree2 = reader.GetInt32(cnt++);
            int tree3 = reader.GetInt32(cnt++);
            int tree4 = reader.GetInt32(cnt++);
            int tree5 = reader.GetInt32(cnt++);
            int tree6 = reader.GetInt32(cnt++);

            MovePlanet.Instance.getPlanets(color, size, mat, rowid);

            GameObject.Find("RotatePlanet/" + rowid).GetComponent<PlanetInfo>().rowid = rowid;
            GameObject.Find("RotatePlanet/" + rowid).GetComponent<PlanetInfo>().pName = pName;
            GameObject.Find("RotatePlanet/" + rowid).GetComponent<PlanetInfo>().size = size;
            GameObject.Find("RotatePlanet/" + rowid).GetComponent<PlanetInfo>().color = color;
            GameObject.Find("RotatePlanet/" + rowid).GetComponent<PlanetInfo>().mat = mat;
            GameObject.Find("RotatePlanet/" + rowid).GetComponent<PlanetInfo>().mFood = mFood;
            GameObject.Find("RotatePlanet/" + rowid).GetComponent<PlanetInfo>().mTitanium = mTitanium;
            GameObject.Find("RotatePlanet/" + rowid).GetComponent<PlanetInfo>().locationX = locationX;
            GameObject.Find("RotatePlanet/" + rowid).GetComponent<PlanetInfo>().locationY = locationY;
            GameObject.Find("RotatePlanet/" + rowid).GetComponent<PlanetInfo>().locationZ = locationZ;
            GameObject.Find("RotatePlanet/" + rowid).GetComponent<PlanetInfo>().le_persec = le_persec;
            GameObject.Find("RotatePlanet/" + rowid).GetComponent<PlanetInfo>().position_house = position_house;
            GameObject.Find("RotatePlanet/" + rowid).GetComponent<PlanetInfo>().state = state;
            GameObject.Find("RotatePlanet/" + rowid).GetComponent<PlanetInfo>().user = user;
            GameObject.Find("RotatePlanet/" + rowid).GetComponent<PlanetInfo>().neighbor = neighbor;
            GameObject.Find("RotatePlanet/" + rowid).GetComponent<PlanetInfo>().lFood = lFood;
            GameObject.Find("RotatePlanet/" + rowid).GetComponent<PlanetInfo>().lTitanium = lTitanium;
            GameObject.Find("RotatePlanet/" + rowid).GetComponent<PlanetInfo>().tree1 = tree1;
            GameObject.Find("RotatePlanet/" + rowid).GetComponent<PlanetInfo>().tree2 = tree2;
            GameObject.Find("RotatePlanet/" + rowid).GetComponent<PlanetInfo>().tree3 = tree3;
            GameObject.Find("RotatePlanet/" + rowid).GetComponent<PlanetInfo>().tree4 = tree4;
            GameObject.Find("RotatePlanet/" + rowid).GetComponent<PlanetInfo>().tree5 = tree5;
            GameObject.Find("RotatePlanet/" + rowid).GetComponent<PlanetInfo>().tree6 = tree6;

            cnt = 0;
        }

        reader.Close();
        reader = null;

        //유저있는행성불러오기
        //sqlQuery = "select * from managePlanetTableTest where rowid = " + MainSingleTon.Instance.cPlanet;
        sqlQuery = "select rowid, name, size, color, mat, mFood, mTitanium, locationX, locationY, locationZ, le_persec, position_house, state, user, neighbor, lFood, lTitanium, tree1, tree2, tree3, tree4, tree5, tree6 FROM managePlanetTable WHERE user = 1";
        dbcmd.CommandText = sqlQuery;
        reader = dbcmd.ExecuteReader();
        cnt = 0;
        while (reader.Read())
        {
            int rowid = reader.GetInt32(cnt++);
            string pName = reader.GetString(cnt++);
            int size = reader.GetInt32(cnt++);
//.........这里部分代码省略.........
开发者ID:Gibom,项目名称:Unity3D,代码行数:101,代码来源:ManageSceneSQL.cs

示例11: readSkillToCode

    public SkillInfo readSkillToCode(int code)
    {
        sqlQuery = "select * from BasicSkillTable Where SkillCode = " + code.ToString();

        dbcmd.CommandText = sqlQuery;
        reader = dbcmd.ExecuteReader();

        reader.Read ();

        SkillInfo info = new SkillInfo ();

        info.skillCode 	= reader.GetInt32 (0);
        info.name 		= reader.GetString (1);
        info.prefabName	= reader.GetString (2);
        info.attribute	= reader.GetInt32 (3);
        info.demage 	= reader.GetInt32 (4);
        info.numberOfObject	= reader.GetInt32 (5);
        info.coolTime	= reader.GetFloat (6);
        info.useLimit	= reader.GetInt32 (7);
        info.etc1		= reader.GetInt32(8);
        info.etc2		= reader.GetInt32(9);
        info.etc3		= reader.GetInt32(10);
        info.ICon		= reader.GetString(11);

        reader.Close();
        reader = null;

        return info;
    }
开发者ID:kms1837,项目名称:Non_Name_Project,代码行数:29,代码来源:DBmanager.cs

示例12: GetItem


//.........这里部分代码省略.........
            {
                item.ChannelId = reader.GetString(5);
            }

            var hasProgramAttributes = item as IHasProgramAttributes;
            if (hasProgramAttributes != null)
            {
                if (!reader.IsDBNull(6))
                {
                    hasProgramAttributes.IsMovie = reader.GetBoolean(6);
                }

                if (!reader.IsDBNull(7))
                {
                    hasProgramAttributes.IsSports = reader.GetBoolean(7);
                }

                if (!reader.IsDBNull(8))
                {
                    hasProgramAttributes.IsKids = reader.GetBoolean(8);
                }

                if (!reader.IsDBNull(9))
                {
                    hasProgramAttributes.IsSeries = reader.GetBoolean(9);
                }

                if (!reader.IsDBNull(10))
                {
                    hasProgramAttributes.IsLive = reader.GetBoolean(10);
                }

                if (!reader.IsDBNull(11))
                {
                    hasProgramAttributes.IsNews = reader.GetBoolean(11);
                }

                if (!reader.IsDBNull(12))
                {
                    hasProgramAttributes.IsPremiere = reader.GetBoolean(12);
                }

                if (!reader.IsDBNull(13))
                {
                    hasProgramAttributes.EpisodeTitle = reader.GetString(13);
                }

                if (!reader.IsDBNull(14))
                {
                    hasProgramAttributes.IsRepeat = reader.GetBoolean(14);
                }
            }

            if (!reader.IsDBNull(15))
            {
                item.CommunityRating = reader.GetFloat(15);
            }

            if (!reader.IsDBNull(16))
            {
                item.CustomRating = reader.GetString(16);
            }

            if (!reader.IsDBNull(17))
            {
                item.IndexNumber = reader.GetInt32(17);
            }

            if (!reader.IsDBNull(18))
            {
                item.IsLocked = reader.GetBoolean(18);
            }

            if (!reader.IsDBNull(19))
            {
                item.PreferredMetadataLanguage = reader.GetString(19);
            }

            if (!reader.IsDBNull(20))
            {
                item.PreferredMetadataCountryCode = reader.GetString(20);
            }

            if (!reader.IsDBNull(21))
            {
                item.IsHD = reader.GetBoolean(21);
            }

            if (!reader.IsDBNull(22))
            {
                item.ExternalEtag = reader.GetString(22);
            }

            if (!reader.IsDBNull(23))
            {
                item.DateLastRefreshed = reader.GetDateTime(23).ToUniversalTime();
            }

            return item;
        }
开发者ID:RavenB,项目名称:Emby,代码行数:101,代码来源:SqliteItemRepository.cs

示例13: Read

        public static CharacterData Read(IDataReader reader)
        {
            if (reader.Read())
            {
                return new CharacterData
                {
                    AccountId = reader.GetUInt64(0),
                    Coid = reader.GetInt64(1),
                    Cbid = reader.GetInt32(2),
                    TeamFaction = reader.GetInt32(3),
                    LastMapId = reader.GetUInt32(4),
                    LastStationMapId = reader.GetInt32(5),
                    X = reader.GetFloat(6),
                    Y = reader.GetFloat(7),
                    Z = reader.GetFloat(8),
                    Q1 = reader.GetFloat(9),
                    Q2 = reader.GetFloat(10),
                    Q3 = reader.GetFloat(11),
                    Q4 = reader.GetFloat(12),
                    Head = reader.GetInt32(13),
                    Body = reader.GetInt32(14),
                    HeadDetail = reader.GetInt32(15),
                    HeadDetail2 = reader.GetInt32(16),
                    Hair = reader.GetInt32(17),
                    Mouth = reader.GetInt32(18),
                    Eyes = reader.GetInt32(19),
                    Helmet = reader.GetInt32(20),
                    PrimaryColor = reader.GetUInt32(21),
                    SecondaryColor = reader.GetUInt32(22),
                    EyeColor = reader.GetUInt32(23),
                    HairColor = reader.GetUInt32(24),
                    SkinColor = reader.GetUInt32(25),
                    SpecialColor = reader.GetUInt32(26),
                    Level = reader.GetByte(27),
                    Name = reader.GetString(28),
                    ScaleOffset = reader.GetFloat(29),
                    ActiveVehicleCOID = reader.GetInt64(30),
                    LastStationId = reader.GetInt32(31),
                    Race = reader.GetByte(32),
                    Class = reader.GetByte(33),
                    CombatMode = reader.GetUInt32(34),
                    BattleMode = reader.GetInt16(35),
                    Credits = reader.GetUInt64(36),
                    CreditsDebt = reader.GetUInt64(37),
                    KmTravelled = reader.GetFloat(37),
                    Scale = reader.GetFloat(39),
                };
            }

            return null;
        }
开发者ID:4ptiv4,项目名称:GenesisSharp,代码行数:51,代码来源:CharacterData.cs

示例14: Push

 internal void Push(CUQueue UQueue, IDataReader dr)
 {
     int n;
     bool bNull;
     if (dr == null)
         throw new ArgumentNullException("Datarow object can't be null");
     if (m_dts == null)
         throw new ArgumentNullException("DataTable header is not serialized yet");
     if (m_dts.Length != dr.FieldCount)
         throw new InvalidOperationException("The size of the input data type array does not match the size of data row");
     byte b = 0;
     byte bOne = 1;
     m_qBit.SetSize(0);
     m_qTemp.SetSize(0);
     int nLen = m_dts.Length;
     for (n = 0; n < nLen; n++)
     {
         bNull = dr.IsDBNull(n);
         if (bNull)
         {
             b += (byte)(bOne << (byte)(n % 8));
         }
         if ((n % 8) == 7)
         {
             m_qBit.Save(b);
             b = 0;
         }
         if (bNull)
             continue;
         switch (m_dts[n])
         {
             case tagDataTypeSupported.dtBoolean:
                 m_qTemp.Save(dr.GetBoolean(n));
                 break;
             case tagDataTypeSupported.dtByte:
                 m_qTemp.Save(dr.GetByte(n));
                 break;
             case tagDataTypeSupported.dtChar:
                 m_qTemp.Save(dr.GetChar(n));
                 break;
             case tagDataTypeSupported.dtDateTime:
                 m_qTemp.Save(dr.GetDateTime(n));
                 break;
             case tagDataTypeSupported.dtDecimal:
                 m_qTemp.Save(dr.GetDecimal(n));
                 break;
             case tagDataTypeSupported.dtDouble:
                 m_qTemp.Save(dr.GetDouble(n));
                 break;
             case tagDataTypeSupported.dtFloat:
                 m_qTemp.Save(dr.GetFloat(n));
                 break;
             case tagDataTypeSupported.dtGuid:
                 m_qTemp.Save(dr.GetGuid(n));
                 break;
             case tagDataTypeSupported.dtInt16:
                 m_qTemp.Save(dr.GetInt16(n));
                 break;
             case tagDataTypeSupported.dtInt32:
                 m_qTemp.Save(dr.GetInt32(n));
                 break;
             case tagDataTypeSupported.dtInt64:
                 m_qTemp.Save(dr.GetInt64(n));
                 break;
             case tagDataTypeSupported.dtString:
                 {
                     string str = dr.GetString(n);
                     m_qTemp.Save(str);
                 }
                 break;
             case tagDataTypeSupported.dtBytes:
                 {
                     uint nBytes = (uint)dr.GetBytes(n, (long)0, null, 0, 0);
                     if (m_Buffer == null || nBytes > m_Buffer.Length)
                         m_Buffer = new byte[nBytes + 1024];
                     dr.GetBytes(n, (long)0, m_Buffer, 0, (int)nBytes);
                     m_qTemp.Save(nBytes);
                     m_qTemp.Push(m_Buffer, nBytes);
                 }
                 break;
             case tagDataTypeSupported.dtUInt64:
             case tagDataTypeSupported.dtUInt32:
             case tagDataTypeSupported.dtUInt16:
             case tagDataTypeSupported.dtValue:
             case tagDataTypeSupported.dtValues:
             case tagDataTypeSupported.dtTimeSpan:
                 {
                     object obj = dr.GetValue(n);
                     m_qTemp.Save(obj, false, false);
                 }
                 break;
             case tagDataTypeSupported.dtUDT:
                 {
                     object obj = dr.GetValue(n);
                     m_qTemp.Save(obj.ToString());
                 }
                 break;
             default:
                 throw new InvalidOperationException("Unsupported data type for serialization");
         }
//.........这里部分代码省略.........
开发者ID:udaparts,项目名称:socketpro,代码行数:101,代码来源:remotingadonethelper.cs

示例15: GetItem


//.........这里部分代码省略.........
                    hasProgramAttributes.IsSeries = reader.GetBoolean(9);
                }

                if (!reader.IsDBNull(10))
                {
                    hasProgramAttributes.IsLive = reader.GetBoolean(10);
                }

                if (!reader.IsDBNull(11))
                {
                    hasProgramAttributes.IsNews = reader.GetBoolean(11);
                }

                if (!reader.IsDBNull(12))
                {
                    hasProgramAttributes.IsPremiere = reader.GetBoolean(12);
                }

                if (!reader.IsDBNull(13))
                {
                    hasProgramAttributes.EpisodeTitle = reader.GetString(13);
                }

                if (!reader.IsDBNull(14))
                {
                    hasProgramAttributes.IsRepeat = reader.GetBoolean(14);
                }
            }

            var index = 15;

            if (!reader.IsDBNull(index))
            {
                item.CommunityRating = reader.GetFloat(index);
            }
            index++;

            if (query.HasField(ItemFields.CustomRating))
            {
                if (!reader.IsDBNull(index))
                {
                    item.CustomRating = reader.GetString(index);
                }
                index++;
            }

            if (!reader.IsDBNull(index))
            {
                item.IndexNumber = reader.GetInt32(index);
            }
            index++;

            if (query.HasField(ItemFields.Settings))
            {
                if (!reader.IsDBNull(index))
                {
                    item.IsLocked = reader.GetBoolean(index);
                }
                index++;

                if (!reader.IsDBNull(index))
                {
                    item.PreferredMetadataLanguage = reader.GetString(index);
                }
                index++;
开发者ID:t-andre,项目名称:Emby,代码行数:66,代码来源:SqliteItemRepository.cs


注:本文中的IDataReader.GetFloat方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。