Ejemplo n.º 1
0
        public Form1()
        {
            Form.CheckForIllegalCrossThreadCalls = false;
            InitializeComponent();
            logs = logs_collection;

            path = Application.StartupPath + '\\';
            c = Conveer.Load(path + conv, ground);
            if (c == null)  c = new Conveer(ground);

            for(int loop1=0;loop1<pro.Length;loop1++)
                c.AddObject(pro[loop1]);

            c.Start();
        }
Ejemplo n.º 2
0
        public static Conveer Load(string path, Panel p)
        {
            if (!File.Exists(path)) return null;
                Conveer c = new Conveer(p);

                try
                {
                    StreamReader fs = new StreamReader(path);
                    BinaryFormatter bf = new BinaryFormatter();

                    c.globalindex = (int)bf.Deserialize(fs.BaseStream);
                    c.localindex = (int)bf.Deserialize(fs.BaseStream);
                    int lim = (int)bf.Deserialize(fs.BaseStream);

                    for (int loop1 = 0; loop1 < lim; loop1++)
                    {
                        Prototype prot = ((Prototype)bf.Deserialize(fs.BaseStream));

                        //int loo = 0;
                        //prot.ots.Clear();
                        //int y = 0;

                        StylesList stli = new StylesList(c, prot, c.styles.Count == 0 ? Top : c.styles[c.styles.Count - 1].Top);
                        stli.Load(fs);
                        stli.SetName("В отстойнике : "+prot.OtstoyCount());
                        c.styles.Add(stli);
                        //prot.ots[1].links = new string[] { };

                        //c.globalindex = c.localindex = 0;

                        //stli.prototype.sites = new string[] { };

                        //stli.prototype.sites = new [] {/*"oron",*/"zippyshare" };
                        //stli.DropLastLinkFields();
                        //stli.prototype.Clear();
                    }

                    fs.Close();
                }

                catch { return null; }

                return c;
        }
Ejemplo n.º 3
0
        public StylesList(Conveer conv,Prototype proto,int top=0)
        {
            tipok.IsBalloon = true;
            owner = conv;
            prototype = proto;

            currtop = top;

            onoff = new CheckBox();
            onoff.ThreeState = true;
            onoff.Checked = false;
            Name = prototype.Name;
            onoff.Text=Name;
            onoff.Left = 5;
            onoff.Top = top + 5;
            onoff.AutoSize = false;
            onoff.Width = owner.objectscontainer.Width - 20;
            onoff.Anchor = AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top;
            onoff.BackColor = System.Drawing.Color.LightBlue;

            currtop += 10 + onoff.Height;

            owner.objectscontainer.Controls.Add(onoff);
        }