Exemplo n.º 1
0
 public void drawTasks() // Scrum formu yüklenirken task componentlerini çizmek için kullanıyoruz.
 {
     foreach (Task task in userStory.TaskList)
     {
         TaskTool taskTool = new TaskTool();
         taskTool.MouseDown           += _MouseDown;
         taskTool.Cursor               = Cursors.Hand;
         taskTool.txttaskAciklama.Text = task.Description;
         taskTool.txtKisi.Text         = task.Kisi;
         taskTool.dtpsonTarih.Text     = task.SonTarih;
         taskTool.lblID.Text          += "#" + task.ID.ToString(); // ID veriyoruz.
         TaskToolList.Add(taskTool);
         taskTool.location = task.location;
         if (task.location == 1)
         {
             pnlNotStarted.Controls.Add(taskTool);
         }
         else if (task.location == 2)
         {
             pnlInProgress.Controls.Add(taskTool);
         }
         else if (task.location == 3)
         {
             pnlAccTest.Controls.Add(taskTool);
         }
         else
         {
             pnlDone.Controls.Add(taskTool);
         }
     }
 }
Exemplo n.º 2
0
 private void btntaskEkle_Click(object sender, EventArgs e)
 {
     if (TaskToolList.Count < 4)
     {
         // Ekle butonuna basıldığı anda yeni bir TaskTool componenti yaratıp draq drop desteklemesi için ilgili method atamasını sağlıyoruz.
         TaskTool tt    = new TaskTool();
         Task     added = userStory.TaskEkle(null);
         tt.MouseDown  += _MouseDown;
         tt.Cursor      = Cursors.Hand; // componentin üzerine gelindiğinde el simgesinin çıkmasını sağlıyoruz.
         tt.lblID.Text += "#" + added.ID.ToString();
         TaskToolList.Add(tt);
         pnlNotStarted.Controls.Add(tt);
         // yeni eklenen TaskTool'u direk olarak pnlNotStarted 'a ekliyoruz.
     }
 }
Exemplo n.º 3
0
        private TaskTool findCorrespondingTaskTool(string text)
        {
            // Drag drop esnasında sürüklenilen TaskTool'un hash code propertysinden faydalanarak ilgili TaskToolu bulup drop yapılacak yere
            //gönderiyoruz.
            TaskTool ours = null;

            foreach (TaskTool taskTool in this.TaskToolList)
            {
                if (taskTool.GetHashCode().ToString() == text)
                {
                    ours = taskTool;
                    break;
                }
            }
            return(ours);
        }
Exemplo n.º 4
0
        private void _DragDrop(object sender, DragEventArgs e)
        {
            // DoDragDrop methoduna text olarak hashCode vermiştik bu kodun gerçekte hangi TaskTool'a ait olduğunu bulmak için bir method çağırıyoruz.
            // İlgili component bulunduktan sonra sender parametresine göre taskTool'un location property'sini dinamik olarak her drop işleminden sonra
            // değiştiriyoruz. Bu bize task'leri yeniden yazdırırken ilgili panele yazmamızda yardımcı oluyor.
            FlowLayoutPanel temp     = (FlowLayoutPanel)sender;
            string          text     = e.Data.GetData(DataFormats.Text).ToString();
            TaskTool        taskTool = findCorrespondingTaskTool(text);

            try
            {
                if (temp == pnlNotStarted)
                {
                    taskTool.location = 1;
                }
                else if (temp == pnlInProgress)
                {
                    taskTool.location = 2;
                }
                else if (temp == pnlAccTest)
                {
                    taskTool.location = 3;
                }
                else
                {
                    taskTool.location = 4;
                }
            }
            catch (NullReferenceException f)
            {
                MessageBox.Show("İlgili taski ait olmadığı User Story'e taşıyamazsınız.");
            }

            if (temp.Controls.Count < 4)
            {
                temp.Controls.Add(taskTool);
            }
        }
Exemplo n.º 5
0
        private void _MouseDown(object sender, MouseEventArgs e)
        {
            TaskTool temp = (TaskTool)sender;

            temp.DoDragDrop(temp.GetHashCode().ToString(), DragDropEffects.All);
        }