本文整理汇总了C#中PropertyValue类的典型用法代码示例。如果您正苦于以下问题:C# PropertyValue类的具体用法?C# PropertyValue怎么用?C# PropertyValue使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PropertyValue类属于命名空间,在下文中一共展示了PropertyValue类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateProperty
public static ExtendedProperty CreateProperty(string defName, string value, BXC_MasterControlEntities entity, int userId)
{
var prop = new ExtendedProperty {User_Id = userId};
var name = (from n in entity.PropertyNames where n.Name == defName select n).FirstOrDefault();
if (name != null)
{
prop.PropertyNames_Id = name.Id;
}
else
{
var n = new PropertyName {Name = defName};
entity.AddObject("PropertyNames", n);
entity.SaveChanges();
prop.PropertyNames_Id = n.Id;
}
var propValue = (from v in entity.PropertyValues where v.Value == value select v).FirstOrDefault();
if (propValue != null)
{
prop.PropertyValues_Id = propValue.Id;
}
else
{
var v = new PropertyValue {Value = value};
entity.AddObject("Propertyvalues", v);
entity.SaveChanges();
prop.PropertyValues_Id = v.Id;
}
return prop;
}
示例2: ShowDialog
public override void ShowDialog(PropertyValue propertyValue, IInputElement commandSource)
{
OpenFileDialog dlg = new OpenFileDialog();
var filename = FileName;
if (!String.IsNullOrWhiteSpace(filename))
{
dlg.FileName = filename;
}
var dialogtitle = DialogTitle;
if (!String.IsNullOrWhiteSpace(dialogtitle))
{
dlg.Title = dialogtitle;
}
var filter = Filter;
if (!String.IsNullOrWhiteSpace(filter))
{
dlg.Filter = filter;
}
dlg.FilterIndex = 0;
dlg.Multiselect = false;
dlg.FileOk += this.BeforeFileOk;
if (dlg.ShowDialog() == true)
{
this.OnFileOk(dlg.FileName, propertyValue, commandSource);
}
}
示例3: 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;
}
示例4: ShowDialog
public override void ShowDialog(PropertyValue propertyValue, IInputElement commandSource)
{
ModelPropertyEntryToOwnerActivityConverter ownerActivityConverter = new ModelPropertyEntryToOwnerActivityConverter();
ModelItem activityItem =
ownerActivityConverter.Convert(propertyValue.ParentProperty, typeof(ModelItem), false, null) as ModelItem;
EditingContext context = activityItem.GetEditingContext();
ModelItem parentModelItem =
ownerActivityConverter.Convert(propertyValue.ParentProperty, typeof(ModelItem), true, null) as ModelItem;
ModelItemDictionary arguments = parentModelItem.Properties[propertyValue.ParentProperty.PropertyName].Dictionary;
DynamicArgumentDesignerOptions options = new DynamicArgumentDesignerOptions
{
Title = propertyValue.ParentProperty.DisplayName
};
using (ModelEditingScope change = arguments.BeginEdit("PowerShellParameterEditing"))
{
if (DynamicArgumentDialog.ShowDialog(activityItem, arguments, context, activityItem.View, options))
{
change.Complete();
}
else
{
change.Revert();
}
}
}
示例5: ShowDialog
public override void ShowDialog(PropertyValue propertyValue, IInputElement commandSource)
{
ModelPropertyEntryToOwnerActivityConverter propertyEntryConverter =
new ModelPropertyEntryToOwnerActivityConverter();
ModelItem activityModelItem =
(ModelItem)propertyEntryConverter.Convert(propertyValue.ParentProperty, typeof(ModelItem), false, null);
ModelItem parentModelItem =
(ModelItem)propertyEntryConverter.Convert(propertyValue.ParentProperty, typeof(ModelItem), true, null);
EditingContext context = ((IModelTreeItem)activityModelItem).ModelTreeManager.Context;
var inputData = parentModelItem.Properties[propertyValue.ParentProperty.PropertyName].Collection;
DynamicArgumentDesignerOptions options = new DynamicArgumentDesignerOptions
{
Title = propertyValue.ParentProperty.DisplayName,
};
using (EditingScope scope = context.Services.GetRequiredService<ModelTreeManager>().CreateEditingScope(StringResourceDictionary.Instance.GetString("InvokeMethodParameterEditing"), true))
{
if (DynamicArgumentDialog.ShowDialog(activityModelItem, inputData, context, activityModelItem.View, options))
{
scope.Complete();
}
}
}
示例6: 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";
}
示例7: ShowDialog
public override void ShowDialog(PropertyValue propertyValue, IInputElement commandSource)
{
Microsoft.Win32.OpenFileDialog ofd = new Microsoft.Win32.OpenFileDialog();
if (ofd.ShowDialog() == true)
{
propertyValue.Value = ofd.FileName.Substring(ofd.FileName.LastIndexOf('\\')+1);
}
}
示例8: ShowDialog
public override void ShowDialog(PropertyValue propertyValue, IInputElement commandSource)
{
ModelPropertyEntryToOwnerActivityConverter propertyEntryConverter = new ModelPropertyEntryToOwnerActivityConverter();
ModelItem modelItem = (ModelItem)propertyEntryConverter.Convert(propertyValue.ParentProperty, typeof(ModelItem), false, null);
EditingContext context = modelItem.GetEditingContext();
this.ShowDialog(modelItem, context);
}
示例9: to_string_with_name_but_no_accessor
public void to_string_with_name_but_no_accessor()
{
var value = new PropertyValue(){
Name = "Key1",
Value = "Value1"
};
value.ToString().ShouldEqual("Key1=Value1");
}
示例10: GetArgs
private IEnumerable<object> GetArgs(
ConstructorInfo constructor,
PropertyValue propertyValue)
{
foreach (var parameter in constructor.GetParameters())
{
yield return GetArg(parameter.ParameterType, propertyValue);
}
}
示例11: ShowDialog
public override void ShowDialog(PropertyValue propertyValue, IInputElement commandSource)
{
var userDataDialog = new UserDataDialog();
userDataDialog.Set(propertyValue.Value.ToString());
userDataDialog.ShowDialog();
if (userDataDialog.DialogResult == true)
{
propertyValue.Value = userDataDialog.Get();
}
}
示例12: CreateInstance
private BaseFilter CreateInstance(
Type filterType,
PropertyValue propertyValue)
{
var constructor = filterType.GetConstructors().Single();
var args = GetArgs(constructor, propertyValue);
return (BaseFilter)constructor.Invoke(args.ToArray());
}
示例13: WriteData
public override void WriteData(TraceLoggingDataCollector collector, PropertyValue value)
{
if (this.properties != null)
{
foreach (var property in this.properties)
{
property.typeInfo.WriteData(collector, property.getter(value));
}
}
}
示例14: Property
/// <summary>
/// Create property meta information from property value
/// </summary>
/// <param name="propValue"></param>
/// <param name="catalogId"></param>
/// <param name="categoryId"></param>
/// <param name="propertyType"></param>
public Property(PropertyValue propValue, string catalogId, string categoryId, coreModel.PropertyType propertyType)
{
Id = propValue.Id;
CatalogId = catalogId;
IsManageable = false;
Name = propValue.PropertyName;
Type = propertyType;
ValueType = propValue.ValueType;
Values = new List<PropertyValue>();
}
示例15: 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;
}