Exemplo n.º 1
0
        protected override void ProcessData()
        {
            base.ProcessData();

            this.Name = "Script.xls";
            string duongdan = Parser.pathworkingdir + Constants.Directory.ScriptDir;

            string path = duongdan + Name;

            this.PathFile = path;

            //--------minh diem cai interface co bao nhieu cot

            SourceLine _SourlineScript = new SourceLine();

            Parser.getopen(path);
            int cot = Parser.ColumnCount;

            Parser.pathlines = path;
            int dong = Parser.CountRow(path);

            //----------------------------------------------------


            ActionLines = new List <ActionLine>();
            for (int j = 1; j <= dong; j++)
            {
                if (_SourlineScript.CountColmsv(path) > 0)
                {
                    ActionLine actLine = new ActionLine();
                    actLine.ActionName = Parser.ValueCell(path, j - 1, 0).ToLower();

                    for (int i = 1; i < cot; i++)
                    {
                        string[] pairs = Parser.ValueCell(path, j - 1, i).Split(Constants.PropertyDelimeter.ToCharArray(), 2);
                        if (pairs.Length != 2)
                        {
                            continue;
                        }
                        if (Constants.KeywordWindow.Equals(pairs[0], StringComparison.CurrentCultureIgnoreCase))
                        {
                            actLine.WindowName = pairs[1];
                        }
                        else if (Constants.KeywordControl.Equals(pairs[0], StringComparison.CurrentCultureIgnoreCase))
                        {
                            actLine.ControlName = pairs[1].ToLower();
                        }
                        else
                        {
                            actLine.Arguments[pairs[0]] = pairs[1];
                        }
                    }

                    ActionLines.Add(actLine);
                }
            }
        }
Exemplo n.º 2
0
        protected override void ProcessData()
        {
            base.ProcessData();

            this.Name = "s1.xls";
            string duongdan = Parser.pathworkingdir + Constants.Directory.ScriptDir;

            string path = duongdan + Name;
            this.PathFile = path;

            //--------minh diem cai interface co bao nhieu cot

            SourceLine _SourlineScript = new SourceLine();
            Parser.getopen(path);
            int cot = Parser.ColumnCount;
            Parser.pathlines = path;
            int dong = Parser.CountRow(path);

            //----------------------------------------------------

            ActionLines = new List<ActionLine>();
            for (int j = 1; j <= dong; j++)
            {
                if (_SourlineScript.CountColmsv(path) > 0)
                {
                    ActionLine actLine = new ActionLine();
                    actLine.ActionName = Parser.ValueCell(path, j - 1, 0).ToLower();

                    for (int i = 1; i < cot; i++)
                    {

                        string[] pairs = Parser.ValueCell(path, j - 1, i).Split(Constants.PropertyDelimeter.ToCharArray(), 2);
                        if (pairs.Length != 2)
                        {
                            continue;
                        }
                        if (Constants.KeywordWindow.Equals(pairs[0], StringComparison.CurrentCultureIgnoreCase))
                            actLine.WindowName = pairs[1].ToLower();
                        else if (Constants.KeywordControl.Equals(pairs[0], StringComparison.CurrentCultureIgnoreCase))
                            actLine.ControlName = pairs[1].ToLower();
                        else
                            actLine.Arguments[pairs[0].ToLower()] = pairs[1];

                    }

                    ActionLines.Add(actLine);
                }
            }
        }
Exemplo n.º 3
0
        // minh phai dc duoc script len coi su dung interface nao roi moi fare len
        protected override void ProcessData()
        {
            base.ProcessData();
            // Lay Dc Windown - Control
            // minh phải cho no den cua interface de doc
            this.Name = "calculator";
            string duongdan = Parser.pathworkingdir + Constants.Directory.InterfaceDir;

            string path = duongdan + Name + Parser.FileExtension;
            this.PathFile = path;
            Name.ToLower();
            //--------minh diem cai interface co bao nhieu cot

            SourceLine _Sourline = new SourceLine();
            Parser.getopen(path);
            int cot = Parser.ColumnCount;
            //int cot = _Sourline.CountColmsv(path);
            Parser.pathlines = path;
            int dong = Parser.CountRow(path);

            Controls = new Dictionary<string, Dictionary<string, string>>();
            Properties = new Dictionary<string, string>();
            for (int j = 1; j <= dong; j++)
            {

                if (_Sourline.CountColmsv(path) > 0)
                {
                    string window = Parser.ValueCell(path, j - 1, 0);
                    string control = Parser.ValueCell(path, j - 1, 0);
                    if (Constants.KeywordWindow == window)
                    {
                        this.NameWindow = Parser.ValueCell(path, j - 1, 1).ToLower();
                        for (int i = 2; i < _Sourline.CountColmsv(path); i++)
                        {
                            string[] pairs = Parser.ValueCell(path, j - 1, i).Split(Constants.PropertyDelimeter.ToCharArray(), 2);

                            if (pairs.Length != 2)
                                throw new FormatException(Constants.Messages.Error_Parsing_Interface_InvalidWindow);

                            Properties[pairs[0].ToLower()] = pairs[1];

                        }
                    }

                    else if (Constants.KeywordControl == control)
                    {
                        string controlName = Parser.ValueCell(path, j - 1, 1).ToLower();
                        for (int i = 2; i < _Sourline.CountColmsv(path); i++)
                        {
                            string[] pairs = Parser.ValueCell(path, j - 1, i).Split(Constants.PropertyDelimeter.ToCharArray(), 2);
                            if (pairs.Length != 2)
                                throw new FormatException(Constants.Messages.Error_Parsing_Interface_InvalidControl);

                            Controls.Add(controlName, new Dictionary<string, string>());
                            Controls[controlName][pairs[0].ToLower()] = pairs[1];

                        }
                    }
                }
            }
        }
Exemplo n.º 4
0
        // minh phai dc duoc script len coi su dung interface nao roi moi fare len
        protected override void ProcessData()
        {
            base.ProcessData();
            // Lay Dc Windown - Control
            // minh phải cho no den cua interface de doc
            this.Name = "Calculator";
            string duongdan = Parser.pathworkingdir + Constants.Directory.InterfaceDir;

            string path = duongdan + Name + Parser.FileExtension;

            this.PathFile = path;
            Name.ToLower();
            //--------minh diem cai interface co bao nhieu cot

            SourceLine _Sourline = new SourceLine();

            Parser.getopen(path);
            int cot = Parser.ColumnCount;

            //int cot = _Sourline.CountColmsv(path);
            Parser.pathlines = path;
            int dong = Parser.CountRow(path);


            Controls   = new Dictionary <string, Dictionary <string, string> >();
            Properties = new Dictionary <string, string>();
            for (int j = 1; j <= dong; j++)
            {
                if (_Sourline.CountColmsv(path) > 0)
                {
                    string window  = Parser.ValueCell(path, j - 1, 0);
                    string control = Parser.ValueCell(path, j - 1, 0);
                    if (Constants.KeywordWindow == window)
                    {
                        this.NameWindow = Parser.ValueCell(path, j - 1, 1).ToLower();
                        for (int i = 2; i < _Sourline.CountColmsv(path); i++)
                        {
                            string[] pairs = Parser.ValueCell(path, j - 1, i).Split(Constants.PropertyDelimeter.ToCharArray(), 2);

                            if (pairs.Length != 2)
                            {
                                throw new FormatException(Constants.Messages.Error_Parsing_Interface_InvalidWindow);
                            }

                            Properties[pairs[0]] = pairs[1];
                        }
                    }

                    else if (Constants.KeywordControl == control)
                    {
                        string controlName = Parser.ValueCell(path, j - 1, 1).ToLower();
                        for (int i = 2; i < _Sourline.CountColmsv(path); i++)
                        {
                            string[] pairs = Parser.ValueCell(path, j - 1, i).Split(Constants.PropertyDelimeter.ToCharArray(), 2);
                            if (pairs.Length != 2)
                            {
                                throw new FormatException(Constants.Messages.Error_Parsing_Interface_InvalidControl);
                            }

                            Controls.Add(controlName, new Dictionary <string, string>());
                            Controls[controlName][pairs[0]] = pairs[1];
                        }
                    }
                }
            }
        }