示例#1
0
文件: Node.cs 项目: SiteView/ECC8.13
 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);
 }
示例#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);
            }
        }