private void btnAddAttr_Click(object sender, EventArgs e)
 {
     CtrlAttr ctrl = new CtrlAttr();
     ctrl.BorderStyle = BorderStyle.Fixed3D;
     ctrl.OnRemoveItem = OnRemoveAttrItem;
     fpnlAttrList.Controls.Add(ctrl);
 }
示例#2
0
        private void btnAddAttr_Click(object sender, EventArgs e)
        {
            CtrlAttr ctrl = new CtrlAttr();

            ctrl.BorderStyle  = BorderStyle.Fixed3D;
            ctrl.OnRemoveItem = OnRemoveAttrItem;
            fpnlAttrList.Controls.Add(ctrl);
        }
示例#3
0
        private void InitControls()
        {
            fpnlImageList.Controls.Clear();
            fpnlAttrList.Controls.Clear();
            fpnlItemList.Controls.Clear();

            string currentPath = Assembly.GetExecutingAssembly().Location;
            string dir         = new FileInfo(currentPath).DirectoryName;

            if (File.Exists(dir + "\\default_attr.txt"))
            {
                using (StreamReader reader = new StreamReader(dir + "\\default_attr.txt", Encoding.Default))
                {
                    string item = reader.ReadLine();
                    while (!string.IsNullOrEmpty(item))
                    {
                        CtrlAttr ctrl = new CtrlAttr();
                        ctrl.BorderStyle  = BorderStyle.Fixed3D;
                        ctrl.OnRemoveItem = OnRemoveAttrItem;

                        string[] attr = item.Split(':');
                        if (attr.Length == 1)
                        {
                            ctrl.AttrName = attr[0];
                        }
                        else if (attr.Length == 2)
                        {
                            ctrl.AttrName  = attr[0];
                            ctrl.AttrValue = attr[1];
                        }
                        fpnlAttrList.Controls.Add(ctrl);

                        item = reader.ReadLine();
                    }
                }
            }
        }
        private void InitControls()
        {
            fpnlImageList.Controls.Clear();
            fpnlAttrList.Controls.Clear();
            fpnlItemList.Controls.Clear();

            string currentPath = Assembly.GetExecutingAssembly().Location;
            string dir = new FileInfo(currentPath).DirectoryName;

            if (File.Exists(dir + "\\default_attr.txt"))
            {
                using (StreamReader reader = new StreamReader(dir + "\\default_attr.txt", Encoding.Default))
                {
                    string item = reader.ReadLine();
                    while (!string.IsNullOrEmpty(item))
                    {
                        CtrlAttr ctrl = new CtrlAttr();
                        ctrl.BorderStyle = BorderStyle.Fixed3D;
                        ctrl.OnRemoveItem = OnRemoveAttrItem;

                        string[] attr = item.Split(':');
                        if (attr.Length == 1)
                        {
                            ctrl.AttrName = attr[0];
                        }
                        else if (attr.Length == 2)
                        {
                            ctrl.AttrName = attr[0];
                            ctrl.AttrValue = attr[1];
                        }
                        fpnlAttrList.Controls.Add(ctrl);

                        item = reader.ReadLine();
                    }
                }
            }
        }