Example #1
0
        private void CopyAllFiles(string arrayObjectName, string destination)
        {
            string          destinationPath;
            ArrayObject     arrayObject     = new ArrayObject(varObjectStructList);
            VarObjectStruct varObjectStruct = arrayObject.GetObjectFromName(arrayObjectName);
            Array           fileList        = varObjectStruct.ToArray();

            Common.MakeAllSubFolders(destination);
            destination = Common.SetSlashOnEndOfDirectory(destination);

            for (int i = 0; i < fileList.Length; i++)
            {
                if (!File.Exists(fileList.GetValue(i).ToString()))
                {
                    ModuleLog.Write(string.Format("File dont exists\r\n{0}", fileList.GetValue(i).ToString()), this, "CopyAllFiles", ModuleLog.LogType.WARNING);
                }
                else
                {
                    destinationPath = destination + Common.ExtractFileFromPath(fileList.GetValue(i).ToString());
                    ModuleLog.Write(new string[] { "Source: " + fileList.GetValue(i).ToString(), "Destination: " + destinationPath }, this, "CopyAllFiles", ModuleLog.LogType.DEBUG);

                    File.Copy(fileList.GetValue(i).ToString(), destinationPath, true);
                }
            }
        }
Example #2
0
        private void List(string folderPath, string arrayObjectName)
        {
            // Get all files from folder and put it in array object

            ArrayObject arrayObject = new ArrayObject(varObjectStructList);

            foreach (string file in Directory.GetFiles(folderPath))
            {
                arrayObject.AddOnce(arrayObjectName, file);
            }
            //VarObjectStruct varObjectStruct = arrayObject.GetObjectFromName(arrayObjectName);
            //ModuleLog.Write(varObjectStruct.ToArray(), this, "", ModuleLog.LogType.DEBUG);
        }
Example #3
0
        private string ReplaceSuportedObject(string objectName, string objectValue, RowCollectionRow row)
        {
            //
            //  I N F O - ReplaceTagsFromInToOut will not cut this
            //

            Tag2 tag = new Tag2("{=" + objectName + "." + objectValue);

            if (objectName == "date")
            {
                // Call to datetime object
                return this.DateObject(objectValue);
            }
            else if (objectName == "string")
            {
                // Call to main generic method, other method will call it to get object row value and then format it
                // this one just return pure text value

                //
                //   Ovo sa split je privremeno ovdje stavito
                //
                if (tag.Child.Name.Equals("split"))
                {
                    return StringObject(row, tag);
                }
                else
                {
                    return StringObject(row, objectValue);
                }
            }
            else if (objectName == "nth")
            {
                // Call to main generic method, other method will call it to get object row value and then format it
                // this one just return pure text value
                return NTHObject(row, objectValue);
            }
            else if (objectName == "number")
            {
                // Call to main generic method, other method will call it to get object row value and then format it
                // this one just return pure text value
                return NumberObject(row, objectValue);
            }
            else if (tag.Name == "input")
            {
                // Call to InputObject
                return InputObject(row, tag);
            }
            else if (tag.Name == "var")
            {
                // Call to VarObject
                return VarObject(tag);
            }
            else if (tag.Name == "array")
            {
                // Call to ArrayObject
                ArrayObject arrayObject = new ArrayObject(tag, varObjectList);
                return arrayObject.ProcessTag();
            }
            else if (tag.Name == "format")
            {
                // Call to FormatObject, get and set method
                return FormatObject(tag);
            }
            else if (objectName == "xml")
            {
                // Call to FormatObject, get and set method
                return XMLObject(row, objectValue);
            }
            else if (objectName.StartsWith("random"))
            {
                return RandomObject(objectName, objectValue);
            }
            else if (objectName.StartsWith("md5"))
            {
                return MD5Object(objectName, objectValue);
            }
            else if (tag.Name == "file")
            {
                FileObject fileObject = new FileObject(tag, ref varObjectList);
                return fileObject.ProcessTag();
            }
            else if (tag.Name == "dir")
            {
                DirObject dirObject = new DirObject(tag, ref varObjectList);
                return dirObject.ProcessTag();
            }
            else if (tag.Name == "graphics")
            {
                GraphicsObject fileObject = new GraphicsObject(tag);
                return fileObject.ProcessTag();
            }
            else if (tag.Name == "math")
            {
                MathObject mathObject = new MathObject(tag);
                return mathObject.ProcessTag();
            }
            else
            {
                // objects that dont need be in initialization proccess
                if (isInitialization == false)
                {
                    if (tag.Name == "active")
                    {
                        return ActiveObject(tag);

                    }
                    else if (tag.Name == "data")
                    {
                        // Call to main generic method, other method will call it to get object row value and then format it
                        // this one just return pure text value
                        return DataObjectGetValue(row, tag);
                    }
                    //else if (objectName.StartsWith("data"))
                    //{
                    //    return DataObjectGetValue(objectName, objectValue);
                    //}
                    else
                    {
                        return DataObjectGetValue(tag);
                    }
                }
            }

            return null;
        }
Example #4
0
        private void CopyAllFiles(string arrayObjectName, string destination)
        {
            string destinationPath;
            ArrayObject arrayObject = new ArrayObject(varObjectStructList);
            VarObjectStruct varObjectStruct = arrayObject.GetObjectFromName(arrayObjectName);
            Array fileList = varObjectStruct.ToArray();

            Common.MakeAllSubFolders(destination);
            destination = Common.SetSlashOnEndOfDirectory(destination);

            for (int i = 0; i < fileList.Length; i++)
            {
                if (!File.Exists(fileList.GetValue(i).ToString()))
                {
                    ModuleLog.Write(string.Format("File dont exists\r\n{0}", fileList.GetValue(i).ToString()), this, "CopyAllFiles", ModuleLog.LogType.WARNING);
                }
                else
                {
                    destinationPath = destination + Common.ExtractFileFromPath(fileList.GetValue(i).ToString());
                    ModuleLog.Write(new string[] { "Source: " + fileList.GetValue(i).ToString(), "Destination: " + destinationPath }, this, "CopyAllFiles", ModuleLog.LogType.DEBUG);

                    File.Copy(fileList.GetValue(i).ToString(), destinationPath, true);
                }
            }
        }
Example #5
0
        private void List(string folderPath, string arrayObjectName)
        {
            // Get all files from folder and put it in array object

            ArrayObject arrayObject = new ArrayObject(varObjectStructList);

            foreach (string file in Directory.GetFiles(folderPath))
            {
                arrayObject.AddOnce(arrayObjectName, file);
            }
            //VarObjectStruct varObjectStruct = arrayObject.GetObjectFromName(arrayObjectName);
            //ModuleLog.Write(varObjectStruct.ToArray(), this, "", ModuleLog.LogType.DEBUG);
        }