Exemplo n.º 1
0
        /// <ToBeCompleted></ToBeCompleted>
        public void AddLayer(Diagram diagram, string layerName)
        {
            if (diagram == null)
            {
                throw new ArgumentNullException("diagram");
            }
            if (layerName == null)
            {
                throw new ArgumentNullException("layerName");
            }
            AssertDiagramSetControllerIsSet();
            if (diagram.Layers.FindLayer(layerName) != null)
            {
                throw new NShapeException("Layer name '{0}' already exists.", layerName);
            }
            Command cmd = new AddLayerCommand(diagram, layerName);

            Project.ExecuteCommand(cmd);
            if (LayersAdded != null)
            {
                LayersAdded(this, LayerHelper.GetLayersEventArgs(LayerHelper.GetLayers(layerName, diagram)));
            }
        }
Exemplo n.º 2
0
		/// <ToBeCompleted></ToBeCompleted>
		public void AddLayer(Diagram diagram, string layerName)
		{
			if (diagram == null) throw new ArgumentNullException("diagram");
			if (layerName == null) throw new ArgumentNullException("layerName");
			AssertDiagramSetControllerIsSet();
			if (diagram.Layers.FindLayer(layerName) != null)
				throw new NShapeException("Layer name '{0}' already exists.", layerName);
			Command cmd = new AddLayerCommand(diagram, layerName);
			Project.ExecuteCommand(cmd);
			if (LayersAdded != null)
				LayersAdded(this, LayerHelper.GetLayersEventArgs(LayerHelper.GetLayers(layerName, diagram)));
		}
Exemplo n.º 3
0
 private void InitCommands()
 {
     AddLayerCommand           = new AddLayerCommand(this);
     ShowLayerSelectionCommand = new ShowLayerSelectionCommand(this);
 }