示例#1
0
文件: Floater.cs 项目: d3x0r/xperdex
        private void CreateFloater(object sender, EventArgs e)
        {
            Floater f;

            local.floaters.Add(f = new Floater());
            f.Show();
            local.WriteFloaters();
        }
示例#2
0
文件: local.cs 项目: d3x0r/xperdex
        static local()
        {
            //FILE_NAME = Application.UserAppDataPath + "\\floaters.bin";
            FILE_NAME = Application.ExecutablePath + ".bin2";
            color     = Color.Black;
            floaters  = new List <Floater>();
            try
            {
                reading = true;
                FileStream   fs = new FileStream(FILE_NAME, FileMode.Open);
                BinaryReader r  = new BinaryReader(fs);
                try
                {
                    resize = r.ReadBoolean();
                    locked = r.ReadBoolean();
                    color  = Color.FromArgb(r.ReadInt32());
                    while (true)
                    {
                        int     x      = r.ReadInt32();
                        int     y      = r.ReadInt32();
                        int     width  = r.ReadInt32();
                        int     height = r.ReadInt32();
                        Floater f      = new Floater();
                        f.Size = new Size(width, height);
                        floaters.Add(f);
                        f.Show();
                        f.Location = new Point(x, y);
                    }
                }
                catch (Exception e)
                {
                }
                fs.Close();
            }
            catch (Exception e)
            {
            }
            reading = false;

            if (local.floaters.Count == 0)
            {
                Floater floater = new Floater();
                local.floaters.Add(floater);
                //            floater.Visible = true;
                floater.Size = new Size(250, 800);
                floater.Show();
            }
        }