コード例 #1
0
ファイル: OpenLocationPopup.cs プロジェクト: glupschta/Kex
        protected override void HandleSelection()
        {
            if (Input.ListBox.SelectedIndex != -1)
                SelectedLocation = ((StringPopupItem)Input.ListBox.SelectedItem).FilterString;
            else
            {
                SelectedLocation = Input.TextBox.Text;
                if (string.IsNullOrEmpty(SelectedLocation))
                {
                    NewWindow = true;
                    SelectedLocation =  ListerManager.Instance.ListerViewManager.CurrentListerView.Lister.CurrentDirectory;
                }
            }

            if (File.Exists(SelectedLocation))
            {
                SelectedLocation = new FileInfo(SelectedLocation).FullName;
                FileItem fi = new FileItem(SelectedLocation, ItemType.Executable, null);// ListerManager.Instance.ListerViewManager.CurrentListerView.Lister.ItemProvider as FilesystemItemProvider);
                ListerManager.Instance.CommandManager.DoDefaultAction();
            }
            else if (Directory.Exists(SelectedLocation))
            {
                SelectedLocation = new DirectoryInfo(SelectedLocation).FullName;
                if (NewWindow)
                    ListerManager.Instance.ListerViewManager.OpenLister(SelectedLocation);
                else
                    ListerManager.Instance.CommandManager.SetContainer(SelectedLocation);
            }
            Hide();
        }
コード例 #2
0
ファイル: PropertyDialog.xaml.cs プロジェクト: glupschta/Kex
        public void Show(FileItem fi)
        {
            var items = new List<PropertyItem>();
            items.AddRange(fi.ShellObject.Properties.DefaultPropertyCollection
                .Where(pc => pc.CanonicalName != null && pc.ValueAsObject != null)
                .Select(pc => new PropertyItem(pc.Description.DisplayName, pc.ValueAsObject.ToString())));

            if (fi.FullPath.ToLower().EndsWith(".dll"))
            {
                try
                {
                    items.Add(new PropertyItem("References", ""));
                    var a = Mono.Cecil.AssemblyDefinition.ReadAssembly(fi.FullPath);
                    items.AddRange(a.MainModule.AssemblyReferences.Select(ar => new PropertyItem("", ar.FullName)));
                } catch {}
            }
            PropertyList.ItemsSource = items;
            Title = fi.Name + " " + "Properties";

            ShowDialog();
        }
コード例 #3
0
ファイル: PropertyLister.cs プロジェクト: glupschta/Kex
 public PropertyLister(FileItem fileItem)
     : base()
 {
     FileItem = fileItem;
 }
コード例 #4
0
ファイル: TextLister.cs プロジェクト: glupschta/Kex
 public TextLister(FileItem fileItem)
     : base()
 {
     FileItem = fileItem;
 }