예제 #1
0
        private void Form1_Load(object sender, EventArgs e)
        {
            //var newTags = new List<TFSTag>();
            //newTags.Add(new TFSTag("TEST5", 80));
            //newTags.Add(new TFSTag("TEST9"));

            //mTagsDB.CheckTags(ref newTags);
            //mTagsDB.AddTag("image");
            //mTagsDB.AddTag("song");

            return;

            //addFilesInDir(@"F:\");

            //String Dir = "D:\\_RockGroup";
            String Dir  = "D:\\";
            var    Tags = new List <TFSTag>();

            long PrevID = -1;

            foreach (String tag in Dir.Split('\\'))
            {
                if (tag != "")
                {
                    TFSTag CurrentTag = mTagsDB.AddTag(tag, PrevID);
                    PrevID = CurrentTag.ID;
                    Tags.Add(CurrentTag);
                }
            }

            mTagsDB.OpenConnection();
            addFilesInDir(Dir, PrevID, Tags);
            mTagsDB.CloseConnection();
            //foreach (TFSTag Tag in newTags)
            //lstTags.Items.Add(Tag.ID.ToString() + "  " + Tag.Name + "  pid:" + Tag.ParentID.ToString());

            // Attributes test
            //mTagsDB.CheckAttribute("Definition");
            //mTagsDB.CheckAttribute("Definition");
            //mTagsDB.CheckAttribute("Definition", "Nice,Good");
            //mTagsDB.CheckAttribute("Definition", "Good,Cool,Bad");
            //mTagsDB.CheckAttribute("Definition");

            mTagsDB.LoadAllTags();
        }
예제 #2
0
        private void tfsTagBranch_Paint(object sender, PaintEventArgs e)
        {
            Graphics g = e.Graphics;
            TFSTag   t = mTag;
            PointF   p = new PointF(0, 0);
            Font     f = Font;// new Font("Segoe UI", 9);

            List <float> sizes = new List <float>();

            int i = 0;

            while (t != null)
            {
                float size = g.MeasureString(t.Name, f).Width + 2;
                sizes.Add(size);
                p.X += sizes.Last();
                t    = t.ParentTag;
            }

            t = mTag;
            while (t != null)
            {
                i++;
                p.X -= sizes[i - 1];
                g.DrawString(t.Name, f, new SolidBrush((t != mTagMM) ? ForeColor : Color.FromArgb(19, 130, 206)), p);

                t = t.ParentTag;
            }

            if (mTagMM != null || mFocused)
            {
                Rectangle r = ClientRectangle;
                r.Size = r.Size - new Size(1, 1);
                g.DrawRectangle(new Pen(Color.FromArgb(50, 50, 50, 100)), r);
            }
        }
예제 #3
0
        private void tfsTagBranch_MouseMove(object sender, MouseEventArgs e)
        {
            Graphics g = this.CreateGraphics();
            TFSTag   t = mTag;
            PointF   p = new PointF(0, 0);
            Font     f = Font; // new Font("Segoe UI", 9);

            List <float> sizes = new List <float>();

            int i = 0;

            while (t != null)
            {
                float size = g.MeasureString(t.Name, f).Width + 2;
                sizes.Add(size);
                p.X += sizes.Last();
                t    = t.ParentTag;
            }

            t = mTag;
            while (t != null)
            {
                i++;
                p.X -= sizes[i - 1];
                if (e.X > p.X && e.X < p.X + sizes[i - 1])
                {
                    mTagMM = t;
                    Refresh();
                    return;
                }

                t = t.ParentTag;
            }
            mTagMM = null;
            Refresh();
        }
예제 #4
0
 public ucTagBranch(TFSTag _Tag)
 {
     InitializeComponent();
     Tag = _Tag;
 }
예제 #5
0
 public TagClickEventArgs(TFSTag _Tag)
 {
     Tag = _Tag;
 }
예제 #6
0
 private void tfsTagBranch_MouseLeave(object sender, EventArgs e)
 {
     mTagMM = null;
     Refresh();
 }