상속: System.Windows.Forms.Form, IMetroForm, IDisposable
        //End variables

        //Constructor
        public frmShowController(MetroForm form, MetroGrid grid)
        {
            this.form = form;
            this.grid = grid;
            //Instantiate database.
            database = new Database(form);
        }
예제 #2
1
파일: Util.cs 프로젝트: The-Mad-Pirate/Mist
 public static void ShowSteamProfile(SteamBot.Bot bot, ulong steamId)
 {
     var form = new MetroForm();
     form.Text = "Steam Community";
     form.Width = 800;
     form.Height = 600;
     form.Style = Friends.GlobalStyleManager.Style;
     form.Theme = Friends.GlobalStyleManager.Theme;
     form.Icon = MistClient.Properties.Resources.Icon;
     form.ShadowType = MetroFormShadowType.DropShadow;
     var webControl = new Awesomium.Windows.Forms.WebControl();
     webControl.Dock = System.Windows.Forms.DockStyle.Fill;
     string cookies = string.Format("steamLogin={0}; sessionid={1}", bot.token, bot.sessionId);
     webControl.WebSession = Awesomium.Core.WebCore.CreateWebSession(new Awesomium.Core.WebPreferences());
     webControl.WebSession.SetCookie(new Uri("http://steamcommunity.com"), cookies, true, true);
     webControl.Source = new Uri((string.Format("http://steamcommunity.com/profiles/{0}/", steamId)));
     webControl.DocumentReady += webControl_DocumentReady;
     webControl.TitleChanged += (s, e) => webControl_TitleChanged(s, e, form);
     form.Controls.Add(webControl);
     form.Show();
 }
예제 #3
0
            protected MetroShadowBase(MetroForm targetForm, int shadowSize, int wsExStyle)
            {
                TargetForm  = targetForm;
                _shadowSize = shadowSize;
                _wsExStyle  = wsExStyle;

                MaximizeBox     = false;
                MinimizeBox     = false;
                ShowInTaskbar   = false;
                ShowIcon        = false;
                FormBorderStyle = FormBorderStyle.None;

                TargetForm.Activated      += OnTargetFormActivated;
                TargetForm.ResizeBegin    += OnTargetFormResizeBegin;
                TargetForm.ResizeEnd      += OnTargetFormResizeEnd;
                TargetForm.VisibleChanged += OnTargetFormVisibleChanged;
                TargetForm.SizeChanged    += OnTargetFormSizeChanged;

                TargetForm.Move   += OnTargetFormMove;
                TargetForm.Resize += OnTargetFormResize;

                // When a form is owned by another form, it is closed or hidden with the owner form.
                // Owned forms are also never displayed behind their owner form.

                if (TargetForm.Owner != null)
                {
                    Owner = TargetForm.Owner;
                }

                TargetForm.Owner = this;

                // This should "do the right thing" (tm)
                OnTargetFormVisibleChanged(this, new EventArgs());
            }
예제 #4
0
        public static void LimpiarTXT(MetroFramework.Forms.MetroForm metroForm)

        {
            foreach (Control item in metroForm.Controls)
            {
                string test = item.ToString();
                if (item.ToString().Contains("TextBox"))
                {
                    item.Text = "";
                }
                if (item.ToString().Contains("TabControl"))
                {
                    foreach (Control subItem in item.Controls)
                    {
                        foreach (Control tab in subItem.Controls)
                        {
                            if (tab.ToString().Contains("TextBox"))
                            {
                                tab.Text = "";
                            }
                        }
                    }
                }
            }
        }
예제 #5
0
        public ReceiveManager(MySqlDataReader dataReader,MetroForm _login)
        {
            InitializeComponent();
            login = _login;
            this.FormClosing += ReceiveManager_FormClosing;
            worker_id = dataReader.GetString("worker_name");
            this.Text = "欢迎回来," + dataReader.GetString("worker_name");
            dataReader.Close();
            DataGridViewButtonColumn request_column = new DataGridViewButtonColumn();
            request_column.HeaderText = "请求";
            //gigUrlColumn.Name = "Gig Url name";
            request_column.Text = "确认";
            request_column.UseColumnTextForButtonValue = true;
            request_column.Width = 106;
            WaitToConfrimDataGridView.Columns.Add(request_column);
            WaitToConfrimDataGridView.DataSource = FillDataGrid();

            DataGridViewButtonColumn request2_column = new DataGridViewButtonColumn();
            request2_column.HeaderText = "请求";
            //gigUrlColumn.Name = "Gig Url name";
            request2_column.Text = "接货成功";
            request2_column.UseColumnTextForButtonValue = true;
            request2_column.Width = 106;
            CheckGridView.Columns.Add(request2_column);
            CheckGridView.DataSource = FillCheckData();
        }
예제 #6
0
        public static void CambiarIdiomaCotrolesFormulario(MetroFramework.Forms.MetroForm metroFor, List <Traduccion> traduccions)

        {
            foreach (var traduccion in traduccions)
            {
                foreach (Control item in metroFor.Controls)
                {
                    //verifico los label, botones y tiles

                    if (item.ToString().Contains("Label") || item.ToString().Contains("Button") || item.ToString().Contains("Tile"))
                    {
                        if (traduccion.palabra.palabra == item.Tag.ToString())
                        {
                            if (traduccion.traduccion != null)
                            {
                                item.Text = traduccion.traduccion;
                            }
                            else
                            {
                                item.Text = item.Tag.ToString();
                            }
                        }
                    }
                }
            }
        }
        public frmReservationController(MetroForm form, int reservationID)
        {
            this.reservationID = reservationID;
            this.form = form;

            //Instantiate database
            database = new Database(form);
        }
        //End variables

        //Constructor
        public frmReservationController(MetroGrid grid, MetroForm form)
        {
            this.grid = grid;
            this.form = form;

            //Instantiate database
            database = new Database(form);
        }
        public frmShowController(MetroForm form, MetroGrid grid, int reservationID)
        {
            this.form = form;
            this.grid = grid;
            this.reservationID = reservationID;

            database = new Database(form); //Instantiate database.
        }
        public frmShowController(MetroForm form, int showID)
        {
            this.form = form;
            this.showID = showID;

            //Instantiate database
            database = new Database(form);
        }
        //End variables

        //Constructor
        public frmSeatController(MetroForm form)
        {
            this.form = form;

            //Start instantiations
            database = new Database(form);
            show = new Show();
            //End instantiations
        }
        public frmSeatController(MetroForm form, List<int> seatID, int showID)
        {
            this.seatID = seatID;
            this.showID = showID;
            this.form = form;

            //Instantiate database
            database = new Database(form);
        }
        //End variables

        //Constructor
        public frmEmployeeController(MetroForm form, MetroGrid grid)
        {
            this.form = form;
            this.grid = grid;
            //Start instantiation
            database = new Database(this.form);
            encryptionController = new frmEncryptionController();
            //End instantiation
        }
        //End variables

        //Constructor
        public frmRegisterController(Customer customer, MetroForm form)
        {
            this.customer = customer;
            this.form = form;

            //Start instantiations
            database = new Database(form);
            encryptionController = new frmEncryptionController();
            //End instantiations
        }
        //End variables

        //Constructor
        public frmOverviewController(MetroForm form, ComboBox comboBox)
        {
            this.form = form;
            this.comboBox = comboBox;

            //Start instantiation
            seatAvailability = new List<bool>();
            database = new Database(form);
            //End instantiation
        }
예제 #16
0
 public static void LoadTheme(MetroFramework.Forms.MetroForm Form, System.Windows.Forms.Control.ControlCollection Controls, MetroFramework.Controls.MetroUserControl MetroUserControl = null)
 {
     foreach (var form in System.Windows.Forms.Application.OpenForms)
     {
         if (form is MetroForm && !form.Equals(Form))
         {
             try
             {
                 var metroForm = (MetroForm)form;
                 metroForm.Theme = metroForm.StyleManager.Theme = Friends.GlobalStyleManager.Theme;
                 metroForm.Style = metroForm.StyleManager.Style = Friends.GlobalStyleManager.Style;
                 metroForm.Refresh();
             }
             catch
             {
             }
         }
     }
     if (Controls != null)
     {
         foreach (System.Windows.Forms.Control control in Controls)
         {
             try
             {
                 if (control.GetType().GetProperties().Any(x => x.Name == "StyleManager") || (control.GetType().GetProperties().Any(x => x.Name == "Theme") && control.GetType().GetProperties().Any(x => x.Name == "Style")))
                 {
                     control.GetType().GetProperty("Theme").SetValue(control, Friends.GlobalStyleManager.Theme, null);
                     control.GetType().GetProperty("Style").SetValue(control, Friends.GlobalStyleManager.Style, null);
                     var styleManager = control.GetType().GetProperty("StyleManager").GetValue(control, null) as MetroFramework.Components.MetroStyleManager;
                     styleManager       = Friends.GlobalStyleManager;
                     styleManager.Style = Friends.GlobalStyleManager.Style;
                     styleManager.Theme = Friends.GlobalStyleManager.Theme;
                     control.Refresh();
                 }
                 LoadTheme(null, control.Controls);
             }
             catch
             {
             }
         }
     }
     if (Form != null)
     {
         Form.Theme = Form.StyleManager.Theme = Friends.GlobalStyleManager.Theme;
         Form.Style = Form.StyleManager.Style = Friends.GlobalStyleManager.Style;
         Form.Refresh();
     }
     if (MetroUserControl != null)
     {
         MetroUserControl.Theme = MetroUserControl.StyleManager.Theme = Friends.GlobalStyleManager.Theme;
         MetroUserControl.Style = MetroUserControl.StyleManager.Style = Friends.GlobalStyleManager.Style;
         MetroUserControl.Refresh();
     }
 }
        //End variables

        //Controller
        public frmLoginController(MetroForm form, string username, string password)
        {
            this.username = username;
            this.form = form;
            this.password = password;

            //Start instantiation
            database = new Database(form);
            encryptionController = new frmEncryptionController();
            //End instantiation
        }
        public frmReservationController(MetroForm form, int customerID, List<int> seatID, int showID)
        {
            this.form = form;
            this.customerID = customerID;
            this.seatID = seatID;
            this.showID = showID;

            //Start instantiation
            reservation = new Reservation(customerID, DateTime.Now.Date);
            database = new Database(form);
            //End instantiation
        }
예제 #19
0
 public DeliverManager(MySqlDataReader data_reader,MetroForm _login)
 {
     InitializeComponent();
     login = _login;
     this.FormClosing += DeliverManager_FormClosing;
     worker_id = data_reader.GetString("worker_name");
     this.Text = "欢迎回来," + worker_id;
     data_reader.Close();
     InitialTable();
     FillComboBox();
     UpdataTable(cargo_name);
 }
        public frmTicketController(MetroForm form, MetroGrid grid, int reservationID)
        {
            this.form = form;
            this.grid = grid;
            
            //Start instantiation
            ticket = new Ticket();
            database = new Database(form);
            //End instantiation

            ticket.getSetReservationID = reservationID;
        }
예제 #21
0
        public static void CambiarIdiomaCotrolesDentroDelTab(MetroFramework.Forms.MetroForm metroFor, List <Traduccion> traduccions)

        {
            foreach (var traduccion in traduccions)
            {
                foreach (Control item in metroFor.Controls)
                {
                    if (item.ToString().Contains("TabControl"))
                    {
                        foreach (Control subItem in item.Controls)
                        {
                            if (subItem.Tag != null)
                            {
                                if (traduccion.palabra.palabra == subItem.Tag.ToString())
                                {
                                    if (traduccion.traduccion == null)
                                    {
                                        subItem.Text = subItem.Tag.ToString();
                                    }
                                    else
                                    {
                                        subItem.Text = traduccion.traduccion;
                                    }
                                }
                            }



                            foreach (Control tab in subItem.Controls)
                            {
                                if (tab.ToString().Contains("Label") || tab.ToString().Contains("Button") || tab.ToString().Contains("Tile"))
                                {
                                    if (tab.Tag != null)
                                    {
                                        if (traduccion.palabra.palabra == tab.Tag.ToString())
                                        {
                                            if (traduccion.traduccion == null)
                                            {
                                                tab.Text = tab.Tag.ToString();
                                            }
                                            else
                                            {
                                                tab.Text = traduccion.traduccion;
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
예제 #22
0
 public MetroAeroDropShadow(MetroForm targetForm)
     : base(targetForm, 0, WS_EX_TRANSPARENT | WS_EX_NOACTIVATE)
 {
     // Results differ between 32-bit and 64-bit... In 32-it, we seem to be able to use all border styles
     // (except None, of course). In 64 bit, the only fully working style is SizableToolWindow.
     // In particular (64-bit):
     //   FixedDialog gives a small transparent frame and round corners.
     //   Same with Fixed 3D or FixedSingle, but there are strange animation artifacts!?
     //   FixedToolWindow results in a small frame straight corners, no anim artifacts
     //   Sizable comes with no frames, but artifacts (64, OK in 32)
     FormBorderStyle = FormBorderStyle.SizableToolWindow;
     TransparencyKey = Color.Black;
 }
        //End variables

        //Constructor
        public frmTicketController(MetroForm form, List<int> seatID, int showID, int customerID, MetroGrid grid)
        {
            this.showID = showID;
            this.seatID = seatID;
            this.form = form;
            this.grid = grid;
            this.customerID = customerID;

            //Start instantiations
            reservationController = new frmReservationController(form, customerID, seatID, showID);
            reservation = new Reservation(customerID, DateTime.Now.Date);
            database = new Database(form);
            ticket = new Ticket();
            //End instantiations
        }
예제 #24
0
 public User(MySqlDataReader dataReader,MySqlConnection con,MetroForm _login)
 {
     InitializeComponent();
     this.userId = dataReader.GetString(0);
     this.WelcomeNameLabel.Text += dataReader.GetString(2) + "!";
     nameDispalyText.Text = dataReader.GetString(2);
     emailDisplayText.Text = dataReader.GetString(3);
     addressDispalyText.Text = dataReader.GetString(5);
     phoneDisplayText.Text = dataReader.GetString(6);
     idNumDispalyText.Text = dataReader.GetString(4);
     moneyDispalyText.Text = dataReader.GetString(7);
     dataReader.Close();
     this.con = con;
     login = _login;
     this.FormClosing += User_FormClosing1;
 }
예제 #25
0
        public static void CambiarIdioma(MetroFramework.Forms.MetroForm metroForm)



        {
            TraduccionComponent traduccionComponent = new TraduccionComponent();
            List <Traduccion>   traduccions         = new List <Traduccion>();

            if (SingletonIdioma.intance.getUsuario() != null)
            {
                traduccions = traduccionComponent.ReadByIdioma(SingletonIdioma.intance.getUsuario().Id);

                CambiarIdiomaFormulario(metroForm, traduccions);
                CambiarIdiomaCotrolesFormulario(metroForm, traduccions);
                CambiarIdiomaCotrolesDentroDelTab(metroForm, traduccions);
            }
        }
예제 #26
0
            protected override void Dispose(bool disposing)
            {
                if (disposing)
                {
                    TargetForm.Activated      -= OnTargetFormActivated;
                    TargetForm.ResizeBegin    -= OnTargetFormResizeBegin;
                    TargetForm.ResizeEnd      -= OnTargetFormResizeEnd;
                    TargetForm.VisibleChanged -= OnTargetFormVisibleChanged;
                    TargetForm.SizeChanged    -= OnTargetFormSizeChanged;

                    TargetForm.Move   -= OnTargetFormMove;
                    TargetForm.Resize -= OnTargetFormResize;

                    TargetForm.Owner = Owner; // dis-own so we don't dispose it
                    Owner            = TargetForm = null;
                }
                base.Dispose(disposing);
            }
예제 #27
0
        public static void CambiarIdiomaFormulario(MetroFramework.Forms.MetroForm metroFor, List <Traduccion> traduccions)

        {
            if (metroFor.Tag != null)
            {
                foreach (var traduccion in traduccions)
                {
                    if (traduccion.palabra.palabra == metroFor.Tag.ToString())
                    {
                        if (traduccion.traduccion != null)
                        {
                            metroFor.Text = traduccion.traduccion;
                        }
                        else
                        {
                            metroFor.Text = metroFor.Tag.ToString();
                        }
                    }
                }
            }
        }
예제 #28
0
        public WareHouseManager(MySqlDataReader dataReader,MetroForm _login)
        {
            InitializeComponent();
            login = _login;
            this.FormClosing += WareHouseManager_FormClosing;
            //We last don't have it as a id but a name for reading.
            worker_id = dataReader.GetString("worker_name");
            this.Text = "欢迎回来," + dataReader.GetString("worker_name");
            dataReader.Close();
            data_set = new DataTable();
            DataGridViewButtonColumn request_column = new DataGridViewButtonColumn();
            request_column.HeaderText = "请求";
            //gigUrlColumn.Name = "Gig Url name";
            request_column.Text = "入库";
            request_column.UseColumnTextForButtonValue = true;
            request_column.Width = 106;
            WHdataGridView.Columns.Add(request_column);
            WHdataGridView.DataSource = FillDataGrid();
            WHdataGridView.DefaultCellStyle.SelectionBackColor = Color.SkyBlue;
            WHdataGridView.DefaultCellStyle.SelectionForeColor = Color.White;

        }
예제 #29
0
        public static void ObtenerTag(MetroFramework.Forms.MetroForm metroForm)

        {
            String cadena = "";

            foreach (Control item in metroForm.Controls)
            {
                string test = item.ToString();
                if (item.ToString().Contains("Label") || item.ToString().Contains("Button"))
                {
                    cadena = cadena + Environment.NewLine + item.Tag.ToString();
                }
                if (item.ToString().Contains("TabControl"))
                {
                    foreach (Control subItem in item.Controls)
                    {
                        cadena = cadena + Environment.NewLine + subItem.Tag.ToString();
                        foreach (Control tab in subItem.Controls)
                        {
                            if (tab.ToString().Contains("Label") || tab.ToString().Contains("Button"))
                            {
                                cadena = cadena + Environment.NewLine + tab.Tag.ToString();
                            }
                        }
                    }
                }
            }

            string rutaCompleta = @" C:\temp\tag.txt";
            string texto        = cadena;

            using (StreamWriter file = new StreamWriter(rutaCompleta, true))
            {
                file.WriteLine(texto); //se agrega información al documento

                file.Close();
            }
        }
예제 #30
0
 public OpenControlHelper(MetroFramework.Forms.MetroForm owner)
 {
     _owner = owner;
 }
예제 #31
0
 public FixedStyleManager(MetroForm form)
 {
     this.m_manager = new MetroStyleManager(form.Container);
     this.m_manager.Owner = form;
 }
        /// <summary>
        /// Shows a metro-styles message notification into the specified owner window.
        /// </summary>
        /// <param name="owner"></param>
        /// <param name="message"></param>
        /// <param name="title"></param>
        /// <param name="buttons"></param>
        /// <param name="icon"></param>
        /// <param name="defaultbutton"></param>
        /// <returns></returns>
        public static DialogResult Show(IWin32Window owner, String message, String title, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultbutton)
        {
            DialogResult _result = DialogResult.None;

            if (owner != null)
            {
                MetroFramework.Forms.MetroForm _owner = (MetroFramework.Forms.MetroForm)owner;

                int _minWidth  = 450;
                int _minHeight = 250;

                if (_owner.Size.Width < _minWidth ||
                    _owner.Size.Height < _minHeight)
                {
                    if (_owner.Size.Width < _minWidth &&
                        _owner.Size.Height < _minHeight)
                    {
                        _owner.Size = new Size(_minWidth, _minHeight);
                    }
                    else
                    {
                        if (_owner.Size.Width < _minWidth)
                        {
                            _owner.Size = new Size(_minWidth, _owner.Size.Height);
                        }
                        else
                        {
                            _owner.Size = new Size(_owner.Size.Width, _minHeight);
                        }
                    }

                    int x = Convert.ToInt32(Math.Ceiling((decimal)(Screen.PrimaryScreen.WorkingArea.Size.Width / 2) - (_owner.Size.Width / 2)));
                    int y = Convert.ToInt32(Math.Ceiling((decimal)(Screen.PrimaryScreen.WorkingArea.Size.Height / 2) - (_owner.Size.Height / 2)));
                    _owner.Location = new Point(x, y);
                }

                MetroMessageBoxControl _control = new MetroMessageBoxControl(_owner.Style);
                _control.BackColor                = _owner.BackColor;
                _control.Properties.Buttons       = buttons;
                _control.Properties.DefaultButton = defaultbutton;
                _control.Properties.Icon          = icon;
                _control.Properties.Message       = message;
                _control.Properties.Title         = title;
                _control.Padding       = new Padding(0, 0, 0, 0);
                _control.ControlBox    = false;
                _control.ShowInTaskbar = false;
                _control.Size          = new Size(_owner.Size.Width, _control.Height);
                _control.Location      = new Point(_owner.Location.X, _owner.Location.Y + (_owner.Height - _control.Height) / 2);
                _control.ArrangeApperance();
                int _overlaySizes = Convert.ToInt32(Math.Floor(_control.Size.Height * 0.28));

                _control.SetDefaultButton();

                switch (icon)
                {
                case MessageBoxIcon.Error:
                    SystemSounds.Hand.Play(); break;

                case MessageBoxIcon.Exclamation:
                    SystemSounds.Exclamation.Play(); break;

                case MessageBoxIcon.Question:
                    SystemSounds.Beep.Play(); break;

                default:
                    SystemSounds.Asterisk.Play(); break;
                }

                _result = _control.ShowDialog(_owner);
                _control.Dispose();
                _control = null;
            }

            return(_result);
        }
예제 #33
0
 public Admin(MetroForm _login)
 {
     InitializeComponent();
     login = _login;
     this.FormClosing += Admin_FormClosing;
 }
 public frmMovieController(MetroForm form, int movieID)
 {
     this.form = form;
     this.movieID = movieID;
     database = new Database(form);//Instantiate database
 }
예제 #35
0
 private void sendTradeOfferToolStripMenuItem_Click(object sender, EventArgs e)
 {
     var sid = new SteamID(contextMenuSteamId);
     var url = "http://steamcommunity.com/tradeoffer/new/?partner=" + sid.AccountID;
     var tradeOffersForm = new MetroForm();
     tradeOffersForm.Icon = MistClient.Properties.Resources.Icon;
     tradeOffersForm.Width = 720;
     tradeOffersForm.Height = 730;
     tradeOffersForm.Text = "Trade Offer with " + bot.SteamFriends.GetFriendPersonaName(sid);
     tradeOffersForm.Style = this.Style;
     tradeOffersForm.Theme = this.Theme;
     tradeOffersForm.ShadowType = MetroFormShadowType.DropShadow;
     var tradeOffersWeb = new Awesomium.Windows.Forms.WebControl();
     tradeOffersWeb.Dock = DockStyle.Fill;
     string cookies = string.Format("steamLogin={0}; sessionid={1}", bot.token, bot.sessionId);
     tradeOffersWeb.WebSession = WebCore.CreateWebSession(new WebPreferences());
     tradeOffersWeb.WebSession.SetCookie("http://steamcommunity.com".ToUri(), cookies, true, true);
     tradeOffersWeb.Source = url.ToUri();
     tradeOffersWeb.DocumentReady += tradeOffersWeb_DocumentReady;
     tradeOffersForm.Controls.Add(tradeOffersWeb);
     tradeOffersForm.Show();
     tradeOffersForm.Focus();
 }
예제 #36
0
 private void tradeOffersToolStripMenuItem_Click(object sender, EventArgs e)
 {
     var tradeOffersForm = new MetroForm();
     tradeOffersForm.Icon = MistClient.Properties.Resources.Icon;
     tradeOffersForm.Width = 1012;
     tradeOffersForm.Height = 500;
     tradeOffersForm.Text = "Trade Offers";
     tradeOffersForm.Style = this.Style;
     tradeOffersForm.Theme = this.Theme;
     tradeOffersForm.ShadowType = MetroFormShadowType.DropShadow;
     var tradeOffersWeb = new Awesomium.Windows.Forms.WebControl();
     tradeOffersWeb.Dock = DockStyle.Fill;
     string cookies = string.Format("steamLogin={0}; sessionid={1}", bot.token, bot.sessionId);
     tradeOffersWeb.WebSession = WebCore.CreateWebSession(new WebPreferences());
     tradeOffersWeb.WebSession.SetCookie("http://steamcommunity.com".ToUri(), cookies, true, true);
     tradeOffersWeb.Source = ("http://steamcommunity.com/profiles/" + bot.SteamUser.SteamID.ConvertToUInt64() + "/tradeoffers/").ToUri();
     tradeOffersWeb.DocumentReady += tradeOffersWeb_DocumentReady;
     tradeOffersForm.Controls.Add(tradeOffersWeb);
     tradeOffersForm.Show();
     tradeOffersForm.Focus();
 }
예제 #37
0
 private void steamCommunityMarketToolStripMenuItem_Click(object sender, EventArgs e)
 {
     var form = new MetroForm();
     form.Text = "Steam Community Market";
     form.Width = 1025;
     form.Height = 600;
     form.Style = Friends.GlobalStyleManager.Style;
     form.Theme = Friends.GlobalStyleManager.Theme;
     form.Icon = MistClient.Properties.Resources.Icon;
     form.ShadowType = MetroFormShadowType.DropShadow;
     var webControl = new Awesomium.Windows.Forms.WebControl();
     form.Controls.Add(webControl);
     webControl.Dock = System.Windows.Forms.DockStyle.Fill;
     string cookies = string.Format("steamLogin={0}; sessionid={1}", bot.token, bot.sessionId);
     webControl.WebSession = Awesomium.Core.WebCore.CreateWebSession(new Awesomium.Core.WebPreferences());
     webControl.WebSession.SetCookie(new Uri("http://steamcommunity.com"), cookies, true, true);
     webControl.Source = new Uri("http://steamcommunity.com/market");
     webControl.DocumentReady += steamCommunityMarket_DocumentReady;
     webControl.TitleChanged += (s, ev) => webControl_TitleChanged(s, ev, form);
     form.Show();
 }
예제 #38
0
 public static void SetManagerOwner(MetroForm form)
 {
     MANAGER.Owner = form;
 }
 public frmShowController(MetroForm form)
 {
     this.form = form;
     //Instantiate database
     database = new Database(form);
 }
예제 #40
0
파일: Util.cs 프로젝트: The-Mad-Pirate/Mist
 private static void webControl_TitleChanged(object sender, Awesomium.Core.TitleChangedEventArgs e, MetroForm parentForm)
 {
     parentForm.Text = e.Title;
     parentForm.Refresh();
     ((Awesomium.Windows.Forms.WebControl)sender).TitleChanged -= (s, ev) => webControl_TitleChanged(s, ev, parentForm);
 }
        //End variables

        //Constructor
        public Database(MetroForm form)
        {
            this.form = form;
        }
예제 #42
0
 public void ShowSteamInfo(SteamBot.Bot bot, ulong steamId)
 {
     var steamInfo = new MetroForm();
     var steamInfoTextBox = new MetroFramework.Controls.MetroTextBox();
     steamInfoTextBox.Multiline = true;
     steamInfoTextBox.Dock = DockStyle.Fill;
     steamInfoTextBox.Text = Util.GetSteamIDInfo(bot, steamId);
     steamInfoTextBox.Theme = this.StyleManager.Theme;
     steamInfoTextBox.Style = this.StyleManager.Style;
     steamInfo.Icon = MistClient.Properties.Resources.Icon;
     steamInfo.Width = 435;
     steamInfo.Height = 155;
     steamInfo.MaximizeBox = false;
     steamInfo.MinimizeBox = false;
     steamInfo.Resizable = false;
     steamInfo.Text = "Steam Info";
     steamInfo.Theme = this.StyleManager.Theme;
     steamInfo.Style = this.StyleManager.Style;
     steamInfo.ShadowType = MetroFormShadowType.DropShadow;
     steamInfo.Controls.Add(steamInfoTextBox);
     steamInfo.ShowDialog();
 }