예제 #1
0
 public static bool WONewObject(string[] Words, WebObject.Base CurrentObject)
 {
     if (Words[1].Length > 3)
     {
         if (Words[1].Remove(3) == "new")
         {
             foreach (WebObject.Base LocalCurrentObject in CurrentObject.CurrentProject.ObjectList)
             {
                 string MasterObjName = Words[1].Substring(3);
                 if (LocalCurrentObject.GetName() == MasterObjName)
                 {
                     WebObject.Base NewObject = Tools.CreateWebObject(Words[0], LocalCurrentObject, CurrentObject.HTML_Path, CurrentObject.CSS_Path);
                     NewObject.ClassName = LocalCurrentObject.GetName();
                     CurrentObject.LocalObjectList.Add(NewObject);
                 }
             }
         }
         else
         {
             string PropName = Words[0];
             Type   LangType = CurrentObject.CurrentProject.LangTools.PropType(PropName);
             CurrentObject.CurrentProject.LangTools.SetLangObjectValue(LangType, CurrentObject, PropName, Words[1]);
         }
         return(true);
     }
     else
     {
         return(false);
     }
 }
예제 #2
0
        public static bool WOFinal(string[] Words, WebObject.Base CurrentObject)
        {
            string PropName = Words[0];
            Type   LangType = CurrentObject.CurrentProject.LangTools.PropType(PropName);

            CurrentObject.CurrentProject.LangTools.SetLangObjectValue(LangType, CurrentObject, PropName, Words[1]);
            return(true);
        }
예제 #3
0
        //public static void SetObjectValue(Type PropType, string PropName, string PropValue)


        //public static string GetObjectValue<T>(T PropObject, string PropName)


        public static WebObject.Base CreateWebObject(string Name, WebObject.Base CurrentObject, string HTML_Path, string CSS_Path)
        {
            WebObject.Base NewObject = new WebObject.Base(Name, CurrentObject.CurrentProject, HTML_Path, CSS_Path);
            NewObject.CSS.SetAllProp(CurrentObject, CurrentObject.CSS.GetAllProp());
            NewObject.HTML.SetAllProp(CurrentObject, CurrentObject.HTML.GetAllProp());
            NewObject.ClassName = CurrentObject.ClassName;
            foreach (WebObject.Base Child in CurrentObject.LocalObjectList)
            {
                NewObject.LocalObjectList.Add(Tools.CreateWebObject(Child.GetName(), Child, HTML_Path, CSS_Path));
            }
            return(NewObject);
        }
예제 #4
0
 public static bool WOSetSource(string[] Words, WebObject.Base CurrentObject)
 {
     if (Words[0] == "source")
     {
         CurrentObject.HTML.PropertiesValue[3] = Words[1];
         return(true);
     }
     else
     {
         return(false);
     }
 }
예제 #5
0
        public static void CheckSousInstances(string ToAnalyze, string PreviousObjects, List <WebObject.Base> GlobalList)
        {
            string[]              PreviousNames = PreviousObjects.Split(new string[] { "->" }, StringSplitOptions.RemoveEmptyEntries);
            WebObject.Base        MasterObject  = Tools.FindWebObjectByName(PreviousNames[0], GlobalList);
            List <WebObject.Base> LoadedObjects = new List <WebObject.Base>();

            LoadedObjects.Add(MasterObject);
            for (int i = 1; i < PreviousNames.Length; i++)
            {
                WebObject.Base LocalObject = Tools.FindWebObjectByName(PreviousNames[i], LoadedObjects[LoadedObjects.Count - 1].LocalObjectList);
                LoadedObjects.Add(LocalObject);
            }
        }
예제 #6
0
 public static bool WOFunc(string[] Words, WebObject.Base CurrentObject)
 {
     if (Tools.IsBasicFuntion(Words[1].Split('(')[0]))
     {
         string[] FuncArguments = Words[1].Split('(')[1].Split(')')[0].Split(',');
         string   FuncName      = Words[1].Split('(')[0];
         Tools.ExecuteBasicFuntion(FuncName, FuncArguments, Words[0], CurrentObject);
         return(true);
     }
     else
     {
         return(false);
     }
 }
예제 #7
0
 public static void ExecuteBasicFuntion(string Name, string[] Arguments, string ObjectName, WebObject.Base CurrentObject)
 {
     MethodInfo[] BasicFunctionsList = typeof(BasicFunctions).GetMethods();
     foreach (MethodInfo BasicFunc in BasicFunctionsList)
     {
         if (BasicFunc.Name == Name)
         {
             object[] BasicArguments = new object[3];
             BasicArguments[0] = ObjectName;
             BasicArguments[1] = Arguments;
             BasicArguments[2] = CurrentObject;
             BasicFunc.Invoke(BasicFunc, BasicArguments);
         }
     }
 }
예제 #8
0
 public static bool WOCheckForSousInstances(string[] Words, WebObject.Base CurrentObject)
 {
     if (Words[0].Split(new string[] { "->" }, StringSplitOptions.RemoveEmptyEntries).Length > 1)
     {
         string[]              LocalWords    = Words[0].Split(new string[] { "->" }, StringSplitOptions.RemoveEmptyEntries);
         WebObject.Base        MasterObject  = Tools.FindWebObjectByName(LocalWords[0], CurrentObject.CurrentProject.ObjectList);
         List <WebObject.Base> LoadedObjects = new List <WebObject.Base>();
         LoadedObjects.Add(MasterObject);
         for (int i = 1; i < LocalWords.Length; i++)
         {
             if (LocalWords[i].Split('.').Length > 1)
             {
                 WebObject.Base ChildObject = Tools.FindWebObjectByName(LocalWords[i].Split('.')[0], LoadedObjects[LoadedObjects.Count - 1].LocalObjectList);
                 string         PropName    = LocalWords[i].Split('.')[1];
                 Type           LangType    = CurrentObject.CurrentProject.LangTools.PropType(PropName);
                 CurrentObject.CurrentProject.LangTools.SetLangObjectValue(LangType, CurrentObject, PropName, Words[1]);
             }
             else
             {
                 WebObject.Base LocalObject = null;
                 if (Words[1].Length > 3)
                 {
                     if (Words[1].Remove(3) == "new")
                     {
                         Console.WriteLine("Super coool :D " + Words[1].Substring(3) + LocalWords[i] + LocalWords[i - 1]);
                         LocalObject = Tools.CreateWebObject(LocalWords[i], Tools.FindWebObjectByName(Words[1].Substring(3), CurrentObject.CurrentProject.ObjectList), CurrentObject.HTML_Path, CurrentObject.CSS_Path);
                         Tools.FindWebObjectByName(LocalWords[i - 1], CurrentObject.LocalObjectList).LocalObjectList.Add(LocalObject);
                         Console.WriteLine(Tools.FindWebObjectByName(LocalWords[i - 1], CurrentObject.LocalObjectList).LocalObjectList[0].GetName());
                     }
                     else
                     {
                         LocalObject = Tools.FindWebObjectByName(LocalWords[i], LoadedObjects[LoadedObjects.Count - 1].LocalObjectList);
                     }
                 }
                 else
                 {
                     LocalObject = Tools.FindWebObjectByName(LocalWords[i], LoadedObjects[LoadedObjects.Count - 1].LocalObjectList);
                 }
                 LoadedObjects.Add(LocalObject);
             }
         }
         return(true);
     }
     else
     {
         return(false);
     }
 }
예제 #9
0
        public static void ExecuteAllAnalyzerFunc(string[] Words, WebObject.Base CurrentObject)
        {
            MethodInfo[] FunctionsList = typeof(Analyzer).GetMethods();
            int          DNum          = 0;

            foreach (MethodInfo AnalyzerFunc in FunctionsList)
            {
                if (AnalyzerFunc.Name.Remove(2) == "WO")
                {
                    if ((bool)AnalyzerFunc.Invoke(AnalyzerFunc, new object[] { Words, CurrentObject }))
                    {
                        break;
                    }
                }
                DNum++;
            }
        }
예제 #10
0
 public static void SetEmbemdedProp(string LocalData, WebObject.Base NewObject, WebProject CurrentProject)
 {
     //string NewLine = SyntaxTools.GetNewLine(LocalData);
     string[] LocalPropList = LocalData.Split('|');
     if (LocalPropList.Length > 0)
     {
         foreach (string LocalProp in LocalPropList)
         {
             string[] TestString = LocalData.Split('#');
             if (LocalProp == "-")
             {
             }
             else if (TestString[0].Split('.').Length > 1 && GetPropPos(LocalProp.Split('#')[0]) == -1)
             {
                 string[]       Words            = LocalProp.Split('.');
                 WebObject.Base ChildObject      = Tools.FindWebObjectByName(Words[0], NewObject.LocalObjectList);
                 string[]       Prop             = Words[1].Split('#');
                 int            CurrentPropIndex = GetPropPos(Prop[0]);
                 Console.WriteLine(LocalData + " " + Prop[0]);
                 string PropValue = Tools.GetProcessedValue(Prop[1], NewObject);
                 Console.WriteLine("Words[1] = " + Words[1] + " PropValue = " + PropValue);
                 if (CurrentPropIndex > -1)
                 {
                     NewObject.HTML.PropertiesValue[CurrentPropIndex] = Words[1];
                 }
                 string PropName = Prop[0];
                 Type   LangType = CurrentProject.LangTools.PropType(PropName);
                 CurrentProject.LangTools.SetLangObjectValue(LangType, ChildObject, PropName, PropValue);
             }
             else
             {
                 string[] Words     = LocalProp.Split('#');
                 string   PropValue = Tools.GetProcessedValue(Words[1], NewObject);
                 Console.WriteLine("Words[1] = " + Words[1] + " PropValue = " + PropValue);
                 int CurrentPropIndex = GetPropPos(Words[0]);
                 if (CurrentPropIndex > -1)
                 {
                     NewObject.HTML.PropertiesValue[CurrentPropIndex] = PropValue;
                 }
                 string PropName = Words[0];
                 Type   LangType = CurrentProject.LangTools.PropType(PropName);
                 CurrentProject.LangTools.SetLangObjectValue(LangType, NewObject, PropName, PropValue);
             }
         }
     }
 }
예제 #11
0
 public static bool WOSetPropValueWithObjectValue(string[] Words, WebObject.Base CurrentObject)
 {
     if (Words[1].Split('.').Length > 1 && Char.IsLetter(Words[1].Split('.')[1][0]))
     {
         string ObjName  = Words[1].Split('.')[0];
         string PropName = Words[1].Split('.')[1];
         foreach (WebObject.Base CurrentObj in CurrentObject.CurrentProject.ObjectList)
         {
             if (CurrentObj.GetName() == ObjName)
             {
                 Type LangType = CurrentObj.CurrentProject.LangTools.PropType(PropName);
                 CurrentObj.CurrentProject.LangTools.SetLangObjectValue(LangType, CurrentObj, PropName, CurrentObj.CurrentProject.LangTools.GetLangObjectValue(LangType, CurrentObj, PropName));
             }
         }
         return(true);
     }
     else
     {
         return(false);
     }
 }
예제 #12
0
        public static void Group(string Name, string[] Arguments, WebObject.Base CurrentObject, WebProject CurrentProject)
        {
            WebObject.Base ArrayObject = Tools.FindWebObjectByName(Arguments[1], CurrentObject.LocalObjectList);
            List <string>  DataArray   = new List <string>();

            foreach (string Data in ArrayObject.ArrayDatas)
            {
                DataArray.Add(Data);
            }
            WebObject.Base        MasterClass  = Tools.FindWebObjectByName(Arguments[0], CurrentObject.CurrentProject.ObjectList);
            List <WebObject.Base> ChildObjects = new List <WebObject.Base>();

            foreach (string LocalData in DataArray)
            {
                WebObject.Base NewObject = Tools.CreateWebObject(Name + DataArray.IndexOf(LocalData), MasterClass, MasterClass.HTML_Path, MasterClass.CSS_Path);
                NewObject.ClassName = MasterClass.GetName();
                Tools.SetEmbemdedProp(Arguments[2], NewObject, CurrentProject);
                Tools.SetEmbemdedProp(LocalData, NewObject, CurrentProject);
                CurrentObject.LocalObjectList.Add(NewObject);
            }
        }
예제 #13
0
 public static string GetProcessedValue(string LocalData, WebObject.Base CurrentObject)
 {
     if (LocalData.Split('.').Length > 1 && Char.IsLetter(LocalData.Split('.')[1][0]))
     {
         string LeftSide  = LocalData.Split('.')[0];
         string RightSide = LocalData.Split('.')[1];
         if (LeftSide == "data")
         {
             return(CurrentObject.CurrentProject.GetData(RightSide));
         }
         else
         {
             WebObject.Base SearchedObject = Tools.FindWebObjectByName(LeftSide, CurrentObject.CurrentProject.ObjectList);
             Type           LangType       = CurrentObject.CurrentProject.LangTools.PropType(RightSide);
             Console.WriteLine("Value : ");
             Console.WriteLine(CurrentObject.CurrentProject.LangTools.GetLangObjectValue(LangType, SearchedObject, RightSide));
             return(CurrentObject.CurrentProject.LangTools.GetLangObjectValue(LangType, SearchedObject, RightSide));
         }
     }
     return(LocalData);
 }
예제 #14
0
 public static bool WOArray(string[] Words, WebObject.Base CurrentObject)
 {
     if (Words[1].Length < 2)
     {
         return(false);
     }
     else if (Words[1].Remove(1) == "[")
     {
         string         LocalArguments      = Words[1].Substring(1).Split(']')[0];
         string[]       LocalArgumentsArray = LocalArguments.Split(',');
         WebObject.Base CreatedObject       = new WebObject.Base(Words[0], CurrentObject.CurrentProject, CurrentObject.HTML_Path, CurrentObject.CSS_Path);
         foreach (string LocalData in LocalArgumentsArray)
         {
             CreatedObject.ArrayDatas.Add(LocalData);
         }
         CurrentObject.LocalObjectList.Add(CreatedObject);
         return(true);
     }
     else
     {
         return(false);
     }
 }
예제 #15
0
 public static bool WOCheckForPropSetting(string[] Words, WebObject.Base CurrentObject)
 {
     if (Words[0].Split('.').Length > 1)
     {
         WebObject.Base ChildObject  = Tools.FindWebObjectByName(Words[0].Split('.')[0], CurrentObject.LocalObjectList);
         string         CurrentValue = Tools.GetProcessedValue(Words[1], CurrentObject);
         if (Words[0].Split('.')[1] == "link")
         {
             ChildObject.HTML.PropertiesValue[2] = CurrentValue;
         }
         else if (Words[0].Split('.')[1] == "source")
         {
             ChildObject.HTML.PropertiesValue[3] = CurrentValue;
         }
         string PropName = Words[0].Split('.')[1];
         Type   LangType = CurrentObject.CurrentProject.LangTools.PropType(PropName);
         CurrentObject.CurrentProject.LangTools.SetLangObjectValue(LangType, ChildObject, PropName, CurrentValue);
         return(true);
     }
     else
     {
         return(false);
     }
 }
예제 #16
0
 public static void LoadFromJSON(string Name, string[] Arguments, WebObject.Base CurrentObject)
 {
 }
예제 #17
0
        public string GlobalCompile()
        {
            string[] FileText     = System.IO.File.ReadAllLines(FileName);
            string   FileNamePath = "";

            if (FileName.Split('/').Length > 1)
            {
                FileNamePath = FileName.Remove(FileName.Length - FileName.Split('/')[FileName.Split('/').Length - 1].Length - 1);
            }
            else
            {
                FileNamePath = FileName.Remove(FileName.Length - FileName.Split('\\')[FileName.Split('\\').Length - 1].Length - 1);
            }
            string[]   ConfigLines   = System.IO.File.ReadAllLines(FileNamePath + "/config.bk");
            string[]   DataLines     = {};
            WebProject CurrenProject = new WebProject();

            CurrenProject.ProjectStopWatch.Start();
            if (System.IO.File.Exists(FileNamePath + "/data.bk"))
            {
                DataLines = System.IO.File.ReadAllLines(FileNamePath + "/data.bk");
                for (int i = 0; i < DataLines.Length; i++)
                {
                    string[] LocalLine = SyntaxTools.GetNewLine(DataLines[i]).Split('=');
                    CurrenProject.AddData(LocalLine[0], LocalLine[1]);
                }
            }
            this.HTML_Path = FileNamePath + ConfigLines[0].Split('=')[1];
            VerifyFolder(this.HTML_Path);
            this.CSS_Path = FileNamePath + ConfigLines[1].Split('=')[1];
            VerifyFolder(this.CSS_Path);
            bool Started = false;

            WebObject.Base CurrentObject = new WebObject.Base("default", CurrenProject, "", "");
            FileLines = new List <string>();
            AddFileLines(FileText, FileNamePath);
            for (int i = 0; i < FileLines.Count; i++)
            {
                string[] LinesWords = FileLines[i].Split(' ');

                if (LinesWords[0] == "page")
                {
                    CurrentObject = new WebObject.Page(LinesWords[1], CurrenProject, HTML_Path, CSS_Path);
                    Started       = true;
                }
                else if (LinesWords[0] == "object")
                {
                    if (LinesWords[1].Split(':').Length > 1)
                    {
                        string[] LocalWords = LinesWords[1].Split(':');
                        CurrentObject = new WebObject.Base(LocalWords[0], CurrenProject, HTML_Path, CSS_Path);
                        foreach (WebObject.Base LocalObject in CurrenProject.ObjectList)
                        {
                            if (LocalObject.GetName() == LocalWords[1])
                            {
                                CurrentObject.CSS.SetAllProp(LocalObject, LocalObject.CSS.GetAllProp());
                            }
                        }
                    }
                    else
                    {
                        CurrentObject = new WebObject.Base(LinesWords[1], CurrenProject, HTML_Path, CSS_Path);
                    }
                    Started = true;
                }
                else if (Started && LinesWords[0] == "end")
                {
                    CurrentObject.CompileObject();
                    CurrenProject.ObjectList.Add(CurrentObject);
                    Started = false;
                }
                else if (Started)
                {
                    CurrentObject.AddLine(FileLines[i]);
                }
            }
            CurrenProject.DisplayCompileTime();
            return("ExitCode = 0");
        }