本文整理汇总了C#中PropertyValue类的典型用法代码示例。如果您正苦于以下问题:C# PropertyValue类的具体用法?C# PropertyValue怎么用?C# PropertyValue使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PropertyValue类属于命名空间,在下文中一共展示了PropertyValue类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
开发者ID:joelkarr,项目名称:ENGworks,代码行数:29,代码来源:HomeController.cs
示例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);
}
}
开发者ID:zimmybln,项目名称:Workflow,代码行数:31,代码来源:SelectFileEditor.cs
示例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;
}
开发者ID:CadeLaRen,项目名称:digiCamControl,代码行数:35,代码来源:CustomDevice.cs
示例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();
}
}
}
开发者ID:tian1ll1,项目名称:WPF_Examples,代码行数:28,代码来源:ArgumentDictionaryEditor.cs
示例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();
}
}
}
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:28,代码来源:ArgumentCollectionPropertyEditor.cs
示例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";
}
开发者ID:tomriddle1234,项目名称:digiCamControl,代码行数:25,代码来源:FakeCameraDevice.cs
示例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);
}
}
开发者ID:tian1ll1,项目名称:WPF_Examples,代码行数:9,代码来源:FilePickerEditor.cs
示例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);
}
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:9,代码来源:CorrelationInitializerValueEditor.cs
示例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");
}
开发者ID:cprieto,项目名称:fubumvc,代码行数:9,代码来源:PropertyValueTester.cs
示例10: GetArgs
private IEnumerable<object> GetArgs(
ConstructorInfo constructor,
PropertyValue propertyValue)
{
foreach (var parameter in constructor.GetParameters())
{
yield return GetArg(parameter.ParameterType, propertyValue);
}
}
开发者ID:rgonek,项目名称:Ilaro.Admin,代码行数:9,代码来源:FilterFactory.cs
示例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();
}
}
开发者ID:bperreault,项目名称:autox,代码行数:10,代码来源:UserDataEditor.cs
示例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());
}
开发者ID:rgonek,项目名称:Ilaro.Admin,代码行数:10,代码来源:FilterFactory.cs
示例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));
}
}
}
开发者ID:noahfalk,项目名称:corefx,代码行数:10,代码来源:InvokeTypeInfo.cs
示例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>();
}
开发者ID:adwardliu,项目名称:vc-community,代码行数:17,代码来源:Property.cs
示例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;
}
开发者ID:brunoklein99,项目名称:nikon-camera-control,代码行数:10,代码来源:NikonD4.cs
示例16: registerPropertyBox
/// <summary>
/// Helper method for registering property box to Ice Object Adapter
/// </summary>
/// <param name="type">Name of box</param>
/// <param name="defaultValue">Default value of box</param>
/// <param name="valFromPrx">Method which converts property value proxy to property value object</param>
public void registerPropertyBox(string type, PropertyValue defaultValue, PropertyBoxModuleFactoryCreatorI.ValueFromPrx valFromPrx, string settingModuleIdentifier)
{
PropertyBoxModuleFactoryCreatorI newCreator = new PropertyBoxModuleFactoryCreatorI("::Ferda::Modules::" + type,
defaultValue.ice_ids(),
type,
defaultValue,
valFromPrx,
propertyReaper,
_adapter,
settingModuleIdentifier);
}
开发者ID:BackupTheBerlios,项目名称:ferdadataminer-svn,代码行数:17,代码来源:FerdaServiceI.cs
示例17: LoadTemplate
public XComponent LoadTemplate(string filePath)
{
var loadProps = new PropertyValue[2];
loadProps[0] = new PropertyValue { Name = "AsTemplate", Value = new Any(true) };
loadProps[1] = new PropertyValue { Name = "MacroExecutionMode", Value = new Any(MacroExecMode.ALWAYS_EXECUTE_NO_WARN) };
return desktop.loadComponentFromURL(
ConvertToURL(filePath),
"_blank", 0,
loadProps);
}
开发者ID:select-artur,项目名称:Bicycles,代码行数:11,代码来源:OpenOffice.cs
示例18: PropertyBoxModuleI
///<summary>
/// Constructor
/// </summary>
/// <param name="factory">A BoxModuleFactoryPrx</param>
/// <param name="propertyClassIceId">A string</param>
/// <param name="propertyFunctionsIceIds">A string[]</param>
/// <param name="identifier">A string</param>
public PropertyBoxModuleI(BoxModuleFactoryPrx factory, string propertyClassIceId, string[] propertyFunctionsIceIds, Ice.ObjectAdapter adapter, Ice.Identity myIdentity, Modules.PropertyBoxModuleFactoryCreatorI.ValueFromPrx valueFromPrx, PropertyValue defaultValue)
{
this.factory = factory;
this.propertyClassIceId = propertyClassIceId;
this.propertyFunctionsIceIds = propertyFunctionsIceIds;
this.myProxy = BoxModulePrxHelper.uncheckedCast(adapter.add(this,myIdentity));
this.adapter = adapter;
this.valueFromPrx = valueFromPrx;
this.defaultValue = defaultValue;
this.setProperty("value",defaultValue);
}
开发者ID:BackupTheBerlios,项目名称:ferdadataminer-svn,代码行数:18,代码来源:PropertyBoxModuleI.cs
示例19: TestPublicProperty
public void TestPublicProperty()
{
a obj = new a();
obj.PropertyA = "a";
PropertyValue pt = new PropertyValue(obj, "PropertyA");
Assert.AreEqual("PropertyA", pt.Name);
Assert.AreEqual(typeof(string), pt.Type);
Assert.AreEqual("a", pt.Value);
pt.Value = "b";
Assert.AreEqual("b", pt.Value);
}
开发者ID:hivie7510,项目名称:csharptest-net,代码行数:12,代码来源:TestPropertyValue.cs
示例20: ShowDialog
public override void ShowDialog(PropertyValue propertyValue, IInputElement commandSource)
{
//get the property entry to model item converter
IValueConverter converter = (ModelPropertyEntryToOwnerActivityConverter)EditorResources.GetResources()["ModelPropertyEntryToOwnerActivityConverter"];
ModelItem item = (ModelItem)converter.Convert(propertyValue.ParentProperty, typeof(ModelItem), false, null);
//we need editing context
EditingContext ctx = ((IModelTreeItem)item).ModelTreeManager.Context;
//get the default dialog owner
DependencyObject owner = ctx.Services.GetService<DesignerView>();
//create and show dialog with owner, edited expression and context
(new EditorDialog(owner, propertyValue, ctx, this.DialogTemplate, this.DialogTitle)).ShowOkCancel();
}
开发者ID:krytht,项目名称:DotNetReferenceSource,代码行数:13,代码来源:ExpressionValueEditor.cs
注:本文中的PropertyValue类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论