public int EstimateRemainingItemsCount (IEnumerationContext context)
		{
			var filter = context.Filter.Value as CimEnumerationFilter;
			if (filter != null) {
				using (CimEnumerator enumerator = new CimEnumerator(IsLocal))
				{
					return enumerator.GetCount(OperationContextProxy.Current.UserName, "", filter.Namespace, filter.Filter);
				}
			}
			return 0;
		}
        public NativeCimInstance InvokeMethod(string namespaceName, string className, string methodName, NativeCimInstance instance, NativeCimInstance inSignature)
        {
            var classObj = new System.Management.ManagementClass(string.Format("//./{0}/{1}", namespaceName, className));
            var inObj    = classObj.GetMethodParameters(className);

            inObj.Properties["CommandLine"].Value = "notepad.exe";
            var result   = classObj.InvokeMethod(methodName, inObj, new System.Management.InvokeMethodOptions());
            var endpoint = CimEnumerator.ToEndointAddress(result, true);

            return(CimEnumerationHelper.CreateInstance(endpoint));
        }
		public System.Collections.Generic.IEnumerable<object> Enumerate (IEnumerationContext context)
		{
			var filter = context.Filter.Value as CimEnumerationFilter;
			if (filter != null) {
				using (CimEnumerator enumerator = new CimEnumerator(IsLocal))
				{
					return enumerator.Get (OperationContextProxy.Current.UserName, "", filter.Namespace, filter.Filter);
				}
			}
			throw new NotImplementedException ();
		}
Example #4
0
        public int EstimateRemainingItemsCount(IEnumerationContext context)
        {
            var filter = context.Filter.Value as CimEnumerationFilter;

            if (filter != null)
            {
                using (CimEnumerator enumerator = new CimEnumerator(IsLocal))
                {
                    return(enumerator.GetCount(OperationContextProxy.Current.UserName, "", filter.Namespace, filter.Filter));
                }
            }
            return(0);
        }
Example #5
0
        public System.Collections.Generic.IEnumerable <object> Enumerate(IEnumerationContext context)
        {
            var filter = context.Filter.Value as CimEnumerationFilter;

            if (filter != null)
            {
                using (CimEnumerator enumerator = new CimEnumerator(IsLocal))
                {
                    return(enumerator.Get(OperationContextProxy.Current.UserName, "", filter.Namespace, filter.Filter));
                }
            }
            throw new NotImplementedException();
        }