예제 #1
0
        private void cmdLoad_Click(object sender, EventArgs e)
        {
            //is image currently open
            //if (MainContentWindow.Image != null &&
            //    !string.IsNullOrEmpty(MainContentWindow.ImageLocation))
            //{
            //    Properties.Settings.Default[MainContentWindow.ImageLocation] = new SavedData(MainContentWindow.ImageSnapPoint, MainContentWindow.ScaleFactor);
            //}

            using (OpenFileDialog OFD = new OpenFileDialog())
            {
                OFD.Filter = "image files (*.jpg; *.png)|*.jpg; *.png";
                if (OFD.ShowDialog() == DialogResult.OK)
                {
                    string imageFile = OFD.FileName;

                    InitMainContentWindow();

                    //MainContentWindow.ImageLocation = imageFile;
                    MainContentWindow.Load(imageFile);
                    MainContentWindow.SizeMode          = PictureBoxSizeMode.CenterImage;
                    MainContentWindow.ScaleFactor       = m_Settings.ScaleFactor;
                    MainContentWindow.UpdateBrackground = true;
                }
            }
        }
예제 #2
0
        public void AddWorkoutReceiveTest()
        {
            bool bTest1 = false;
            bool bTest2 = false;

            List <string> messageTestList1 = new List <string>();

            messageTestList1.Add("1");
            messageTestList1.Add("1");
            //messageTestList1[1] = "1";

            List <string> messageTestList2 = new List <string>();

            //messageTestList2[1] = "2";
            messageTestList2.Add("2");
            messageTestList2.Add("2");

            SimpleNetwork_Client TCPClient         = ConnectToTCPTest();
            MainContentWindow    mainContentWindow = new MainContentWindow(ref TCPClient, "test", 18);
            RoomManager          roomManager       = new RoomManager(ref TCPClient, mainContentWindow, 18);
            WorkoutManager       workoutManager    = new WorkoutManager(ref TCPClient, mainContentWindow, roomManager);

            if (TCPClient != null)
            {
                //Act
                bTest1 = workoutManager.AddWorkoutReceive(messageTestList1);

                bTest2 = workoutManager.AddWorkoutReceive(messageTestList2);
            }
            //Assert
            Assert.IsTrue(bTest1);
            Assert.IsFalse(bTest2);
        }
예제 #3
0
 public WorkoutManager(ref SimpleNetwork_Client TCPClient, MainContentWindow mainContentWindow, RoomManager roomManager)
 {
     this.TCPClient = TCPClient;
     // this.TCPClient.changeProtocolFunction(Server_response_workoutManager);
     this.mainContentWindow  = mainContentWindow;
     this.workoutInformation = new Dictionary <string, List <string> >();
     this.roomManager        = roomManager;
     roomInformation         = roomManager.RoomInformation;
 }
예제 #4
0
 private void cmdEndMask_Click(object sender, EventArgs e)
 {
     m_NewMask.FillBrush                 = new SolidBrush(Color.FromArgb(250, Color.DarkGray));
     m_NewMask                           = null;
     m_ControlPanel.MaskedCells.Text     = string.Empty;
     MainContentWindow.IsCellSelectionOn = false;
     MainContentWindow.Invalidate();
     m_addingMask = false;
     //cmdStartMask.Enabled = true;
     //cmdEndMask.Enabled = false;
     m_ControlPanel.ToggleStartEndMask();
 }
예제 #5
0
        private void cmdSettings_Click(object sender, EventArgs e)
        {
            using (SettingsForm SF = new SettingsForm(m_Settings))
            {
                SF.StartPosition = FormStartPosition.CenterParent;
                if (SF.ShowDialog() == DialogResult.OK)
                {
                    m_Settings.ScaleFactor        = SF.Settings.ScaleFactor;
                    MainContentWindow.ScaleFactor = m_Settings.ScaleFactor;

                    MainContentWindow.CenterImage();
                }
            }
        }
예제 #6
0
        private void InitMainContentWindow()
        {
            MainLayoutPanel.Controls.Remove(MainContentWindow);
            MainContentWindow.CellSelected -= MainContentWindow_CellSelected;
            MainContentWindow.Dispose();

            MainContentWindow                    = new Components.DisplayBox(this.components);
            this.MainContentWindow.Cursor        = Cursors.Hand;
            this.MainContentWindow.Dock          = DockStyle.Fill;
            this.MainContentWindow.Location      = new Point(0, 0);
            this.MainContentWindow.Margin        = new Padding(0);
            this.MainContentWindow.Name          = "MainContentWindow";
            this.MainContentWindow.Size          = new Size(956, 654);
            this.MainContentWindow.TabIndex      = 0;
            this.MainContentWindow.TabStop       = false;
            this.MainContentWindow.CellSelected += MainContentWindow_CellSelected;

            MainLayoutPanel.Controls.Add(MainContentWindow, 0, 0);
        }
예제 #7
0
        public void AddRoomSendTest()
        {
            bool bTest1 = false;
            bool bTest2 = false;

            //Arrange not necessary
            SimpleNetwork_Client TCPClient         = ConnectToTCPTest();
            MainContentWindow    mainContentWindow = new MainContentWindow(ref TCPClient, "test", 18);
            RoomManager          roomManager       = new RoomManager(ref TCPClient, mainContentWindow, 18);

            if (TCPClient != null)
            {
                //Act
                bTest1 = roomManager.AddRoomSend(2, ";", "Hallo Welt", "http://gehtdichnixan.de/", true, "Unit Test Name", "0");

                bTest2 = roomManager.AddRoomSend(2, ";", "Hallo Welt", "http://gehtdichnixan.de/", true, "", "0");
            }
            //Assert
            Assert.IsTrue(bTest1);
            Assert.IsFalse(bTest2);
        }
예제 #8
0
 private void MainContentWindow_CellSelected(object sender, CellSelectedEventArgs e)
 {
     if (m_droppingItem)
     {
         MainContentWindow.AddItem(m_ItemToBeDropped, e.SelectedCell);
         m_ItemToBeDropped = null;
         m_ControlPanel.ListViewItems.ClearActiveItem();
         m_droppingItem = false;
     }
     else if (m_removingItem)
     {
         MainContentWindow.RemoveItem(e.SelectedCell);
         m_removingItem = false;
     }
     else if (m_addingMask)
     {
         m_NewMask.AddCellToMask(e.SelectedCell);
         m_ControlPanel.MaskedCells.Text     = m_NewMask.MaskText;
         MainContentWindow.IsCellSelectionOn = true;
         MainContentWindow.Invalidate();
     }
 }
예제 #9
0
 public StatusManager(ref SimpleNetwork_Client TCPClient, MainContentWindow mainContentWindow)
 {
     this.TCPClient = TCPClient;
     this.TCPClient.changeProtocolFunction(Server_response_statusManager);
     this.mainContentWindow = mainContentWindow;
 }
예제 #10
0
 private void ControlPanel_OnRemoveAllItems(object sender, EventArgs e)
 {
     MainContentWindow.ClearItems();
 }