Beispiel #1
0
        public override void SetCameraField(CameraFieldType cameraFieldType, string comment)
        {
            switch (cameraFieldType)
            {
                case CameraFieldType.Comment:
                    if (string.IsNullOrEmpty(comment))
                    {
                        SetProperty(CONST_CMD_SetDevicePropValue, new[] {(byte) 0}, 0xD091);
                    }
                    else
                    {
                        comment = comment.Length > 36 ? comment.Substring(0, 36) : comment.PadRight(36);
                        List<byte> vals = new List<byte>();
                        List<byte> valsnew = new List<byte>();
                        valsnew.Add(36);
                        vals.AddRange(Encoding.UTF8.GetBytes(comment));
                        foreach (byte val in vals)
                        {
                            valsnew.Add(val);
                            valsnew.Add(0);
                        }
                        valsnew.Add(0);
                        valsnew.Add(0);
                        SetProperty(CONST_CMD_SetDevicePropValue, valsnew.ToArray(), 0xD090);
                        SetProperty(CONST_CMD_SetDevicePropValue, new[] {(byte) 1}, 0xD091);
                    }
                    break;
                case CameraFieldType.Artist:
                    if (string.IsNullOrEmpty(comment))
                    {
                        SetProperty(CONST_CMD_SetDevicePropValue, new[] {(byte) 0, (byte) 0, (byte) 0}, 0xD072);
                    }
                    else
                    {
                        comment = comment.Length > 36 ? comment.Substring(0, 36) : comment.PadRight(36);
                        List<byte> vals = new List<byte>();
                        List<byte> valsnew = new List<byte>();
                        valsnew.Add(36);
                        vals.AddRange(Encoding.UTF8.GetBytes(comment));
                        foreach (byte val in vals)
                        {
                            valsnew.Add(val);
                            valsnew.Add(0);
                        }
                        valsnew.Add(0);
                        valsnew.Add(0);
                        SetProperty(CONST_CMD_SetDevicePropValue, valsnew.ToArray(), 0xD072);
                    }

                    break;
                case CameraFieldType.Copyright:
                    if (string.IsNullOrEmpty(comment))
                    {
                        SetProperty(CONST_CMD_SetDevicePropValue, new[] {(byte) 0, (byte) 0, (byte) 0}, 0xD073);
                    }
                    else
                    {
                        comment = comment.Length > 53 ? comment.Substring(0, 53) : comment.PadRight(53);
                        List<byte> vals = new List<byte>();
                        List<byte> valsnew = new List<byte>();
                        valsnew.Add(54);
                        vals.AddRange(Encoding.UTF8.GetBytes(comment));
                        foreach (byte val in vals)
                        {
                            valsnew.Add(val);
                            valsnew.Add(0);
                        }
                        valsnew.Add(0);
                        valsnew.Add(0);
                        SetProperty(CONST_CMD_SetDevicePropValue, valsnew.ToArray(), 0xD073);
                    }
                    break;
                default:
                    //throw new ArgumentOutOfRangeException("cameraFieldType");
                    break;
            }
        }
 /// <summary>
 /// Sets the in comment field.
 /// </summary>
 /// <param name="cameraFieldType"> </param>
 /// <param name="comment">The comment.</param>
 public virtual void SetCameraField(CameraFieldType cameraFieldType, string comment)
 {
 }
 /// <summary>
 /// Sets the in comment field.
 /// </summary>
 /// <param name="cameraFieldType"> </param>
 /// <param name="comment">The comment.</param>
 public virtual void SetCameraField(CameraFieldType cameraFieldType, string comment)
 {
 }