Exemplo n.º 1
0
 //Constructor
 /// <summary>
 /// Initializes a new instance of the <see cref="health"/> class.
 /// </summary>
 /// <param name="RemoteRunspace">The remote runspace.</param>
 /// <param name="PSCode">The PowerShell code.</param>
 /// <param name="oClient">a CCM Client object.</param>
 public health(Runspace RemoteRunspace, TraceSource PSCode, ccm oClient)
     : base(RemoteRunspace, PSCode)
 {
     remoteRunspace = RemoteRunspace;
     pSCode         = PSCode;
     baseClient     = oClient;
 }
Exemplo n.º 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="agentproperties"/> class.
 /// </summary>
 /// <param name="RemoteRunspace">The remote runspace.</param>
 /// <param name="PSCode">The ps code.</param>
 /// <param name="oClient">The CCM client object.</param>
 public agentproperties(Runspace RemoteRunspace, TraceSource PSCode, ccm oClient)
     : base(RemoteRunspace, PSCode)
 {
     remoteRunspace = RemoteRunspace;
     pSCode         = PSCode;
     baseClient     = oClient;
 }
Exemplo n.º 3
0
 //Constructor
 /// <summary>
 /// Initializes a new instance of the <see cref="Class_Template"/> class.
 /// </summary>
 /// <param name="RemoteRunspace">The remote runspace.</param>
 /// <param name="PSCode">The PowerShell code.</param>
 /// <param name="oClient">A ccm client object.</param>
 public Class_Template(Runspace RemoteRunspace, TraceSource PSCode, ccm oClient)
     : base(RemoteRunspace, PSCode)
 {
     remoteRunspace = RemoteRunspace;
     pSCode         = PSCode;
     baseClient     = oClient;
 }
Exemplo n.º 4
0
 public locationservices(Runspace RemoteRunspace, TraceSource PSCode, ccm oClient)
     : base(RemoteRunspace, PSCode)
 {
     remoteRunspace = RemoteRunspace;
     pSCode         = PSCode;
     baseClient     = oClient;
 }
Exemplo n.º 5
0
        /// <summary>
        /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
        /// </summary>

        /*
         * public new void Dispose()
         * {
         *  if (remoteRunspace != null)
         *      remoteRunspace.Dispose();
         *  if (baseClient != null)
         *      baseClient.Dispose();
         *  AsynchronousScript = null;
         * }*/

        //Constructor
        /// <summary>
        /// Initializes a new instance of the <see cref="monitoring"/> class.
        /// </summary>
        /// <param name="RemoteRunspace">The remote runspace.</param>
        /// <param name="PSCode">The PowerShell code.</param>
        /// <param name="oClient">A CCM Client object.</param>
        public monitoring(Runspace RemoteRunspace, TraceSource PSCode, ccm oClient)
            : base(RemoteRunspace, PSCode)
        {
            remoteRunspace     = RemoteRunspace;
            pSCode             = PSCode;
            baseClient         = oClient;
            AsynchronousScript = new runScriptAsync(RemoteRunspace, pSCode);
        }
Exemplo n.º 6
0
            //Constructor
            /// <summary>
            /// Initializes a new instance of the <see cref="CCM_InstalledComponent"/> class.
            /// </summary>
            /// <param name="WMIObject">A WMI object.</param>
            /// <param name="RemoteRunspace">The remote runspace.</param>
            /// <param name="PSCode">The PowerShell code.</param>
            /// <param name="oClient">A CCM Client object.</param>
            public CCM_InstalledComponent(PSObject WMIObject, Runspace RemoteRunspace, TraceSource PSCode, ccm oClient)
            {
                remoteRunspace = RemoteRunspace;
                pSCode         = PSCode;

                this.__CLASS                 = WMIObject.Properties["__CLASS"].Value as string;
                this.__NAMESPACE             = WMIObject.Properties["__NAMESPACE"].Value as string;
                this.__RELPATH               = WMIObject.Properties["__RELPATH"].Value as string;
                this.__INSTANCE              = true;
                this.WMIObject               = WMIObject;
                this.DisplayName             = WMIObject.Properties["DisplayName"].Value as String;
                this.DisplayNameResourceFile = WMIObject.Properties["DisplayNameResourceFile"].Value as String;
                this.DisplayNameResourceID   = WMIObject.Properties["DisplayNameResourceID"].Value as UInt32?;
                this.Name    = WMIObject.Properties["Name"].Value as String;
                this.Version = WMIObject.Properties["Version"].Value as String;

                try
                {
                    //Disable Tracing
                    PSCode.Switch.Level = SourceLevels.Off;

                    this.Enabled = oClient.Components.ComponentClientConfig.First(t => t.ComponentName == this.Name).Enabled;
                }
                catch
                {
                    this.Enabled        = false;
                    PSCode.Switch.Level = SourceLevels.All;
                }

                PSCode.Switch.Level = SourceLevels.All;
            }