Exemplo n.º 1
0
        private void Form1_Load(object sender, EventArgs e)
        {
            this.ContextMenuStrip   = Program.AddNewUserControlCMS;
            Program.LabelControlCMS = LabelContextMenuStrip1;

            foreach (Control Ctrl in this.Controls)
            {
                if (Ctrl.GetType().ToString() == "System.Windows.Forms.Panel")
                {
                    Ctrl.ContextMenuStrip = Program.AddNewUserControlCMS;
                    foreach (Control Ct in Ctrl.Controls)
                    {
                        if (Ct.GetType().ToString() == "System.Windows.Forms.Panel")
                        {
                            Ct.ContextMenuStrip = Program.AddNewUserControlCMS;
                        }
                    }
                }
            }

            Menus.InitAddUserControls(ref ArticlecontextMenuStrip1);
            Left_panel.Controls.RemoveByKey("UCref");
            RightSubPanel.Controls.RemoveByKey("UCref");
            RightSubPanel.Controls.Clear();
            reclamaPanel.Controls.Clear();
            UCFunctions.AddUC(this);
            //Left_panel.Controls.Add(new AuthenticationUserControl(new List<string>()) { Location = new Point(0,0), Dock = DockStyle.Top , Name = "qq"});
            GC.Collect();
            GC.WaitForPendingFinalizers();
            arts.Clear();
            //textBox_password.UseSystemPasswordChar = true;
            // button_add_reklama.Visible = false;

            lable_name_of_polzovatel.Text = Users.CURRENT_USER;
            AdmButton.Visible             = IS_ADMIN;
            AutButton.Visible             = IS_AUTHOR;
            button2.Visible = false;

            if (IS_ADMIN)
            {
                button2.Visible = true;
            }

            /*  #region Advertising
             *
             * reclamaPanel.Controls.Clear();
             * AdsUserControl recl = new AdsUserControl(new List<string>() { "5", "20" });
             * reclamaPanel.Controls.Add(recl);
             *
             #endregion*/

            textBox_search.Text = LAST_SEARCH;
            Search_Click(sender, e);
            popularArticlesLabel.ContextMenuStrip = Program.LabelControlCMS;
        }
Exemplo n.º 2
0
        public GhostMainForm()
        {
            UCFunctions.AddUC(this);
            DesignClass.AddContextMenuStrip(this);
            InitializeComponent();
            Configs.ZAGOLOVOK_FONT = popularArticlesLabel.Font;
            //label_Author_header.Font = Configs.ZAGOLOVOK_FONT;

            AdmButton.Visible = false;
            AutButton.Visible = false;
        }
Exemplo n.º 3
0
        public StatiyaForm(Statiya stat, bool YaAvtor = false)
        {
            InitializeComponent();
            mainTableLayoutPanel.Controls.RemoveByKey("UCref");
            UCFunctions.AddUC(this);

            avtor = YaAvtor;

            Kategoriatext.Enabled = avtor;
            Stattext.Enabled      = avtor;
            redact.Visible        = avtor;

            Head               = stat.ArticleName;
            Maintext.Text      = stat.ArticleName;
            Kategoriatext.Text = stat.Category;
            Stattext.Text      = stat.Text;

            Kategoriatext.Font = Configs.ZAGOLOVOK_FONT;

            Authortext.Font = Configs.ZAGOLOVOK_FONT;

            /*List<String> ids = SQLClass.Select("SELECT MAX(Artic_ID + 1) FROM  " + Tables.ARTICLES);
             * id = ids[0];
             *
             * SQLClass.Insert("INSERT INTO " + Tables.ARTICLES +
             *  "(Header, Category, Author, Text)" +
             *  " VALUES ('" + Maintext.Text + "'," +
             *  "'" + Kategoriatext.Text + "'," +
             *  "'" + Stattext.Text + "',"  +
             *  " 1)");
             * SQLClass.Update("UPDATE " + Tables.AUTHORS + "'");*/



            GetStata(labelLike, labeldis, Maintext.Text);

            try
            {
                pictureBox1.LoadAsync(stat.PictureURL);
            }
            catch (Exception)
            {
                pictureBox1.Image = new Bitmap("defolt_statiy.jpg");
            }
            Authortext.Text = stat.AuthorName;

            pictureBoxLike.Image    = Properties.Resources.like;
            pictureBoxDislike.Image = Properties.Resources.Dislike;
        }
 public DetailsForm(ArticleDetailsUserControl Details)
 {
     InitializeComponent();
     this.Controls.Add(Details);
     this.Controls.AddRange(UCFunctions.ReadFromDB(this.Name).ToArray());
 }