Esempio n. 1
0
        public void Init(ISnapInPlatform snapInPlatform)
        {
            DirectoryInfo snapInsDir = new DirectoryInfo(this.setup.Local);
            AppDomain appDomain = null;
            AppDomainSetup appDomainSetup = null;
            XmlDocument xmldoc = null;
            foreach (DirectoryInfo snapInDir in snapInsDir.GetDirectories())
            {   
                xmldoc = new XmlDocument();
                xmldoc.Load(Path.Combine(snapInDir.FullName, "info.xml"));

                IDictionary<string, string> infoTable = new Dictionary<string, string>();
                foreach (XmlNode xmlNode in xmldoc.DocumentElement)
                {
                    infoTable.Add(xmlNode.Name, xmlNode.InnerText);
                }
                appDomainSetup = new AppDomainSetup();
                appDomainSetup.ApplicationBase = snapInDir.FullName;

                appDomain = AppDomain.CreateDomain("SNAPIN_" + infoTable["name"], null, appDomainSetup);
                IClassLibraryServices classLiberary = appDomain.CreateInstanceAndUnwrap("Microsoft.ManagementConsole",
                "Microsoft.ManagementConsole.Internal.ClassLibraryServices",
                        false,
                        BindingFlags.NonPublic | BindingFlags.Instance,
                        null, null, null, null, null) as IClassLibraryServices;

                ISnapInClient snapInClient = classLiberary.CreateSnapIn(infoTable["assemblyName"], infoTable["class"]);
                snapInClient.Initialize(snapInPlatform);

                this.snapInClients.Add(infoTable["guid"], snapInClient);
            }
        }
Esempio n. 2
0
 internal void Initialize(ISnapInPlatform platform)
 {
     if (platform == null)
     {
         throw new ArgumentNullException("platform");
     }
     this._dialogHost.Initialize(platform);
 }
Esempio n. 3
0
 void ISnapInClient.Initialize(ISnapInPlatform snapInPlatform)
 {
     SynchronizationContextCache.RestoreOriginalContext();
     this._snapInPlatform = snapInPlatform;
     if (this._onInitialized != null)
     {
         this._onInitialized();
     }
 }
Esempio n. 4
0
 public void Initialize(ISnapInPlatform snapInPlatform)
 {
     lock (this.SyncRoot)
     {
         this._snapInPlatform = snapInPlatform;
         foreach (uint num in this._registeredThreadIds)
         {
             this.RegisterThreadWithExecutive(num, true);
         }
         this._registeredThreadIds.Clear();
     }
 }
Esempio n. 5
0
 public void Initialize(ISnapInPlatform snapInPlatform)
 {
     if (snapInPlatform == null)
     {
         throw new ArgumentNullException("snapInPlatform");
     }
     AsyncDelegate[] array = null;
     lock (this.SyncRoot)
     {
         this._snapInPlatform = snapInPlatform;
         array = new AsyncDelegate[this._pendingDelegates.Values.Count];
         this._pendingDelegates.Values.CopyTo(array, 0);
         this._pendingDelegates.Clear();
     }
     if (array != null)
     {
         foreach (AsyncDelegate delegate2 in array)
         {
             delegate2.Execute(false);
         }
     }
 }
Esempio n. 6
0
 internal void InitializeTestSnapInPlatform(Delegate processCommandCallback)
 {
     this._snapInPlatform = new TestSnapInPlatform(processCommandCallback);
 }
Esempio n. 7
0
 internal void Initialize(ISnapInPlatform snapInPlatform)
 {
     if (this._snapInPlatform != null)
     {
         throw new Exception(Microsoft.ManagementConsole.Internal.Utility.LoadResourceString(Microsoft.ManagementConsole.Internal.Strings.NodeSyncManagerNotInitialized));
     }
     if (snapInPlatform == null)
     {
         throw new ArgumentNullException(Microsoft.ManagementConsole.Internal.Utility.LoadResourceString(Microsoft.ManagementConsole.Internal.Strings.NodeSyncManagerInitializeNullPlatform));
     }
     this._snapInPlatform = snapInPlatform;
     this._initialized = true;
 }
Esempio n. 8
0
 internal void SetSnapInPlatform(ISnapInPlatform snapInPlatform, int dataObjectId)
 {
     this._snapInPlatform = snapInPlatform;
     this._dataObjectId = dataObjectId;
 }