本文整理汇总了C#中PropertyKey类的典型用法代码示例。如果您正苦于以下问题:C# PropertyKey类的具体用法?C# PropertyKey怎么用?C# PropertyKey使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PropertyKey类属于命名空间,在下文中一共展示了PropertyKey类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: GetCell
internal Segment<byte>? GetCell(PropertyKey key)
{
var colDef = _columnDefs.FirstOrDefault(d => d.Tag.Key == key);
if (colDef == null)
return null;
if (!ColumnExists(colDef.CebIndex))
return null;
var type = colDef.Tag.Type;
Segment<byte> data;
var offset = colDef.Offset + (_rowIndex * _offsets.Bm);
if (!type.IsVariableLength() && type.GetLength() <= 8)
{
var length = colDef.Tag.Type.GetLength();
data = _rowData.Derive(offset, length);
}
else
{
var hnid = BitConverter.ToUInt32(_rowData.Array, _rowData.Offset + offset);
if ((hnid & 0x1f) == 0)
{
data = _heap[hnid];
}
else
{
var subnode = _node.FindSubnode(hnid);
var subBlock = subnode.GetDataBlock();
data = subBlock.Data;
}
}
return data;
}
开发者ID:adam-mccoy,项目名称:pst,代码行数:34,代码来源:TcRow.cs
示例2: UpdateProperty
public virtual int UpdateProperty(uint commandId, ref PropertyKey key, PropVariantRef currentValue, out PropVariant newValue)
{
Command command = ParentCommandManager.Get((CommandId)commandId);
if (command == null)
{
return NullCommandUpdateProperty(commandId, ref key, currentValue, out newValue);
}
try
{
newValue = new PropVariant();
command.GetPropVariant(key, currentValue, ref newValue);
if (newValue.IsNull())
{
Trace.Fail("Didn't property update property for " + PropertyKeys.GetName(key) + " on command " + ((CommandId)commandId).ToString());
newValue = PropVariant.FromObject(currentValue.PropVariant.Value);
}
}
catch (Exception ex)
{
Trace.Fail("Exception in UpdateProperty for " + PropertyKeys.GetName(key) + " on command " + commandId + ": " + ex);
newValue = PropVariant.FromObject(currentValue.PropVariant.Value);
}
return HRESULT.S_OK;
}
开发者ID:gmilazzoitag,项目名称:OpenLiveWriter,代码行数:28,代码来源:GenericCommandHandler.cs
示例3: ConstructorWithString
public void ConstructorWithString(string formatId, int propertyId)
{
PropertyKey pk = new PropertyKey(formatId, propertyId);
Assert.Equal<Guid>(new Guid(formatId), pk.FormatId);
Assert.Equal<int>(propertyId, pk.PropertyId);
}
开发者ID:Corillian,项目名称:Windows-API-Code-Pack-1.1,代码行数:7,代码来源:PropertyKeyTests.cs
示例4: EntityHierarchyEnumerator
public EntityHierarchyEnumerator(EntitySystem EntitySystem, ViewModelContext selectedEntitiesContext)
{
isSelectedProperty = new PropertyKey<bool>("IsSelected", typeof(EntityHierarchyEnumerator), new StaticDefaultValueMetadata(false) { PropertyUpdateCallback = IsSelectedChanged });
this.EntitySystem = EntitySystem;
this.selectedEntitiesContext = selectedEntitiesContext;
}
开发者ID:h78hy78yhoi8j,项目名称:xenko,代码行数:7,代码来源:EntityHierarchyEnumerator.cs
示例5: GetOverride
protected object GetOverride(ref PropertyKey key, object defaultValue)
{
PropVariant propVariant;
if (_overrides.TryGetValue(key, out propVariant))
return propVariant.Value;
return defaultValue;
}
开发者ID:gmilazzoitag,项目名称:OpenLiveWriter,代码行数:8,代码来源:OverridableCommand.cs
示例6: ConstructorWithGuid
public void ConstructorWithGuid(string formatIdString, int propertyId)
{
Guid formatId = new Guid(formatIdString);
PropertyKey pk = new PropertyKey(formatId, propertyId);
Assert.Equal<Guid>(formatId, pk.FormatId);
Assert.Equal<int>(propertyId, pk.PropertyId);
}
开发者ID:Corillian,项目名称:Windows-API-Code-Pack-1.1,代码行数:8,代码来源:PropertyKeyTests.cs
示例7: GetPropertyDescription
public ShellPropertyDescription GetPropertyDescription(PropertyKey key)
{
if (!propsDictionary.ContainsKey(key))
{
propsDictionary.Add(key, new ShellPropertyDescription(key));
}
return propsDictionary[key];
}
开发者ID:uonun,项目名称:TaggableShell,代码行数:8,代码来源:ShellPropertyDescriptionsCache.cs
示例8: IsStringPropertyKey
public static bool IsStringPropertyKey(PropertyKey key)
{
return (key == PropertyKeys.Label ||
key == PropertyKeys.LabelDescription ||
key == PropertyKeys.Keytip ||
key == PropertyKeys.TooltipTitle ||
key == PropertyKeys.TooltipDescription);
}
开发者ID:gmilazzoitag,项目名称:OpenLiveWriter,代码行数:8,代码来源:RibbonHelper.cs
示例9: GetPropVariant
public override void GetPropVariant(PropertyKey key, PropVariantRef currentValue, ref PropVariant value)
{
if (key == PropertyKeys.ContextAvailable)
{
value.SetUInt((uint)ContextAvailability);
}
else
base.GetPropVariant(key, currentValue, ref value);
}
开发者ID:gmilazzoitag,项目名称:OpenLiveWriter,代码行数:9,代码来源:ContextAvailabilityCommand.cs
示例10: FindProperty
public Property FindProperty(PropertyKey key)
{
Type type = FindType(key);
Property member = type.FindProperty(key);
if (member == null)
{
member = type.AddProperty(key);
}
return member;
}
开发者ID:machine,项目名称:machine.eon,代码行数:10,代码来源:MemberRepository.cs
示例11: UpdateInvalidationStateAndNotifyIfDifferent
private void UpdateInvalidationStateAndNotifyIfDifferent(ref PropertyKey key, IComparable overrideValue, IComparableDelegate currentValueDelegate)// where T : IComparable
{
// Only invalidate if we're actually making a change.
// Unnecessary invalidations hurt perf as well as cause ribbon bugs.
if (overrideValue.CompareTo(currentValueDelegate()) != 0)
{
UpdateInvalidationState(key, InvalidationState.Pending);
OnStateChanged(EventArgs.Empty);
}
}
开发者ID:fumiya-kume,项目名称:OpenLiveWriter,代码行数:10,代码来源:OverridableCommand.cs
示例12: ToStringReturnsExpectedString
public void ToStringReturnsExpectedString()
{
Guid guid = new Guid("00000000-1111-2222-3333-000000000000");
int property = 1234;
PropertyKey key = new PropertyKey(guid, property);
Assert.Equal<string>(
"{" + guid.ToString() + "}, " + property.ToString(),
key.ToString());
}
开发者ID:Corillian,项目名称:Windows-API-Code-Pack-1.1,代码行数:11,代码来源:PropertyKeyTests.cs
示例13: RemoveOverride
protected int RemoveOverride(ref PropertyKey key, IComparableDelegate currentValueDelegate)
{
PropVariant overrideValue;
if (_overrides.TryGetValue(key, out overrideValue))
{
_overrides.Remove(key);
UpdateInvalidationStateAndNotifyIfDifferent(ref key, (IComparable)overrideValue.Value, currentValueDelegate);
return HRESULT.S_OK;
}
return HRESULT.S_FALSE;
}
开发者ID:gmilazzoitag,项目名称:OpenLiveWriter,代码行数:12,代码来源:OverridableCommand.cs
示例14: HasAssessor_DeclaringType_And_PropertyName
public void HasAssessor_DeclaringType_And_PropertyName()
{
var declaringType = typeof(SimpleClass);
var propertyName = "Id";
var propertyKey = new PropertyKey(declaringType, propertyName);
var assessor = CreatePropertyAssessor(propertyKey);
_cache.TryAdd(propertyKey, assessor);
var result = PropertyAssessorCache.HasAssessor(typeof(SimpleClass), "Id");
Assert.IsTrue(result);
}
开发者ID:jamir-araujo,项目名称:GraphCache,代码行数:12,代码来源:PropertyAssessorCacheTests.cs
示例15: HasAssessor_PropertyInfo
public void HasAssessor_PropertyInfo()
{
var propertyInfo = typeof(SimpleClass).GetProperty("Id");
var propertyKey = new PropertyKey(propertyInfo);
var assessor = CreatePropertyAssessor(propertyKey);
_cache.TryAdd(propertyKey, assessor);
propertyInfo = typeof(SimpleClass).GetProperty("Id");
var result = PropertyAssessorCache.HasAssessor(propertyInfo);
Assert.IsTrue(result);
}
开发者ID:jamir-araujo,项目名称:GraphCache,代码行数:12,代码来源:PropertyAssessorCacheTests.cs
示例16: CancelOverride
public virtual int CancelOverride(ref PropertyKey key)
{
if (key == PropertyKeys.Enabled)
{
return RemoveOverride(ref key, () => Enabled);
}
if (key == PropertyKeys.ContextAvailable)
{
return RemoveOverride(ref key, () => (uint)ContextAvailability);
}
return HRESULT.E_INVALIDARG;
}
开发者ID:gmilazzoitag,项目名称:OpenLiveWriter,代码行数:13,代码来源:OverridableCommand.cs
示例17: Dispatch
public void Dispatch(PropertyKey key, ExecuteEventHandlerArgs args)
{
ExecuteWithArgsDelegate executeWithArgsDelegate = commands[key] as ExecuteWithArgsDelegate;
if (executeWithArgsDelegate != null)
{
executeWithArgsDelegate(args);
return;
}
CommandId commandId = (CommandId)commands[key];
Command command = CommandManager.Get(commandId);
command.PerformExecuteWithArgs(args);
}
开发者ID:gmilazzoitag,项目名称:OpenLiveWriter,代码行数:14,代码来源:DispatchingCommand.cs
示例18: Get
internal Segment<byte> Get(PropertyKey key)
{
var prop = _bTree.Find((ushort)key);
if (prop == null)
return null;
if (prop.Type.IsVariableLength())
{
if ((prop.Hnid & 0x1f) == 0)
return _heap[prop.Hnid];
return _node.FindSubnode(prop.Hnid).GetDataBlock().Data;
}
if (prop.Type.GetLength() <= 4)
return BitConverter.GetBytes(prop.Hnid);
return _heap[prop.Hnid];
}
开发者ID:adam-mccoy,项目名称:pst,代码行数:18,代码来源:PropertyContext.cs
示例19: GetOrAdd_PropertyInfo_WhenIsAlreadyInCache
public void GetOrAdd_PropertyInfo_WhenIsAlreadyInCache()
{
var propertyInfo = typeof(SimpleClass).GetProperty("Id");
var created = false;
var propertyKey = new PropertyKey(propertyInfo);
_cache.TryAdd(propertyKey, CreatePropertyAssessor(propertyKey));
propertyInfo = typeof(SimpleClass).GetProperty("Id");
var assessor = PropertyAssessorCache.GetOrAdd(propertyInfo, propertyKeyForCreation =>
{
created = true;
return CreatePropertyAssessor(propertyKeyForCreation);
});
propertyInfo = typeof(SimpleClass).GetProperty("Id");
Assert.IsTrue(_cache.ContainsKey(new PropertyKey(propertyInfo)));
Assert.IsFalse(created);
}
开发者ID:jamir-araujo,项目名称:GraphCache,代码行数:19,代码来源:PropertyAssessorCacheTests.cs
示例20: OverrideProperty
public virtual int OverrideProperty(ref PropertyKey key, PropVariantRef overrideValue)
{
if (key == PropertyKeys.Enabled)
{
bool currentValue = Enabled;
_overrides[key] = overrideValue.PropVariant;
UpdateInvalidationStateAndNotifyIfDifferent(ref key, Convert.ToBoolean(overrideValue.PropVariant.Value, CultureInfo.InvariantCulture), () => currentValue);
return HRESULT.S_OK;
}
else if (key == PropertyKeys.ContextAvailable)
{
uint currentValue = (uint)ContextAvailability;
_overrides[key] = overrideValue.PropVariant;
UpdateInvalidationStateAndNotifyIfDifferent(ref key, Convert.ToUInt32(overrideValue.PropVariant.Value, CultureInfo.InvariantCulture), () => currentValue);
return HRESULT.S_OK;
}
return HRESULT.E_INVALIDARG;
}
开发者ID:gmilazzoitag,项目名称:OpenLiveWriter,代码行数:19,代码来源:OverridableCommand.cs
注:本文中的PropertyKey类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论