Beispiel #1
0
        public virtual object line(params object[] po)
        {
            object obj = po[0];

            if (obj == null)
            {
                return(Null);
            }
            string     str = "";
            List <int> li  = new List <int>();

            for (int i = 1; i < po.Length; i++)
            {
                try { li.Add(Convert.ToInt32(PATH.getpath(po[i].ToString()))); } catch { }
            }
            if (l || h)
            {
                str = MiMFa_IOService.FileToString(PATH.getpath(obj.ToString()), li.ToArray());
            }
            else
            {
                str = MiMFa_IOService.FileToTrimedString(PATH.getpath(obj.ToString()), li.ToArray());
            }
            if (!_concatwords)
            {
                return(str + SeparateText);
            }
            return(str);
        }
Beispiel #2
0
        public virtual object block(params object[] po)
        {
            object obj = po[0];

            if (obj == null)
            {
                return(Null);
            }
            string str   = "";
            int    index = Convert.ToInt32(po[1]);
            int    count = Convert.ToInt32(po[2]);

            if (l || h)
            {
                str = MiMFa_IOService.FileToString(PATH.getpath((obj.ToString())), index, count);
            }
            else
            {
                str = MiMFa_IOService.FileToTrimedString(PATH.getpath(obj.ToString()), index, count);
            }
            if (!_concatwords)
            {
                return(str + SeparateText);
            }
            return(str);
        }
Beispiel #3
0
 public override object EXECUTE(params object[] po)
 {
     if (_print)
     {
         return(MiMFa_IOService.FileToString(MCL.Address.Constructor));
     }
     else if (_delete && _all)
     {
         MiMFa_IOService.ClearFileContent(MCL.Address.Constructor);
     }
     else if (po != null && po.Length > 0)
     {
         string cmd = MCL.CrudeText(Normalization(po[0].ToString()).Replace("  ", " ")) + ";";
         if (_delete)
         {
             MiMFa_IOService.StringRemoveFromFile(MCL.Address.Constructor, cmd + ";");
         }
         else
         {
             MiMFa_IOService.StringNewLineAppendFile(MCL.Address.Constructor, cmd);
             MCL.Parse(cmd);
         }
     }
     return(Null);
 }
Beispiel #4
0
 public override object EXECUTE(params object[] po)
 {
     if (_analog)
     {
         return(MiMFa_IOService.FileToString(htmladdressA));
     }
     return(MiMFa_IOService.FileToString(htmladdress));
 }
Beispiel #5
0
 public bool Open(string path)
 {
     if (!string.IsNullOrEmpty(path))
     {
         if (MiMFa_GetDetail.IsAbsoluteURL(path))
         {
             Browse(path);
             return(true);
         }
         else
         {
             string mime = "";
             try { mime = General.MiMFa_GetDetail.GetMimeFile(path).Split('/')[0].Trim().ToLower(); } catch { }
             if (mime == "image")
             {
                 ShowBrowser(MiMFa_IOService.TryDeserialize(File.ReadAllBytes(path)), true);
             }
             else if (mime == "text")
             {
                 ShowBrowser(MiMFa_StringService.ToHTML(MiMFa_IOService.FileToString(path)));
             }
             else if (mime == "")
             {
                 Clear();
             }
             else
             {
                 bool b = General.MiMFa_GetDetail.IsBinaryFile(path);
                 if (b)
                 {
                     string ext = System.IO.Path.GetExtension(path).ToLower();
                     if (ext == ".pdf" ||
                         ext.StartsWith(".doc") ||
                         ext.StartsWith(".xls")
                         )
                     {
                         OpenBrowser(path);
                     }
                     else
                     {
                         OpenMediaPlayer(path);
                     }
                 }
                 else
                 {
                     ShowBrowser(MiMFa_IOService.FileToString(path));
                 }
                 return(true);
             }
         }
     }
     else
     {
         Clear();
     }
     return(false);
 }
Beispiel #6
0
 public override object EXECUTE(params object[] po)
 {
     if (po != null && po.Length > 0)
     {
         var sa = MiMFa_StringService.FirstFindAndSplit(po[0].ToString(), ",");
         if (_open || o)
         {
             return(MCL.Compile(MiMFa_IOService.FileToString(PATH.getpath(MCL.Compile(sa[0])))));
         }
         else if (_save || s || sa.Length == 2)
         {
             MiMFa_IOService.StringToFile(MCL.Parse(PATH.getpath(sa[0] + extention)), MCL.CrudeText(sa[1]));
         }
     }
     return(Null);
 }
Beispiel #7
0
 public static Function search(string name, int inputsnum = -1)
 {
     name = name.ToLower();
     try
     {
         Function f = MiMFa_CommandLanguage.FunctionsList.Find((v) => v.Name.ToLower() == name && v.Inputs.Length == inputsnum);
         if (f != null)
         {
             return(f);
         }
     }
     catch { }
     if (inputsnum > -1)
     {
         try
         {
             name = name + "(" + inputsnum + ")";
             string pat = MCL.Address.BaseFunctionDirectory + name + MCL.Address.FunctionExtension;
             if (File.Exists(pat))
             {
                 return((Function)MCL.Parser(MiMFa_IOService.FileToString(pat)));
             }
         }
         catch { }
     }
     else
     {
         try
         {
             string pat = (from v in General.MiMFa_Path.GetAllFiles(MCL.Address.BaseFunctionDirectory) where System.IO.Path.GetFileNameWithoutExtension(v).Split('(').First().ToLower() == name select v).First();
             if (File.Exists(pat))
             {
                 return((Function)MCL.Parser(MiMFa_IOService.FileToString(pat)));
             }
         }
         catch { }
     }
     return(null);
 }
Beispiel #8
0
 public void Open(object o, string addr)
 {
     if (o is Report)
     {
         try
         {
             ShowReport((Report)o, true);
         }
         catch { }
     }
     else if (Path.GetExtension(addr).ToLower() == MiMFa_CommandLanguage.Extension)
     {
         try
         {
             Report r = new Report(Path.GetFileNameWithoutExtension(addr), new ReportStyle(addr, MiMFa_IOService.FileToString(addr)));
             ShowReport(r, true);
         }
         catch { }
     }
     else
     {
         this.Viewer.Navigate(addr);
     }
 }