/// <inheritdoc /> public override string GetPathItemName(OpenApiConvertSettings settings) { Utils.CheckArgumentNull(settings, nameof(settings)); IList <IEdmStructuralProperty> keys = EntityType.Key().ToList(); if (keys.Count() == 1) { string keyName = keys.First().Name; if (settings.PrefixEntityTypeNameBeforeKey) { return("{" + EntityType.Name + "-" + keyName + KeyIndex.ToString() + "}"); } else { return("{" + keyName + KeyIndex.ToString() + "}"); } } else { IList <string> keyStrings = new List <string>(); foreach (var keyProperty in keys) { keyStrings.Add(keyProperty.Name + "={" + keyProperty.Name + KeyIndex.ToString() + "}"); } return(String.Join(",", keyStrings)); } }
private void ComponentOnNavigationMeshChanged(object sender, EventArgs eventArgs) { if (KeyIndex.TryGetValue((NavigationComponent)sender, out int index)) { UpdateNavigationMesh(ComponentDataValues[index]); } }
public AnimationClipResult GetAnimationClipResult(AnimationComponent animationComponent) { if (KeyIndex.TryGetValue(animationComponent, out int index) == false) { return(null); } return(ComponentDataValues[index].AnimationClipResult); }
public Task <WalletAddress> DivideAddressAsync( KeyIndex keyIndex, int keyType) { return(DivideAddressAsync( account: keyIndex.Account, chain: keyIndex.Chain, index: keyIndex.Index, keyType: keyType)); }
protected override void Execute(NativeActivityContext context) { var cryptoKeyProvider = IoC.Instance.Resolve <ICryptoKeyProvider>(); var keyindex = KeyIndex.Get(context); var key = cryptoKeyProvider.GetKey(keyindex); var str = InStr.Get(context); var result = RunArgument == EnumCoding.Encoding ? CryptoHelper.Encrypt(str, key) : CryptoHelper.Decrypt(str, key); OutStr.Set(context, result); }
public SecureBytes GetPublicKey( CurrencyConfig currency, KeyIndex keyIndex, int keyType) { return(GetPublicKey( currency: currency, account: keyIndex.Account, chain: keyIndex.Chain, index: keyIndex.Index, keyType: keyType)); }
public WalletAddress GetAddress( CurrencyConfig currency, KeyIndex keyIndex, int keyType) { return(GetAddress( currency: currency, account: keyIndex.Account, chain: keyIndex.Chain, index: keyIndex.Index, keyType: keyType)); }
public SecureBytes GetPrivateKey( CurrencyConfig currency, KeyIndex keyIndex, int keyType) { using var extKey = GetExtKey( currency: currency, purpose: Bip44.Purpose, keyIndex: keyIndex, keyType: keyType); return(extKey.GetPrivateKey()); }
public void Test_OnKeyChanged() { var key = new KeyIndex(0); var calls = 0; key.Changed += delegate { calls++; }; key.Value = key.Value; Assert.AreEqual(0, calls); key.Value++; Assert.AreEqual(1, calls); }
// InputDevice piano; // Start is called before the first frame update void Start() { // get the keys for (int i = 0; i < numberOfKeys; i++) { GameObject key = GameObject.Find("Key" + i); Debug.Assert(key != null); keyObjects.Add(key); keyObjects[i].GetComponent <KeyControl>().keyOnKeyboard = (KeyIndex)i; keyObjects[i].GetComponent <KeyControl>().keyOnComputerKeyboard = (ComputerKeyboardKeyIndex)i; } // match up 0 indexes keys with the midi note value (there is actually no reason to do this it's an artifact from before i knew how sound would be implemented System.Array indicesArray = KeyIndex.GetValues(typeof(KeyIndex)); // ugly way of getting an itteratable from an enum foreach (KeyIndex i in indicesArray) { indices.Add(i); keys[i] = keyObjects[(int)i]; } System.Array keboardIndicesArray = ComputerKeyboardKeyIndex.GetValues(typeof(ComputerKeyboardKeyIndex)); // ugly way of getting an itteratable from an enum foreach (ComputerKeyboardKeyIndex i in keboardIndicesArray) { computerKeyboardIndices.Add(i); } System.Array notesArray = Note.GetValues(typeof(Note)); foreach (Note n in notesArray) { notes.Add(n); } int length = indicesArray.Length < notesArray.Length ? indicesArray.Length : notesArray.Length; // use the smaller one just to be safe for (int i = 0; i < length; i++) { KeymappingKeyToNote[indices[i]] = notes[i]; KeymappingNoteToKey[notes[i]] = indices[i]; KeymappingComputerKeyboardToNote[computerKeyboardIndices[i]] = notes[i]; KeymappingNoteToComputerKeyboard[notes[i]] = computerKeyboardIndices[i]; } foreach (GameObject key in keys.Values) { key.GetComponent <KeyControl>().note = KeymappingKeyToNote[key.GetComponent <KeyControl>().keyOnKeyboard]; } }
public byte[] SignMessage( CurrencyConfig currency, byte[] data, KeyIndex keyIndex, int keyType) { using var extKey = GetExtKey( currency: currency, purpose: Bip44.Purpose, keyIndex: keyIndex, keyType: keyType); return(extKey.SignMessage(data)); }
private IExtKey GetExtKey( CurrencyConfig currency, int purpose, KeyIndex keyIndex, int keyType) { return(GetExtKey( currency: currency, purpose: purpose, account: keyIndex.Account, chain: keyIndex.Chain, index: keyIndex.Index, keyType: keyType)); }
public byte[] SignHash( CurrencyConfig currency, byte[] hash, KeyIndex keyIndex, int keyType) { using var extKey = GetExtKey( currency: currency, purpose: Bip44.Purpose, keyIndex: keyIndex, keyType: keyType); return(extKey.SignHash(hash)); }
// ********************************* // Methods: // ********************************* public void ProcessKeys(KeyMessageID m, KeyEventArgs e) { KeyIndex keyindex = (KeyIndex)GetKeyIndex(e.KeyCode); switch (m) { case KeyMessageID.KeyDown: // If KeyDown event occured: if (!Receiver.Destroyed && Receiver.Enabled) { switch ((KeyIndex)keyindex) { case KeyIndex.Up: Receiver.Direction = Directions.Up; KeysBuffer |= 0x01; break; case KeyIndex.Down: Receiver.Direction = Directions.Down; KeysBuffer |= 0x02; break; case KeyIndex.Left: Receiver.Direction = Directions.Left; KeysBuffer |= 0x04; break; case KeyIndex.Right: Receiver.Direction = Directions.Right; KeysBuffer |= 0x08; break; case KeyIndex.Shoot: Receiver.Shoot(); break; default: break; } } break; case KeyMessageID.KeyUp: // If KeyUp event occured: if (!Receiver.Destroyed) { switch ((KeyIndex)keyindex) { case KeyIndex.Up: KeysBuffer &= 0x0e; break; case KeyIndex.Down: KeysBuffer &= 0x0d; break; case KeyIndex.Left: KeysBuffer &= 0x0b; break; case KeyIndex.Right: KeysBuffer &= 0x07; break; //case KeyIndex.Shoot: KeysBuffer &= 0x0e; break; default: break; } } break; } }
public SecureBytes GetPrivateKey(Currency currency, KeyIndex keyIndex) { if (keyIndex.Chain == NonHdKeysChain) { return(GetNonHdPrivateKey(currency, keyIndex.Index)); } using var extKey = GetExtKey( currency: currency, purpose: Bip44.Purpose, chain: keyIndex.Chain, index: keyIndex.Index); return(extKey.GetPrivateKey()); }
public bool VerifyMessage( CurrencyConfig currency, byte[] data, byte[] signature, KeyIndex keyIndex, int keyType) { using var extKey = GetExtKey( currency: currency, purpose: Bip44.Purpose, keyIndex: keyIndex, keyType: keyType); return(extKey.VerifyMessage(data, signature)); }
public byte[] SignMessage(Currency currency, byte[] data, KeyIndex keyIndex) { if (keyIndex.Chain == NonHdKeysChain) { return(GetNonHdKey(currency, keyIndex.Index) .SignMessage(data)); } return(GetExtKey( currency: currency, purpose: Bip44.Purpose, chain: keyIndex.Chain, index: keyIndex.Index) .SignMessage(data)); }
/// <summary> /// 片方押しながらもう片方放しても入力を受け付けるやつ /// </summary> /// <param name="a"></param> /// <param name="b"></param> /// <returns></returns> private bool CheckRotateTrigger(KeyIndex a, KeyIndex b) { // トリガーされてたら入力あり if (CheckTriggeredKey(a)) { return(true); } // 反対を押しっぱなしの場合 if (CheckPressedKey(b) && CheckReleasedKey(a)) { return(true); } // それ以外 return(false); }
public byte[] SignHash(Currency currency, byte[] hash, KeyIndex keyIndex) { if (keyIndex.Chain == NonHdKeysChain) { return(GetNonHdKey(currency, keyIndex.Index) .SignHash(hash)); } return(GetExtKey( currency: currency, purpose: Bip44.Purpose, chain: keyIndex.Chain, index: keyIndex.Index) .SignHash(hash)); }
public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("InternalNode. KeyIndex: " + KeyIndex.ToString() + ". Keys: ["); for (int i = 0; i <= KeyIndex; i++) { sb.Append(Keys[i]); if (i != KeyIndex) { sb.Append(" "); } } sb.Append("]"); return(sb.ToString()); }
public byte[] SignMessage(Currency currency, byte[] data, KeyIndex keyIndex) { if (keyIndex.Chain == NonHdKeysChain) { using var nonHdKey = GetNonHdKey(currency, keyIndex.Index); return(nonHdKey.SignMessage(data)); } using var extKey = GetExtKey( currency: currency, purpose: Bip44.Purpose, chain: keyIndex.Chain, index: keyIndex.Index); return(extKey.SignMessage(data)); }
public byte[] GetPrivateKey(Currency currency, KeyIndex keyIndex) { if (keyIndex.Chain == NonHdKeysChain) { return(GetNonHdPrivateKey(currency, keyIndex.Index)); } var extKey = GetExtKey( currency: currency, purpose: Bip44.Purpose, chain: keyIndex.Chain, index: keyIndex.Index); extKey.GetPrivateKey(out var privateKey); return(privateKey); }
private Keyboard.Code GetKeyCode(KeyIndex index) { Keyboard.Code ret = Keyboard.Code.W; if (index >= KeyIndex.W && index <= KeyIndex.D) { Keyboard.Code[] list = s_Normal; /*if (WorldSystem.Instance.IsPvpScene()) { * int campId = WorldSystem.Instance.CampId; * if (campId == (int)CampIdEnum.Blue) * list = s_Blue; * else if (campId == (int)CampIdEnum.Red) * list = s_Red; * }*/ ret = list[(int)index]; } return(ret); }
public bool VerifyMessage( Currency currency, byte[] data, byte[] signature, KeyIndex keyIndex) { if (keyIndex.Chain == NonHdKeysChain) { return(GetNonHdKey(currency, keyIndex.Index) .VerifyMessage(data, signature)); } return(GetExtKey( currency: currency, purpose: Bip44.Purpose, chain: keyIndex.Chain, index: keyIndex.Index) .VerifyMessage(data, signature)); }
public bool VerifyHash( Currency currency, byte[] hash, byte[] signature, KeyIndex keyIndex) { if (keyIndex.Chain == NonHdKeysChain) { using var nonHdKey = GetNonHdKey(currency, keyIndex.Index); return(nonHdKey.VerifyHash(hash, signature)); } using var extKey = GetExtKey( currency: currency, purpose: Bip44.Purpose, chain: keyIndex.Chain, index: keyIndex.Index); return(extKey.VerifyHash(hash, signature)); }
private void SaveKeyIndex(ICommands cmds, KeyIndex keyedIndex, string id) { var bytes = SerializationHelper.Serialize(keyedIndex); cmds.SaveAsync(id, bytes); }
private void FireSaveKeyIndex(ICommands cmds, KeyIndex keyedIndex, string id) { lock (keyedIndex) { } }
/// <summary> /// Creates a new TapNote instance. /// </summary> /// <param name="key">The key index the note is on.</param> /// <param name="beat">The beat the tap note occurs.</param> public TapNote(KeyIndex key, Beat beat) : base(key, beat) { }
public byte[] GetPublicKey(Currency currency, KeyIndex keyIndex) { return(GetPublicKey(currency, keyIndex.Chain, keyIndex.Index)); }
/// <summary> /// Creates a new HoldNote instance. /// </summary> /// <param name="key">The key index the note is on.</param> /// <param name="beat">The beat the hold note starts.</param> /// <param name="length">The length of the hold note (in beats).</param> public HoldNote(KeyIndex key, Beat beat, BeatDuration length) : base(key, beat, length) { }
public override string ToString() { string lockType = LockpickingChanceReduction == 0 ? "Open" : LockpickingChanceReduction >= 100 ? "No Lockpicking" : $"-{LockpickingChanceReduction}% Chance"; return($"{Type}: Chest {ChestIndex}, Lock=[{lockType}], RemovedWhenEmpty={RemoveWhenEmpty}, Key={(KeyIndex == 0 ? "None" : KeyIndex.ToString())}, Event index if unlock failed {UnlockFailedEventIndex:x4}, Text {(TextIndex == 0xff ? "none" : TextIndex.ToString())}, Flags: {Flags}"); }
public override string ToString() { string lockType = LockpickingChanceReduction == 0 ? "Open" : LockpickingChanceReduction >= 100 ? "No Lockpicking" : $"-{LockpickingChanceReduction}% Chance"; return($"{Type}: Key={(KeyIndex == 0 ? "None" : KeyIndex.ToString())}, Lock=[{lockType}], Event index if unlock failed {UnlockFailedEventIndex:x4}, Text {(TextIndex == 0xff ? "none" : TextIndex.ToString())}, UnlockText {(UnlockTextIndex == 0xff ? "none" : UnlockTextIndex.ToString())}, Door Index {DoorIndex}"); }