Ejemplo n.º 1
0
 public override void InitializeComInterfaces()
 {
     base.InitializeComInterfaces();
     try
     {
         if (this.serviceLoader == null)
         {
             this.serviceLoader = InteropHelpers.QueryInterface <IVdsServiceLoader>(base.ComUnknown);
         }
     }
     catch (Exception exception)
     {
         if (VdsException.IsFatalException(exception))
         {
             throw;
         }
         throw new VdsException("QueryInterface for IVdsServiceLoader failed.", exception);
     }
 }
Ejemplo n.º 2
0
        private IVdsServiceLoader GetMockVdsServiceLoader()
        {
            IVdsServiceLoader mockObject = null;
            Assembly          assembly   = null;

            try
            {
                assembly = Assembly.Load("Microsoft.Storage.Vds.TestModel, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35");
            }
            catch (Exception exception)
            {
                if (VdsException.IsFatalException(exception))
                {
                    throw;
                }
            }
            Type type = null;

            if (assembly != null)
            {
                type = assembly.GetType("Microsoft.Storage.Vds.TestModel.TmVdsLoader", false);
            }
            if (type != null)
            {
                try
                {
                    IMockObject obj3 = type.InvokeMember("GetInstance", BindingFlags.InvokeMethod, null, null, new object[0], CultureInfo.InvariantCulture) as IMockObject;
                    if (obj3 != null)
                    {
                        mockObject = obj3.GetMockObject() as IVdsServiceLoader;
                    }
                }
                catch (Exception exception2)
                {
                    if (VdsException.IsFatalException(exception2))
                    {
                        throw;
                    }
                }
            }
            return(mockObject);
        }
Ejemplo n.º 3
0
 public void Wait()
 {
     this.asyncWaitHandle.Reset();
     try
     {
         uint             num;
         VDS_ASYNC_OUTPUT vds_async_output;
         this.async.Wait(out num, out vds_async_output);
         this.ReleaseAsyncOutput(vds_async_output);
     }
     catch (Exception exception)
     {
         if (VdsException.IsFatalException(exception))
         {
             throw;
         }
     }
     this.asyncWaitHandle.Set();
     if (this.callback != null)
     {
         this.callback(this);
     }
 }