Exemple #1
0
        public async Task <InvokedResult> SaveColorFormAsync(ColorForm colorForm)
        {
            DbContext.Set <ColorForm>().AddOrUpdate(colorForm);
            await DbContext.SaveChangesAsync();

            return(InvokedResult.SucceededResult);
        }
 public OpenFileStripCommand(IAppState appState, MainForm mainForm, ColorForm colorForm, OpenFileDialog openFileDialog, ICommsPort commsPort) : base(appState)
 {
     _mainForm       = mainForm;
     _colorForm      = colorForm;
     _commsPort      = commsPort;
     _openFileDialog = openFileDialog;
 }
Exemple #3
0
 public UploadColorsStripCommand(IAppState appState, ColorForm colorForm, IColorTarget colorTarget, ICommsPort commsPort)
     : base(appState)
 {
     _commsPort   = commsPort;
     _colorForm   = colorForm;
     _colorTarget = colorTarget;
 }
Exemple #4
0
        private void colorSelectToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ColorForm frm = new ColorForm();

            frm.Show();
            mode_select(4);
        }
Exemple #5
0
 private void цвToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (!hasChilds)
     {
         hasChilds = true;
         ColorForm subform = new ColorForm(this);
         subform.Show();
     }
 }
        private void ColorButton_Click(object sender, EventArgs e)
        {
            var form = new ColorForm
            {
                MdiParent     = this,
                StartPosition = FormStartPosition.CenterScreen
            };

            form.Show();
        }
Exemple #7
0
        public async Task <JsonResult> EditColorForm(ColorForm colorForm)
        {
            if (!ModelState.IsValid)
            {
                return(Json(false, data: ErrorToDictionary()));
            }

            var manager = new BasicDataManager(User);
            var result  = await manager.SaveColorFormAsync(colorForm);

            return(Json(result));
        }
        public void CurrentPlayerThrowsCard(Card card)
        {
            var itemToRemove = myHand.FirstOrDefault(u => u.Color == card.Color && u.Number == card.Number);

            myHand.Remove(itemToRemove);
            ThrowCardOnTheField(card);

            switch (card.Type)
            {
            case "SkippingCard":     //Skiping card
            {
                NextPlayer();
                break;
            }

            case "ReversingCard":     //Reverse card
            {
                ChangeReverse();
                break;
            }

            case "BuyingCard":     //Buying card
            {
                NextPlayerBuy(card.Buy);
                break;
            }

            case "ChangingCard":
            {
                using (var form = new ColorForm())
                {
                    var result = form.ShowDialog();
                    if (result == DialogResult.OK)
                    {
                        SetFieldColor(form.ReturnColor);
                    }
                    else
                    {
                        SetFieldColor(0);
                    }
                }
                break;
            }

            default:
            {
                break;
            }
            }

            NextPlayer();
        }
Exemple #9
0
        public MainForm()
        {
            InitializeComponent();
            CommonFunction.RegisterMarkTargetDelegate(MarkTargetLine);
            ReplaceForm.RegisterReplaceTargetDelegate(ReplaceTarget);
            GoToForm.RegisterGoToLineDelegate(GoToLine);
            EncryptForm.RegisterEncryptDelegate(EncryptText);
            FontForm.RegisterFontDelegate(ChangeFont);
            ColorForm.RegisterColorDelegate(ChangeColor);

            ContextMenuStrip cms = new ContextMenuStrip();

            ToolStripMenuItem undo = new ToolStripMenuItem("Undo");

            undo.Name   = undo.Text;
            undo.Click += new EventHandler(toolStrip_Undo_Click);
            cms.Items.Add(undo);
            ToolStripMenuItem redo = new ToolStripMenuItem("Redo");

            redo.Name   = redo.Text;
            redo.Click += new EventHandler(toolStrip_Redo_Click);
            cms.Items.Add(redo);
            cms.Items.Add(new ToolStripSeparator());

            ToolStripMenuItem cut = new ToolStripMenuItem("Cut");

            cut.Name   = cut.Text;
            cut.Click += new EventHandler(toolStrip_Cut_Click);
            cms.Items.Add(cut);
            ToolStripMenuItem copy = new ToolStripMenuItem("Copy");

            copy.Name   = copy.Text;
            copy.Click += new EventHandler(toolStrip_Copy_Click);
            cms.Items.Add(copy);
            ToolStripMenuItem paste = new ToolStripMenuItem("Paste");

            paste.Name   = paste.Text;
            paste.Click += new EventHandler(toolStrip_Paste_Click);
            cms.Items.Add(paste);
            cms.Items.Add(new ToolStripSeparator());

            ToolStripMenuItem selectAll = new ToolStripMenuItem("Select All");

            selectAll.Name   = selectAll.Text;
            selectAll.Click += new EventHandler(toolStrip_SelectAll_Click);
            cms.Items.Add(selectAll);

            cms.Opening += new CancelEventHandler(ContextMenuStrip_Opening);
            customRtb.ContextMenuStrip = cms;
        }
Exemple #10
0
        public async Task <ActionResult> EditColorForm(int?id)
        {
            var colorForm = new ColorForm();

            if (!id.HasValue)
            {
                return(View(colorForm));
            }

            var manager = new BasicDataManager(User);

            colorForm = await manager.GetColorFormAsync(id.Value);

            return(View(colorForm));
        }
        public DrawingForm(string templatePath)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            //
            // TODO: Add any constructor code after InitializeComponent call
            //
            m_LButtonPressed	= false;
            m_CtrlPressed		= false;
            m_bRedoing			= false;

            m_selectingRect	= new System.Drawing.Rectangle(0, 0, 0, 0);
            m_selectedPen	= new Pen(System.Drawing.Color.FromArgb(150, 0, 0, 255), 1);
            m_groupSelPen	= new Pen(System.Drawing.Color.FromArgb(255, 200, 200, 200), 1);
            m_selectingPen	= new Pen(System.Drawing.Color.FromArgb(100, 0, 0, 0), 1);
            m_groupSelPen.DashStyle = System.Drawing.Drawing2D.DashStyle.Dot;
            m_selectingPen.DashStyle = System.Drawing.Drawing2D.DashStyle.Dash;

            m_frmColor					= new ColorForm();
            m_frmColor.TopLevel			= false;
            m_frmColor.FormBorderStyle	= FormBorderStyle.None;
            m_frmColor.Visible			= false;
            m_frmColor.DrawingStyleChanged	+= new DrawingStyleChangedEvent(m_frmColor_DrawingStyleChanged);
            m_frmColor.FillingStyleChanged	+= new FillingStyleChangedEvent(m_frmColor_FillingStyleChanged);

            m_frmEdit					= new EditForm();
            m_frmEdit.TopLevel			= false;
            m_frmEdit.FormBorderStyle	= FormBorderStyle.None;
            m_frmEdit.Visible			= false;
            m_frmEdit.CommandSelected	+= new CommandSelectedEvent(m_frmEdit_CommandSelected);

            m_frmLink					= new LinkForm();
            m_frmLink.TopLevel			= false;
            m_frmLink.FormBorderStyle	= FormBorderStyle.None;
            m_frmLink.Visible			= false;
            m_frmLink.LinkStyleChanged	+= new LinkStyleChangedEvent(m_frmLink_LinkStyleChanged);
            m_frmLink.RemoveLink		+= new RemoveLinkEvent(m_frmLink_RemoveLink);

            m_frmInfo = new InfoForm();
            m_frmInfo.TopLevel = false;
            m_frmInfo.FormBorderStyle = FormBorderStyle.None;
            m_frmInfo.Visible = false;
            m_frmInfo.DrawingInfoChanged += new DrawingInfoChanged(m_frmInfo_DrawingInfoChanged);
            tagInfo.TagControl = m_frmInfo;
            //m_frmLink.LoadLinkStyle(Environment.CurrentDirectory + "\\Links");

            tagColor.TagControl	= m_frmColor;
            tagEdit.TagControl	= m_frmEdit;
            tagLink.TagControl	= m_frmLink;

            m_clipBoard	= new GOMLib.GOM_Objects();
            m_selObjs	= new GOMLib.GOM_Objects();
            m_rgObjects	= new GOMLib.GOM_Objects();
            m_bitmap	= new Bitmap(plDraw.Width, plDraw.Height, System.Drawing.Imaging.PixelFormat.Format24bppRgb);

            m_preprocess = new PreprocessQueue();
            m_preprocess.m_bDebugging	= false;
            m_preprocess.UpdateRequired += new PreprocessOverEvent(m_preprocess_UpdateRequired);
            m_preprocess.StartPreprocessThread();

            m_recognition = new RecognitionQueue(templatePath);
            m_recognition.m_bDebugging		= false;
            m_recognition.RecognitionStart	+= new RecognitionEvent(m_recognition_RecognitionStart);
            m_recognition.RecognitionEnd	+= new RecognitionEvent(m_recognition_RecognitionEnd);
            m_recognition.RecognitionOver	+= new RecognitionOverEvent(m_recognition_RecognitionOver);
            m_recognition.StartRecognitionThread();

            m_rgRedoList= new ArrayList();
            m_rgLinks	= new GOMLib.GOM_Links();
            m_rgStroke	= null;
            m_sketch	= null;

            m_selectedPoint	= null;
            m_selectedLink	= null;
            m_selectedLinkKeyPoint = null;

            m_tracker = new MouseTrackerLib.CTrackerClass();

            Graphics.FromImage(m_bitmap).FillRectangle(System.Drawing.Brushes.White, 0, 0, plDraw.Width, plDraw.Height);
        }
Exemple #12
0
        private void настройкаЦветаБейджаToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ColorForm cf = new ColorForm();

            cf.ShowDialog();
        }
 public CaptureStripCommand(IAppState appState, MainForm mainForm, ColorForm colorForm, ICommsPort commsPort) : base(appState)
 {
     _mainForm  = mainForm;
     _colorForm = colorForm;
     _commsPort = commsPort;
 }
 public OpenColorStripCommand(IAppState appState, ColorForm colorForm) : base(appState)
 {
     _colorForm = colorForm;
 }