本文整理汇总了C#中Property.SetValue方法的典型用法代码示例。如果您正苦于以下问题:C# Property.SetValue方法的具体用法?C# Property.SetValue怎么用?C# Property.SetValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Property
的用法示例。
在下文中一共展示了Property.SetValue方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RsDocOptionsPage
public RsDocOptionsPage(Lifetime lifetime, OptionsSettingsSmartContext optionsSettingsSmartContext)
: base(lifetime, optionsSettingsSmartContext)
{
// output path
IProperty<FileSystemPath> outputPath = new Property<FileSystemPath>(lifetime, "RsDocOptionsPage::OutputPath");
outputPath.SetValue(FileSystemPath.TryParse(optionsSettingsSmartContext.StoreOptionsTransactionContext.GetValue((RsDocSettingsKey key) => key.RsDocOutputFolder)));
outputPath.Change.Advise(lifetime, a =>
{
if (!a.HasNew || a.New == null) return;
optionsSettingsSmartContext.StoreOptionsTransactionContext.SetValue((RsDocSettingsKey key) => key.RsDocOutputFolder, a.New.FullPath);
});
AddText("Output folder for generated content:");
var outputPathOption = AddFolderChooserOption(outputPath, null, null);
outputPathOption.IsEnabledProperty.SetValue(true);
// folder with samples for context actions
IProperty<FileSystemPath> caFolder = new Property<FileSystemPath>(lifetime, "RsDocOptionsPage::CaFolder");
caFolder.SetValue(FileSystemPath.TryParse(optionsSettingsSmartContext.StoreOptionsTransactionContext.GetValue((RsDocSettingsKey key) => key.RsDocCaFolder)));
caFolder.Change.Advise(lifetime, a =>
{
if (!a.HasNew || a.New == null) return;
optionsSettingsSmartContext.StoreOptionsTransactionContext.SetValue((RsDocSettingsKey key) => key.RsDocCaFolder, a.New.FullPath);
});
AddText("Folder with context actions samples:");
var caFoolderOption = AddFolderChooserOption(caFolder, null, null);
caFoolderOption.IsEnabledProperty.SetValue(true);
}
示例2: AddCategories
private IList<string> AddCategories()
{
IList<string> categories = _Properties.GetMany<string>("CATEGORIES");
categories.Add("Work");
categories.Add("Personal");
Property property = new Property();
property.Group = "CATEGORIES";
property.SetValue(new string[] { "A", "Few", "More" });
_Properties.Add(property);
return categories;
}