public void CopyTo (QualifierData [] qualifierArray, int index)
		{
			throw new NotImplementedException ();
		}
Ejemplo n.º 2
0
		public void CopyTo(QualifierData[] qualifierArray, int index)
		{
			this.CopyTo(qualifierArray, index);
		}
Ejemplo n.º 3
0
        private bool IncludeQualifier(QualifierData qualifier)
        {
            if (qualifier.Name.Equals("CIMTYPE", StringComparison.InvariantCultureIgnoreCase))
                return false;

            return true;
        }
Ejemplo n.º 4
0
		/// <summary>
		/// <para>Copies the <see cref='System.Management.QualifierDataCollection'/> into a specialized 
		/// <see cref='System.Management.QualifierData'/> 
		/// array.</para>
		/// </summary>
		/// <param name='qualifierArray'><para>The specialized array of <see cref='System.Management.QualifierData'/> objects 
		/// to which to copy the <see cref='System.Management.QualifierDataCollection'/>.</para></param>
		/// <param name=' index'>The index from which to start copying.</param>
		public void CopyTo(QualifierData[] qualifierArray, int index)
		{
			CopyTo((Array)qualifierArray, index);
		}
Ejemplo n.º 5
0
        private String GetQualifierStringValue(QualifierData qualifier, Int32 lineoffset)
        {
            /*
             * Print each word unless it exceeds MAX_LINE_LEN
             */
            var sb = new StringBuilder();
            String[] values;

            // Expand value to a array
            if (qualifier.Value.GetType().IsArray)
                values = (String[])qualifier.Value;
            else
                values = new String[] { (String) qualifier.Value };

            if (qualifier.Value.GetType().IsArray)
                sb.Append("{");
            else
                sb.Append("(");

            // Print each value
            for (int i = 0; i < values.Length; i++)
            {
                sb.Append(@"""");
                int c = 0;
                int l = 0;

                // Escape characters
                values[i] = new StringBuilder(values[i])
                    .Replace("\\", "\\\\")
                    .Replace("\r", @"\r")
                    .Replace("\n", @"\n")
                    .Replace("\"", "\"\"")
                    .ToString();

                // Get index of the end of the next word
                while (c < values[i].Length)
                {

                    int nextc = 1 + values[i].IndexOfAny(new char[] { ' ', ',', '.', '\r', '\n' }, c);
                    if (nextc == 0)
                        nextc = values[i].Length;

                    if (l < MAX_LINE_LEN)
                    {
                        l += nextc - c;
                        sb.Append(values[i].Substring(c, nextc - c));
                    }
                    else
                    {
                        l = nextc - c;
                        sb.AppendFormat("\"\r\n    \"{0}", values[i].Substring(c, nextc - c));
                    }

                    c = nextc;
                }

                sb.Append(@"""");

                if (i < values.Length - 1)
                    sb.Append(",");

                lineoffset = 0;
            }

            if (qualifier.Value.GetType().IsArray)
                sb.Append("}");
            else
                sb.Append(")");

            return sb.ToString();
        }