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


C# ShellObject类代码示例

本文整理汇总了C#中ShellObject的典型用法代码示例。如果您正苦于以下问题:C# ShellObject类的具体用法?C# ShellObject怎么用?C# ShellObject使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: StartWatcher

        private void StartWatcher(ShellObject shellObject)
        {
            if (_watcher != null) { _watcher.Dispose(); }
            eventStack.Children.Clear();

            txtPath.Text = shellObject.ParsingName;

            _watcher = new ShellObjectWatcher(shellObject, chkRecursive.IsChecked ?? true);
            _watcher.AllEvents += AllEventsHandler;

            _watcher.Start();
        }
开发者ID:Corillian,项目名称:Windows-API-Code-Pack-1.1,代码行数:12,代码来源:MainWindow.xaml.cs

示例2: ArchiveViewWindow

        public ArchiveViewWindow(ShellObject loc, bool IsPreviewPaneEnabled, bool IsInfoPaneEnabled)
        {
            InitializeComponent();

            archive = loc;

            this.Title = "View Archive - " + archive.GetDisplayName(DisplayNameType.Default);

            ShellVView.Child = Explorer;

            Explorer.NavigationOptions.PaneVisibility.Commands = PaneVisibilityState.Hide;
            Explorer.NavigationOptions.PaneVisibility.CommandsOrganize = PaneVisibilityState.Hide;
            Explorer.NavigationOptions.PaneVisibility.CommandsView = PaneVisibilityState.Hide;
            Explorer.NavigationOptions.PaneVisibility.Preview =
                IsPreviewPaneEnabled ? PaneVisibilityState.Show : PaneVisibilityState.Hide;
            Explorer.NavigationOptions.PaneVisibility.Details =
                IsInfoPaneEnabled ? PaneVisibilityState.Show : PaneVisibilityState.Hide;
            Explorer.NavigationOptions.PaneVisibility.Navigation = PaneVisibilityState.Hide;

            Explorer.ContentOptions.FullRowSelect = true;
            Explorer.ContentOptions.CheckSelect = false;
            Explorer.ContentOptions.ViewMode = ExplorerBrowserViewMode.Tile;

            Explorer.NavigationComplete += new EventHandler<NavigationCompleteEventArgs>(Explorer_NavigationComplete);
            Explorer.Navigate(loc);
        }
开发者ID:rad1oactive,项目名称:BetterExplorer,代码行数:26,代码来源:ArchiveViewWindow.xaml.cs

示例3: Load

 public void Load(ShellObject shellObject)
 {
     using (var stream = new FileStream(shellObject.ParsingName, FileMode.Open, FileAccess.Read))
     {
         Populate(stream);
     }
 }
开发者ID:QuocHuy7a10,项目名称:Arianrhod,代码行数:7,代码来源:WPFPreviewHandlerDemo.cs

示例4: ShellThumbnail

        /// <summary>
        /// Internal constructor that takes in a parent ShellObject.
        /// </summary>
        /// <param name="shellObject"></param>
        internal ShellThumbnail(ShellObject shellObject)
        {
            if (shellObject == null || shellObject.NativeShellItem == null)
                throw new ArgumentNullException("shellObject");

            shellItemNative = shellObject.NativeShellItem;
        }
开发者ID:pmorton,项目名称:Log2Console,代码行数:11,代码来源:ShellThumbnail.cs

示例5: DriveItem

 public DriveItem(DriveInfo info)
 {
     Name = GetDriveInfoString(info);
     RootDirectory = info.RootDirectory.FullName;
     ShellObject = ShellObject.FromParsingName(RootDirectory);
     IsReady = info.IsReady;
 }
开发者ID:glupschta,项目名称:Kex,代码行数:7,代码来源:DrivesPopup.cs

示例6: ShellThumbnail

        /// <summary>
        /// Internal constructor that takes in a parent ShellObject.
        /// </summary>
        /// <param name="shellObject"></param>
        internal ShellThumbnail(ShellObject shellObject)
        {
            if (shellObject == null || shellObject.NativeShellItem == null)
            {
                throw new ArgumentNullException(nameof(shellObject));
            }

            shellItemNative = shellObject.NativeShellItem;
        }
开发者ID:dbremner,项目名称:Windows-API-Code-Pack-1.1,代码行数:13,代码来源:ShellThumbnail.cs

示例7: Resolve

 public static string Resolve(ShellObject shellObject, string fullPath)
 {
     if (shellObject == null)
         return fullPath;
     if (shellObject.IsLink)
     {
         var link = ShellLink.FromParsingName(fullPath);
         var shellPath = ((string)shellObject.Properties.GetProperty("System.ParsingPath").ValueAsObject);
        // var shellPath = ((string)shellObject.Properties.GetProperty("System.Link.TargetParsingPath").ValueAsObject);
         //Für .lnk Systemsteuerung/Verwaltung
         return shellPath == shellObject.Name ? fullPath : shellPath;
     }
     return fullPath;
 }
开发者ID:glupschta,项目名称:Kex,代码行数:14,代码来源:PathResolver.cs

示例8: LoadDirectory

        public void LoadDirectory(ShellObject obj)
        {
            obj.Thumbnail.FormatOption = ShellThumbnailFormatOption.IconOnly;
            obj.Thumbnail.CurrentSize = new Size(16, 16);
            this.PathImage.Source = obj.Thumbnail.BitmapSource;
            this.pathName.Text = obj.GetDisplayName(DisplayNameType.Default);
            this.so = obj;
            path = obj.ParsingName;

            Dispatcher.BeginInvoke(DispatcherPriority.Normal, (ThreadStart)(() =>
            {




                if (obj.ParsingName == KnownFolders.Network.ParsingName || obj.ParsingName.StartsWith(@"\\"))
                {
                    SetChildren(true);
                    grid1.Visibility = System.Windows.Visibility.Visible;
                    MenuBorder.Visibility = System.Windows.Visibility.Visible;

                }
                else
                {
                    try
                    {
                        ShellContainer con = (ShellContainer)obj;
                        List<ShellObject> joe = new List<ShellObject>();
                        foreach (ShellObject item in con)
                        {
                            if (item.IsFolder == true)
                            {
                                if (item.ParsingName.ToLower().EndsWith(".zip") == false && item.ParsingName.ToLower().EndsWith(".cab") == false)
                                {
                                    joe.Add(item);
                                }
                            }
                        }
                        SetChildren(joe.Count > 0);
                    }
                    catch
                    {
                        SetChildren(false);
                    }
                    
                }
            }));

        }
开发者ID:rad1oactive,项目名称:BetterExplorer,代码行数:49,代码来源:BreadcrumbBarItem.xaml.cs

示例9: GetIcon

 internal static ImageSource GetIcon(ShellObject shell, IconSize size)
 {
     shell.Thumbnail.CurrentSize = new System.Windows.Size(16, 16);
     switch (size)
     {
         case IconSize.ExtraLarge:
             return shell.Thumbnail.LargeBitmapSource;
         case IconSize.Large:
             return shell.Thumbnail.MediumBitmapSource;
         case IconSize.Medium:
             return shell.Thumbnail.SmallBitmapSource;
         case IconSize.Small:
             return shell.Thumbnail.BitmapSource;
     }
     return null;
 }
开发者ID:soukoku,项目名称:MExplorer,代码行数:16,代码来源:Util.cs

示例10: ShellObjectWatcher

		/// <summary>
		/// Creates the ShellObjectWatcher for the given ShellObject
		/// </summary>
		/// <param name="shellObject">The ShellObject to monitor</param>
		/// <param name="recursive">Whether to listen for changes recursively (for when monitoring a container)</param>
		public ShellObjectWatcher(ShellObject shellObject, bool recursive) {
			if (shellObject == null) {
				throw new ArgumentNullException("shellObject");
			}

			if (_context == null) {
				_context = new SynchronizationContext();
				SynchronizationContext.SetSynchronizationContext(_context);
			}

			_shellObject = shellObject;
			this._recursive = recursive;

			var result = MessageListenerFilter.Register(OnWindowMessageReceived);
			_listenerHandle = result.WindowHandle;
			_message = result.Message;
		}
开发者ID:GodLesZ,项目名称:svn-dump,代码行数:22,代码来源:ShellObjectWatcher.cs

示例11: ResizeImage

        public ResizeImage(ShellObject file, string height, string width, string imagename)
        {
            InitializeComponent();

            textBlock1.Text = imagename + ": " + file.GetDisplayName(DisplayNameType.Default);
            cvt = new Bitmap(file.ParsingName);
            textBlock2.Text = height + ": " + cvt.Height.ToString();
            textBlock3.Text = width + ": " + cvt.Width.ToString();

            spinner1.Value = 100;

            percsetting = true;

            textBox1.Text = cvt.Width.ToString();
            textBox2.Text = cvt.Height.ToString();

            percsetting = false;
        }
开发者ID:rad1oactive,项目名称:BetterExplorer,代码行数:18,代码来源:ResizeImage.xaml.cs

示例12: Photo

 public Photo(string path)
 {
     // Debug.WriteLine("Photo[" + Thread.CurrentThread.ManagedThreadId + "](" + path + ") started...");
     FullPath = path;
     #if STORE_SHELLOBJECT
     _threadId = Thread.CurrentThread.ManagedThreadId;
     _shellObject = ShellObject.FromParsingName(path);
     var x = DateTaken;
     var xx = Camera;
     #else
     // var shellObject = ShellObject.FromParsingName(path);
     using (var shellObject = ShellObject.FromParsingName(path))
     {
         DateTaken = shellObject.Properties.GetProperty<DateTime?>(SystemProperties.System.Photo.DateTaken).Value;
         Camera = new Camera(shellObject);
     }
     #endif
     // Debug.WriteLine("Photo[" + Thread.CurrentThread.ManagedThreadId + "](" + path + ") complete.");
 }
开发者ID:SteveHarveyUK,项目名称:PhotoSync,代码行数:19,代码来源:Photo.cs

示例13: GetExifRotationInfo

 public int GetExifRotationInfo(string path)
 {
     if (!_shellsupport) return 1;
     _shellitem = ShellObject.FromParsingName(path);
     object res = 1;
     foreach (var item in _shellitem.Properties.DefaultPropertyCollection)
     {
         if (item.CanonicalName == "System.Photo.Orientation")
         {
             res = item.ValueAsObject;
             break;
         }
     }
     _shellitem.Dispose();
     _shellitem = null;
     GC.Collect();
     GC.WaitForPendingFinalizers();
     GC.Collect();
     return Convert.ToInt32(res);
 }
开发者ID:jiliyutou,项目名称:Kinect.Joy,代码行数:20,代码来源:WinShellWraper.cs

示例14: GetThumbnail

 public BitmapSource GetThumbnail(string path)
 {
     try
     {
         if (_shellsupport)
         {
             _shellitem = ShellObject.FromParsingName(path);
             BitmapSource ret = _shellitem.Thumbnail.LargeBitmapSource;
             _shellitem.Dispose();
             _shellitem = null;
             GC.Collect();
             GC.WaitForPendingFinalizers();
             GC.Collect();
             return ret;
         }
         else return FailSafeThumbnail(path);
     }
     catch (Exception)
     {
         return FailSafeThumbnail(path);
     }
 }
开发者ID:jiliyutou,项目名称:Kinect.Joy,代码行数:22,代码来源:WinShellWraper.cs

示例15: PropertySystemDevices

 internal PropertySystemDevices(ShellObject parent)
 {
     shellObjectParent = parent;
 }
开发者ID:overeemm,项目名称:JoomlaPodcaster,代码行数:4,代码来源:StronglyTypedProperties.cs


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