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


C# PropertyValue类代码示例

本文整理汇总了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;
 }
开发者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


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