Post Pacific

Post Pacific (https://postpacific.loc-online.com/index.php)
-   Темы без сохранившегося раздела (https://postpacific.loc-online.com/forumdisplay.php?f=10001)
-   -   [SHARE] HD SAE .NET (skillacquire.txt explorer) + sources (https://postpacific.loc-online.com/showthread.php?t=4338)

humordwarf 07.05.2006 22:15

[SHARE] HD SAE .NET (skillacquire.txt explorer) + sources
 
NOT EDITOR, JUST VIEWER
no any AntiLE keys needed :D

.net framework 2.0 required

shot:
http://img473.imageshack.us/img473/4...shot1zh.th.jpg

sources:
Code:

using System;
using System.IO;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace hd_sae
{
    public partial class Main : Form
    {
        const int SAParamCount  = 8;
        const string sInclude  = "include";
        const string sBegin    = "begin";
        const string sEnd      = "end";
        const string sSkill    = "skill";
        const string sError    = "error";

        ArrayList SA = new ArrayList();
        StreamReader sr;

        void AddClassToTree(string ClassName)
        {
            Tree.Nodes.Add(ClassName);
        }

        void AddSkillToListView(string SkillLine)
        {
            string[] ss = SkillLine.Split('\t');
            if (ss.Length == SAParamCount)
            {
                ListViewItem li = ListView.Items.Add(GetSkillValue(ss[2]));
                li.SubItems.Add(GetSkillValue(ss[3]));
                li.SubItems.Add(GetSkillValue(ss[4]));
                li.SubItems.Add(GetSkillValue(ss[5]));
                li.SubItems.Add(GetSkillValue(ss[6]));
            }
        }

        void BuildTree()
        {
            string s1="", s2="";
            Tree.Nodes.Clear();
            ListView.Items.Clear();
            for (int i = 0; i < SA.Count; i++)
            {
                if (ExtractParams((string)SA[i], ref s1, ref s2))
                {
                    if (s1 == sSkill)
                    {
                    }
                    else if (s1 == sInclude)
                    {
                    }
                    else if (s2 == sBegin)
                    {
                        AddClassToTree(s1);
                    }
                }
            }
        }

        string GetSkillValue(string s)
        {
            string[] ss = s.Split('=');
            if (ss.Length == 2)
            {
                return ss[1];
            }
            else
            {
                return sError;
            }
        }
   
        void AddClassToListView(string ClassName)
        {
            ArrayList IncList = GetIncludeList(ClassName);
            for (int i = 0; i < IncList.Count; i++)
            {
                AddClassToListView((string)IncList[i]);
            }

            string s1 = "", s2 = "", cc = "";
            for (int i = 0; i < SA.Count; i++)
            {
                if (ExtractParams((string)SA[i], ref s1, ref s2))
                {
                    if (s1 == sSkill)
                    {
                        if (cc == ClassName)
                        {
                            AddSkillToListView((string)SA[i]);
                        }
                    }
                    else if (s1 == sInclude)
                    {
                    }
                    else if (s2 == sBegin)
                    {
                        cc = s1;
                    }
                    else if (s2 == sEnd && cc == ClassName)
                    {
                        cc = "";
                        break;
                    }

                }
            }
        }

        ArrayList GetIncludeList(string ClassName)
        {
            ArrayList r = new ArrayList();
            string s1="",s2="",cc="";
            for (int i = 0; i < SA.Count; i++)
            {
                if (ExtractParams((string)SA[i], ref s1, ref s2))
                {
                    if (s1 == sSkill)
                    {
                    }
                    else if (s1 == sInclude)
                    {
                        if (cc == ClassName)
                        {
                            r.Add(s2);
                        }
                    }
                    else if (s2 == sBegin)
                    {
                        cc = s1;
                    }
                    else if (s2 == sEnd && cc==ClassName)
                    {
                        cc = "";
                        break;
                    }

                }
            }
            return r;
        }

        bool ExtractParams(string Line, ref string s1, ref string s2)
        {
            string[] ss = Line.Split('\t');
            if (ss.Length == SAParamCount)
            {
                string[] s0 = ss[0].Split('_');
                if (s0.Length >= 2)
                {
                    s1 = s0[0];
                    s2 = s0[s0.Length - 1];

                    if (s1 == sInclude)
                    {
                        for (int i = 1; i < s0.Length - 1; i++)
                        {
                            s2 = s0[i] + "_" + s2;
                        }

                    }
                    else
                    {
                        for (int i = 1; i < s0.Length - 1; i++)
                        {
                            s1 = s1 + "_" + s0[i];
                        }
                    }
                    return true;
                }
            }
            s1 = "";
            s2 = "";
            return false;
        }

        public Main()
        {
            InitializeComponent();
        }

        private void openToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (OpenDlg.ShowDialog() == DialogResult.OK)
            {
                string Line;
                sr = File.OpenText(OpenDlg.FileName);
                SA.Clear();
                while ((Line = sr.ReadLine()) != null)
                {
                    SA.Add(Line);
                }
                sr.Close();
                BuildTree();
            }
        }

        private void exitToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Application.Exit();
        }

        private void aboutToolStripMenuItem_Click(object sender, EventArgs e)
        {
            frmAbout About = new frmAbout();
            About.ShowDialog();
        }

        private void Tree_AfterSelect(object sender, TreeViewEventArgs e)
        {
            ListView.ListViewItemSorter = null;
            ListView.Sorting = SortOrder.None;
            ListView.Items.Clear();
            AddClassToListView(Tree.SelectedNode.Text);
        }

        private void ListView_ColumnClick(object sender, ColumnClickEventArgs e)
        {
            ListView.ListViewItemSorter = new ListViewItemComparer(e.Column);
        }

        class ListViewItemComparer : IComparer
        {
            private int col;
            public ListViewItemComparer()
            {
                col = 0;
            }
            public ListViewItemComparer(int column)
            {
                col = column;
            }
            public int Compare(object x, object y)
            {
                int a, b;
                if (col == 1 || col == 2)
                {
                    try
                    {
                        a = int.Parse(((ListViewItem)x).SubItems[col].Text);
                        b = int.Parse(((ListViewItem)y).SubItems[col].Text);
                        return a - b;
                    }
                    catch
                    {
                        return String.Compare(((ListViewItem)x).SubItems[col].Text, ((ListViewItem)y).SubItems[col].Text);
                    }
                }
                else
                {
                    return String.Compare(((ListViewItem)x).SubItems[col].Text, ((ListViewItem)y).SubItems[col].Text);
                }
            }
        }
    }
}


humordwarf 07.05.2006 22:15

[SHARE] HD SAE .NET (skillacquire.txt explorer) + sources
 
NOT EDITOR, JUST VIEWER
no any AntiLE keys needed :D

.net framework 2.0 required

shot:
http://img473.imageshack.us/img473/4...shot1zh.th.jpg

sources:
Code:

using System;
using System.IO;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace hd_sae
{
    public partial class Main : Form
    {
        const int SAParamCount  = 8;
        const string sInclude  = "include";
        const string sBegin    = "begin";
        const string sEnd      = "end";
        const string sSkill    = "skill";
        const string sError    = "error";

        ArrayList SA = new ArrayList();
        StreamReader sr;

        void AddClassToTree(string ClassName)
        {
            Tree.Nodes.Add(ClassName);
        }

        void AddSkillToListView(string SkillLine)
        {
            string[] ss = SkillLine.Split('\t');
            if (ss.Length == SAParamCount)
            {
                ListViewItem li = ListView.Items.Add(GetSkillValue(ss[2]));
                li.SubItems.Add(GetSkillValue(ss[3]));
                li.SubItems.Add(GetSkillValue(ss[4]));
                li.SubItems.Add(GetSkillValue(ss[5]));
                li.SubItems.Add(GetSkillValue(ss[6]));
            }
        }

        void BuildTree()
        {
            string s1="", s2="";
            Tree.Nodes.Clear();
            ListView.Items.Clear();
            for (int i = 0; i < SA.Count; i++)
            {
                if (ExtractParams((string)SA[i], ref s1, ref s2))
                {
                    if (s1 == sSkill)
                    {
                    }
                    else if (s1 == sInclude)
                    {
                    }
                    else if (s2 == sBegin)
                    {
                        AddClassToTree(s1);
                    }
                }
            }
        }

        string GetSkillValue(string s)
        {
            string[] ss = s.Split('=');
            if (ss.Length == 2)
            {
                return ss[1];
            }
            else
            {
                return sError;
            }
        }
   
        void AddClassToListView(string ClassName)
        {
            ArrayList IncList = GetIncludeList(ClassName);
            for (int i = 0; i < IncList.Count; i++)
            {
                AddClassToListView((string)IncList[i]);
            }

            string s1 = "", s2 = "", cc = "";
            for (int i = 0; i < SA.Count; i++)
            {
                if (ExtractParams((string)SA[i], ref s1, ref s2))
                {
                    if (s1 == sSkill)
                    {
                        if (cc == ClassName)
                        {
                            AddSkillToListView((string)SA[i]);
                        }
                    }
                    else if (s1 == sInclude)
                    {
                    }
                    else if (s2 == sBegin)
                    {
                        cc = s1;
                    }
                    else if (s2 == sEnd && cc == ClassName)
                    {
                        cc = "";
                        break;
                    }

                }
            }
        }

        ArrayList GetIncludeList(string ClassName)
        {
            ArrayList r = new ArrayList();
            string s1="",s2="",cc="";
            for (int i = 0; i < SA.Count; i++)
            {
                if (ExtractParams((string)SA[i], ref s1, ref s2))
                {
                    if (s1 == sSkill)
                    {
                    }
                    else if (s1 == sInclude)
                    {
                        if (cc == ClassName)
                        {
                            r.Add(s2);
                        }
                    }
                    else if (s2 == sBegin)
                    {
                        cc = s1;
                    }
                    else if (s2 == sEnd && cc==ClassName)
                    {
                        cc = "";
                        break;
                    }

                }
            }
            return r;
        }

        bool ExtractParams(string Line, ref string s1, ref string s2)
        {
            string[] ss = Line.Split('\t');
            if (ss.Length == SAParamCount)
            {
                string[] s0 = ss[0].Split('_');
                if (s0.Length >= 2)
                {
                    s1 = s0[0];
                    s2 = s0[s0.Length - 1];

                    if (s1 == sInclude)
                    {
                        for (int i = 1; i < s0.Length - 1; i++)
                        {
                            s2 = s0[i] + "_" + s2;
                        }

                    }
                    else
                    {
                        for (int i = 1; i < s0.Length - 1; i++)
                        {
                            s1 = s1 + "_" + s0[i];
                        }
                    }
                    return true;
                }
            }
            s1 = "";
            s2 = "";
            return false;
        }

        public Main()
        {
            InitializeComponent();
        }

        private void openToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (OpenDlg.ShowDialog() == DialogResult.OK)
            {
                string Line;
                sr = File.OpenText(OpenDlg.FileName);
                SA.Clear();
                while ((Line = sr.ReadLine()) != null)
                {
                    SA.Add(Line);
                }
                sr.Close();
                BuildTree();
            }
        }

        private void exitToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Application.Exit();
        }

        private void aboutToolStripMenuItem_Click(object sender, EventArgs e)
        {
            frmAbout About = new frmAbout();
            About.ShowDialog();
        }

        private void Tree_AfterSelect(object sender, TreeViewEventArgs e)
        {
            ListView.ListViewItemSorter = null;
            ListView.Sorting = SortOrder.None;
            ListView.Items.Clear();
            AddClassToListView(Tree.SelectedNode.Text);
        }

        private void ListView_ColumnClick(object sender, ColumnClickEventArgs e)
        {
            ListView.ListViewItemSorter = new ListViewItemComparer(e.Column);
        }

        class ListViewItemComparer : IComparer
        {
            private int col;
            public ListViewItemComparer()
            {
                col = 0;
            }
            public ListViewItemComparer(int column)
            {
                col = column;
            }
            public int Compare(object x, object y)
            {
                int a, b;
                if (col == 1 || col == 2)
                {
                    try
                    {
                        a = int.Parse(((ListViewItem)x).SubItems[col].Text);
                        b = int.Parse(((ListViewItem)y).SubItems[col].Text);
                        return a - b;
                    }
                    catch
                    {
                        return String.Compare(((ListViewItem)x).SubItems[col].Text, ((ListViewItem)y).SubItems[col].Text);
                    }
                }
                else
                {
                    return String.Compare(((ListViewItem)x).SubItems[col].Text, ((ListViewItem)y).SubItems[col].Text);
                }
            }
        }
    }
}


Mattho 07.05.2006 22:37

what the hell is wrong with you? :D

keep up good work...

Mattho 07.05.2006 22:37

what the hell is wrong with you? :D

keep up good work...

jtomasrl 07.05.2006 23:12

WTH is this

jtomasrl 07.05.2006 23:12

WTH is this

madar 07.05.2006 23:16

Quote:

Originally Posted by jtomasrl
WTH is this

skillacquire.txt viewer, are you blind or cant read?

madar 07.05.2006 23:16

Quote:

Originally Posted by jtomasrl
WTH is this

skillacquire.txt viewer, are you blind or cant read?

jtomasrl 08.05.2006 01:05

cant read

jtomasrl 08.05.2006 01:05

cant read

RipperX 08.05.2006 02:12

Quote:

Originally Posted by jtomasrl
cant read

//spanish
no seas huevon pibe, media pila
//spanish

//english
not be a leecher, read and learn
//english

RipperX 08.05.2006 02:12

Quote:

Originally Posted by jtomasrl
cant read

//spanish
no seas huevon pibe, media pila
//spanish

//english
not be a leecher, read and learn
//english

jtomasrl 08.05.2006 02:40

//spanish
huevon = leecher?
pff
//spanish

jtomasrl 08.05.2006 02:40

//spanish
huevon = leecher?
pff
//spanish

tpuNIsher 08.05.2006 04:24

you are a GOD

tpuNIsher 08.05.2006 04:24

you are a GOD

TheOrder 08.05.2006 07:28

Humordwarf you Rule !!! Tnx again for this tool !!!

TheOrder 08.05.2006 07:28

Humordwarf you Rule !!! Tnx again for this tool !!!

Zeran 08.05.2006 09:55

Big respect to you man!
10x for good job :)

Zeran 08.05.2006 09:55

Big respect to you man!
10x for good job :)

andrei1516 08.05.2006 10:18

oOOOOo
Thnx again, and thx for sourse code !!!!!

andrei1516 08.05.2006 10:18

oOOOOo
Thnx again, and thx for sourse code !!!!!

mantrastic 08.05.2006 13:04

you wont stop eh? lol , man , good job! keep it up! :D

mantrastic 08.05.2006 13:04

you wont stop eh? lol , man , good job! keep it up! :D

humordwarf 08.05.2006 13:44

Quote:

Originally Posted by mantrastic
you wont stop eh?

i will, soon.
everything has end.


All times are GMT. The time now is 15:16.