Esempio n. 1
0
 private void ReferenceVisibility()
 {
     if (muc.ReadBool("Main", "ConsoleButton") == true)
     {
         consButton.Visible = true;
     }
     else
     {
         consButton.Visible = false;
     }
     if (muc.ReadBool("Main", "TrayButton") == true)
     {
         ttButton.Visible = true;
     }
     else
     {
         ttButton.Visible = false;
     }
     if (muc.ReadBool("Main", "Tooltips") == true)
     {
         Info.Visible = true;
     }
     else
     {
         Info.Visible = false;
     }
     MemoryManagement.FlushMemory();
 }
Esempio n. 2
0
        private void HandleHotkey()
        {
            Graphics SS = Graphics.FromImage(ScSh as Image);

            SS.CopyFromScreen(0, 0, 0, 0, ScSh.Size);
            cwl(cc_lang[13]);
            cwl(cc_lang[14]);
            if (_sound)
            {
                sound.Play();
            }
            DateTime now        = DateTime.Now;
            string   name       = now.ToString("yyyy-MM-dd,hh-mm-ss");
            string   dateString = string.Format(@"{0}{1}", muc.Read("Main", "Path"), name + "." + muc.Read("Main", "Format"));

            cwl(cc_lang[20] + name);
            SasLabel.Text = cc_lang[11] + cc_lang[21] + ":" + Environment.NewLine + dateString;
            saveImage(dateString, ScSh, muc.Read("Main", "Format"), muc.ReadInt("Main", "jpgQuality"));
            pictureBox1.Image    = ScSh;
            pictureBox1.SizeMode = PictureBoxSizeMode.Zoom;
            cwl(cc_lang[11] + cc_lang[21] + " " + dateString);
            cwl(cc_lang[16]);
            muc.Write("Main", "LastPath", dateString);
            if (lstButton.Visible == false)
            {
                cwl(cc_lang[22]);
                lstButton.Visible = true;
            }
            SS.Dispose();
            MemoryManagement.FlushMemory();
        }
Esempio n. 3
0
        private void btnupdate_Click(object sender, EventArgs e)
        {
            try
            {
                if (txtCName.Text == string.Empty || txtCredit.Text == string.Empty || txtAmount.Text == string.Empty)
                {
                    MessageBox.Show("Please enter valid data");
                    return;
                }

                decimal paid = Convert.ToDecimal(txtAmount.Text);

                if (globalForm.publicSales.UpdateCredit(con, paid))
                {
                    MemoryManagement.FlushMemory();
                    //   this.Close();
                    MessageBox.Show("Credit amount has been deducted");
                    txtAmount.Clear();
                    txtCredit.Text = Convert.ToString(Convert.ToDecimal(txtCredit.Text) - paid);
                }
            }
            catch (Exception ex)
            {
                MetroMessageBox.Show(this, "! System Error . Code 104. " + ex.Message, "System Message", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Esempio n. 4
0
        //event handler for updating the window
        private void DataPlaceholder_UpdteTheGame(object sender, UpdateGameWindowEventArgs e)
        {
            if (thisPlayerID == e.ReceivedData.PlayerID)
            {
                SynchCont.Post(_ => ThisUserControlsEnabler.EnableOrDisableThisUserControls(ref ThisPlayerControl,
                                                                                            ref DeckRepresentationControl, e.ReceivedData.CurrentPlayerNumber), null);

                //assign cards to controls
                CardsToControlsAssigner CardsAssigner = new CardsToControlsAssigner(this);
                SynchCont.Post(_ => CardsAssigner.AssignPlayersCards(PlayersControlsMapper, e.ReceivedData.DataOfThisPlayer.ThisPlayerCards,
                                                                     e.ReceivedData.DataOfOtherPlayers), null);
                SynchCont.Post(_ => CardsAssigner.AssignAmountOfCardsInDeck(e.ReceivedData.AmountOfCardsInDeck), null);
                SynchCont.Post(_ => CardsAssigner.AddMultipleCardsToUsedCardsControl(e.ReceivedData.NewCardsOnTheTableList), null);

                //assign properties values - those which implements INotifyPropertyChange interface
                SynchCont.Post(_ => AssignProperties(e.ReceivedData.CurrentGameStatusData), null);

                //move posibilities
                SynchCont.Post(_ => AssignPlayersMovePosibilities(e.ReceivedData.DataOfThisPlayer), null);

                //players rectangles colors
                SynchCont.Post(_ => PlayersRectanglesColorAssigner.AssignPlayersRectanglesColors(ref ActivePlayerRectangles, e.ReceivedData.CurrentPlayerNumber), null);

                SynchCont.Post(_ => OpenMatchingCardInBattleWindow(MatchingCardInBattleMode, AlreadyUsedCardsControl.Cards[0]), null);
            }

            SynchCont.Post(_ => MemoryManagement.FlushMemory(), null);
        }
Esempio n. 5
0
        //event handler for clicking menu item - cretion of the new room
        private void MenuStartNewGame_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                Windows.StartNewHostWindow newGameWindow = new Windows.StartNewHostWindow
                                                               (SavedDataPlaceholder.SavedAmountOfPlayers, SavedDataPlaceholder.SavedAmountOfDecks,
                                                               SavedDataPlaceholder.SavedAmountOfJokers, SavedDataPlaceholder.SavedAmountOfStartCards)
                {
                    Owner = this
                };
                newGameWindow.NewRoomDataChanged += NewRoomDataConfirm_Click;

                //logging
                var logger = NLog.LogManager.GetCurrentClassLogger();
                logger.Info("Opening creation of new game window");

                newGameWindow.ShowDialog();
                MemoryManagement.FlushMemory();
            }
            catch (Exception ex)
            {
                var logger = NLog.LogManager.GetCurrentClassLogger();
                logger.Error("Opening creation of new game window failure: " + ex.Message);
            }
        }
Esempio n. 6
0
        private void curWindSSHandler()
        {
            ScSh = CurrentWindowScreenShot.CaptureCurrentWindow();
            cwl(cc_lang[13]);
            cwl(cc_lang[14]);
            if (_sound)
            {
                sound.Play();
            }
            DateTime now        = DateTime.Now;
            string   name       = now.ToString("yyyy-MM-dd,hh-mm-ss") + "-Window";
            string   dateString = string.Format(@"{0}{1}", muc.Read("Main", "Path"), name + "." + muc.Read("Main", "Format"));

            cwl(cc_lang[20] + name);
            SasLabel.Text = cc_lang[11] + cc_lang[21] + ":" + Environment.NewLine + dateString;
            saveImage(dateString, ScSh, muc.Read("Main", "Format"), muc.ReadInt("Main", "jpgQuality"));
            pictureBox1.Image    = ScSh;
            pictureBox1.SizeMode = PictureBoxSizeMode.Zoom;
            cwl(cc_lang[11] + cc_lang[21] + " " + dateString);
            cwl(cc_lang[16]);
            muc.Write("Main", "LastPath", dateString);
            if (lstButton.Visible == false)
            {
                cwl(cc_lang[22]);
                lstButton.Visible = true;
            }
            MemoryManagement.FlushMemory();
        }
Esempio n. 7
0
 private void MainWindowShow()
 {
     Show();
     TopMost = true;
     Thread.Sleep(1);
     TopMost = false;
     cwl(cc_lang[6] + " " + cc_lang[0] + ifru("о"));
     MemoryManagement.FlushMemory();
 }
Esempio n. 8
0
        private void button1_Click(object sender, EventArgs e)
        {
            MemoryManagement.FlushMemory();

            this.Close();
            //this.Hide();
            //var form2 = new ManageStock();
            //form2.Closed += (s, args) => this.Dispose();
            //form2.Show();
        }
Esempio n. 9
0
 //method for handling with suit demanding window
 private void SuitDemandingWindowHandle()
 {
     jackOrAceInCardsToPutOnTheTable = true;
     Windows.DemandTheSuitWindow DemandingWindow = new DemandTheSuitWindow()
     {
         Owner = this,
     };
     DemandingWindow.SuitDemandingWindowClosing += DemandingWindow_SuitDemandingWindowClosing;
     DemandingWindow.ShowDialog();
     MemoryManagement.FlushMemory();
 }
Esempio n. 10
0
        //method for opening window with game results
        private void OpenEngGameResultsWindow(GameFinishedDataRequest inputData)
        {
            GameFinishedWindow EndingWindow = new GameFinishedWindow(inputData, thisPlayerID)
            {
                //Owner = this,
            };

            EndingWindow.GameResultsWindowClosing += EndingWindow_GameResultsWindowClosing;
            EndingWindow.ShowDialog();
            MemoryManagement.FlushMemory();
        }
Esempio n. 11
0
        //reaction for clicking creation of new user option from window menu
        private void MenuCreateNewUser_Click(object sender, RoutedEventArgs e)
        {
            CreateNewUser newUserCreationWindow = new CreateNewUser()
            {
                Owner = this,
            };

            newUserCreationWindow.AdditionSuccedeed += NewUserCreationWindow_AdditionSuccedeed;
            newUserCreationWindow.ShowDialog();
            MemoryManagement.FlushMemory();
        }
Esempio n. 12
0
        private void metroTile3_Click(object sender, EventArgs e)
        {
            MemoryManagement.FlushMemory();


            this.Hide();
            var form2 = new ManageStock();

            form2.Closed += (s, args) => this.Dispose();
            form2.Show();
        }
Esempio n. 13
0
        //method for opening loging window
        private void OpenLogingWIndow()
        {
            LoginWindow loginWindow = new LoginWindow()
            {
                Owner = this,
            };

            loginWindow.LoginSuccedeed += LoginWindow_LoginSuccedeed;
            loginWindow.ShowDialog();
            MemoryManagement.FlushMemory();
        }
Esempio n. 14
0
        private void RankDemandingButton_Click(object sender, RoutedEventArgs e)
        {
            DemandTheRankWindow rankDemandingWindow = new DemandTheRankWindow(topCard.Suit)
            {
                Owner = this,
            };

            rankDemandingWindow.RankDemandingWindowClosing += RankDemandingWindow_RankDemandingWindowClosing;
            rankDemandingWindow.ShowDialog();
            MemoryManagement.FlushMemory();
        }
Esempio n. 15
0
        private void SuitDemandingButton_Click(object sender, RoutedEventArgs e)
        {
            DemandTheSuitWindow suitDemandingWIndow = new DemandTheSuitWindow()
            {
                Owner = this,
            };

            suitDemandingWIndow.SuitDemandingWindowClosing += SuitDemandingWIndow_SuitDemandingWindowClosing;
            suitDemandingWIndow.ShowDialog();
            MemoryManagement.FlushMemory();
        }
Esempio n. 16
0
        private void AdEndpointManuallyButton_Click(object sender, RoutedEventArgs e)
        {
            AddEndpointManuallyWindow endpointWindow = new AddEndpointManuallyWindow()
            {
                Owner = mainWindowInstance,
            };

            endpointWindow.ManualHostInputed += EndpointWindow_ManualHostInputed;

            endpointWindow.ShowDialog();
            MemoryManagement.FlushMemory();
        }
Esempio n. 17
0
 private void pathLabel_MouseHover(object sender, EventArgs e)
 {
     if (muc.Read("Main", "Path") == "")
     {
         TooltipShow(cc_lang[52] + " " + cc_lang[33], pathLabel);
     }
     else
     {
         TooltipShow(cc_lang[52] + muc.Read("Main", "Path"), pathLabel);
     }
     MemoryManagement.FlushMemory();
 }
Esempio n. 18
0
 private void ShowHideAbout()
 {
     if (About.Visible == true)
     {
         About.Hide();
     }
     else
     {
         About.ShowDialog();
     }
     MemoryManagement.FlushMemory();
 }
Esempio n. 19
0
        //open new game window
        private void StartNewgameWindow(ThirdPlayerLocation location, PersonalizedForSpecificPlayerStartGameDataRequest data)
        {
            Windows.GameWindow gameWindow = new Windows.GameWindow(location, data, SavedDataPlaceholder.CardsBackColor)
            {
                Owner = this,
            };

            gameWindow.WindowWasClosedByUser  += GameWindow_WindowWasClosedByUser;
            gameWindow.GameWindowClosedByHost += GameWindow_GameWindowClosedByHost;
            gameWindow.ShowDialog();
            MemoryManagement.FlushMemory();
        }
Esempio n. 20
0
 private void TooltipShow(string text, IWin32Window window)
 {
     if (muc.ReadBool("Main", "Tooltips") == true)
     {
         toolTip.Show(text, window);
     }
     else
     {
         toolTip.Hide(window);
     }
     MemoryManagement.FlushMemory();
 }
Esempio n. 21
0
        private void ChangeJokerButton_Click(object sender, RoutedEventArgs e)
        {
            FirstCardJokerPermittedCardsSelection newJokerWindow
                = new FirstCardJokerPermittedCardsSelection(permittedCardsList)
                {
                Owner = this,
                };

            newJokerWindow.NewJokerCard += NewJokerWindow_NewJokerCard;
            newJokerWindow.ShowDialog();
            MemoryManagement.FlushMemory();
        }
Esempio n. 22
0
 //opening the settings window
 private void MenuSettings_Click(object sender, RoutedEventArgs e)
 {
     Windows.UserSettingsWindow settingsWindow = new UserSettingsWindow
                                                     (SavedDataPlaceholder.CardsBackColor, SavedDataPlaceholder.JoiningTimeoutEnabled, SavedDataPlaceholder.JoiningTimeoutMinutesAmount,
                                                     SavedDataPlaceholder.ReadinessTimeoutEnabled, SavedDataPlaceholder.ReadinessTimeoutMinutesAmount, SavedDataPlaceholder.LocationOfThirdPlayersCards)
     {
         Owner = this,
     };
     settingsWindow.SettingsChanged += SettingsWindow_SettingsChanged;
     settingsWindow.ShowDialog();
     MemoryManagement.FlushMemory();
 }
Esempio n. 23
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            Program p = new Program();

            p.NonStaticMethod();

            MemoryManagement.FlushMemory();

            Application.Run();
        }
Esempio n. 24
0
 //method for opening window
 private void OpenMatchingCardInBattleWindow(PlayingCard newCard, PlayingCard topCard)
 {
     if (CardTakenInBattleModeMatches)
     {
         BattleCardWindow BattleWindow = new BattleCardWindow(newCard, topCard, GameStateData.CurrentStatusOfTheGame,
                                                              GameStateData.CurrentlyDemandedRank, GameStateData.CurrentlyDemandedSuit)
         {
             Owner = this
         };
         BattleWindow.CancelButtonClick  += BattleWindow_CancelButtonClick;
         BattleWindow.ConfirmButtonClick += BattleWindow_ConfirmButtonClick;
         BattleWindow.ShowDialog();
         MemoryManagement.FlushMemory();
     }
 }
Esempio n. 25
0
 private void consButton_Click(object sender, EventArgs e)
 {
     if (cws == true)
     {
         cws  = false;
         cwsw = false;
         SSConsoleHide();
     }
     else
     {
         SSConsoleShow();
         cws  = true;
         cwsw = true;
     }
     MemoryManagement.FlushMemory();
 }
Esempio n. 26
0
 public static void Main()
 {
     using (Mutex mutex = new Mutex(false, "Global\\" + appGUid))
     {
         if (!mutex.WaitOne(0, false))
         {
             PostMessage((IntPtr)0xffff, ao, 0, 0);
             return;
         }
         MemoryManagement.FlushMemory();
         Application.EnableVisualStyles();
         Application.SetCompatibleTextRenderingDefault(false);
         ScreenShotter SSMain = new ScreenShotter();
         Application.Run();
     }
 }
Esempio n. 27
0
        internal void session_StateChanged(object sender, SessionSwitchEventArgs e)
        {
            write_log(string.Format("State: {0}\t\tTime: {1} ", e.Reason, DateTime.Now));

            switch (e.Reason)
            {
            case SessionSwitchReason.SessionUnlock:
                System.Threading.Thread.Sleep(5000);
                ExecuteCommand();
                break;

            default:
                break;
            }

            MemoryManagement.FlushMemory();
        }
Esempio n. 28
0
        public ScreenShotter()
        {
//            if (muc.Read("Main","lang") == "")
//            {
//                muc.Read("Main","lang") ="en";
//            }
            if (!File.Exists(Configs.filePath))
            {
                muc.Write("Main", "TrayShow", "true");
                var syslang = System.Globalization.CultureInfo.CurrentCulture;
                if (Convert.ToString(syslang) == "ru-RU")
                {
                    muc.Write("Main", "lang", "ru");
                }
                langchange();
                icon.ShowTooltip(cc_lang[68], cc_lang[69]);
            }
            langchange();
            check.Tick    += new EventHandler(checkis);
            check.Interval = 50;
            check.Start();
            langchange();
            cwl(cc_lang[9]);
            AddOwnedForm(configs);
            AddOwnedForm(console);
            AddOwnedForm(selSCR);
            InitializeComponent();
            ScrShHK     = new HotkeyHandler(Modifiers.ALT, Keys.F3, this);
            ScrShshhHK  = new HotkeyHandler(Modifiers.ALT + Modifiers.CTRL, Keys.F3, this);
            ScrShExit   = new HotkeyHandler(Modifiers.ALT + Modifiers.CTRL + Modifiers.WIN, Keys.F4, this);
            Oplast      = new HotkeyHandler(Modifiers.ALT + Modifiers.SHIFT, Keys.F3, this);
            SelScrShot  = new HotkeyHandler(Modifiers.CTRL + Modifiers.SHIFT, Keys.F3, this);
            curWindowSS = new HotkeyHandler(Modifiers.CTRL, Keys.F3, this);
            Selpath     = new FolderBrowserDialog();
            ScrShHK.Register();
            ScrShshhHK.Register();
            ScrShExit.Register();
            Oplast.Register();
            curWindowSS.Register();
            SelScrShot.Register();
            InitializeTrayIcon();
            About  = new AboutBox();
            _sound = muc.ReadBool("Main", "sound");
            CurrentWindowScreenShot.WinShadow = muc.ReadInt("Main", "WShadow");
            MemoryManagement.FlushMemory();
        }
Esempio n. 29
0
 //opening window with rules of this game
 private void MenuRules_Click(object sender, RoutedEventArgs e)
 {
     if (rulesWindow == null)
     {
         rulesWindow = new RulesWindow.RulesWindow()
         {
             Owner = this,
         };
         rulesWindow.WindowClosing += RulesWindow_WindowClosing;
         rulesWindow.Show();
     }
     else
     {
         rulesWindow.Activate();
     }
     MemoryManagement.FlushMemory();
 }
Esempio n. 30
0
        private void spButton_Click(object sender, EventArgs e)
        {
            cwl("Showing Path Selection Dialog.");
            DialogResult result = Selpath.ShowDialog();

            if (result == DialogResult.OK)
            {
                muc.Write("Main", "Path", Selpath.SelectedPath + "\\");
                cwl(cc_lang[15] + muc.Read("Main", "Path"));
                ApplySave();
                pathLabel.Text = cc_lang[17] + ": " + Environment.NewLine + muc.Read("Main", "Path");
                cwl(cc_lang[18]);
            }
            else
            {
                cwl(cc_lang[19]);
            }
            MemoryManagement.FlushMemory();
        }