예제 #1
0
        private void Output(SaveFormat to, string fileName, bool openforce)
        {
            Exclusive.Extension.MiMFa_Convert pc = new Exclusive.Extension.MiMFa_Convert();
            string addr = Config.TempDirectory + System.DateTime.Now.Ticks + "htmlimportlogoutput.html";

            MiMFa_IOService.StringToFile(addr, Browser.DocumentText);
            pc.To(addr, fileName, to, openforce);
        }
예제 #2
0
        private void Output(Aspose.Words.SaveFormat to, string dest, bool openforce = false)
        {
            Exclusive.Extension.MiMFa_Convert pc = new Exclusive.Extension.MiMFa_Convert();
            string addr = Config.TempDirectory + System.DateTime.Now.Ticks + "mrloutput.html";

            MiMFa_IOService.StringToFile(addr, MiMFa_StringService.ReplaceWithAllWordBetween(Viewer.DocumentText, "<input ", "/>", ""));
            pc.To(addr, dest, to, openforce);
        }
예제 #3
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);
 }
예제 #4
0
        public override object execute(object obj, int index, int length)
        {
            FileMode f = (_create) ? FileMode.OpenOrCreate : FileMode.Open;

            if (index == 0)
            {
                source = obj;
            }
            else if (obj != null && obj is string)
            {
                if (source != null && source is string)
                {
                    string s  = PATH.getpath(source.ToString().Trim());
                    string d  = PATH.getpath(obj.ToString().Trim());
                    bool   sf = PATH.isfile(s);
                    bool   df = PATH.isfile(d);
                    if (!df && !_nocreatedestinationdirectory)
                    {
                        MiMFa_Path.CreateAllDirectories(d);
                    }
                    if (!df && !sf)
                    {
                        MiMFa_Path.DirectoryCopy(s, d, _copysubdirectory);//copy directory to directory
                    }
                    else if (!df && sf)
                    {
                        File.Copy(s, d + Path.GetFileName(s));
                    }
                    else if (df && !sf)
                    {
                        throw new ArgumentException("Can not copy a directory in file!");
                    }
                    else
                    {
                        File.Copy(s, d);
                    }
                }
                else if (source != null)
                {
                    if (_serialize)
                    {
                        MiMFa_IOService.SaveSerializeFile(obj.ToString(), source, f);
                    }
                    else if (_append)
                    {
                        MiMFa_IOService.StringNewLineAppendFile(obj.ToString(), MCL.Display.Done(source), f);
                    }
                    else
                    {
                        MiMFa_IOService.StringToFile(obj.ToString(), MCL.Display.Done(source), f);
                    }
                }
                else
                {
                    throw new ArgumentNullException("Can not be null sources!");
                }
            }
            else
            {
                obj = source;
            }
            return(Null);
        }