Ejemplo n.º 1
0
        private void OpenScheduledTaskFile()
        {
            ScheduledTaskDte dte = new ScheduledTaskDte(ModelElement.Store);

            var scheduledTask = ModelElement as BaseScheduledTask;

            if (scheduledTask != null)
            {
                if (scheduledTask.Type == TaskType.CSharp)
                {
                    dte.DiagramContainerProject.OpenClass(scheduledTask.Id, this.ParentShape.ModelElement.Id);
                }
                else
                {
                    dte.DiagramContainerProject.OpenSql(scheduledTask.Id, this.ParentShape.ModelElement.Id);
                }
            }
        }
Ejemplo n.º 2
0
        public void CreateScheduledTaskFile(Microsoft.VisualStudio.Modeling.ModelElement scheduledTaskElement)
        {

            ScheduledTaskDte dte = new ScheduledTaskDte(scheduledTaskElement.Store);

            var scheduledTask = scheduledTaskElement as BaseScheduledTask;

            if (scheduledTask != null)
            {
                if (scheduledTask.Type == TaskType.CSharp)
                {
                    dte.DiagramContainerProject.AddClass(scheduledTask.Id, this.ModelElement.Id);
                }
                else
                {
                    dte.DiagramContainerProject.AddSql(scheduledTask.Id, this.ModelElement.Id);
                }
            }
        }
Ejemplo n.º 3
0
        protected override void OnDeleting()
        {
            base.OnDeleting();

            if (ModelElement == null) return;

            var scheduledTask = ModelElement as BaseScheduledTask;

            if (scheduledTask == null)
                return;

            ScheduledTaskDte dte = new ScheduledTaskDte(ModelElement.Store);

            if (scheduledTask.Type == TaskType.CSharp)
            {
                dte.DiagramContainerProject.RemoveClass(scheduledTask.Id, this.ParentShape.ModelElement.Id);
            }
            else
            {
                dte.DiagramContainerProject.RemoveSql(scheduledTask.Id, this.ParentShape.ModelElement.Id);
            }
        }