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


C# PropertyValue.AddValues方法代码示例

本文整理汇总了C#中PropertyValue.AddValues方法的典型用法代码示例。如果您正苦于以下问题:C# PropertyValue.AddValues方法的具体用法?C# PropertyValue.AddValues怎么用?C# PropertyValue.AddValues使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PropertyValue的用法示例。


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

示例1: InitExposureDelay

 protected override PropertyValue<long> InitExposureDelay()
 {
     PropertyValue<long> res = new PropertyValue<long>() { Name = "Exposure delay mode", IsEnabled = true, Code = 0xD06A };
     res.AddValues("3 sec", 0);
     res.AddValues("2 sec", 1);
     res.AddValues("One sec", 1);
     res.AddValues("OFF", 1);
     res.ValueChanged += (sender, key, val) => SetProperty(CONST_CMD_SetDevicePropValue, new[] { (byte)val }, res.Code, -1);
     return res;
 }
开发者ID:brunoklein99,项目名称:nikon-camera-control,代码行数:10,代码来源:NikonD4.cs

示例2: CaptureAreaCrop

 protected override PropertyValue<long> CaptureAreaCrop()
 {
     PropertyValue<long> res = new PropertyValue<long>()
     {
         Name = "Capture area crop",
         IsEnabled = true,
         Code = 0xD030,
         SubType = typeof(sbyte)
     };
     res.AddValues("DX", 0);
     res.AddValues("1.3x", 1);
     res.ValueChanged +=
         (sender, key, val) => SetProperty(CONST_CMD_SetDevicePropValue, BitConverter.GetBytes(val), res.Code);
     return res;
 }
开发者ID:CadeLaRen,项目名称:digiCamControl,代码行数:15,代码来源:NikonD7100.cs

示例3: FakeCameraDevice

 public FakeCameraDevice()
 {
     HaveLiveView = false;
     IsBusy = false;
     DeviceName = "Fake camera";
     SerialNumber = "00000000";
     IsConnected = true;
     HaveLiveView = false;
     ExposureStatus = 1;
     ExposureCompensation = new PropertyValue<int>() {IsEnabled = false};
     Mode = new PropertyValue<uint> {IsEnabled = false};
     FNumber = new PropertyValue<int> {IsEnabled = false};
     ShutterSpeed = new PropertyValue<long> {IsEnabled = false};
     WhiteBalance = new PropertyValue<long> {IsEnabled = false};
     FocusMode = new PropertyValue<long> {IsEnabled = false};
     CompressionSetting = new PropertyValue<int> {IsEnabled = false};
     IsoNumber = new PropertyValue<int> {IsEnabled = false};
     ExposureMeteringMode = new PropertyValue<int> {IsEnabled = false};
     Battery = 100;
     Capabilities.Add(CapabilityEnum.CaptureNoAf);
     Capabilities.Add(CapabilityEnum.LiveView);
     LiveViewImageZoomRatio=new PropertyValue<int>();
     LiveViewImageZoomRatio.AddValues("All",0);
     LiveViewImageZoomRatio.Value = "All";
 }
开发者ID:tomriddle1234,项目名称:digiCamControl,代码行数:25,代码来源:FakeCameraDevice.cs

示例4: Init

        public bool Init(DeviceDescriptor deviceDescriptor,DeviceDescription description)
        {
            base.Init(deviceDescriptor);
            StillImageDevice imageDevice = StillImageDevice as StillImageDevice;
            if (imageDevice != null)
                imageDevice.DeviceEvent += StillImageDevice_DeviceEvent;
            foreach (var property in description.Properties)
            {
                if (!string.IsNullOrEmpty(property.Name))
                {
                    try
                    {
                        MTPDataResponse result = StillImageDevice.ExecuteReadData(CONST_CMD_GetDevicePropDesc, property.Code);

                        ErrorCodes.GetException(result.ErrorCode);
                        uint dataType = BitConverter.ToUInt16(result.Data, 2);
                        int dataLength = StaticHelper.GetDataLength(dataType);

                        var value = new PropertyValue<long> { Code = property.Code, Name = property.Name };
                        foreach (var propertyValue in property.Values)
                        {
                            value.AddValues(propertyValue.Name, propertyValue.Value);
                        }
                        value.ValueChanged += value_ValueChanged;
                        
                        AdvancedProperties.Add(value);
                    }
                    catch (Exception ex)
                    {
                        Log.Error("Error ger property ", ex);
                    }
                }
            }
            return true;
        }
开发者ID:CadeLaRen,项目名称:digiCamControl,代码行数:35,代码来源:CustomDevice.cs

示例5: FakeCameraDevice

        public FakeCameraDevice()
        {
            HaveLiveView = false;
            IsBusy = false;
            DeviceName = "Fake camera";
            SerialNumber = "00000000";
            IsConnected = true;
            HaveLiveView = false;
            ExposureStatus = 1;
            ExposureCompensation = new PropertyValue<int>() {IsEnabled = false};
            Mode = new PropertyValue<uint> {IsEnabled = false};
            FNumber = new PropertyValue<int> {IsEnabled = false};
            ShutterSpeed = new PropertyValue<long> {IsEnabled = false};
            WhiteBalance = new PropertyValue<long> {IsEnabled = false};
            FocusMode = new PropertyValue<long> {IsEnabled = false};
            CompressionSetting = new PropertyValue<int> {IsEnabled = false};
            IsoNumber = new PropertyValue<int> {IsEnabled = true};
            ExposureMeteringMode = new PropertyValue<int> {IsEnabled = false};
            Battery = 100;
            Capabilities.Add(CapabilityEnum.CaptureNoAf);
            Capabilities.Add(CapabilityEnum.LiveView);
            Capabilities.Add(CapabilityEnum.LiveViewStream);
            LiveViewImageZoomRatio = new PropertyValue<int>();
            LiveViewImageZoomRatio.AddValues("All", 0);
            LiveViewImageZoomRatio.Value = "All";

            IsoNumber.AddValues("100", 100);
            IsoNumber.AddValues("200", 200);
            IsoNumber.AddValues("300", 300);
            IsoNumber.Value = "100";
            IsoNumber.ReloadValues();

            var val = new PropertyValue<long>() {Name = "Test Test"};
            val.AddValues("Val 1", 1);
            val.AddValues("Val 2", 2);
            val.AddValues("Val 3", 3);
            val.Value = "Val 1";
            val.ReloadValues();
            AdvancedProperties.Add(val);
        }
开发者ID:CadeLaRen,项目名称:digiCamControl,代码行数:40,代码来源:FakeCameraDevice.cs

示例6: Init

        public override bool Init(DeviceDescriptor deviceDescriptor)
        {
            CurrentValues = new Dictionary<string, string>();
            Capabilities.Add(CapabilityEnum.LiveView);
            Capabilities.Add(CapabilityEnum.LiveViewStream);
            Protocol = deviceDescriptor.StillImageDevice as YiCameraProtocol;
            Protocol.DataReceiverd += Protocol_DataReceiverd;

            DeviceName = Protocol.Model;
            Manufacturer = Protocol.Manufacturer;
            IsConnected = true;
            CompressionSetting = new PropertyValue<int> { Tag = "photo_quality" };
            
            Mode = new PropertyValue<uint> { Tag = "capture_mode" };
            Mode.AddValues("Single", 0);
            Mode.AddValues("Burst", 1);
            Mode.AddValues("Delayed", 2);
            //Mode.AddValues("TimeLapse", 3);
            Mode.ReloadValues();

            ExposureMeteringMode = new PropertyValue<int>() { Tag = "meter_mode" };
            
            LiveViewImageZoomRatio = new PropertyValue<int>();
            LiveViewImageZoomRatio.AddValues("All", 0);
            LiveViewImageZoomRatio.Value = "All";
            SendCommand(3);
            Thread.Sleep(500);

            SerialNumber = GetValue("serial_number");
            SetProperty(Mode.Tag, GetValue(Mode.Tag));


            var thread = new Thread(LoadProperties) { Priority = ThreadPriority.Lowest };
            thread.Start();
            return true;
        }
开发者ID:modulexcite,项目名称:digiCamControl,代码行数:36,代码来源:YiCamera.cs

示例7: InitCompressionSetting

        protected override void InitCompressionSetting()
        {
            try
              {
            byte datasize = 1;
            CompressionSetting = new PropertyValue<int>();
            CompressionSetting.ValueChanged += CompressionSetting_ValueChanged;
            byte[] result = StillImageDevice.ExecuteReadData(CONST_CMD_GetDevicePropDesc, CONST_PROP_CompressionSetting);
            byte defval = result[datasize + 5];
            for (int i = 0; i < result.Length - ((2 * datasize) + 6 + 2); i += datasize)
            {
              byte val = result[((2 * datasize) + 6 + 2) + i];
              CompressionSetting.AddValues(_csTable.ContainsKey(val) ? _csTable[val] : val.ToString(), val);
            }
            CompressionSetting.SetValue(defval);
              }
              catch (Exception)
              {

              }
        }
开发者ID:brunoklein99,项目名称:nikon-camera-control,代码行数:21,代码来源:NikonD60.cs

示例8: InitStillCaptureMode

 protected override PropertyValue<long> InitStillCaptureMode()
 {
     PropertyValue<long> res = new PropertyValue<long>()
                                   {
                                       Name = "Still Capture Mode",
                                       IsEnabled = true,
                                       Code = 0x5013,
                                       SubType = typeof (UInt16)
                                   };
     res.AddValues("Single shot (single-frame shooting)", 0x0001);
     res.AddValues("Continuous high-speed shooting (CH)", 0x0002);
     res.AddValues("Continuous low-speed shooting (CL)", 0x8010);
     res.AddValues("Self-timer", 0x8011);
     res.AddValues("Mirror-up", 0x8012);
     res.AddValues("Quiet shooting", 0x8016);
     res.AddValues("Remote control", 0x8017);
     res.ValueChanged +=
         (sender, key, val) => SetProperty(CONST_CMD_SetDevicePropValue, BitConverter.GetBytes(val),
                                           res.Code, -1);
     return res;
 }
开发者ID:brunoklein99,项目名称:nikon-camera-control,代码行数:21,代码来源:NikonD600.cs

示例9: InitFocalLength

 protected virtual PropertyValue<long> InitFocalLength()
 {
     PropertyValue<long> res = new PropertyValue<long>()
     {
         Name = "Focal Length",
         IsEnabled = true,
         Code = 0x5008,
         SubType = typeof(UInt32)
     };
     res.AddValues("3500", 0x0DAC);
     res.AddValues("4600", 0x11F8);
     res.AddValues("5300", 0x14B4);
     res.AddValues("6100", 0x17D4);
     res.AddValues("7300", 0x1C84);
     res.AddValues("8600", 0x2198);
     res.AddValues("10500", 0x2904);
     res.SetValue(StillImageDevice.ExecuteReadData(CONST_CMD_GetDevicePropValue,
                                     res.Code), false);
     res.ReloadValues();
     res.ValueChanged +=
         (sender, key, val) => SetProperty(CONST_CMD_SetDevicePropValue, BitConverter.GetBytes(val), res.Code);
     return res;
 }
开发者ID:CadeLaRen,项目名称:digiCamControl,代码行数:23,代码来源:NikonL830.cs

示例10: InitCompression

 private void InitCompression()
 {
     CompressionSetting = new PropertyValue<int>();
     CompressionSetting.AddValues("Jpeg", (int) EosImageFormat.Jpeg);
     CompressionSetting.AddValues("Crw", (int) EosImageFormat.Crw);
     CompressionSetting.AddValues("Cr2", (int) EosImageFormat.Cr2);
     CompressionSetting.SetValue((int) Camera.ImageQuality.PrimaryImageFormat);
     CompressionSetting.ValueChanged +=
         new PropertyValue<int>.ValueChangedEventHandler(CompressionSetting_ValueChanged);
 }
开发者ID:kwagalajosam,项目名称:digiCamControl,代码行数:10,代码来源:CanonSDKBase.cs

示例11: InitEc

 private void InitEc()
 {
     ExposureCompensation = new PropertyValue<int>();
     ExposureCompensation.ValueChanged += ExposureCompensation_ValueChanged;
     try
     {
         foreach (KeyValuePair<uint, string> keyValuePair in _ec)
         {
             ExposureCompensation.AddValues(keyValuePair.Value, (int) keyValuePair.Key);
         }
         ExposureCompensation.IsEnabled = true;
         ExposureCompensation.SetValue((int) Camera.GetProperty(Edsdk.PropID_ExposureCompensation), false);
     }
     catch (Exception exception)
     {
         Log.Debug("Error get EC", exception);
     }
 }
开发者ID:kwagalajosam,项目名称:digiCamControl,代码行数:18,代码来源:CanonSDKBase.cs

示例12: InitDriveMode

 private PropertyValue<long> InitDriveMode()
 {
     PropertyValue<long> res = new PropertyValue<long>()
     {
         Name = "Drive Mode",
         IsEnabled = true,
         Code = Edsdk.PropID_DriveMode,
         SubType = typeof (UInt32),
         DisableIfWrongValue = true
     };
     res.AddValues("Single-Frame Shooting", 0);
     res.AddValues("Continuous Shooting", 1);
     res.AddValues("Video", 2);
     //res.AddValues("Not used", 3);
     res.AddValues("High-Speed Continuous Shooting", 4);
     res.AddValues("Low-Speed Continuous Shooting", 5);
     res.AddValues("Silent single shooting", 6);
     res.AddValues("10-Sec Self-Timer plus continuous shots", 7);
     res.AddValues("10-Sec Self-Timer", 10);
     res.AddValues("2-Sec Self-Timer", 11);
     res.ValueChanged +=
         (sender, key, val) => Camera.SetProperty(res.Code, val);
     return res;
 }
开发者ID:show027,项目名称:digiCamControl,代码行数:24,代码来源:CanonSDKBase.cs

示例13: InitFlash

 private PropertyValue<long> InitFlash()
 {
     PropertyValue<long> res = new PropertyValue<long>()
     {
         Name = "Flash",
         IsEnabled = true,
         Code = Edsdk.PropID_FlashOn,
         SubType = typeof(UInt32),
         DisableIfWrongValue = true
     };
     res.AddValues("No flash", 0);
     res.AddValues("Flash", 1);
     res.ValueChanged +=
         (sender, key, val) => Camera.SetProperty(res.Code, val);
     return res;
 }
开发者ID:show027,项目名称:digiCamControl,代码行数:16,代码来源:CanonSDKBase.cs

示例14: InitStillCaptureMode

 protected virtual PropertyValue<long> InitStillCaptureMode()
 {
     PropertyValue<long> res = new PropertyValue<long>()
                                   {
                                       Name = "Still Capture Mode",
                                       IsEnabled = true,
                                       Code = 0x5013,
                                       SubType = typeof (UInt16)
                                   };
     res.AddValues("Single shot (single-frame shooting)", 0x0001);
     res.AddValues("Continuous shot (continuous shooting)", 0x0002);
     res.AddValues("Self-timer", 0x8011);
     res.AddValues("Quick-response remote", 0x8014);
     res.AddValues("2s delayed remote", 0x8015);
     res.AddValues("Quiet shooting", 0x8016);
     res.ReloadValues();
     res.ValueChanged +=
         (sender, key, val) => SetProperty(CONST_CMD_SetDevicePropValue, BitConverter.GetBytes(val),
                                           res.Code);
     return res;
 }
开发者ID:CadeLaRen,项目名称:digiCamControl,代码行数:21,代码来源:NikonBase.cs

示例15: InitCompression

 private void InitCompression()
 {
     var data = GetSettingsList(Edsdk.PropID_ImageQuality);
     CompressionSetting = new PropertyValue<int>();
     CompressionSetting.AddValues("Large Fine JPEG", (int) new EosImageQuality(){PrimaryCompressLevel = EosCompressLevel.Fine,PrimaryImageFormat = EosImageFormat.Jpeg,PrimaryImageSize = EosImageSize.Large,SecondaryCompressLevel = EosCompressLevel.Unknown,SecondaryImageFormat = EosImageFormat.Unknown, SecondaryImageSize = EosImageSize.Unknown}.ToBitMask());
     CompressionSetting.AddValues("Large Normal JPEG", (int)new EosImageQuality() { PrimaryCompressLevel = EosCompressLevel.Normal, PrimaryImageFormat = EosImageFormat.Jpeg, PrimaryImageSize = EosImageSize.Large, SecondaryCompressLevel = EosCompressLevel.Unknown, SecondaryImageFormat = EosImageFormat.Unknown, SecondaryImageSize = EosImageSize.Unknown }.ToBitMask());
     CompressionSetting.AddValues("Medium Fine JPEG", (int)new EosImageQuality() { PrimaryCompressLevel = EosCompressLevel.Fine, PrimaryImageFormat = EosImageFormat.Jpeg, PrimaryImageSize = EosImageSize.Middle, SecondaryCompressLevel = EosCompressLevel.Unknown, SecondaryImageFormat = EosImageFormat.Unknown, SecondaryImageSize = EosImageSize.Unknown }.ToBitMask());
     CompressionSetting.AddValues("Medium Normal JPEG", (int)new EosImageQuality() { PrimaryCompressLevel = EosCompressLevel.Normal, PrimaryImageFormat = EosImageFormat.Jpeg, PrimaryImageSize = EosImageSize.Middle, SecondaryCompressLevel = EosCompressLevel.Unknown, SecondaryImageFormat = EosImageFormat.Unknown, SecondaryImageSize = EosImageSize.Unknown }.ToBitMask());
     CompressionSetting.AddValues("Small Fine JPEG", (int)new EosImageQuality() { PrimaryCompressLevel = EosCompressLevel.Fine, PrimaryImageFormat = EosImageFormat.Jpeg, PrimaryImageSize = EosImageSize.Small2, SecondaryCompressLevel = EosCompressLevel.Unknown, SecondaryImageFormat = EosImageFormat.Unknown, SecondaryImageSize = EosImageSize.Unknown }.ToBitMask());
     CompressionSetting.AddValues("Small Normal JPEG", (int)new EosImageQuality() { PrimaryCompressLevel = EosCompressLevel.Normal, PrimaryImageFormat = EosImageFormat.Jpeg, PrimaryImageSize = EosImageSize.Small2, SecondaryCompressLevel = EosCompressLevel.Unknown, SecondaryImageFormat = EosImageFormat.Unknown, SecondaryImageSize = EosImageSize.Unknown }.ToBitMask());
     CompressionSetting.AddValues("Smaller JPEG", (int)new EosImageQuality() { PrimaryCompressLevel = EosCompressLevel.Fine, PrimaryImageFormat = EosImageFormat.Jpeg, PrimaryImageSize = EosImageSize.Small3, SecondaryCompressLevel = EosCompressLevel.Unknown, SecondaryImageFormat = EosImageFormat.Unknown, SecondaryImageSize = EosImageSize.Unknown }.ToBitMask());
     CompressionSetting.AddValues("Tiny JPEG", (int)new EosImageQuality() { PrimaryCompressLevel = EosCompressLevel.Fine, PrimaryImageFormat = EosImageFormat.Jpeg, PrimaryImageSize = EosImageSize.Small4, SecondaryCompressLevel = EosCompressLevel.Unknown, SecondaryImageFormat = EosImageFormat.Unknown, SecondaryImageSize = EosImageSize.Unknown }.ToBitMask());
     CompressionSetting.AddValues("RAW + Large Fine JPEG", (int)new EosImageQuality() {PrimaryImageFormat =EosImageFormat.Cr2,PrimaryCompressLevel = EosCompressLevel.Lossless, PrimaryImageSize = EosImageSize.Large, SecondaryImageSize =EosImageSize.Large,SecondaryCompressLevel = EosCompressLevel.Fine, SecondaryImageFormat = EosImageFormat.Jpeg }.ToBitMask());
     CompressionSetting.AddValues("RAW", (int)new EosImageQuality() { PrimaryImageFormat = EosImageFormat.Cr2, PrimaryCompressLevel = EosCompressLevel.Lossless, PrimaryImageSize = EosImageSize.Large, SecondaryCompressLevel = EosCompressLevel.Unknown, SecondaryImageFormat = EosImageFormat.Unknown, SecondaryImageSize = EosImageSize.Unknown}.ToBitMask());
     CompressionSetting.Filter(data);
     CompressionSetting.SetValue((int) Camera.ImageQuality.ToBitMask());
     CompressionSetting.ValueChanged += CompressionSetting_ValueChanged;
 }
开发者ID:show027,项目名称:digiCamControl,代码行数:18,代码来源:CanonSDKBase.cs


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