Exemple #1
0
        /// <summary>
        /// Update all layers.
        /// </summary>
        public void updateAllLayers()
        {
            try
            {
                if (_document is CadKit.Interfaces.ILayerList)
                {
                    CadKit.Interfaces.ILayerList layerList = (CadKit.Interfaces.ILayerList)_document;

                    object[] layers = layerList.Layers;
                    for (int i = 0; i < layers.Length; ++i)
                    {
                        CadKit.Interfaces.ILayer layer = layers[i] as CadKit.Interfaces.ILayer;

                        if (null != layer)
                        {
                            layerList.modifyLayer(layer, this);
                            //_listBox.Items[i].Text = layer.Name;
                        }
                    }
                }
            }
            catch (System.Exception exception)
            {
                System.Console.WriteLine("Error 394702580: Exception caught while trying to update layers.");
                System.Console.WriteLine("Message: {0}", exception.Message);
            }
        }
Exemple #2
0
        /// <summary>
        /// Update only layers that are selected.
        /// </summary>
        public void updateSelectedLayers()
        {
            try
            {
                if (_document is CadKit.Interfaces.ILayerList)
                {
                    CadKit.Interfaces.ILayerList layerList = (CadKit.Interfaces.ILayerList)_document;

                    CadKit.Interfaces.ILayer layer = this._getLayer(_treeView.SelectedNode);
                    if (null != layer)
                    {
                        layerList.modifyLayer(layer, this);
                    }
                }
            }
            catch (System.Exception exception)
            {
                System.Console.WriteLine("Error 2700916252: Exception caught while trying to update layer(s).");
                System.Console.WriteLine("Message: {0}", exception.Message);
            }
        }