Esempio n. 1
0
        private void SaveCurrentLocationOld()
        {
            DialogResult result1 = MessageBox.Show(
                "Update Favorite Location ",
                "Important Question",
                MessageBoxButtons.YesNo);

            if (result1 == DialogResult.Yes)
            {
                string hh = this.Left.ToString() + "," + this.Top.ToString() + "," + this.Width.ToString() + ","
                            + this.Height.ToString();

                var attacheWin = _attachedWindow.GetAttacheWindowSize();



                string hh1 = attacheWin.Left.ToString() + "," + attacheWin.Top.ToString() + "," + attacheWin.Width.ToString() + ","
                             + attacheWin.Height.ToString();

                hh += "|" + hh1;

                File.WriteAllText("FavoriteLocation.txt", hh);
            }

            Location location = new TransparentWindow.Location();

            location.TransparentWindowLocation = this.Bounds;
            location.AttachedWindowLocation    = _attachedWindow.GetAttacheWindowSize();
        }
Esempio n. 2
0
        public void SaveCurrentLocation(string FileName)
        {
            var location = new TransparentWindow.Location();

            location.TransparentWindowLocation = _transparentForm.Bounds;
            location.AttachedWindowLocation    = _attachedWindow.GetAttacheWindowSize();

            var serializer = new JavaScriptSerializer();

            File.WriteAllText(FileName + ".json", serializer.Serialize(location));
        }