Stamp

Namespace: log4net.Ext.Json
We found 10 examples in language CSharp for this search. You will see 53 fragments of code.

    void IStateInterpolator<CharacterTransformInterpolatorData>.SetGoals(ref TimeStamped<CharacterTransformInterpolatorData> sample)
    {
        base.SetGoals(ref sample);
    }

    void IStateInterpolator<CharacterTransformInterpolatorData>.SetGoals(ref CharacterTransformInterpolatorData sample, ref double timeStamp)
    {
        base.SetGoals(ref sample, ref timeStamp);
    }

    public bool Sample(ref double time, out CharacterTransformInterpolatorData result)
    {
        int index;
        double timeStamp;
        int num3;
        int num4;
        switch (base.len)
        {
            case 0:
                result = new CharacterTransformInterpolatorData();
                return false;

            case 1:
                index = base.tbuffer[0].index;
                timeStamp = base.tbuffer[index].timeStamp;
                result = base.tbuffer[index].value;
                return true;

            default:
                num3 = 0;
                num4 = -1;
                break;
        }
    Label_006F:
        index = base.tbuffer[num3].index;
        timeStamp = base.tbuffer[index].timeStamp;
        if (timeStamp > time)
        {
            num4 = index;
            goto Label_0613;
        }
        if (timeStamp == time)
        {
            result = base.tbuffer[index].value;
            return true;
        }
        if (timeStamp >= time)
        {
            goto Label_0613;
        }
        if (num4 == -1)
        {
            if (base.extrapolate && (num3 < (base.len - 1)))
            {
                num4 = index;
                index = base.tbuffer[num3 + 1].index;
                double num5 = (timeStamp - base.tbuffer[index].timeStamp) / (timeStamp - base.tbuffer[index].timeStamp);
                switch (num5)
                {
                    case 0.0:
                        result = base.tbuffer[index].value;
                        goto Label_0611;

                    case 1.0:
                        result = base.tbuffer[num4].value;
                        goto Label_0611;
                }
                double num6 = 1.0 - num5;
                result.origin.x = (float) ((base.tbuffer[index].value.origin.x * num6) + (base.tbuffer[num4].value.origin.x * num5));
                result.origin.y = (float) ((base.tbuffer[index].value.origin.y * num6) + (base.tbuffer[num4].value.origin.y * num5));
                result.origin.z = (float) ((base.tbuffer[index].value.origin.z * num6) + (base.tbuffer[num4].value.origin.z * num5));
                result.eyesAngles = new Angle2();
                result.eyesAngles.yaw = base.tbuffer[index].value.eyesAngles.yaw + ((float) (Mathf.DeltaAngle(base.tbuffer[index].value.eyesAngles.yaw, base.tbuffer[num4].value.eyesAngles.yaw) * num5));
                result.eyesAngles.pitch = Mathf.DeltaAngle(0f, base.tbuffer[index].value.eyesAngles.pitch + ((float) (Mathf.DeltaAngle(base.tbuffer[index].value.eyesAngles.pitch, base.tbuffer[num4].value.eyesAngles.pitch) * num5)));
            }
            else
            {
                result = base.tbuffer[index].value;
            }
        }
        else
        {
            double num7 = base.tbuffer[num4].timeStamp;
            double num8 = base.allowableTimeSpan + NetCull.sendInterval;
            double num9 = num7 - timeStamp;
            if (num9 > num8)
            {
                timeStamp = num7 - (num9 = num8);
                if (timeStamp >= time)
                {
                    result = base.tbuffer[index].value;
                    return true;
                }
            }
            double num10 = (time - timeStamp) / num9;
            switch (num10)
            {
                case 0.0:
                    result = base.tbuffer[index].value;
                    goto Label_0611;

                case 1.0:
                    result = base.tbuffer[num4].value;
                    goto Label_0611;
            }
            double num11 = 1.0 - num10;
            result.origin.x = (float) ((base.tbuffer[index].value.origin.x * num11) + (base.tbuffer[num4].value.origin.x * num10));
            result.origin.y = (float) ((base.tbuffer[index].value.origin.y * num11) + (base.tbuffer[num4].value.origin.y * num10));
            result.origin.z = (float) ((base.tbuffer[index].value.origin.z * num11) + (base.tbuffer[num4].value.origin.z * num10));
            result.eyesAngles = new Angle2();
            result.eyesAngles.yaw = base.tbuffer[index].value.eyesAngles.yaw + ((float) (Mathf.DeltaAngle(base.tbuffer[index].value.eyesAngles.yaw, base.tbuffer[num4].value.eyesAngles.yaw) * num10));
            result.eyesAngles.pitch = Mathf.DeltaAngle(0f, base.tbuffer[index].value.eyesAngles.pitch + ((float) (Mathf.DeltaAngle(base.tbuffer[index].value.eyesAngles.pitch, base.tbuffer[num4].value.eyesAngles.pitch) * num10)));
        }
    Label_0611:
        return true;
    Label_0613:
        if (++num3 < base.len)
        {
            goto Label_006F;
        }
        result = base.tbuffer[base.tbuffer[base.len - 1].index].value;
        return true;
    }

    public bool SampleWorldVelocity(out Angle2 worldAngularVelocity)
    {
        return this.SampleWorldVelocity(Interpolation.time, out worldAngularVelocity);
    }

    public bool SampleWorldVelocity(out Vector3 worldLinearVelocity)
    {
        return this.SampleWorldVelocity(Interpolation.time, out worldLinearVelocity);
    }

    public bool SampleWorldVelocity(out Vector3 worldLinearVelocity, out Angle2 worldAngularVelocity)
    {
        return this.SampleWorldVelocity(Interpolation.time, out worldLinearVelocity, out worldAngularVelocity);
    }


        public static TimeSpan Elapsed(DateTime dateTimeStart, DateTime dateTimeEnd)
        {
            return dateTimeEnd.ToUniversalTime().Subtract(dateTimeStart.ToUniversalTime());
        }

        public static TimeSpan Elapsed(int timeStampStart, int timeStampEnd)
        {
            return TimeSpan.FromSeconds((double) (timeStampEnd - timeStampStart));
        }

        public static TimeSpan Elapsed(TimeSpan sinceEpochStart, TimeSpan sinceEpochEnd)
        {
            return sinceEpochEnd.Subtract(sinceEpochStart);
        }

        public static double ElapsedSeconds(DateTime dateTimeStart, DateTime dateTimeEnd)
        {
            return dateTimeEnd.ToUniversalTime().Subtract(dateTimeStart.ToUniversalTime()).TotalSeconds;
        }

        public static double ElapsedSeconds(int timeStampStart, int timeStampEnd)
        {
            return TimeSpan.FromSeconds((double) (timeStampEnd - timeStampStart)).TotalSeconds;
        }

        public static double ElapsedSeconds(TimeSpan sinceEpochStart, TimeSpan sinceEpochEnd)
        {
            return sinceEpochEnd.Subtract(sinceEpochStart).TotalSeconds;
        }

        /// <summary>
        /// ����һ������
        /// </summary>
        public int Add(ModStamp model)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("insert into N_Stamp(");
            strSql.Append("StampNo,Password,IsUsed,StampMoney,StampOutTime,StampType,AddTime)");
            strSql.Append(" values (");
            strSql.Append("@StampNo,@Password,@IsUsed,@StampMoney,@StampOutTime,@StampType,@AddTime)");
            strSql.Append(";select @@IDENTITY");
            SqlParameter[] parameters = {
					new SqlParameter("@StampNo", SqlDbType.VarChar,50),
					new SqlParameter("@Password", SqlDbType.VarChar,50),
					new SqlParameter("@IsUsed", SqlDbType.Int,4),
					new SqlParameter("@StampMoney", SqlDbType.Int,4),
					new SqlParameter("@StampOutTime", SqlDbType.DateTime),
					new SqlParameter("@StampType", SqlDbType.Int,4),
					new SqlParameter("@AddTime", SqlDbType.DateTime)};
            parameters[0].Value = model.StampNo;
            parameters[1].Value = model.Password;
            parameters[2].Value = model.IsUsed;
            parameters[3].Value = model.StampMoney;
            parameters[4].Value = model.StampOutTime;
            parameters[5].Value = model.StampType;
            parameters[6].Value = model.AddTime;

            return adoHelper.ExecuteSqlNonQuery(strSql.ToString(), parameters);
        }
        /// <summary>
        /// ����һ������
        /// </summary>
        public int Update(ModStamp model)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("update N_Stamp set ");
            strSql.Append("[email protected],");
            strSql.Append("[email protected],");
            strSql.Append("[email protected],");
            strSql.Append("[email protected],");
            strSql.Append("[email protected],");
            strSql.Append("[email protected],");
            strSql.Append("[email protected]");
            strSql.Append(" where [email protected] ");
            SqlParameter[] parameters = {
					new SqlParameter("@ID", SqlDbType.Int,4),
					new SqlParameter("@StampNo", SqlDbType.VarChar,50),
					new SqlParameter("@Password", SqlDbType.VarChar,50),
					new SqlParameter("@IsUsed", SqlDbType.Int,4),
					new SqlParameter("@StampMoney", SqlDbType.Int,4),
					new SqlParameter("@StampOutTime", SqlDbType.DateTime),
					new SqlParameter("@StampType", SqlDbType.Int,4),
					new SqlParameter("@AddTime", SqlDbType.DateTime)};
            parameters[0].Value = model.ID;
            parameters[1].Value = model.StampNo;
            parameters[2].Value = model.Password;
            parameters[3].Value = model.IsUsed;
            parameters[4].Value = model.StampMoney;
            parameters[5].Value = model.StampOutTime;
            parameters[6].Value = model.StampType;
            parameters[7].Value = model.AddTime;

            return adoHelper.ExecuteSqlNonQuery(strSql.ToString(), parameters);
        }

        /// <summary>
        /// ɾ��һ������
        /// </summary>
        public int Delete(int ID)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("delete N_Stamp ");
            strSql.Append(" where [email protected] ");
            SqlParameter[] parameters = {
					new SqlParameter("@ID", SqlDbType.Int,4)};
            parameters[0].Value = ID;

            return adoHelper.ExecuteSqlNonQuery(strSql.ToString(), parameters);
        }

        /// <summary>
        /// �õ�һ������ʵ��
        /// </summary>
        public ModStamp GetModel(string StampNo)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("select ID,StampNo,Password,IsUsed,StampMoney,StampOutTime,StampType,AddTime from N_Stamp ");
            strSql.Append(" where [email protected] ");
            SqlParameter[] parameters = {
					new SqlParameter("@StampNo", SqlDbType.VarChar,50)
            };
            parameters[0].Value = StampNo;

            ModStamp model = new ModStamp();
            DataSet ds = adoHelper.ExecuteSqlDataset(strSql.ToString(), parameters);
            if (ds.Tables[0].Rows.Count > 0)
            {
                if (ds.Tables[0].Rows[0]["ID"].ToString() != "")
                {
                    model.ID = int.Parse(ds.Tables[0].Rows[0]["ID"].ToString());
                }
                model.StampNo = ds.Tables[0].Rows[0]["StampNo"].ToString();
                model.Password = ds.Tables[0].Rows[0]["Password"].ToString();
                if (ds.Tables[0].Rows[0]["IsUsed"].ToString() != "")
                {
                    model.IsUsed = int.Parse(ds.Tables[0].Rows[0]["IsUsed"].ToString());
                }
                if (ds.Tables[0].Rows[0]["StampMoney"].ToString() != "")
                {
                    model.StampMoney = int.Parse(ds.Tables[0].Rows[0]["StampMoney"].ToString());
                }
                if (ds.Tables[0].Rows[0]["StampOutTime"].ToString() != "")
                {
                    model.StampOutTime = DateTime.Parse(ds.Tables[0].Rows[0]["StampOutTime"].ToString());
                }
                if (ds.Tables[0].Rows[0]["StampType"].ToString() != "")
                {
                    model.StampType = int.Parse(ds.Tables[0].Rows[0]["StampType"].ToString());
                }
                if (ds.Tables[0].Rows[0]["AddTime"].ToString() != "")
                {
                    model.AddTime = DateTime.Parse(ds.Tables[0].Rows[0]["AddTime"].ToString());
                }
                return model;
            }
            else
            {
                return null;
            }
        }

        /// <summary>
        /// ��������б�
        /// </summary>
        public DataSet GetList(string strWhere)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("select ID,StampNo,Password,IsUsed,StampMoney,StampOutTime,StampType,AddTime ");
            strSql.Append(" FROM N_Stamp ");
            if (strWhere.Trim() != "")
            {
                strSql.Append(" where " + strWhere);
            }
            return adoHelper.ExecuteSqlDataset(strSql.ToString());
        }


        /// <summary>
        /// ������֤��1��ͨ����֤��-1�����Ŵ���-2���������
        /// </summary>
        public int CheckStamp(string stampNum, string stampPwd)
        {
            DataSet ds = GetList("stampNo='" + stampNum + "'");
            if (ds.Tables[0].Rows.Count > 0)
            {
                if (ds.Tables[0].Rows[0]["password"].ToString() == stampPwd)
                { return 1; }
                else { return -2; }
            }
            else { return -1; }
        }

		[Description("6.1. Add rotated Draft stamp from a standard collection by Stamp ID")]
		static public void AddStandardStampByID(Form1 Parent)
		{
			if (Parent.m_CurDoc == null)
				Document.CreateNewDoc(Parent);
			IPXC_Pages pages = Parent.m_CurDoc.Pages;
			IPXC_Page firstPage = pages[0];
			PXC_Rect rcPB = firstPage.get_Box(PXC_BoxType.PBox_PageBox);
			IPXC_StampsManager stampManager = Parent.m_pxcInst.StampsManager;
			IPXC_StampInfo si = stampManager.FindStamp("Draft");
			//Creating stamp annotation
			IPXS_Inst pSInt = (IPXS_Inst)Parent.m_pxcInst.GetExtension("PXS");
			uint nStamp = pSInt.StrToAtom("Stamp");
			double nHeight = 0;
			double nWidth = 0;
			si.GetSize(out nWidth, out nHeight);
			PXC_Rect rc;
			rc.left = rcPB.left - nWidth / 2.0 + nHeight / 2.0;
			rc.right = rcPB.left + nWidth / 2.0 + nHeight / 2.0;
			rc.top = rcPB.top;
			rc.bottom = rc.top - nWidth;
			IPXC_Annotation annot = firstPage.InsertNewAnnot(nStamp, ref rc, 0);
			IPXC_AnnotData_Stamp stampData = (IPXC_AnnotData_Stamp)annot.Data;
			stampData.Rotation = 90;
			stampData.SetStampName(si.ID);
			annot.Data = stampData;
			Marshal.ReleaseComObject(firstPage);
			Marshal.ReleaseComObject(pages);
		}

		[Description("6.2. Add Expired stamp from a standard collection by index in collection")]
		static public void AddStandardStampByIndexInCollection(Form1 Parent)
		{
			if (Parent.m_CurDoc == null)
				Document.CreateNewDoc(Parent);
			IPXC_Pages pages = Parent.m_CurDoc.Pages;
			IPXC_Page firstPage = pages[0];
			PXC_Rect rcPB = firstPage.get_Box(PXC_BoxType.PBox_PageBox);
			IPXC_StampsManager stampManager = Parent.m_pxcInst.StampsManager;
			uint nColIndex = (uint)stampManager.FindCollection("Standard");
			IPXC_StampsCollection sc = stampManager[nColIndex];
			IPXC_StampInfo si = null;
			for (uint i = 0; i < sc.Count; i++)
			{
				if (sc[i].ID == "Expired")
				{
					si = sc[i];
					break;
				}
			}
			//Creating stamp annotation
			IPXS_Inst pSInt = (IPXS_Inst)Parent.m_pxcInst.GetExtension("PXS");
			uint nStamp = pSInt.StrToAtom("Stamp");
			double nHeight = 0;
			double nWidth = 0;
			si.GetSize(out nWidth, out nHeight);
			PXC_Rect rc;
			rc.left = 0;
			rc.right = nWidth;
			rc.top = rcPB.top;
			rc.bottom = rc.top - nHeight;
			IPXC_Annotation annot = firstPage.InsertNewAnnot(nStamp, ref rc, 0);
			IPXC_AnnotData_Stamp stampData = (IPXC_AnnotData_Stamp)annot.Data;
			stampData.SetStampName(si.ID);
			annot.Data = stampData;
			Marshal.ReleaseComObject(firstPage);
			Marshal.ReleaseComObject(pages);
		}

		[Description("6.3. Load stamps collection from stamp file and place stamp from it")]
		static public void LoadStampsCollectionFromFile(Form1 Parent)
		{
			if (Parent.m_CurDoc == null)
				Document.CreateNewDoc(Parent);

			//Loading stamp collection from stamp file
			IAFS_Inst afsInst = (IAFS_Inst)Parent.m_pxcInst.GetExtension("AFS");
			string sPath = System.Environment.CurrentDirectory + "\\Documents\\MyStamps.pdf";
			IAFS_Name name = afsInst.DefaultFileSys.StringToName(sPath);
			int openFileFlags = (int)(AFS_OpenFileFlags.AFS_OpenFile_Read | AFS_OpenFileFlags.AFS_OpenFile_ShareRead);
			IAFS_File destFile = afsInst.DefaultFileSys.OpenFile(name, openFileFlags);
			IPXC_StampsCollection sc = Parent.m_pxcInst.StampsManager.LoadCollection(destFile);

			//Placing stamp from the loaded collection
			IPXC_Pages pages = Parent.m_CurDoc.Pages;
			IPXC_Page firstPage = pages[0];
			PXC_Rect rcPB = firstPage.get_Box(PXC_BoxType.PBox_PageBox);
			IPXC_StampInfo si = sc[0]; //getting stamp by index - they are sorted by name
			//Creating stamp annotation
			IPXS_Inst pSInt = (IPXS_Inst)Parent.m_pxcInst.GetExtension("PXS");
			uint nStamp = pSInt.StrToAtom("Stamp");
			double nHeight = 0;
			double nWidth = 0;
			si.GetSize(out nWidth, out nHeight);
			PXC_Rect rc;//Annotation rectangle
			rc.left = 0;
			rc.right = nWidth;
			rc.top = rcPB.top;
			rc.bottom = rc.top - nHeight;
			IPXC_Annotation annot = firstPage.InsertNewAnnot(nStamp, ref rc, 0);
			IPXC_AnnotData_Stamp stampData = (IPXC_AnnotData_Stamp)annot.Data;
			stampData.set_BBox(rc); //Stamp rectangle boundaries
			stampData.SetStampName(si.ID);
			annot.Data = stampData;
			Marshal.ReleaseComObject(firstPage);
			Marshal.ReleaseComObject(pages);
		}
		[Description("6.4. Load stamp from image file")]
		static public void LoadStampFromTheImageFile(Form1 Parent)
		{
			if (Parent.m_CurDoc == null)
				Document.CreateNewDoc(Parent);

			//Loading image file
			IAFS_Inst afsInst = (IAFS_Inst)Parent.m_pxcInst.GetExtension("AFS");
			string sPath = System.Environment.CurrentDirectory + "\\Images\\run_24.png";
			IAFS_Name name = afsInst.DefaultFileSys.StringToName(sPath);
			int openFileFlags = (int)(AFS_OpenFileFlags.AFS_OpenFile_Read | AFS_OpenFileFlags.AFS_OpenFile_ShareRead);
			IAFS_File destFile = afsInst.DefaultFileSys.OpenFile(name, openFileFlags);
			//Creating new collection
			IPXC_StampsCollection sc = Parent.m_pxcInst.StampsManager.CreateEmptyCollection("My Stamps");

			IPXC_StampInfo si = sc.AddStamp(destFile, "My Stamp");
			IPXC_Pages pages = Parent.m_CurDoc.Pages;
			IPXC_Page firstPage = pages[0];
			PXC_Rect rcPB = firstPage.get_Box(PXC_BoxType.PBox_PageBox);
			//Creating stamp annotation
			IPXS_Inst pSInt = (IPXS_Inst)Parent.m_pxcInst.GetExtension("PXS");
			uint nStamp = pSInt.StrToAtom("Stamp");
			double nHeight = 0;
			double nWidth = 0;
			si.GetSize(out nWidth, out nHeight);
			//Increasing width and height by 20
			PXC_Rect rc; //Annotation rectangle
			rc.left = 0;
			rc.right = nWidth * 20;
			rc.top = rcPB.top;
			rc.bottom = rc.top - nHeight * 20;
			IPXC_Annotation annot = firstPage.InsertNewAnnot(nStamp, ref rc, 0);
			IPXC_AnnotData_Stamp stampData = (IPXC_AnnotData_Stamp)annot.Data;
			stampData.set_BBox(rc); //Stamp rectangle boundaries
			stampData.SetStampName(si.ID);
			annot.Data = stampData;
			Marshal.ReleaseComObject(firstPage);
			Marshal.ReleaseComObject(pages);
		}

		[Description("6.1. Add rotated Draft stamp from a standard collection by Stamp ID")]
		static public void AddStandardStampByID(Form1 Parent)
		{
			if (Parent.m_CurDoc == null)
				Document.CreateNewDoc(Parent);
			IPXC_Pages pages = Parent.m_CurDoc.Pages;
			IPXC_Page firstPage = pages[0];
			PXC_Rect rcPB = firstPage.get_Box(PXC_BoxType.PBox_PageBox);
			IPXC_StampsManager stampManager = Parent.m_pxcInst.StampsManager;
			IPXC_StampInfo si = stampManager.FindStamp("Draft");
			//Creating stamp annotation
			IPXS_Inst pSInt = (IPXS_Inst)Parent.m_pxcInst.GetExtension("PXS");
			uint nStamp = pSInt.StrToAtom("Stamp");
			double nHeight = 0;
			double nWidth = 0;
			si.GetSize(out nWidth, out nHeight);
			PXC_Rect rc;
			rc.left = rcPB.left - nWidth / 2.0 + nHeight / 2.0;
			rc.right = rcPB.left + nWidth / 2.0 + nHeight / 2.0;
			rc.top = rcPB.top;
			rc.bottom = rc.top - nWidth;
			IPXC_Annotation annot = firstPage.InsertNewAnnot(nStamp, ref rc, 0);
			IPXC_AnnotData_Stamp stampData = (IPXC_AnnotData_Stamp)annot.Data;
			stampData.Rotation = 90;
			stampData.SetStampName(si.ID);
			annot.Data = stampData;
			Marshal.ReleaseComObject(firstPage);
			Marshal.ReleaseComObject(pages);
		}

		[Description("6.2. Add Expired stamp from a standard collection by index in collection")]
		static public void AddStandardStampByIndexInCollection(Form1 Parent)
		{
			if (Parent.m_CurDoc == null)
				Document.CreateNewDoc(Parent);
			IPXC_Pages pages = Parent.m_CurDoc.Pages;
			IPXC_Page firstPage = pages[0];
			PXC_Rect rcPB = firstPage.get_Box(PXC_BoxType.PBox_PageBox);
			IPXC_StampsManager stampManager = Parent.m_pxcInst.StampsManager;
			uint nColIndex = (uint)stampManager.FindCollection("Standard");
			IPXC_StampsCollection sc = stampManager[nColIndex];
			IPXC_StampInfo si = null;
			for (uint i = 0; i < sc.Count; i++)
			{
				if (sc[i].ID == "Expired")
				{
					si = sc[i];
					break;
				}
			}
			//Creating stamp annotation
			IPXS_Inst pSInt = (IPXS_Inst)Parent.m_pxcInst.GetExtension("PXS");
			uint nStamp = pSInt.StrToAtom("Stamp");
			double nHeight = 0;
			double nWidth = 0;
			si.GetSize(out nWidth, out nHeight);
			PXC_Rect rc;
			rc.left = 0;
			rc.right = nWidth;
			rc.top = rcPB.top;
			rc.bottom = rc.top - nHeight;
			IPXC_Annotation annot = firstPage.InsertNewAnnot(nStamp, ref rc, 0);
			IPXC_AnnotData_Stamp stampData = (IPXC_AnnotData_Stamp)annot.Data;
			stampData.SetStampName(si.ID);
			annot.Data = stampData;
			Marshal.ReleaseComObject(firstPage);
			Marshal.ReleaseComObject(pages);
		}

		[Description("6.3. Load stamps collection from stamp file and place stamp from it")]
		static public void LoadStampsCollectionFromFile(Form1 Parent)
		{
			if (Parent.m_CurDoc == null)
				Document.CreateNewDoc(Parent);

			//Loading stamp collection from stamp file
			IAFS_Inst afsInst = (IAFS_Inst)Parent.m_pxcInst.GetExtension("AFS");
			string sPath = System.Environment.CurrentDirectory + "\\Documents\\MyStamps.pdf";
			IAFS_Name name = afsInst.DefaultFileSys.StringToName(sPath);
			int openFileFlags = (int)(AFS_OpenFileFlags.AFS_OpenFile_Read | AFS_OpenFileFlags.AFS_OpenFile_ShareRead);
			IAFS_File destFile = afsInst.DefaultFileSys.OpenFile(name, openFileFlags);
			IPXC_StampsCollection sc = Parent.m_pxcInst.StampsManager.LoadCollection(destFile);

			//Placing stamp from the loaded collection
			IPXC_Pages pages = Parent.m_CurDoc.Pages;
			IPXC_Page firstPage = pages[0];
			PXC_Rect rcPB = firstPage.get_Box(PXC_BoxType.PBox_PageBox);
			IPXC_StampInfo si = sc[0]; //getting stamp by index - they are sorted by name
			//Creating stamp annotation
			IPXS_Inst pSInt = (IPXS_Inst)Parent.m_pxcInst.GetExtension("PXS");
			uint nStamp = pSInt.StrToAtom("Stamp");
			double nHeight = 0;
			double nWidth = 0;
			si.GetSize(out nWidth, out nHeight);
			PXC_Rect rc;//Annotation rectangle
			rc.left = 0;
			rc.right = nWidth;
			rc.top = rcPB.top;
			rc.bottom = rc.top - nHeight;
			IPXC_Annotation annot = firstPage.InsertNewAnnot(nStamp, ref rc, 0);
			IPXC_AnnotData_Stamp stampData = (IPXC_AnnotData_Stamp)annot.Data;
			stampData.set_BBox(rc); //Stamp rectangle boundaries
			stampData.SetStampName(si.ID);
			annot.Data = stampData;
			Marshal.ReleaseComObject(firstPage);
			Marshal.ReleaseComObject(pages);
		}
		[Description("6.4. Load stamp from image file")]
		static public void LoadStampFromTheImageFile(Form1 Parent)
		{
			if (Parent.m_CurDoc == null)
				Document.CreateNewDoc(Parent);

			//Loading image file
			IAFS_Inst afsInst = (IAFS_Inst)Parent.m_pxcInst.GetExtension("AFS");
			string sPath = System.Environment.CurrentDirectory + "\\Images\\run_24.png";
			IAFS_Name name = afsInst.DefaultFileSys.StringToName(sPath);
			int openFileFlags = (int)(AFS_OpenFileFlags.AFS_OpenFile_Read | AFS_OpenFileFlags.AFS_OpenFile_ShareRead);
			IAFS_File destFile = afsInst.DefaultFileSys.OpenFile(name, openFileFlags);
			//Creating new collection
			IPXC_StampsCollection sc = Parent.m_pxcInst.StampsManager.CreateEmptyCollection("My Stamps");

			IPXC_StampInfo si = sc.AddStamp(destFile, "My Stamp");
			IPXC_Pages pages = Parent.m_CurDoc.Pages;
			IPXC_Page firstPage = pages[0];
			PXC_Rect rcPB = firstPage.get_Box(PXC_BoxType.PBox_PageBox);
			//Creating stamp annotation
			IPXS_Inst pSInt = (IPXS_Inst)Parent.m_pxcInst.GetExtension("PXS");
			uint nStamp = pSInt.StrToAtom("Stamp");
			double nHeight = 0;
			double nWidth = 0;
			si.GetSize(out nWidth, out nHeight);
			//Increasing width and height by 20
			PXC_Rect rc; //Annotation rectangle
			rc.left = 0;
			rc.right = nWidth * 20;
			rc.top = rcPB.top;
			rc.bottom = rc.top - nHeight * 20;
			IPXC_Annotation annot = firstPage.InsertNewAnnot(nStamp, ref rc, 0);
			IPXC_AnnotData_Stamp stampData = (IPXC_AnnotData_Stamp)annot.Data;
			stampData.set_BBox(rc); //Stamp rectangle boundaries
			stampData.SetStampName(si.ID);
			annot.Data = stampData;
			Marshal.ReleaseComObject(firstPage);
			Marshal.ReleaseComObject(pages);
		}

		
		public static RebornStamp getInstance()
		{
			return RebornStamp.instance;
		}

		
		public static bool ParseYinJiConfig()
		{
			string fileName = Global.GameResPath(RebornStampConsts.RebornStampZhu);
			XElement xml = XElement.Load(fileName);
			if (null == xml)
			{
				LogManager.WriteLog(LogTypes.Fatal, string.Format("加载系统xml配置文件:{0}, 失败。没有找到相关XML配置文件!", fileName), null, true);
			}
			try
			{
				Dictionary<MainAttrType, Dictionary<int, int>> CurrMainYinJiHot = new Dictionary<MainAttrType, Dictionary<int, int>>();
				Dictionary<MainAttrType, List<int>> TypeMapHot = new Dictionary<MainAttrType, List<int>>();
				Dictionary<int, ChongShengYinJiZhu> MainYinJiHot = new Dictionary<int, ChongShengYinJiZhu>();
				Dictionary<MainAttrType, Dictionary<int, int>> MainYinJiLevelUpHot = new Dictionary<MainAttrType, Dictionary<int, int>>();
				IEnumerable<XElement> xmlItems = xml.Elements();
				foreach (XElement xmlItem in xmlItems)
				{
					ChongShengYinJiZhu temp = new ChongShengYinJiZhu();
					List<int> TypeList = new List<int>();
					Dictionary<int, double> AttrList = new Dictionary<int, double>();
					temp.ItemID = Convert.ToInt32(Global.GetSafeAttributeStr(xmlItem, "ID"));
					temp.MainType = (MainAttrType)Convert.ToInt32(Global.GetSafeAttributeStr(xmlItem, "TypeZhu"));
					temp.NeedLevel = Convert.ToInt32(Global.GetSafeAttributeStr(xmlItem, "NeedLevel"));
					string[] arrType = Global.GetSafeAttributeStr(xmlItem, "TypeFu").Split(new char[]
					{
						','
					});
					for (int i = 0; i < arrType.Length; i++)
					{
						TypeList.Add(Convert.ToInt32(arrType[i]));
					}
					temp.MinorType = TypeList;
					temp.Level = Convert.ToInt32(Global.GetSafeAttributeStr(xmlItem, "Level"));
					string[] arrAttr = Global.GetSafeAttributeStr(xmlItem, "ShuXing").Split(new char[]
					{
						'|'
					});
					for (int i = 0; i < arrAttr.Length; i++)
					{
						AttrList.Add((int)ConfigParser.GetPropIndexByPropName(arrAttr[i].Split(new char[]
						{
							','
						})[0]), Convert.ToDouble(arrAttr[i].Split(new char[]
						{
							','
						})[1]));
					}
					temp.AttrList = AttrList;
					MainYinJiHot.Add(temp.ItemID, temp);
					if (CurrMainYinJiHot.ContainsKey(temp.MainType))
					{
						CurrMainYinJiHot[temp.MainType].Add(temp.Level, temp.ItemID);
					}
					else
					{
						Dictionary<int, int> dict = new Dictionary<int, int>();
						dict.Add(temp.Level, temp.ItemID);
						CurrMainYinJiHot.Add(temp.MainType, dict);
					}
					if (MainYinJiLevelUpHot.ContainsKey(temp.MainType))
					{
						MainYinJiLevelUpHot[temp.MainType].Add(temp.NeedLevel, temp.ItemID);
					}
					else
					{
						Dictionary<int, int> dict = new Dictionary<int, int>();
						dict.Add(temp.NeedLevel, temp.ItemID);
						MainYinJiLevelUpHot.Add(temp.MainType, dict);
					}
					if (!TypeMapHot.ContainsKey(temp.MainType))
					{
						TypeMapHot.Add(temp.MainType, TypeList);
					}
				}
				RebornStamp.CurrMainYinJi = CurrMainYinJiHot;
				RebornStamp.TypeMap = TypeMapHot;
				RebornStamp.MainYinJi = MainYinJiHot;
				RebornStamp.MainYinJiLevelUp = MainYinJiLevelUpHot;
				if (RebornStamp.CurrMainYinJi == null || RebornStamp.TypeMap == null || RebornStamp.MainYinJi == null || RebornStamp.MainYinJiLevelUp == null)
				{
					return false;
				}
			}
			catch (Exception ex)
			{
				LogManager.WriteException(ex.ToString());
			}
			fileName = Global.GameResPath(RebornStampConsts.RebornStampZi);
			xml = XElement.Load(fileName);
			if (null == xml)
			{
				LogManager.WriteLog(LogTypes.Fatal, string.Format("加载系统xml配置文件:{0}, 失败。没有找到相关XML配置文件!", fileName), null, true);
			}
			try
			{
				Dictionary<int, Dictionary<int, int>> MinorYinJiLevelUpHot = new Dictionary<int, Dictionary<int, int>>();
				Dictionary<int, int> MinorLevelLimitHot = new Dictionary<int, int>();
				Dictionary<int, ChongShengYinJiZi> MinorYinJiHot = new Dictionary<int, ChongShengYinJiZi>();
				IEnumerable<XElement> xmlItems = xml.Elements();
				foreach (XElement xmlItem in xmlItems)
				{
					ChongShengYinJiZi temp2 = new ChongShengYinJiZi();
					List<int> TypeList = new List<int>();
					Dictionary<int, double> AttrList = new Dictionary<int, double>();
					temp2.ItemID = Convert.ToInt32(Global.GetSafeAttributeStr(xmlItem, "ID"));
					temp2.MinorType = Convert.ToInt32(Global.GetSafeAttributeStr(xmlItem, "Type"));
					temp2.Level = Convert.ToInt32(Global.GetSafeAttributeStr(xmlItem, "Level"));
					string[] arrAttr = Global.GetSafeAttributeStr(xmlItem, "ShuXing").Split(new char[]
					{
						'|'
					});
					for (int i = 0; i < arrAttr.Length; i++)
					{
						string[] str = arrAttr[i].Split(new char[]
						{
							','
						});
						if (str.Length == 1)
						{
							AttrList.Add(0, 0.0);
						}
						else
						{
							AttrList.Add((int)ConfigParser.GetPropIndexByPropName(str[0]), Convert.ToDouble(str[1]));
						}
					}
					temp2.AttrList = AttrList;
					MinorYinJiHot.Add(temp2.ItemID, temp2);
					if (MinorLevelLimitHot.ContainsKey(temp2.MinorType))
					{
						if (MinorLevelLimitHot[temp2.MinorType] < temp2.Level)
						{
							MinorLevelLimitHot[temp2.MinorType] = temp2.Level;
						}
					}
					else
					{
						MinorLevelLimitHot.Add(temp2.MinorType, temp2.Level);
					}
					if (MinorYinJiLevelUpHot.ContainsKey(temp2.MinorType))
					{
						MinorYinJiLevelUpHot[temp2.MinorType].Add(temp2.Level, temp2.ItemID);
					}
					else
					{
						Dictionary<int, int> dict = new Dictionary<int, int>();
						dict.Add(temp2.Level, temp2.ItemID);
						MinorYinJiLevelUpHot.Add(temp2.MinorType, dict);
					}
				}
				RebornStamp.MinorYinJiLevelUp = MinorYinJiLevelUpHot;
				RebornStamp.MinorLevelLimit = MinorLevelLimitHot;
				RebornStamp.MinorYinJi = MinorYinJiHot;
				if (RebornStamp.MinorYinJiLevelUp == null || RebornStamp.MinorLevelLimit == null || RebornStamp.MinorYinJi == null)
				{
					return false;
				}
			}
			catch (Exception ex)
			{
				LogManager.WriteException(ex.ToString());
			}
			List<int> YinJiResetHot = new List<int>();
			int[] num = GameManager.systemParamsList.GetParamValueIntArrayByName("ChongShengYinJiChongZhi", ',');
			foreach (int it in num)
			{
				YinJiResetHot.Add(it);
			}
			RebornStamp.YinJiReset = YinJiResetHot;
			return RebornStamp.YinJiReset != null;
		}

		
		public static bool CheckTypeMatch(RebornStampData curr, int StampID, int StampType, out int Index, out int MainAttr)
		{
			Index = 0;
			MainAttr = 0;
			bool result;
			if (curr == null || curr.StampInfo == null || curr.StampInfo.Count < 0 || curr.StampInfo.Count > 16)
			{
				result = false;
			}
			else if (!RebornStamp.TypeMap.ContainsKey((MainAttrType)curr.StampInfo[0]) || !RebornStamp.TypeMap.ContainsKey((MainAttrType)curr.StampInfo[8]))
			{
				result = false;
			}
			else if (!RebornStamp.MinorYinJi.ContainsKey(StampID) || RebornStamp.MinorYinJi[StampID].MinorType != StampType)
			{
				result = false;
			}
			else
			{
				bool Exist = false;
				int i = 2;
				int j = 10;
				while (i < 8)
				{
					if (StampType == curr.StampInfo[i])
					{
						Exist = true;
						MainAttr = 1;
						Index = i;
						break;
					}
					if (StampType == curr.StampInfo[j])
					{
						Exist = true;
						MainAttr = 2;
						Index = j;
						break;
					}
					i += 2;
					j += 2;
				}
				if (!Exist)
				{
					result = false;
				}
				else
				{
					int temp = 0;
					bool[] flag = new bool[3];
					if (MainAttr == 1 && RebornStamp.TypeMap.ContainsKey((MainAttrType)curr.StampInfo[0]))
					{
						for (i = 2; i < 8; i += 2)
						{
							foreach (int it in RebornStamp.TypeMap[(MainAttrType)curr.StampInfo[0]])
							{
								if (curr.StampInfo[i] == 0)
								{
									flag[temp] = true;
								}
								else if (curr.StampInfo[i] == it)
								{
									flag[temp] = true;
									break;
								}
							}
							temp++;
						}
					}
					if (MainAttr == 2 && RebornStamp.TypeMap.ContainsKey((MainAttrType)curr.StampInfo[8]))
					{
						for (i = 10; i < 16; i += 2)
						{
							foreach (int it in RebornStamp.TypeMap[(MainAttrType)curr.StampInfo[8]])
							{
								if (curr.StampInfo[i] == 0)
								{
									flag[temp] = true;
								}
								else if (curr.StampInfo[i] == it)
								{
									flag[temp] = true;
									break;
								}
							}
							temp++;
						}
					}
					bool[] array = flag;
					for (int k = 0; k < array.Length; k++)
					{
						if (!array[k])
						{
							Exist = false;
						}
					}
					result = Exist;
				}
			}
			return result;
		}

		
		public static int GetCurrMinorLevelItemID(RebornStampData dbInfo, int Index)
		{
			int result;
			if (dbInfo.StampInfo[Index] == 0)
			{
				result = 0;
			}
			else
			{
				result = RebornStamp.MinorYinJiLevelUp[dbInfo.StampInfo[Index]][dbInfo.StampInfo[Index + 1]];
			}
			return result;
		}

		
		public static int GetCurrMainLevelItemID(RebornStampData dbInfo, int Index)
		{
			int result;
			if (dbInfo.StampInfo[Index] == 0)
			{
				result = 0;
			}
			else
			{
				result = RebornStamp.CurrMainYinJi[(MainAttrType)dbInfo.StampInfo[Index]][dbInfo.StampInfo[Index + 1]];
			}
			return result;
		}

		
		public static int GetMainYinJiLevelUpNum(RebornStampData dbInfo, int Index)
		{
			int MainUpNum = 0;
			int result;
			if (Index != 0 && Index != 8)
			{
				result = MainUpNum;
			}
			else
			{
				int CurrID = RebornStamp.GetCurrMainLevelItemID(dbInfo, Index);
				if (Index == 0)
				{
					foreach (KeyValuePair<int, int> it in RebornStamp.MainYinJiLevelUp[(MainAttrType)dbInfo.StampInfo[Index]])
					{
						if (it.Value > CurrID)
						{
							if (dbInfo.StampInfo[3] >= it.Key && dbInfo.StampInfo[5] >= it.Key && dbInfo.StampInfo[7] >= it.Key)
							{
								MainUpNum++;
							}
							if (MainUpNum > 0 && (dbInfo.StampInfo[3] < it.Key || dbInfo.StampInfo[5] < it.Key || dbInfo.StampInfo[7] < it.Key))
							{
								break;
							}
						}
					}
				}
				else if (Index == 8)
				{
					foreach (KeyValuePair<int, int> it in RebornStamp.MainYinJiLevelUp[(MainAttrType)dbInfo.StampInfo[Index]])
					{
						if (it.Value > CurrID)
						{
							if (dbInfo.StampInfo[11] >= it.Key && dbInfo.StampInfo[13] >= it.Key && dbInfo.StampInfo[15] >= it.Key)
							{
								MainUpNum++;
							}
							if (MainUpNum > 0 && (dbInfo.StampInfo[11] < it.Key || dbInfo.StampInfo[13] < it.Key || dbInfo.StampInfo[15] < it.Key))
							{
								break;
							}
						}
					}
				}
				result = MainUpNum;
			}
			return result;
		}


    public static Stamp.StandardTypeEnum? Get(
      PdfName name
      )
    {
      foreach(KeyValuePair<Stamp.StandardTypeEnum,TypeItem> entry in codes)
      {
        if(entry.Value.Code.Equals(name))
          return entry.Key;
      }
      return null;
    }

    /**
      <summary>Gets the aspect ratio of the original Acrobat standard stamp.</summary>
    */
    public static float GetAspect(
      this Stamp.StandardTypeEnum type
      )
    {return codes[type].Aspect;}

    public static PdfName GetName(
      this Stamp.StandardTypeEnum type
      )
    {return codes[type].Code;}


        public void Report(ComponentVertexDeploymentProgress value)
        {
            if (value != null)
            {
                switch (value.Status)
                {
                    case ComponentVertexDeploymentStatus.NotStarted:
                        ComponentDeploymentNotStarted(value);
                        break;
                    case ComponentVertexDeploymentStatus.Started:
                        ComponentDeploymentStarted(value);
                        break;
                    case ComponentVertexDeploymentStatus.InProgress:
                        ComponentDeploymentInProgress(value);
                        break;
                    case ComponentVertexDeploymentStatus.Failure:
                        ComponentDeploymentFailure(value);
                        break;
                    case ComponentVertexDeploymentStatus.Cancelled:
                        ComponentDeploymentCancelled(value);
                        break;
                    case ComponentVertexDeploymentStatus.Success:
                        ComponentDeploymentSuccess(value);
                        break;
                    default:
                        throw new ArgumentOutOfRangeException();
                }
            }
        }

        public void PrintHelp(HelpText helpText)
        {
            var timeStamp = GetJavaTimeStamp();

            var message = _serviceMessageFormatter.FormatMessage("message", new
            {
                text = helpText,
                flowId = NoParent,
                timeStamp = timeStamp
            });

            Console.Out.WriteLine(message);
        }

        public void PrintVersion(string version)
        {
            var timeStamp = GetJavaTimeStamp();

            var message = _serviceMessageFormatter.FormatMessage("message", new
            {
                text = version,
                flowId = NoParent,
                timeStamp = timeStamp
            });

            Console.Out.WriteLine(message);
        }

        public void PrintActionMessage(string messageToSend)
        {
            var timeStamp = GetJavaTimeStamp();

            var message = _serviceMessageFormatter.FormatMessage("message", new
            {
                text = messageToSend,
                flowId = NoParent,
                timeStamp = timeStamp
            });

            Console.Out.WriteLine(message);
        }

        public void PrintEnvironmentDeploy(EnvironmentDeployment environmentDeployment)
        {
            var name = "EnvironmentDeployment";
            var description = "Environment Deployment";
            var timeStamp = GetJavaTimeStamp();

            var environmentDeploymentJson = JsonConvert.SerializeObject(environmentDeployment, new JsonSerializerSettings { Formatting = Formatting.Indented });

            var openBlockMessage = _serviceMessageFormatter.FormatMessage("blockOpened", new
            {
                name = name,
                description = description,
                flowId = name,
                timeStamp = timeStamp
            });

            var closeBlockMessage = _serviceMessageFormatter.FormatMessage("blockClosed", new
            {
                name = name,
                flowId = name,
                timeStamp = timeStamp
            });

            var message = openBlockMessage + Environment.NewLine + environmentDeploymentJson + Environment.NewLine + closeBlockMessage;

            Console.Out.WriteLine(message);
        }

        private void ComponentDeploymentNotStarted(ComponentVertexDeploymentProgress value)
        {
        }


    void IStateInterpolator<CharacterStateInterpolatorData>.SetGoals(ref TimeStamped<CharacterStateInterpolatorData> sample)
    {
        base.SetGoals(ref sample);
    }

    void IStateInterpolator<CharacterStateInterpolatorData>.SetGoals(ref CharacterStateInterpolatorData sample, ref double timeStamp)
    {
        base.SetGoals(ref sample, ref timeStamp);
    }

    public bool Sample(ref double time, out CharacterStateInterpolatorData result)
    {
        int index;
        double timeStamp;
        int num3;
        int num4;
        switch (base.len)
        {
            case 0:
                result = new CharacterStateInterpolatorData();
                return false;

            case 1:
                index = base.tbuffer[0].index;
                timeStamp = base.tbuffer[index].timeStamp;
                result = base.tbuffer[index].value;
                return true;

            default:
                num3 = 0;
                num4 = -1;
                break;
        }
    Label_006F:
        index = base.tbuffer[num3].index;
        timeStamp = base.tbuffer[index].timeStamp;
        if (timeStamp > time)
        {
            num4 = index;
            goto Label_07E1;
        }
        if (timeStamp == time)
        {
            result = base.tbuffer[index].value;
            return true;
        }
        if (timeStamp >= time)
        {
            goto Label_07E1;
        }
        if (num4 == -1)
        {
            if (base.extrapolate && (num3 < (base.len - 1)))
            {
                num4 = index;
                index = base.tbuffer[num3 + 1].index;
                double num5 = (timeStamp - base.tbuffer[index].timeStamp) / (timeStamp - base.tbuffer[index].timeStamp);
                switch (num5)
                {
                    case 0.0:
                        result = base.tbuffer[index].value;
                        goto Label_07DF;

                    case 1.0:
                        result = base.tbuffer[num4].value;
                        goto Label_07DF;
                }
                double num6 = 1.0 - num5;
                result.origin.x = (float) ((base.tbuffer[index].value.origin.x * num6) + (base.tbuffer[num4].value.origin.x * num5));
                result.origin.y = (float) ((base.tbuffer[index].value.origin.y * num6) + (base.tbuffer[num4].value.origin.y * num5));
                result.origin.z = (float) ((base.tbuffer[index].value.origin.z * num6) + (base.tbuffer[num4].value.origin.z * num5));
                result.eyesAngles = new Angle2();
                result.eyesAngles.yaw = base.tbuffer[index].value.eyesAngles.yaw + ((float) (Mathf.DeltaAngle(base.tbuffer[index].value.eyesAngles.yaw, base.tbuffer[num4].value.eyesAngles.yaw) * num5));
                result.eyesAngles.pitch = Mathf.DeltaAngle(0f, base.tbuffer[index].value.eyesAngles.pitch + ((float) (Mathf.DeltaAngle(base.tbuffer[index].value.eyesAngles.pitch, base.tbuffer[num4].value.eyesAngles.pitch) * num5)));
                if (num5 > 1.0)
                {
                    result.state = base.tbuffer[num4].value.state;
                }
                else if (num5 < 0.0)
                {
                    result.state = base.tbuffer[index].value.state;
                }
                else
                {
                    result.state = base.tbuffer[index].value.state;
                    result.state.flags = (ushort) (result.state.flags | ((byte) (base.tbuffer[num4].value.state.flags & 0x43)));
                    if (result.state.grounded != base.tbuffer[num4].value.state.grounded)
                    {
                        result.state.grounded = false;
                    }
                }
            }
            else
            {
                result = base.tbuffer[index].value;
            }
        }
        else
        {
            double num7 = base.tbuffer[num4].timeStamp;
            double num8 = base.allowableTimeSpan + NetCull.sendInterval;
            double num9 = num7 - timeStamp;
            if (num9 > num8)
            {
                timeStamp = num7 - (num9 = num8);
                if (timeStamp >= time)
                {
                    result = base.tbuffer[index].value;
                    return true;
                }
            }
            double num10 = (time - timeStamp) / num9;
            switch (num10)
            {
                case 0.0:
                    result = base.tbuffer[index].value;
                    goto Label_07DF;

                case 1.0:
                    result = base.tbuffer[num4].value;
                    goto Label_07DF;
            }
            double num11 = 1.0 - num10;
            result.origin.x = (float) ((base.tbuffer[index].value.origin.x * num11) + (base.tbuffer[num4].value.origin.x * num10));
            result.origin.y = (float) ((base.tbuffer[index].value.origin.y * num11) + (base.tbuffer[num4].value.origin.y * num10));
            result.origin.z = (float) ((base.tbuffer[index].value.origin.z * num11) + (base.tbuffer[num4].value.origin.z * num10));
            result.eyesAngles = new Angle2();
            result.eyesAngles.yaw = base.tbuffer[index].value.eyesAngles.yaw + ((float) (Mathf.DeltaAngle(base.tbuffer[index].value.eyesAngles.yaw, base.tbuffer[num4].value.eyesAngles.yaw) * num10));
            result.eyesAngles.pitch = Mathf.DeltaAngle(0f, base.tbuffer[index].value.eyesAngles.pitch + ((float) (Mathf.DeltaAngle(base.tbuffer[index].value.eyesAngles.pitch, base.tbuffer[num4].value.eyesAngles.pitch) * num10)));
            if (num10 > 1.0)
            {
                result.state = base.tbuffer[num4].value.state;
            }
            else if (num10 < 0.0)
            {
                result.state = base.tbuffer[index].value.state;
            }
            else
            {
                result.state = base.tbuffer[index].value.state;
                result.state.flags = (ushort) (result.state.flags | ((byte) (base.tbuffer[num4].value.state.flags & 0x43)));
                if (result.state.grounded != base.tbuffer[num4].value.state.grounded)
                {
                    result.state.grounded = false;
                }
            }
        }
    Label_07DF:
        return true;
    Label_07E1:
        if (++num3 < base.len)
        {
            goto Label_006F;
        }
        result = base.tbuffer[base.tbuffer[base.len - 1].index].value;
        return true;
    }

    public bool Sample(ref double time, out CharacterTransformInterpolatorData result)
    {
        CharacterStateInterpolatorData data;
        bool flag = this.Sample(ref time, out data);
        result.eyesAngles = data.eyesAngles;
        result.origin = data.origin;
        return flag;
    }

    public bool SampleWorldVelocity(out Angle2 worldAngularVelocity)
    {
        return this.SampleWorldVelocity(Interpolation.time, out worldAngularVelocity);
    }

    public bool SampleWorldVelocity(out Vector3 worldLinearVelocity)
    {
        return this.SampleWorldVelocity(Interpolation.time, out worldLinearVelocity);
    }


        public void SetEntity(MyEntity entity)
        {
            m_entity = entity;
        }

        public void Update(uint timeStamp)
        {
            if(m_entity == null|| m_entity.Physics == null)
            {
                m_timeStampData.Remove(timeStamp);
                return;
            }
    
            var matrix = m_entity.WorldMatrix;

            m_timeStampData[timeStamp] = new MyTimeStampValues()
            {
                EntityId = m_entity.EntityId,
                Transform = new MyTransformD(matrix),
                LinearVelocity = m_entity.Physics.LinearVelocity,
                AngularVelocity = m_entity.Physics.AngularVelocity,
            };

            if (m_timeStampData.Count >= MAX_POSHISTORY)
            {
                m_timeStampData.Remove(m_timeStampData.First().Key);
            }

            m_currentTimestamp = timeStamp;
        }

        public MyTimeStampValues? GetTransform(uint timeStamp)
        {
            MyTimeStampValues transform;
            if (m_timeStampData.TryGetValue(timeStamp, out transform) == false)
            {
                return null;
            }
            return transform;          
        }

        public void ServerResponse(uint timeStamp, ref MyTransformD serverPositionAndOrientation)
        {
            if (timeStamp < m_lastTSFromServer)
                return;

            if (m_timeStampData.ContainsKey(timeStamp) == false)
            {
                m_entity.PositionComp.SetWorldMatrix(serverPositionAndOrientation.TransformMatrix, null, true);
                return;
            }

            MyTimeStampValues cachedData = m_timeStampData[timeStamp];

            var mat = m_entity.WorldMatrix;
            MyTransformD delta = UpdateValues(m_entity, ref serverPositionAndOrientation, ref cachedData);
            mat.Translation = serverPositionAndOrientation.Position;
            m_entity.PositionComp.SetWorldMatrix(mat, null, true);

            UpdateDeltaPosition(timeStamp, ref delta);

            m_lastTSFromServer = timeStamp;
        }

        MyTransformD UpdateValues(MyEntity entity, ref MyTransformD serverPositionAndOrientation, ref MyTimeStampValues cachedData)
        {

            MyTransformD delta = new MyTransformD();

            delta.Position = serverPositionAndOrientation.Position - cachedData.Transform.Position;

            cachedData.Transform.Rotation = Quaternion.Inverse(cachedData.Transform.Rotation);
            Quaternion.Multiply(ref serverPositionAndOrientation.Rotation, ref cachedData.Transform.Rotation, out delta.Rotation);
            delta.Rotation = Quaternion.Identity;

            MatrixD matrix = entity.WorldMatrix;
            matrix.Translation = Vector3D.Zero;
            MatrixD correctionMatrix = MatrixD.Multiply(matrix, delta.TransformMatrix);
            correctionMatrix.Translation += entity.WorldMatrix.Translation;
            entity.PositionComp.SetWorldMatrix(correctionMatrix, null, true);

            return delta;
        }

        public void UpdateDeltaVelocities(uint timestamp, ref Vector3 deltaLinear, ref Vector3 deltaAngular)
        {
            if (m_timeStampData.Count <= 0)
                return;

            for (uint i = timestamp; i <= m_currentTimestamp; ++i)
            {
                UpdateData(i, ref deltaLinear, ref deltaAngular);
            }
        }

log4net.Util.Stamps.Stamp : IStamp

Constructors :

public Stamp()

Methods :

public String get_Name()
public Void set_Name(String value = )
public Void StampEvent(LoggingEvent loggingEvent = )
public static Void Init()
public static Int32 GetProcessId()
public static Int64 GetSequence()
public static Int64 SetSequence(Int64 value = )
public static Double GetSystemUpTime()
public static Double ConvertStopwatchTicksToSeconds(Int64 ticks = )
public static Double ConvertTimeSpanToSeconds(TimeSpan span = )
public static Double GetEpochTime(AgeReference ageRef = )
public static Double GetTimeStampValue(AgeReference tfrom = , AgeReference tto = , Double multiplier = , Boolean round = )
public static Double AdjustTimeValue(Double value = , Double multiplier = , Boolean round = )
public Type GetType()
public String ToString()
public Boolean Equals(Object obj = )
public Int32 GetHashCode()