示例#1
0
        private void panel4_MouseClick(object sender, MouseEventArgs e) //Link
        {
            MultipurposePopup LinkPopUp = new MultipurposePopup("Paste the URL here:", "Link:", true);
            string            s         = "";

            if (LinkPopUp.ShowDialog() == DialogResult.OK)
            {
                s = LinkPopUp.MyText;
                UploadEvent?.Invoke(s, s, null, null, "true", "false", null);
            }
            else
            {
                return;
            }
        }
示例#2
0
        private void DeleteClass(object sender, EventArgs e)
        {
            MultipurposePopup AreYouSure = new MultipurposePopup("This will delete all Files for this class. Are you sure?", "", false);
            var Result = AreYouSure.ShowDialog();

            if (Result == DialogResult.OK)
            {
                this?.Invoke((NoArgDelegate)BeginLoading);
                //ControlHelper.SuspendDrawing(ResourcePanel);
                //ControlHelper.SuspendDrawing(ClassesPanel);
                MenuItem MenuSender = (MenuItem)sender;
                string   DeleteName = MenuSender.Name;
                ClassClick?.Invoke(DeleteName);
                Thread t = new Thread(() => DeleteClassHelper(DeleteName));
                t.Start();
            }
        }
示例#3
0
        /// <summary>
        /// %BG - 0
        /// %DB - 1
        /// %DP - 2
        /// %_G - 3
        /// %LB - 4
        /// %LP - 5
        /// %_O - 6
        /// %_P - 7
        /// %_R - 8
        /// %_Y - 9
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void AddClassClick(object sender, EventArgs e)
        {
            MultipurposePopup ClassNamePopUp = new MultipurposePopup("Choose a class name.", "Class:", true);
            var Result = ClassNamePopUp.ShowDialog();

            if (Result == DialogResult.OK)
            {
                string Extension = GetNextColor();
                CurrentClass = ClassNamePopUp.MyText + Extension;
                //DeleteSempahore.Release();
                ResourcePanel.BackgroundImage = System.Drawing.Image.FromFile(GetBackImage(CurrentClass));
                ClassClick?.Invoke(CurrentClass);
                CurrentClassLabel.Text = CurrentClass.Substring(0, CurrentClass.Length - 3);
                AllClasses.Add(CurrentClass);
                ClassesMediator.Controls.Clear();
                UpdateClasses(AllClasses);
                Thread.Sleep(500); //Give ClassClick time to finish.
                UploadEvent?.Invoke("_Placeholder to keep new class on server", "_Class_Foot_In_Door", null, null, "true", "false", null);
            }
        }
示例#4
0
        private void UnitMenuItemClick(object sender, EventArgs e) //refering to the right click context menu for resources.
        {
            MenuItem CurrentMenu = (MenuItem)sender;
            string   Name        = CurrentMenu.Parent.Name;

            ResourceData CurrentResource = null;

            foreach (ResourceData R in CurrentResources)
            {
                if (R.Name.Equals(Name))
                {
                    CurrentResource = R;
                    break;
                }
            }
            if (CurrentMenu.Text.Equals("New Unit..."))
            {
                //Perform add unit.
                MultipurposePopup UnitSelector = new MultipurposePopup("", "Unit:", true);
                var Result = UnitSelector.ShowDialog();
                if (Result == DialogResult.OK)
                {
                    string FullUnitName = GetUnitPlusExt(UnitSelector.MyText);
                    TempOldResource          = CurrentResource;
                    TempUpdatedResource      = CurrentResource.Clone();
                    TempUpdatedResource.Unit = FullUnitName;
                    CurrentResources.Remove(CurrentResource);
                    UpdateResourceEvent?.Invoke(CurrentResource.Name, GetIsLinkFromR(CurrentResource), null, null, null, FullUnitName, CurrentResource.Type, CurrentResource.Comments);
                    return;
                }
                else
                {
                    return;
                }
            }
            TempOldResource          = CurrentResource;
            TempUpdatedResource      = CurrentResource.Clone();
            TempUpdatedResource.Unit = CurrentMenu.Name;
            CurrentResources.Remove(CurrentResource);
            UpdateResourceEvent?.Invoke(CurrentResource.Name, GetIsLinkFromR(CurrentResource), null, null, null, CurrentMenu.Name, CurrentResource.Type, CurrentResource.Comments);
        }