Exemple #1
0
 public void ReleasePopWindow(PopWindow window)
 {
     pops.Remove(window);
     if (currentPop == window)
     {
         currentPop = null;
     }
     window.Dispose();
 }
            public void LoadPopWindow <T>() where T : PopWindow, new()
            {
                if (window != null)
                {
                    window.Dispose();
                }
                var t = new T();

                t.Initial(Content.transform, null);
                t.ReSize();
                window = t;
            }
Exemple #3
0
 public void ReleasePopWindow(PopWindow window)
 {
     pops.Remove(window);
     if (currentPop == window)
     {
         currentPop = null;
         if (mask != null)
         {
             mask.SetActive(false);
         }
     }
     window.Dispose();
 }
Exemple #4
0
        public void LoadPopWindow <T>() where T : PopWindow, new()
        {
            if (window != null)
            {
                window.Dispose();
            }
            var t = new T();

            t.Initial(model, null);
            t.model.data.sizeDelta = model.data.sizeDelta;
            t.model.IsChanged      = true;
            t.ReSize();
            window = t;
        }
 public void AddNewItems()
 {
     DetermineItemStatus();
     try
     {
         if (LBName.Text != "")
         {
             if (LBTitle.Text == "Bicycle")
             {
                 PopulateBikeDataTable();
                 if (LBID.Text != null)
                 {
                     TBikeDAL      MyDAL = new TBikeDAL();
                     ConfirmWindow con   = new ConfirmWindow(ImageType.Question, "Are you sure to add new data?", "Confirmation", "Yes", "No");
                     con.ShowDialog();
                     if (con.Confirmed)
                     {
                         MyDAL.AddBicycleTable(TBName.Text, TBType.Text, Convert.ToInt32(TBQuantity.Text), Convert.ToDouble(TBPrice.Text), TBColor.Text, TLUsername.Text);
                         PopulateBikeDataTable();
                     }
                 }
             }
             else if (LBTitle.Text == "Snacks")
             {
                 PopulateSnackDataTable();
                 TBikeDAL      MyDAL = new TBikeDAL();
                 ConfirmWindow con   = new ConfirmWindow(ImageType.Question, "Confirmation", "Are you sure to add new data?", "Add Please", "No, don't add please");
                 con.ShowDialog();
                 if (con.Confirmed)
                 {
                     MyDAL.AddSnackTable(TBName.Text, TBType.Text, Convert.ToDouble(TBPrice.Text), Convert.ToInt32(TBColor.Text), TLUsername.Text);
                     PopulateSnackDataTable();
                 }
             }
         }
         else
         {
             PopWindow con = new PopWindow(ImageType.Error, "No field", "Please fill in all", "OK");
             con.ShowDialog();
         }
     }
     catch (Exception ex)
     {
         PopWindow pop = new PopWindow(ImageType.Information, "Error", ex.Message, "I will Fix this");
         pop.ShowDialog();
         pop.Dispose();
     }
 }