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


C# PropVariant.SetDateTime方法代码示例

本文整理汇总了C#中PropVariant.SetDateTime方法的典型用法代码示例。如果您正苦于以下问题:C# PropVariant.SetDateTime方法的具体用法?C# PropVariant.SetDateTime怎么用?C# PropVariant.SetDateTime使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PropVariant的用法示例。


在下文中一共展示了PropVariant.SetDateTime方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CreateLeafCondition

        /// <summary>
        /// Creates a leaf condition node that represents a comparison of property value and constant value. 
        /// Overload method takes a DateTime parameter for the comparison value.
        /// </summary>
        /// <param name="propertyName">The name of a property to be compared, or null for an unspecified property. 
        /// The locale name of the leaf node is LOCALE_NAME_USER_DEFAULT.</param>
        /// <param name="value">The DateTime value against which the property value should be compared.</param>
        /// <param name="operation">Specific condition to be used when comparing the actual value and the expected value of the given property</param>
        /// <returns>SearchCondition based on the given parameters</returns>
        /// <remarks>
        /// The search will only work for files that are indexed, as well as the specific properties are indexed. To find 
        /// the properties that are indexed, look for the specific property's property description and 
        /// <see cref="P:Microsoft.WindowsAPICodePack.Shell.PropertySystem.ShellPropertyDescription.TypeFlags"/> property for IsQueryable flag.
        /// </remarks>
        public static SearchCondition CreateLeafCondition(string propertyName, DateTime value, SearchConditionOperation operation)
        {
            PropVariant propVar = new PropVariant();
            propVar.SetDateTime(value);

            return CreateLeafCondition(propertyName, propVar, "System.StructuredQuery.CustomProperty.DateTime", operation);
        }
开发者ID:TanyaTPG,项目名称:Log2Console,代码行数:21,代码来源:SearchConditionFactory.cs

示例2: GetProperty

        public int GetProperty(ItemPropId propID, ref PropVariant value)
        {
            value.Clear();

            if (_subArchiveMode)
            {
                if (propID == ItemPropId.Name)
                {
                    value.SetBString(_subArchiveName);
                }
            }
            else
            {
                switch (propID)
                {
                    case ItemPropId.Name:
                        if (!_streamMode)
                        {
                            value.SetBString(Path.GetFileName(_fileName));
                        }
                        break;
                    case ItemPropId.IsDirectory:
                        value.SetBool(_streamMode ? false : (byte)(new FileInfo(_fileName).Attributes & FileAttributes.Directory) != 0);
                        break;
                    case ItemPropId.Size:
                        value.SetULong((ulong)_currentVolumeSize);
                        break;
                    case ItemPropId.Attributes:
                        value.SetUInt(_streamMode ? (uint)0 : (uint)new FileInfo(_fileName).Attributes);
                        break;
                    case ItemPropId.CreationTime:
                        if (!_streamMode)
                        {
                            value.SetDateTime(new FileInfo(_fileName).CreationTime);
                        }
                        break;
                    case ItemPropId.LastAccessTime:
                        if (!_streamMode)
                        {
                            value.SetDateTime(new FileInfo(_fileName).LastAccessTime);
                        }
                        break;
                    case ItemPropId.LastWriteTime:
                        if (!_streamMode)
                        {
                            value.SetDateTime(new FileInfo(_fileName).LastWriteTime);
                        }
                        break;
                }
            }
            return HRESULT.S_OK;
        }
开发者ID:GEPWNAGE,项目名称:Steel,代码行数:52,代码来源:ArchiveOpenCallback.cs


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