Example #1
0
 internal void Initialize(NodeData data)
 {
     this.Data = data;
     this._snapIn = SnapInBase.SnapInInstance as NamespaceSnapInBase;
     if (this._snapIn == null)
     {
         throw new Exception(Microsoft.ManagementConsole.Internal.Utility.FormatResourceString(Microsoft.ManagementConsole.Internal.Strings.ExceptionCommonWrongThread, new object[] { "Node" }));
     }
     if (_idCounter == 0x7fffffff)
     {
         TraceSources.ExecutiveSource.TraceEvent(TraceEventType.Error, 12, "The max value for Node identifiers has been reached; no new nodes can be created.");
         throw new Exception(Microsoft.ManagementConsole.Internal.Utility.LoadResourceString(Microsoft.ManagementConsole.Internal.Strings.ExceptionMMCOutOfResources));
     }
     this.Data.Id = Interlocked.Increment(ref _idCounter);
 }
Example #2
0
        public static void BuildImageIndex(NamespaceSnapInBase snapin)
        {
            // wipe module
            imageIndex = new Dictionary<string, int>();
            Dictionary<string, Image> images = WipeModule.ActionImages;

            foreach(KeyValuePair<string, Image> kvp in images) {
                imageIndex.Add(kvp.Key, snapin.SmallImages.Count);
                snapin.SmallImages.Add(kvp.Value);
            }

            // schedule module
            images = ScheduleModule.ActionImages;

            foreach(KeyValuePair<string, Image> kvp in images) {
                imageIndex.Add(kvp.Key, snapin.SmallImages.Count);
                snapin.SmallImages.Add(kvp.Value);
            }
        }