Esempio n. 1
0
 /// <summary>
 /// Deserializes xml markup from file into an SiteInformation object
 /// </summary>
 /// <param name="fileName">string xml file to load and deserialize</param>
 /// <param name="obj">Output SiteInformation object</param>
 /// <param name="exception">output Exception value if deserialize failed</param>
 /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
 public static bool LoadFromFile(string fileName, out SiteInformation obj, out System.Exception exception)
 {
     exception = null;
     obj       = default(SiteInformation);
     try {
         obj = LoadFromFile(fileName);
         return(true);
     }
     catch (System.Exception ex) {
         exception = ex;
         return(false);
     }
 }
Esempio n. 2
0
 /// <summary>
 /// Deserializes workflow markup into an SiteInformation object
 /// </summary>
 /// <param name="xml">string workflow markup to deserialize</param>
 /// <param name="obj">Output SiteInformation object</param>
 /// <param name="exception">output Exception value if deserialize failed</param>
 /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
 public static bool Deserialize(string xml, out SiteInformation obj, out System.Exception exception)
 {
     exception = null;
     obj       = default(SiteInformation);
     try {
         obj = Deserialize(xml);
         return(true);
     }
     catch (System.Exception ex) {
         exception = ex;
         return(false);
     }
 }
 public static bool LoadFromFile(string fileName, out SiteInformation obj) {
     System.Exception exception = null;
     return LoadFromFile(fileName, out obj, out exception);
 }
 /// <summary>
 /// Deserializes xml markup from file into an SiteInformation object
 /// </summary>
 /// <param name="fileName">string xml file to load and deserialize</param>
 /// <param name="obj">Output SiteInformation object</param>
 /// <param name="exception">output Exception value if deserialize failed</param>
 /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
 public static bool LoadFromFile(string fileName, out SiteInformation obj, out System.Exception exception) {
     exception = null;
     obj = default(SiteInformation);
     try {
         obj = LoadFromFile(fileName);
         return true;
     }
     catch (System.Exception ex) {
         exception = ex;
         return false;
     }
 }
 public static bool Deserialize(string xml, out SiteInformation obj) {
     System.Exception exception = null;
     return Deserialize(xml, out obj, out exception);
 }
 /// <summary>
 /// Deserializes workflow markup into an SiteInformation object
 /// </summary>
 /// <param name="xml">string workflow markup to deserialize</param>
 /// <param name="obj">Output SiteInformation object</param>
 /// <param name="exception">output Exception value if deserialize failed</param>
 /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
 public static bool Deserialize(string xml, out SiteInformation obj, out System.Exception exception) {
     exception = null;
     obj = default(SiteInformation);
     try {
         obj = Deserialize(xml);
         return true;
     }
     catch (System.Exception ex) {
         exception = ex;
         return false;
     }
 }
Esempio n. 7
0
        public override SiteInformation GetSiteInfo()
        {
            var info = new SiteInformation();
            info.SiteServer = new SiteInformationSiteServer();
            info.SiteServer.OperatingSystem = new SiteInformationSiteServerOperatingSystem();
            info.Statistics = new SiteInformationStatistics();

            var props = this.ServerAdmin.GetInformationProperties();
            LogMethodCall("MgServerAdmin::GetInformationProperties", true);

            var prop = props.GetItem(MgServerInformationProperties.DisplayName);
            info.SiteServer.DisplayName = ((MgStringProperty)prop).GetValue();

            prop = props.GetItem(MgServerInformationProperties.OperatingSystemVersion);
            info.SiteServer.OperatingSystem.Version = ((MgStringProperty)prop).GetValue();

            prop = props.GetItem(MgServerInformationProperties.TotalPhysicalMemory);
            info.SiteServer.OperatingSystem.TotalPhysicalMemory = ((MgInt64Property)prop).GetValue().ToString();

            prop = props.GetItem(MgServerInformationProperties.TotalVirtualMemory);
            info.SiteServer.OperatingSystem.TotalVirtualMemory = ((MgInt64Property)prop).GetValue().ToString();

            prop = props.GetItem(MgServerInformationProperties.AvailablePhysicalMemory);
            info.SiteServer.OperatingSystem.AvailablePhysicalMemory = ((MgInt64Property)prop).GetValue().ToString();

            prop = props.GetItem(MgServerInformationProperties.AvailableVirtualMemory);
            info.SiteServer.OperatingSystem.AvailableVirtualMemory = ((MgInt64Property)prop).GetValue().ToString();

            prop = props.GetItem(MgServerInformationProperties.Status);
            info.SiteServer.Status = ((MgBooleanProperty)prop).GetValue() ? "Online" : "Offline";

            prop = props.GetItem(MgServerInformationProperties.ServerVersion);
            info.SiteServer.Version = ((MgStringProperty)prop).GetValue();

            prop = props.GetItem(MgServerInformationProperties.TotalActiveConnections);
            info.Statistics.ActiveConnections = ((MgInt32Property)prop).GetValue().ToString();

            prop = props.GetItem(MgServerInformationProperties.AdminOperationsQueueCount);
            info.Statistics.AdminOperationsQueueCount = ((MgInt32Property)prop).GetValue().ToString();

            prop = props.GetItem(MgServerInformationProperties.AverageOperationTime);
            info.Statistics.AverageOperationTime = ((MgInt64Property)prop).GetValue().ToString();

            prop = props.GetItem(MgServerInformationProperties.ClientOperationsQueueCount);
            info.Statistics.ClientOperationsQueueCount = ((MgInt32Property)prop).GetValue().ToString();

            prop = props.GetItem(MgServerInformationProperties.CpuUtilization);
            info.Statistics.CpuUtilization = ((MgInt32Property)prop).GetValue().ToString();

            prop = props.GetItem(MgServerInformationProperties.SiteOperationsQueueCount);
            info.Statistics.SiteOperationsQueueCount = ((MgInt32Property)prop).GetValue().ToString();

            prop = props.GetItem(MgServerInformationProperties.TotalConnections);
            info.Statistics.TotalConnections = ((MgInt32Property)prop).GetValue().ToString();

            prop = props.GetItem(MgServerInformationProperties.TotalProcessedOperations);
            info.Statistics.TotalOperationsProcessed = ((MgInt32Property)prop).GetValue().ToString();

            prop = props.GetItem(MgServerInformationProperties.TotalReceivedOperations);
            info.Statistics.TotalOperationsReceived = ((MgInt32Property)prop).GetValue().ToString();

            prop = props.GetItem(MgServerInformationProperties.TotalOperationTime);
            info.Statistics.TotalOperationTime = ((MgInt64Property)prop).GetValue().ToString();

            prop = props.GetItem(MgServerInformationProperties.Uptime);
            info.Statistics.Uptime = ((MgInt64Property)prop).GetValue().ToString();

            return info;
        }
Esempio n. 8
0
 public static bool LoadFromFile(string fileName, out SiteInformation obj)
 {
     System.Exception exception = null;
     return(LoadFromFile(fileName, out obj, out exception));
 }
Esempio n. 9
0
 public static bool Deserialize(string xml, out SiteInformation obj)
 {
     System.Exception exception = null;
     return(Deserialize(xml, out obj, out exception));
 }