Example #1
0
 public EntryAction(Entry[] Entries, Method method, string Path)
 {
     InitializeComponent();
     if (Environment.OSVersion.Version.Build >= 7600)
     {
         Windows7 = true;
     }
     if (Environment.OSVersion.Version.Build >= 6000)
     {
         Aero = true;
     }
     if (Windows7)
     {
         tm = TaskbarManager.Instance;
     }
     this.HandleCreated += new EventHandler(EntryAction_HandleCreated);
     this.FormClosing += new FormClosingEventHandler(EntryAction_FormClosing);
     m = method;
     OutPath = Path;
     this.Entries = Entries;
 }
 public static long BlockToFATOffset(uint BaseBlock, Entry e)
 {
     return BlockToFATOffset(BaseBlock, e.PartitionInfo);
 }
 /// <summary>
 /// Returns the remaining size of a file/folder
 /// </summary>
 public static long RemainingData(int NumberOfBlocks, long FileSize, Entry e)
 {
     long length = (long)(NumberOfBlocks - 1) * e.PartitionInfo.ClusterSize;
     return FileSize - length;
 }
 /// <summary>
 /// Converts cluster (block) number to offset
 /// </summary>
 public static long GetBlockOffset(uint block, Entry e)
 {
     return GetBlockOffset(block, e.PartitionInfo);
 }
        private void LoadGeneral(Entry xFile)
        {
            string ftype = xFile.EntryType;
            l_fileType.Text = ftype;
            if (!xFile.IsFolder)
            {
                l_size.Text = "0x" + ((File)xFile).Size.ToString("X") + " (" + CLKsFATXLib.VariousFunctions.ByteConversion(((File)xFile).Size) + ")";
                l_sizeOnDisk.Text = "0x" + CLKsFATXLib.VariousFunctions.UpToNearestCluster(((File)xFile).Size, xFile.PartitionInfo.ClusterSize).ToString("X") + " (" + CLKsFATXLib.VariousFunctions.ByteConversion(CLKsFATXLib.VariousFunctions.UpToNearestCluster(((File)xFile).Size, xFile.PartitionInfo.ClusterSize)) + ")";
            }
            else
            {
                l_size.Text = "0x" + ((long)xFolder.BlocksOccupied.Length * xFolder.PartitionInfo.ClusterSize).ToString("X");
                l_sizeOnDisk.Text = l_size.Text;
            }
            l_Created.Text = xFile.CreationDate.ToString();
            l_Modified.Text = xFile.ModifiedDate.ToString();
            l_Accessed.Text = xFile.AccessedDate.ToString();
            l_FullPath.Text = xFile.FullPath;
            toolTip1.SetToolTip(l_FullPath, l_FullPath.Text);
            l_Flags.Text = "";
            CLKsFATXLib.Geometry.Flags[] flags = xFile.Flags;
            for (int i = 0; i < flags.Length; i++)
            {
                if (i == flags.Length - 1)
                {
                    l_Flags.Text += flags[i].ToString();
                }
                else
                {
                    l_Flags.Text += flags[i].ToString() + ", ";
                }
            }
            if (l_Flags.Text == "")
            {
                l_Flags.Text = "None";
            }

            propertyGrid1.SelectedObject = xFile;
        }
 /// <summary>
 /// Provides partition/FAT information
 /// </summary>
 public PartitionFunctions(Entry entry)
 {
     FATXDrive = (Drive)entry.Drive;
     Partition = entry.PartitionInfo;
     //ProcessBootSector();
 }
 public EntryFunctions(Entry DesiredEntry)
 {
     this.Parent = DesiredEntry;
 }