ToString() public méthode

public ToString ( ) : string
Résultat string
Exemple #1
0
                public StoredVolume(Win32Impl.Volume vol, WmiSession wmisession, long nextid)
                {
                    try
                    {
                        Id = nextid;
                        this.wmisession = wmisession;
                        WmiBase.Singleton.DebugMsg("Stored volume: new " + vol.Name);
                        path = getVolumePath();
                        WmiBase.Singleton.DebugMsg("creating " + path + "/name");
                        name = wmisession.GetXenStoreItemCached(path + "/name");
                        WmiBase.Singleton.DebugMsg(" : " + name.ToString());
                        size       = wmisession.GetXenStoreItemCached(path + "/size");
                        free       = wmisession.GetXenStoreItemCached(path + "/free");
                        volumeName = wmisession.GetXenStoreItemCached(path + "/volume_name");

                        filesystem = wmisession.GetXenStoreItemCached(path + "/filesystem");
                    }
                    catch
                    {
                        throw;
                    }
                    try
                    {
                        name.value       = vol.Name;
                        size.value       = vol.SizeBytes.ToString();
                        freebytes        = vol.FreeBytes;
                        free.value       = freebytes.ToString();
                        volumeName.value = vol.VolumeName;
                        filesystem.value = vol.FSName;
                    }
                    catch
                    {
                        throw;
                    }
                    try
                    {
                        mountPoints = new List <XenStoreItemCached>();
                        int i = 0;
                        foreach (string mountpoint in vol.pathnames)
                        {
                            XenStoreItemCached mp = wmisession.GetXenStoreItemCached(path + "/mount_points/" + i.ToString());
                            mp.value = mountpoint;
                            mountPoints.Add(mp);
                            i++;
                        }
                    }
                    catch
                    {
                        throw;
                    }

                    try
                    {
                        int i = 0;
                        extents = new List <XenStoreItemCached>();
                        WmiBase.Singleton.DebugMsg("About to iterrate through extent names");
                        foreach (string disk in getExtentNames(vol.extents))
                        {
                            XenStoreItemCached ext = wmisession.GetXenStoreItemCached(path + "/extents/" + i.ToString());
                            ext.value = disk;
                            extents.Add(ext);
                        }
                    }
                    catch
                    {
                        throw;
                    }
                }
Exemple #2
0
                public StoredVolume Change(Win32Impl.Volume vol)
                {
                    WmiBase.Singleton.DebugMsg("changing stored volume id " + Id.ToString());
                    WmiBase.Singleton.DebugMsg("name : " + name.ToString());
                    WmiBase.Singleton.DebugMsg("size : " + size.ToString());
                    try
                    {
                        name.value = vol.Name;
                        size.value = vol.SizeBytes.ToString();
                        if ((ulong)Math.Abs((long)(vol.FreeBytes - freebytes)) > (vol.SizeBytes / 100))
                        {
                            freebytes  = vol.FreeBytes;
                            free.value = freebytes.ToString();
                        }
                        volumeName.value = vol.VolumeName;
                        filesystem.value = vol.FSName;
                    }
                    catch {
                        throw;
                    }
                    try
                    {
                        List <XenStoreItemCached> .Enumerator storecursor = mountPoints.GetEnumerator();
                        List <string> .Enumerator             newcursor   = vol.pathnames.GetEnumerator();
                        int i = 0;
                        while (true)
                        {
                            if (!storecursor.MoveNext())
                            {
                                while (newcursor.MoveNext())
                                {
                                    XenStoreItemCached mp = wmisession.GetXenStoreItemCached(path + "/mount_points/" + i.ToString());
                                    mp.value = newcursor.Current;

                                    mountPoints.Add(mp);
                                    i++;
                                }
                                break;
                            }
                            else if (!newcursor.MoveNext())
                            {
                                do
                                {
                                    storecursor.Current.Remove();
                                } while (storecursor.MoveNext());
                                break;
                            }
                            else
                            {
                                storecursor.Current.value = newcursor.Current;
                                i++;
                            }
                        }
                    }
                    catch
                    {
                        throw;
                    }
                    try
                    {
                        List <XenStoreItemCached> .Enumerator storecursor = extents.GetEnumerator();
                        List <string> .Enumerator             newcursor   = getExtentNames(vol.extents).GetEnumerator();
                        int i = 0;
                        while (true)
                        {
                            if (!storecursor.MoveNext())
                            {
                                while (newcursor.MoveNext())
                                {
                                    XenStoreItemCached ext = wmisession.GetXenStoreItemCached(path + "/extents/" + i.ToString());
                                    ext.value = newcursor.Current;
                                    mountPoints.Add(ext);
                                    i++;
                                }
                                break;
                            }
                            else if (!newcursor.MoveNext())
                            {
                                do
                                {
                                    storecursor.Current.Remove();
                                } while (storecursor.MoveNext());
                                break;
                            }
                            else
                            {
                                storecursor.Current.value = newcursor.Current;
                                i++;
                            }
                        }
                    }
                    catch
                    {
                        throw;
                    }
                    return(this);
                }
                public StoredVolume(Win32Impl.Volume vol, WmiSession wmisession, long nextid)
                {
                    try
                    {
                        Id = nextid;
                        this.wmisession = wmisession;
                        WmiBase.Singleton.DebugMsg("Stored volume: new " + vol.Name);
                        path = getVolumePath();
                        WmiBase.Singleton.DebugMsg("creating " + path + "/name");
                        name = wmisession.GetXenStoreItemCached(path + "/name");
                        WmiBase.Singleton.DebugMsg(" : " + name.ToString());
                        size = wmisession.GetXenStoreItemCached(path + "/size");
                        free = wmisession.GetXenStoreItemCached(path + "/free");
                        volumeName = wmisession.GetXenStoreItemCached(path + "/volume_name");

                        filesystem = wmisession.GetXenStoreItemCached(path + "/filesystem");
                    }
                    catch
                    {
                        throw;
                    }
                    try
                    {
                        name.value = vol.Name;
                        size.value = vol.SizeBytes.ToString();
                        freebytes = vol.FreeBytes;
                        free.value = freebytes.ToString();
                        volumeName.value = vol.VolumeName;
                        filesystem.value = vol.FSName;
                    }
                    catch
                    {
                        throw;
                    }
                    try
                    {

                        mountPoints = new List<XenStoreItemCached>();
                        int i = 0;
                        foreach (string mountpoint in vol.pathnames)
                        {
                            XenStoreItemCached mp = wmisession.GetXenStoreItemCached(path + "/mount_points/" + i.ToString());
                            mp.value = mountpoint;
                            mountPoints.Add(mp);
                            i++;
                        }
                    }
                    catch
                    {
                        throw;
                    }

                    try
                    {
                        int i = 0;
                        extents = new List<XenStoreItemCached>();
                        WmiBase.Singleton.DebugMsg("About to iterrate through extent names");
                        foreach (string disk in getExtentNames(vol.extents))
                        {
                            XenStoreItemCached ext = wmisession.GetXenStoreItemCached(path + "/extents/" + i.ToString());
                            ext.value = disk;
                            extents.Add(ext);
                        }
                    }
                    catch
                    {
                        throw;
                    }
                }