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(); }
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(); }
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); } }
//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); }
//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); } }
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(); }
private void MainWindowShow() { Show(); TopMost = true; Thread.Sleep(1); TopMost = false; cwl(cc_lang[6] + " " + cc_lang[0] + ifru("о")); MemoryManagement.FlushMemory(); }
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(); }
//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(); }
//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(); }
//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(); }
private void metroTile3_Click(object sender, EventArgs e) { MemoryManagement.FlushMemory(); this.Hide(); var form2 = new ManageStock(); form2.Closed += (s, args) => this.Dispose(); form2.Show(); }
//method for opening loging window private void OpenLogingWIndow() { LoginWindow loginWindow = new LoginWindow() { Owner = this, }; loginWindow.LoginSuccedeed += LoginWindow_LoginSuccedeed; loginWindow.ShowDialog(); MemoryManagement.FlushMemory(); }
private void RankDemandingButton_Click(object sender, RoutedEventArgs e) { DemandTheRankWindow rankDemandingWindow = new DemandTheRankWindow(topCard.Suit) { Owner = this, }; rankDemandingWindow.RankDemandingWindowClosing += RankDemandingWindow_RankDemandingWindowClosing; rankDemandingWindow.ShowDialog(); MemoryManagement.FlushMemory(); }
private void SuitDemandingButton_Click(object sender, RoutedEventArgs e) { DemandTheSuitWindow suitDemandingWIndow = new DemandTheSuitWindow() { Owner = this, }; suitDemandingWIndow.SuitDemandingWindowClosing += SuitDemandingWIndow_SuitDemandingWindowClosing; suitDemandingWIndow.ShowDialog(); MemoryManagement.FlushMemory(); }
private void AdEndpointManuallyButton_Click(object sender, RoutedEventArgs e) { AddEndpointManuallyWindow endpointWindow = new AddEndpointManuallyWindow() { Owner = mainWindowInstance, }; endpointWindow.ManualHostInputed += EndpointWindow_ManualHostInputed; endpointWindow.ShowDialog(); MemoryManagement.FlushMemory(); }
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(); }
private void ShowHideAbout() { if (About.Visible == true) { About.Hide(); } else { About.ShowDialog(); } MemoryManagement.FlushMemory(); }
//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(); }
private void TooltipShow(string text, IWin32Window window) { if (muc.ReadBool("Main", "Tooltips") == true) { toolTip.Show(text, window); } else { toolTip.Hide(window); } MemoryManagement.FlushMemory(); }
private void ChangeJokerButton_Click(object sender, RoutedEventArgs e) { FirstCardJokerPermittedCardsSelection newJokerWindow = new FirstCardJokerPermittedCardsSelection(permittedCardsList) { Owner = this, }; newJokerWindow.NewJokerCard += NewJokerWindow_NewJokerCard; newJokerWindow.ShowDialog(); MemoryManagement.FlushMemory(); }
//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(); }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Program p = new Program(); p.NonStaticMethod(); MemoryManagement.FlushMemory(); Application.Run(); }
//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(); } }
private void consButton_Click(object sender, EventArgs e) { if (cws == true) { cws = false; cwsw = false; SSConsoleHide(); } else { SSConsoleShow(); cws = true; cwsw = true; } MemoryManagement.FlushMemory(); }
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(); } }
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(); }
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(); }
//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(); }
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(); }