public CameraSetting GetSetting(SettingIds id) { CameraSetting setting; cameraSettings.TryGetValue(id, out setting); return(setting); }
/// <summary> /// We return an empty string if there is no global called VS2P4_Version180OrAfter /// and we have not yet done our first load of options. /// </summary> /// <param name="settingsId"></param> /// <returns></returns> public static string OptionNameForLoad(SettingIds settingsId) { switch (settingsId) { case SettingIds.UseP4Config: case SettingIds.Server: case SettingIds.User: case SettingIds.Password: case SettingIds.Workspace: case SettingIds.LogLevel: case SettingIds.IsCheckoutEnabled: case SettingIds.IsAddEnabled: case SettingIds.IsRevertIfUnchangedEnabled: case SettingIds.IsRevertEnabled: case SettingIds.PromptBeforeRevert: case SettingIds.IsGetLatestRevisionEnabled: case SettingIds.IsViewRevisionHistoryEnabled: case SettingIds.IsViewDiffEnabled: case SettingIds.IsViewTimeLapseEnabled: case SettingIds.AutoCheckoutOnEdit: case SettingIds.AutoCheckoutOnSave: case SettingIds.AutoAdd: case SettingIds.AutoDelete: case SettingIds.IgnoreFilesNotUnderP4Root2: case SettingIds.Version180OrAfter: return(Prefix + settingsId); default: throw new ArgumentOutOfRangeException("settingsId"); } }
public CameraSetting(SettingIds id) { Id = id; AcceptedValues = new List <int>(); switch (id) { case SettingIds.FocusAreaSpot: case SettingIds.FocusMagnifierPosition: case SettingIds.ShutterSpeed: HasSubValue = true; break; } }
private bool DoSetting(OpCodes opcode, SettingIds id, int value1, int value2, int value1DataSize, int value2DataSize) { using (Packet request = new Packet(opcode)) { request.WriteHexString("00 00 00 00 00 00 00 00"); request.WriteUInt16((ushort)id); request.WriteHexString("00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 04 00 00 00"); for (int i = 0; i < 2; i++) { int dataSize = i == 0 ? value1DataSize : value2DataSize; int data = i == 0 ? value1 : value2; switch (dataSize) { case 1: request.WriteByte((byte)data); break; case 2: request.WriteInt16((short)data); break; case 4: request.WriteInt32(data); break; } } byte[] buffer = SendCommand(request.GetBuffer()); using (Packet response = Packet.Reader(buffer)) { if (!IsValidResponse(response)) { return(false); } return(true); } } }
private bool DoSubSettingU8(SettingIds id, byte value) { return(DoSettingU8(OpCodes.SubSetting, id, value)); }
private bool DoSubSettingI16(SettingIds id, short value1, short value2) { return(DoSettingI16(OpCodes.SubSetting, id, value1, value2)); }
private bool DoSubSettingI32(SettingIds id, int value) { return(DoSettingI32(OpCodes.SubSetting, id, value)); }
private bool DoMainSettingI16(SettingIds id, short value) { return(DoSettingI16(OpCodes.MainSetting, id, value)); }
private bool DoSettingI16(OpCodes opcode, SettingIds id, short value1, short value2) { return(DoSetting(opcode, id, value1, value2, 2, 2)); }
private bool DoSettingI16(OpCodes opcode, SettingIds id, short value) { return(DoSetting(opcode, id, value, 0, 2, 0)); }
private bool DoSettingI32(OpCodes opcode, SettingIds id, int value) { return(DoSetting(opcode, id, value, 0, 4, 0)); }
private bool DoSettingU8(OpCodes opcode, SettingIds id, byte value) { return(DoSetting(opcode, id, value, 0, 1, 0)); }
public Setting(SettingIds id, object value) { this.Id = id; this.Value = value; }