Exemple #1
0
        protected override void Update(GameTime gameTime)
        {
            Update_Frame();

            Debug.Add(string.Format("CurrentFrameIntervalIndex: {0}/{1}", CurrentFrameIntervalIndex, (FrameIntervals.Length - 1)));
            Debug.Add(string.Format("IsRepeating: {0} ({1}/{2})", (isRepeating ? "Yes" : "No"), CurrentRepeatCount, (RepeatCount == REPEAT_FOREVER ? "~" : RepeatCount.ToString())));
        }
Exemple #2
0
 /// <include file='.\..\Documentation\CodeComments.xml' path="/comments/comment[@id='IUIAnimationStoryboard::RepeatBetweenKeyframes']/*"/>	
 /// <unmanaged>HRESULT IUIAnimationStoryboard::RepeatBetweenKeyframes([In] __MIDL___MIDL_itf_UIAnimation_0000_0002_0003* startKeyframe,[In] __MIDL___MIDL_itf_UIAnimation_0000_0002_0003* endKeyframe,[In] int repetitionCount)</unmanaged>	
 public void RepeatBetweenKeyframes(SharpDX.Animation.KeyFrame startKeyframe, SharpDX.Animation.KeyFrame endKeyframe, RepeatCount repetitionCount)
 {
     RepeatBetweenKeyframes(startKeyframe, endKeyframe, (int)repetitionCount);
 }
Exemple #3
0
        void IXmlSerializable.WriteXml(XmlWriter writer)
        {
            if (!string.IsNullOrEmpty(GatherUrl))
            {
                writer.WriteAttributeString("gatherUrl", GatherUrl);
            }
            if (!string.IsNullOrEmpty(GatherMethod))
            {
                writer.WriteAttributeString("gatherMethod", GatherMethod);
            }
            if (!string.IsNullOrEmpty(TerminatingDigits))
            {
                writer.WriteAttributeString("terminatingDigits", TerminatingDigits);
            }
            if (!string.IsNullOrEmpty(Tag))
            {
                writer.WriteAttributeString("tag", Tag);
            }
            if (MaxDigits.HasValue)
            {
                writer.WriteAttributeString("maxDigits", MaxDigits.ToString());
            }

            writer.WriteAttributeString("interDigitTimeout", InterDigitTimeout.ToString());

            if (!string.IsNullOrEmpty(Username))
            {
                writer.WriteAttributeString("username", Username);
            }

            if (!string.IsNullOrEmpty(Password))
            {
                writer.WriteAttributeString("password", Password);
            }

            if (!string.IsNullOrEmpty(FallbackUsername))
            {
                writer.WriteAttributeString("fallbackUsername", FallbackUsername);
            }

            if (!string.IsNullOrEmpty(FallbackPassword))
            {
                writer.WriteAttributeString("fallbackPassword", FallbackPassword);
            }

            if (!string.IsNullOrEmpty(GatherFallbackUrl))
            {
                writer.WriteAttributeString("gatherFallbackUrl", GatherFallbackUrl);
            }

            if (!string.IsNullOrEmpty(GatherFallbackMethod))
            {
                writer.WriteAttributeString("gatherFallbackMethod", GatherFallbackMethod);
            }

            writer.WriteAttributeString("firstDigitTimeout", FirstDigitTimeout.ToString());

            if (RepeatCount.HasValue)
            {
                writer.WriteAttributeString("repeatCount", RepeatCount.ToString());
            }

            if (SpeakSentence != null)
            {
                var ns = new XmlSerializerNamespaces();
                ns.Add("", "");

                var serializer = new XmlSerializer(SpeakSentence.GetType(), "");
                serializer.Serialize(writer, SpeakSentence, ns);
            }

            if (PlayAudio != null)
            {
                var ns = new XmlSerializerNamespaces();
                ns.Add("", "");

                var serializer = new XmlSerializer(PlayAudio.GetType(), "");
                serializer.Serialize(writer, PlayAudio, ns);
            }

            if (AudioProducers != null && AudioProducers.Count > 0)
            {
                var ns = new XmlSerializerNamespaces();
                ns.Add("", "");

                foreach (var verb in AudioProducers)
                {
                    var serializer = new XmlSerializer(verb.GetType(), "");
                    serializer.Serialize(writer, verb, ns);
                }
            }
        }
Exemple #4
0
        /// <summary>
        /// Create a list view item describing this HidEvent
        /// </summary>
        /// <returns></returns>
        public ListViewItem ToListViewItem()
        {
            string usageText   = "";
            string inputReport = null;

            foreach (ushort usage in Usages)
            {
                if (usageText != "")
                {
                    //Add a separator
                    usageText += ", ";
                }

                //Try to get a name for that usage
                string name = "";
                if (Enum.IsDefined(typeof(Hid.UsagePage), UsagePage))
                {
                    UsagePage usagePage = (UsagePage)UsagePage;

                    try
                    {
                        name = Enum.GetName(Utils.UsageType(usagePage), usage);
                    }
                    catch
                    {
                    }
                }

                if (name == null || name.Equals("") || Device.IsGamePad) //Gamepad buttons do not belong to Usage enumeration, they are just ordinal
                {
                    name = usage.ToString("X2");
                }
                usageText += name;
            }

            // Get input report for generic HID events
            if (IsGeneric)
            {
                inputReport = InputReportString();
            }

            //If we are a gamepad display axis and dpad values
            if (Device != null && Device.IsGamePad)
            {
                //uint dpadUsageValue = GetUsageValue((ushort)Hid.UsagePage.GenericDesktopControls, (ushort)Hid.Usage.GenericDesktop.HatSwitch);
                //usageText = dpadUsageValue.ToString("X") + " (dpad), " + usageText;

                if (usageText != "")
                {
                    //Add a separator
                    usageText += " (Buttons)";
                }

                if (usageText != "")
                {
                    //Add a separator
                    usageText += ", ";
                }

                usageText += GetDirectionPadState().ToString();

                //For each axis
                foreach (KeyValuePair <HIDP_VALUE_CAPS, uint> entry in UsageValues)
                {
                    if (entry.Key.IsRange)
                    {
                        continue;
                    }

                    //Get our usage type
                    Type usageType = Utils.UsageType((UsagePage)entry.Key.UsagePage);
                    if (usageType == null)
                    {
                        //Unknown usage type
                        //TODO: check why this is happening on Logitech rumble gamepad 2.
                        //Probably some of our axis are hiding in there.
                        continue;
                    }

                    //Get the name of our axis
                    string name = Enum.GetName(usageType, entry.Key.NotRange.Usage);

                    if (usageText != "")
                    {
                        //Add a separator
                        usageText += ", ";
                    }
                    usageText += entry.Value.ToString("X") + " (" + name + ")";
                }
            }
            //Handle keyboard events
            else if (IsKeyboard)
            {
                //Get the virtual key
                System.Windows.Forms.Keys vKey = (Keys)RawInput.data.keyboard.VKey;
                usageText = vKey.ToString() + " -";

                //Get the key flag
                if (IsButtonUp)
                {
                    usageText += " UP";
                }
                else if (IsButtonDown)
                {
                    usageText += " DOWN";
                }

                if (RawInput.data.keyboard.Flags.HasFlag(RawInputKeyFlags.RI_KEY_E0))
                {
                    usageText += " E0";
                }

                if (RawInput.data.keyboard.Flags.HasFlag(RawInputKeyFlags.RI_KEY_E1))
                {
                    usageText += " E1";
                }

                if (HasModifierShift)
                {
                    usageText += " SHIFT";
                }

                if (HasModifierControl)
                {
                    usageText += " CTRL";
                }

                if (HasModifierAlt)
                {
                    usageText += " ALT";
                }

                if (HasModifierWindows)
                {
                    usageText += " WIN";
                }


                //Put our scan code into our input report field
                inputReport = "0x" + RawInput.data.keyboard.MakeCode.ToString("X4");
            }

            //Now create our list item
            ListViewItem item = new ListViewItem(new[] { usageText, inputReport, UsagePageNameAndValue(), UsageCollectionNameAndValue(), RepeatCount.ToString(), Time.ToString("HH:mm:ss:fff"), IsBackground.ToString() });

            return(item);
        }
Exemple #5
0
 /// <include file='Documentation\CodeComments.xml' path="/comments/comment[@id='IUIAnimationStoryboard::RepeatBetweenKeyframes']/*"/>
 /// <unmanaged>HRESULT IUIAnimationStoryboard::RepeatBetweenKeyframes([In] __MIDL___MIDL_itf_UIAnimation_0000_0002_0003* startKeyframe,[In] __MIDL___MIDL_itf_UIAnimation_0000_0002_0003* endKeyframe,[In] int repetitionCount)</unmanaged>
 public void RepeatBetweenKeyframes(SharpDX.Animation.KeyFrame startKeyframe, SharpDX.Animation.KeyFrame endKeyframe, RepeatCount repetitionCount)
 {
     RepeatBetweenKeyframes(ref startKeyframe, ref endKeyframe, (int)repetitionCount);
 }