예제 #1
0
        private void DisplaySpaceInfo()
        {
            string nm = (string)listSpace.SelectedItem;

            if ((cbShow.SelectedIndex == 0) | (nm == "<All>"))
            { // Display Space Info
                OpenStorage();
                this.DisplayInfo();
                CloseStorage();
            }
            else if (nm != "<All>")
            {
                if (cbShow.SelectedIndex == 1)
                { // Display Free Space Info
                    txtInfo.Text = "";
                    OpenStorage();
                    string[] info = mgr.GetFreeSpaceInfo(nm);
                    CloseStorage();
                    for (int i = 0; i < info.Length; i++)
                    {
                        AddInfo(info[i]);
                    }
                }
                else if (cbShow.SelectedIndex == 2)
                { // Display Pool Allocation
                    OpenStorage();
                    txtInfo.Text = "";
                    VSpace  sp    = mgr.GetSpace(nm);
                    short[] pools = sp.GetPools();
                    string  spf   = "#,#;(#,#)";
                    int     padf  = 15;

                    AddInfo("Pool#     Allocated size");
                    for (int i = 0; i < pools.Length; i++)
                    {
                        long[] a     = sp.GetPoolPointers(pools[i]);
                        long   a_use = 0;

                        if (a[0] > 0)
                        {
                            VSObject o = sp.GetRootObject(pools[i]);
                            while (o != null)
                            {
                                a_use += o.Size;
                                o      = o.Next;
                            }


                            if (pools[i] > 0)
                            {
                                AddInfo(pools[i].ToString().PadLeft(5) + " " + a_use.ToString(spf).PadLeft(padf));
                            }
                            else
                            {
                                AddInfo(DEFS.POOL_MNEM(pools[i]).PadLeft(5) + " " + a_use.ToString(spf).PadLeft(padf));
                            }
                        }
                    }
                    AddInfo("Done");

                    CloseStorage();
                }
            }
        }