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


C# KeyInfo类代码示例

本文整理汇总了C#中KeyInfo的典型用法代码示例。如果您正苦于以下问题:C# KeyInfo类的具体用法?C# KeyInfo怎么用?C# KeyInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: sqlite3IndexKeyinfo

 // Return a dynamicly allocated KeyInfo structure that can be used with OP_OpenRead or OP_OpenWrite to access database index pIdx.
 //
 // If successful, a pointer to the new structure is returned. In this case the caller is responsible for calling sqlite3DbFree(db, ) on the returned
 // pointer. If an error occurs (out of memory or missing collation sequence), NULL is returned and the state of pParse updated to reflect
 // the error.
 internal static KeyInfo sqlite3IndexKeyinfo(Parse pParse, Index pIdx)
 {
     var nCol = pIdx.nColumn;
     var db = pParse.db;
     var pKey = new KeyInfo();
     if (pKey != null)
     {
         pKey.db = pParse.db;
         pKey.aSortOrder = new byte[nCol];
         pKey.aColl = new CollSeq[nCol];
         for (var i = 0; i < nCol; i++)
         {
             var zColl = pIdx.azColl[i];
             Debug.Assert(zColl != null);
             pKey.aColl[i] = sqlite3LocateCollSeq(pParse, zColl);
             pKey.aSortOrder[i] = pIdx.aSortOrder[i];
         }
         pKey.nField = (ushort)nCol;
     }
     if (pParse.nErr != 0)
     {
         pKey = null;
         sqlite3DbFree(db, ref pKey);
     }
     return pKey;
 }
开发者ID:JiujiangZhu,项目名称:feaserver,代码行数:31,代码来源:Build.cs

示例2: ValuePair

		static KeyInfo ValuePair(Enum token, object value)
		{
			KeyInfo k=new KeyInfo();
			k.ki_key=(int)(object)token;
			k.ki_name=token.ToString();
			return k;
		}
开发者ID:LogoPhonix,项目名称:libgeotiff.net,代码行数:7,代码来源:geonames.cs

示例3: GetHelper

        private static ProofKeysHelper GetHelper()
        {
            KeyInfo current = new KeyInfo(key, modulus, exponent);
            KeyInfo old = new KeyInfo(oldKey, oldModulus, oldExponent);

            return new ProofKeysHelper(current, old);
        }
开发者ID:shivajiraot,项目名称:Office-Online-Test-Tools-and-Documentation,代码行数:7,代码来源:ProofKeyTests.cs

示例4: KeyValue

 internal KeyValue(KeyInfo key, byte[] keyBuffer)
 {
     if (key == null || keyBuffer == null) {
         throw new ArgumentNullException();
     }
     if (key.Length < keyBuffer.Length) {
         throw new ArgumentException();
     }
     this.Key = key;
     this.KeyBuffer = keyBuffer;
     this.ComplementCount = 0;
 }
开发者ID:jishida,项目名称:BtrieveWrapper,代码行数:12,代码来源:KeyValue.cs

示例5: TmKeyRec

 public TmKeyRec(int _buffSize, BUFF_TYPE _buffType)
 {
     mBuffSize = _buffSize;
     mInfo = new KeyInfo();
     mRecInfo = new KeyInfo[mBuffSize];
     mBuffPtr = -1;
     mRecSize = mRecCtr = mPlayCtr = 0;
     mState = STATE.STOP;
     mBuffType = _buffType;
     mPad = new PAD();
     mDebug = new KeyInfoDebug();
 }
开发者ID:hiyijia,项目名称:unity_mylib,代码行数:12,代码来源:TmKeyRec.cs

示例6: Zero

        public uint[] OverflowIDs; // Cache of overflow page locations

        #endif

        #region Methods

        // was:sqlite3BtreeCursorZero
        public void Zero()
        {
            Next = null;
            Prev = null;
            KeyInfo = null;
            RootID = 0;
            _cachedRowID = 0;
            Info = new MemPage.CellInfo();
            Writeable = false;
            AtLast = false;
            ValidNKey = false;
            State = 0;
            Key = null;
            NKey = 0;
            SkipNext = 0;
            #if !SQLITE_OMIT_INCRBLOB
            IsIncrblob = false;
            OverflowIDs = null;
            #endif
            PageID = 0;
        }
开发者ID:JiujiangZhu,项目名称:feaserver,代码行数:28,代码来源:BtreeCursor.cs

示例7: Clear

        public bool isIncrblobHandle; // True if this cursor is an incr. io handle

        #endif

        #region Methods

        public void Clear()
        {
            pNext = null;
            pPrev = null;
            pKeyInfo = null;
            pgnoRoot = 0;
            cachedRowid = 0;
            info = new CellInfo();
            wrFlag = 0;
            atLast = 0;
            validNKey = false;
            eState = 0;
            pKey = null;
            nKey = 0;
            skipNext = 0;
            #if !SQLITE_OMIT_INCRBLOB
            isIncrblobHandle = false;
            aOverflow = null;
            #endif
            iPage = 0;
        }
开发者ID:JiujiangZhu,项目名称:feaserver,代码行数:27,代码来源:BtCursor.cs

示例8: SvgElement

 // Methods
 internal SvgElement(string prefix, string localname, string ns, SvgDocument doc)
     : base(prefix, localname, ns, doc)
 {
     this.timeLineVisible = true;
     KeyInfo[] infoArray1 = new KeyInfo[1] { new KeyInfo(0, 0) } ;
     this.infoList = new ArrayList(infoArray1);
     this.showParticular = false;
     this.inKey = false;
     this.animatelist = new SvgElementCollection();
     this.svgAttributes = new Hashtable(0x10);
     this.svgAnimAttributes = new Hashtable(0x10);
     this.svgStyleAttributes = new Hashtable(0x10);
     this.beforeChangeValueStr = string.Empty;
     this.showchild = true;
     this.pretime = -1;
     this.AnimateNameValues = new Hashtable(0x10);
     this.AttributePos = new Hashtable();
     this.FormatOutXml = true;
     this.UseElement = null;
     this.CreateParse = true;
     this.ownerDocument = doc;
     this.FormatElement = false;
     this.AllowRename = true;
 }
开发者ID:EdgarEDT,项目名称:myitoppsp,代码行数:25,代码来源:SvgElement.cs

示例9: UIKeyPressed

        public override bool UIKeyPressed(KeyInfo key)
        {
            if (key == null) throw new ArgumentNullException("key");
            switch (key.VirtualKeyCode)
            {
                case KeyCode.F1:

                    if (key.Is())
                    {
                        Far.Api.ShowHelp(Far.Api.GetType().Assembly.Location, SettingsUI.HelpSettings, HelpOptions.None);
                        return true;
                    }

                    break;

                case KeyCode.Delete:
                case KeyCode.F8:

                    SetDefaults();
                    return true;
            }

            return base.UIKeyPressed(key);
        }
开发者ID:pezipink,项目名称:FarNet,代码行数:24,代码来源:SettingsPanel.cs

示例10: Sign

            public static string Sign(string xml, X509Certificate2 certificate)
            {
                if (xml == null) throw new ArgumentNullException("xml");
                if (certificate == null) throw new ArgumentNullException("certificate");
                if (!certificate.HasPrivateKey) throw new ArgumentException("certificate", "Certificate should have a private key");

                XmlDocument doc = new XmlDocument();

                doc.PreserveWhitespace = true;
                doc.LoadXml(xml);

                SignedXml signedXml = new SignedXml(doc);
                signedXml.SigningKey = certificate.PrivateKey;

                // Attach certificate KeyInfo
                KeyInfoX509Data keyInfoData = new KeyInfoX509Data(certificate);
                KeyInfo keyInfo = new KeyInfo();
                keyInfo.AddClause(keyInfoData);
                signedXml.KeyInfo = keyInfo;

                // Attach transforms
                var reference = new Reference("");
                reference.AddTransform(new XmlDsigEnvelopedSignatureTransform(includeComments: false));
                reference.AddTransform(new XmlDsigExcC14NTransform(includeComments: false));
                signedXml.AddReference(reference);

                // Compute signature
                signedXml.ComputeSignature();
                var signatureElement = signedXml.GetXml();

                // Add signature to bundle
                doc.DocumentElement.AppendChild(doc.ImportNode(signatureElement, true));

                return doc.OuterXml;
            }
开发者ID:nagyistoce,项目名称:furore-sprinkler,代码行数:35,代码来源:XmlSignatureHelper.cs

示例11: InitKeyPoints

    //Gets only transform Keys
    public void InitKeyPoints()
    {
        ArmInfo[] arms = GetComponent<ArmController>().Arms;
        TorsoInfo torso = GetComponent<TorsoController>().Torso;
        #if EDITORMODE

        //Rotation x, y and z curves are the same, so one is enough
        //No keypoints defined for localTransform
        AnimationCurve xCurve = AnimationUtility.GetEditorCurve(animation[AnimName].clip,"Hips/Spine/Spine1/RightShoulder/RightArm/RightForeArm/RightHand",typeof(Transform),"m_LocalRotation.x");

        Keyframe[] frames = xCurve.keys;

         //Keyframe[] frames =animation[AnimName].;

        Keys = new KeyInfo[frames.Length];
         //all frames as Keys   Keys = new KeyInfo[frameCnt ];

        for(int i = 0; i < Keys.Length; i++) {

            animation[AnimName].time = frames[i].time;//(float) Keys[i].frameNo / animation[AnimName].clip.frameRate;
            //animation[AnimName].time = i/animation[AnimName].clip.frameRate;//(float) Keys[i].frameNo / animation[AnimName].clip.frameRate;
            animation.Sample ();
            Keys[i] = new KeyInfo();
            Keys[i].FrameNo  = Mathf.FloorToInt(animation[AnimName].time * animation[AnimName].clip.frameRate);
            Keys[i].Time = animation[AnimName].time;
            for(int arm = 0; arm < 2; arm++) {
                Keys[i].EePos[arm] = Keys[i].EePosOrig[arm] = arms[arm].Wrist.position;
            }

            Keys[i].ClavicleLRot = torso.ClavicleL.rotation;
            Keys[i].ClavicleRRot = torso.ClavicleR.rotation;
            Keys[i].NeckRot = torso.Neck.rotation;
            Keys[i].SpineRot = torso.Spine.rotation;
            Keys[i].Spine1Rot = torso.Spine1.rotation;
            Keys[i].ElbowLRot = torso.ElbowL.rotation;
            Keys[i].ElbowRRot = torso.ElbowR.rotation;

            Keys[i].ClavicleLPos = torso.ClavicleL.position;
            Keys[i].ClavicleRPos = torso.ClavicleR.position;
            Keys[i].NeckPos = torso.Neck.position;
            Keys[i].SpinePos = torso.Spine.position;
            Keys[i].Spine1Pos = torso.Spine1.position;
            Keys[i].ElbowLPos = torso.ElbowL.position;
            Keys[i].ElbowRPos = torso.ElbowR.position;

        }
        //Compute end effector velocity
        for(int i = 0; i < Keys.Length; i++) {
            for(int arm = 0; arm < 2; arm++) {
                if(i == 0)
                    Keys[0].EeVel[arm] = (Keys[1].EePos[arm] - Keys[0].EePos[arm]) / (Keys[1].Time - Keys[0].Time);
                else if(i == Keys.Length - 1)
                    Keys[Keys.Length - 1].EeVel[arm] = (Keys[Keys.Length - 1].EePos[arm] - Keys[Keys.Length - 2].EePos[arm]) / (Keys[Keys.Length - 1].Time - Keys[Keys.Length - 2].Time);
                else
                    Keys[i].EeVel[arm] = (Keys[i + 1].EePos[arm] - Keys[i - 1].EePos[arm]) / (Keys[i + 1].Time - Keys[i - 1].Time);

            }
        }

        //Compute end effector acceleration
         for(int i = 0; i < Keys.Length; i++) {
            for(int arm = 0; arm < 2; arm++) {
                if(i == 0)
                    Keys[0].EeAcc[arm] = (Keys[1].EeVel[arm] - Keys[0].EeVel[arm]) / (Keys[1].Time - Keys[0].Time);
                else if(i == Keys.Length - 1)
                    Keys[Keys.Length - 1].EeAcc[arm] = (Keys[Keys.Length - 1].EeVel[arm] - Keys[Keys.Length - 2].EeVel[arm]) / (Keys[Keys.Length - 1].Time - Keys[Keys.Length - 2].Time);
                else
                    Keys[i].EeAcc[arm] = (Keys[i + 1].EeVel[arm] - Keys[i - 1].EeVel[arm]) / (Keys[i + 1].Time - Keys[i - 1].Time);

            }
        }

        #endif
    }
开发者ID:BibleUs,项目名称:Personality,代码行数:75,代码来源:AnimationManager.cs

示例12: MaximumComplement

 public static KeyValue MaximumComplement(KeyInfo key, params object[] segmentValues)
 {
     return new KeyValue(key, segmentValues, false);
 }
开发者ID:jishida,项目名称:BtrieveWrapper,代码行数:4,代码来源:KeyValue.cs

示例13: Create

 public static KeyValue Create(KeyInfo key, params object[] segmentValues)
 {
     if (key.Segments.Count != segmentValues.Length) {
         throw new ArgumentException();
     }
     return new KeyValue(key, segmentValues);
 }
开发者ID:jishida,项目名称:BtrieveWrapper,代码行数:7,代码来源:KeyValue.cs

示例14: FindCode

		// Inverse Utilities (name=>code)
		static int FindCode(KeyInfo[] info, string key)
		{
			foreach(KeyInfo i in info) if(i.ki_name==key) return i.ki_key;

			// not a registered key; might be generic code
			if(!key.StartsWith("Unknown-")) return -1;

			try
			{
				key=key.Substring(8);
				return int.Parse(key);
			}
			catch
			{
				return -1;
			}
		}
开发者ID:LogoPhonix,项目名称:libgeotiff.net,代码行数:18,代码来源:geo_names.cs

示例15: InitKeyPoints

    //Vector3 ComputeInitialSwivelAngle(ArmInfo armInfo) {
    //    float theta;
    //    Vector3 u = new Vector3(1,0,0); //Local x axis
    //    Vector3 n = armInfo.wrist.position - armInfo.shoulder.position;
    //    Vector3 c =  HandleUtility.ProjectPointLine (armInfo.elbow.position, armInfo.shoulder.position, armInfo.wrist.position);
    //    Vector3 pcap = armInfo.elbow.position - c;
    //    Vector3 ptilda = pcap - Vector3.Dot (pcap, n) * n;
    //    theta = Mathf.Atan2(Vector3.Cross(pcap, u).magnitude , Vector3.Dot (ptilda,u));
    //    return new Vector3(theta,0,0);
    //}
    //ARminfo is passed as a transform because animation is sampled
    //We want the end effector position at the sampled time
    public void InitKeyPoints()
    {
        TorsoController torso = GetComponent<TorsoController>();
        ArmInfo[] arms = GetComponent<ArmController>().Arms;

        AssignGoalKeys();

        #if EDITORMODE

          // AnimationClipCurveData[] curveDatas = AnimationUtility.GetAllCurves(animation[animName].clip, true);
          // Keyframe[] frames = curveDatas[0].curve.keys;

        //AnimationCurve xCurve = AnimationUtility.GetEditorCurve(animation[animName].clip,"Hips/Spine/Spine1/RightShoulder/RightArm/RightForeArm/RightHand",typeof(Transform),"m_LocalRotation.x");
        //forearm keys are fewer in number, looks better with  EMOTE
        //AnimationCurve xCurve = AnimationUtility.GetEditorCurve(animation[AnimName].clip, "Hips/Spine/Spine1/RightShoulder/RightArm/RightForeArm", typeof(Transform), "m_LocalRotation.x");
        AnimationCurve xCurve = AnimationUtility.GetEditorCurve(animation[AnimName].clip, "Hips/Spine/Spine1/RightShoulder/RightArm", typeof(Transform), "m_LocalRotation.x");

          Keyframe[] frames = xCurve.keys;

          using (StreamWriter sw = new StreamWriter("keyframes_" + AnimName + ".txt")) {
          sw.WriteLine("MyKeyTimes = new float" + "[" + frames.Length + "];");
            foreach (Keyframe kf in frames) {
                sw.WriteLine("MyKeyTimes[i++]  = " + kf.time + "f; ");
            }
        }
          Debug.Log(AnimName);
        #elif !EDITORMODE

          		//file io does not work in web player
          /*      string[] content = File.ReadAllLines("keyframes.txt");
        MyKeyframe[] frames = new MyKeyframe[content.Length];

        for (int i = 0; i < content.Length; i++) {
            frames[i] = new MyKeyframe();
            frames[i].time = float.Parse(content[i]);

        }*/
        //Will write IO operations  later
          MyKeyframe[] frames = new MyKeyframe[MyKeyTimes.Length];
        for (int i = 0; i < MyKeyTimes.Length; i++) {
            frames[i] = new MyKeyframe();
            frames[i].Time = MyKeyTimes[i];
        }

        #endif
        animation.Play(AnimName);
        int goalKeyInd = 0;

        Keys = new KeyInfo[frames.Length ];

        for(int i = 0; i < frames.Length; i++) {
            animation[AnimName].enabled = true;

        animation[AnimName].time = frames[i].Time;

        animation.Sample ();
        Keys[i] = new KeyInfo();
        Keys[i].Time = animation[AnimName].time;

        //Keys[i].Time = animation[AnimName].length * i / (frames.Length - 1); //FUNDA : If we are using equally-spaced keys. We still sample from original frames, but we change key times.
        if(i == GoalKeys[goalKeyInd]) {
            Keys[i].IsGoal = true;
            goalKeyInd++;
        }
        else if(i < GoalKeys[goalKeyInd])
            Keys[i].IsGoal = false;

        if (Keys[i].FrameNo >= FrameCnt) {
            Keys[i].FrameNo = FrameCnt - 1;
        }

        //body chain and transformation arrays for the specific animation
        BodyChain = torso.BodyChainToArray(torso.Torso.Root);
        Keys[i].BodyPos = torso.BodyPosArr(BodyChain);
        Keys[i].BodyRot = torso.BodyRotArr(BodyChain);

           /*
        BodyChain = torso.BodyChain;
        Keys[i].BodyPos = torso.BodyPos;
        Keys[i].BodyRot = torso.BodyRot;
        */
        for(int arm = 0; arm < 2; arm++) {
            Keys[i].ShoulderPos[arm] = Keys[i].ShoulderPosOrig[arm] = arms[arm].Shoulder.position;
            Keys[i].EePos[arm] = Keys[i].EePosOrig[arm] = arms[arm].Wrist.position;
            Keys[i].ElbowRot[arm] = Keys[i].ElbowRotOrig[arm] = arms[arm].Elbow.localRotation;
            Keys[i].ElbowPos[arm] = Keys[i].ElbowPosOrig[arm] = arms[arm].Elbow.position;
        }
        }
//.........这里部分代码省略.........
开发者ID:BibleUs,项目名称:Personality,代码行数:101,代码来源:AnimationInfo.cs


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