public void ribCB_Basislayer_Initialized(object sender, EventArgs e) { RibbonCombo ribCombo = (RibbonCombo)sender; myRegistry.regIO objRegistry = new myRegistry.regIO(); string Basislayer = (string)objRegistry.readValue("blocks", "Basislayer"); //Basislayer myAutoCAD.myLayer objLayer = myAutoCAD.myLayer.Instance; objLayer.refresh(); objLayer.checkLayer(Basislayer, true); foreach (LayerTableRecord ltr in objLayer.lsLayerTableRecord) { string layName = ltr.Name; if (layName.Length > 2) { if (layName.Substring(layName.Length - 2, 2) == "-P") { RibbonLabel ribLabel = new RibbonLabel(); ribLabel.Text = layName; ribCombo.Items.Add(ribLabel); if (ribLabel.Text == Basislayer) { ribCombo.Current = ribLabel; } } } } }
//Events void Application_OnIdle(object sender, EventArgs e) { // Remove the event when it is fired Application.Idle -= new EventHandler(Application_OnIdle); // Add our Quick Access Toolbar item addRessourceTab(); //prüfen, ob App registriert ist myRegistry.regIO objRegIO = new myRegistry.regIO(); string Basislayer; if ((Basislayer = (string)objRegIO.readValue("blocks", "Basislayer")) == null) { myRegistry.regApp.register(); } //Basislayer prüfen bzw. erzeugen myAutoCAD.myLayer objLayer = myAutoCAD.myLayer.Instance; objLayer.checkLayer(Basislayer, true); }