Ejemplo n.º 1
0
        /// <summary>
        /// Allows the model element to configure itself immediately after the Merge process has related it to the target element.
        /// </summary>
        /// <param name="elementGroup">The group of source elements that have been added back into the target store.</param>
        protected override void MergeConfigure(ElementGroup elementGroup)
        {
            base.MergeConfigure(elementGroup);
            LayerPackage.Level = Level;

            DomainClassInfo.SetUniqueName(this,
                                          StrategyManager.GetInstance(Store).NamingStrategy.CreateLayerName(
                                              LayerPackage, this, Name));
            Namespace =
                StrategyManager.GetInstance(Store).NamingStrategy.CreateNamespace(Component.Namespace, Name, this);

            Layer mainLayer = SoftwareComponent.GetMainLayer();

            if (mainLayer == null)
            {
                mainLayer = SoftwareComponent.SuggestMainLayer(null);
                if (mainLayer == this)
                {
                    mainLayer.StartupProject = true;
                    mainLayer.HostingContext = HostingContext.Standalone;
                }
            }
            else if (mainLayer.Level < Level)
            {
                HostingContext = mainLayer.HostingContext;
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Alerts listeners when the shape is dragged and dropped.
 /// </summary>
 /// <param name="e">The diagram drag event arguments.</param>
 public override void OnDragDrop(DiagramDragEventArgs e)
 {
     base.OnDragDrop(e);
     if (e.Data.GetDataPresent("CF_VSREFPROJECTS"))
     {
         SoftwareComponent component = ModelElement as SoftwareComponent;
         ImportProjectHelper.Import(e.Data.GetData("CF_VSREFPROJECTS"), component, null);
     }
 }