Exemplo n.º 1
0
        public StylePair(StylesList container, Style st, string path)
        {
            p = container;
            p.owner.objectscontainer.AutoScrollMargin = new System.Drawing.Size(1, 1);

            p.owner.objectscontainer.Controls.Add(Name);
            p.owner.objectscontainer.Controls.Add(Path);
            p.owner.objectscontainer.Controls.Add(SetPath);
            p.owner.objectscontainer.Controls.Add(Canc);
            p.owner.objectscontainer.Controls.Add(Info);
            p.owner.objectscontainer.Controls.Add(SubInfo);

            stylecode = st.code;
            Name.Text = st.name;
            SetPath.Text = "...";
            SetPath.Width = SetPathWidth / 2 - 2;
            Canc.Text = "Clr";
            Canc.Width = SetPathWidth / 2;

            Name.Left = 0;
            Path.Left = PathLeft + Name.Left;
            Path.Width = PathWidth;
            SetPath.Left = 5 + Path.Left + Path.Width;
            Canc.Left = SetPath.Left + SetPath.Width + 2;

            Info.Left = SetPathWidth + SetPath.Left + 5;
            SubInfo.AutoSize=Info.AutoSize = true;

            SubInfo.Left = Path.Left;
            SubInfo.Font = new System.Drawing.Font(SubInfo.Font,System.Drawing.FontStyle.Bold);

            Path.Text = path;
            p.tipok.SetToolTip(Path, path);

            Path.Enabled = false;

            Pro2 = new Progress2(Path,0, 100, 1, (int)(1024 * 1024 * 1.5f));

            SetPath.Click += new EventHandler(SetPath_Click);
            Canc.Click += new EventHandler(Canc_Click);

            p.tipok.SetToolTip(SetPath, "Установить путь\r\nТекущий путь : "+Path.Text);
            p.tipok.SetToolTip(Canc, "Очистить путь");
        }
Exemplo 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;
        }
Exemplo n.º 3
0
        public void AddObject(Prototype obj)
        {
            for (int loop1 = 0; loop1 < styles.Count; loop1++)
                if (styles[loop1].prototype.Name == obj.Name)
                {
                    InitStyles(obj,styles[loop1]);
                    return;
                }

            StylesList te = new StylesList(this,obj,styles.Count==0 ? Top : styles[styles.Count-1].Top);
            InitStyles(obj, te);

            styles.Add(te);
        }
Exemplo n.º 4
0
        void timer_Tick(object sender, EventArgs e)
        {
            if (!work)
            {
                if (styles[globalindex].OnOffState != CheckState.Unchecked)
                {
                    work = true;
                    actlist = styles[globalindex];

                    th = new System.Threading.Thread(Routine);

                    th.Priority = System.Threading.ThreadPriority.Highest;
                    th.Start();
                }
                else
                {
                    if (++this.globalindex >= styles.Count)
                        this.globalindex = 0;
                }
            }

            Application.DoEvents();
        }
Exemplo n.º 5
0
        void InitStyles(Prototype pt, StylesList sl)
        {
            Style[] st = pt.InitStyles();

            for (int loop1 = 0; loop1 < st.Length; loop1++)
                if (sl.GetPos(st[loop1].name) == -1)
                    sl.Add(st[loop1]);
        }