public override object execute(object obj, int index, int length) { if (obj == null) { return(Null); } string str = ""; if (_serialize) { return(MiMFa_IOService.OpenDeserializeFile(PATH.getpath(obj.ToString()))); } else if (_longview || _humanreadable) { return(MiMFa_IOService.FileToStringArray(PATH.getpath(obj.ToString()))); } else { str = MiMFa_IOService.FileToTrimedString(PATH.getpath(obj.ToString())); } if (!_concatwords && index < length - 1) { return(str + SeparateText); } return(str); }
public static WebPatern OpenFromFile(string fileaddress) { WebPatern wr = new WebPatern(); MiMFa_IOService.OpenDeserializeFile(fileaddress, ref wr); return(wr); }
private void tsb_Import_Click(object sender, EventArgs e) { OFD.Filter = "MiMfa Report Package Style File (*" + ReportStyle.Extension + ") | *" + ReportStyle.Extension; if (OFD.InitialDirectory == null) { OFD.InitialDirectory = ReportStyle.GetPath(); } if (OFD.ShowDialog() == DialogResult.OK) { ReportStyle report = new ReportStyle(); MiMFa_IOService.OpenDeserializeFile(OFD.FileName, ref report); if (string.IsNullOrEmpty(tstb_Subject.Text) || tstb_Subject.Text == "Default") { ReportStyle = report; } else { ReportStyle.MRLCode = report.MRLCode; ReportStyle.Script = report.Script; ReportStyle.Css = report.Css; ReportStyle.Extra = report.Extra; } ReportStyle.Address = OFD.FileName; } Initialize(null, ReportStyle, false); }
public void ChangeStyle(string fileName) { ReportStyle rs = new ReportStyle(); MiMFa_IOService.OpenDeserializeFile(fileName, ref rs); Report r = new Report(MainReport); r.Style = rs; ShowReport(r, true); }
public MiMFa_Table GetTable(int numberOfItems = -1) { if (FetchedSuccessList.Count < 1) { return(fetch_webpatern.DefaultPatern.TransposeResult? FetchSampleTable(fetch_webpatern).Transpose(true) : FetchSampleTable(fetch_webpatern)); } MiMFa_Table mdt = new MiMFa_Table(); if (numberOfItems < 0) { foreach (var item in FetchedSuccessList) { if (!string.IsNullOrWhiteSpace(item.TableAddress)) { try { MiMFa_Table dt = null; MiMFa_IOService.OpenDeserializeFile(item.TableAddress, ref dt); if (dt != null) { mdt.ConcatTable(dt); } } catch { } } } } else { int ind = 0; foreach (var item in FetchedSuccessList) { if (ind++ == numberOfItems) { break; } if (!string.IsNullOrWhiteSpace(item.TableAddress)) { try { MiMFa_Table dt = null; MiMFa_IOService.OpenDeserializeFile(item.TableAddress, ref dt); if (dt != null) { mdt.ConcatTable(dt); } } catch { } } } } return(mdt); }
private void ts_Main_DragDrop(object sender, DragEventArgs e) { try { string[] data = (string[])e.Data.GetData(DataFormats.FileDrop); object o = null; if (data != null) { foreach (var item in data) { MiMFa_IOService.OpenDeserializeFile(item, ref o); Open(o, item); } } } catch { } }
public Report GetDefaultReportArchive(string condition = "", string reportStylePath = null, string reportName = "Reports Archive", int limit = -1, int offset = -1) { Report report = new Report(); ReportStyle reportstyle = new ReportStyle(); if (string.IsNullOrEmpty(reportStylePath)) { reportStylePath = Address.ReportStyleArchivePath; } MiMFa_IOService.OpenDeserializeFile(reportStylePath, ref reportstyle); Report[] lr = GetReportList(condition, limit, offset); //MiMFaReportLanguage MRL = new MiMFaReportLanguage(); report.Name = reportName; report.Style = reportstyle; report.Type = typeof(Report); report.ObjectArray = lr; //report.HTML = MRL.CompileToHTML(report); return(report); }
public void Open() { OFD.Filter = "All File(*.*) | *.*"; if (OFD.InitialDirectory != null) { OFD.InitialDirectory = MainReport.GetPath(); } if (OFD.ShowDialog() == DialogResult.OK && !string.IsNullOrEmpty(OFD.FileName)) { if (Path.GetExtension(OFD.FileName) == Report.Extension) { MiMFa_IOService.OpenDeserializeFile(OFD.FileName, ref MainReport); ShowReport(() => MainReport, true); } else { this.Viewer.Navigate(OFD.FileName); } } }
//Create Object public void Create_ToolStripChild(ref ToolStripMenuItem thisMenustrip, string PAC_Address, EventHandler target) { try { ToolStripMenuItem t = new ToolStripMenuItem(); Dictionary <string, object> dso = new Dictionary <string, object>(); MiMFa_IOService.OpenDeserializeFile(PAC_Address, ref dso); try { ToolStripMenuItem_Creator(ref t, dso["Name"].ToString(), dso["Text"].ToString(), (RightToLeft)dso["RightToLeft"], (bool)dso["CheckOnClick"], (bool)dso["Checked"]); } catch { } t.Click += target; thisMenustrip.DropDownItems.AddRange(new ToolStripItem[] { t }); } catch { } }
private Dictionary <string, int> GetDicClick(params Control[] childsByDecOrder) { Dictionary <string, int> diccon = new Dictionary <string, int>(); try { MiMFa_IOService.OpenDeserializeFile(SorterHistoryFileAddress, ref diccon); } catch { diccon.Clear(); for (int i = 0; i < childsByDecOrder.Length; i++) { diccon.Add(childsByDecOrder[i].Name, i); } } if (diccon.Count < childsByDecOrder.Length) { diccon.Clear(); for (int i = 0; i < childsByDecOrder.Length; i++) { diccon.Add(childsByDecOrder[i].Name, i); } } return(diccon); }
public object load(params object[] po) { object[] obj = null; MiMFa_IOService.OpenDeserializeFile <object[]>(PATH.getpath(po[0] + extention), ref obj); bool b = !_workspacelist && !_functionslist && !_handlerslist && !h && !f && !w; if (_handlerslist || h) { MiMFa_CommandLanguage.HandlersList.AddRange((List <object>)obj[0]); MiMFa_CommandLanguage.HandlersList = MiMFa_CollectionService.Distinct(MiMFa_CommandLanguage.HandlersList); } if (b || _workspacelist || w) { MiMFa_CommandLanguage.WorkSpaceList.AddRange((MiMFa_List <Variable>)obj[1]); MiMFa_CommandLanguage.WorkSpaceList = MiMFa_CollectionService.Distinct(MiMFa_CommandLanguage.WorkSpaceList); } if (b || _functionslist || f) { MiMFa_CommandLanguage.FunctionsList.AddRange((MiMFa_List <Function>)obj[2]); MiMFa_CommandLanguage.FunctionsList = MiMFa_CollectionService.Distinct(MiMFa_CommandLanguage.FunctionsList); } return(Null); }
private Dictionary <string, int> GetDicClick(Control parent) { Control.ControlCollection ccc = parent.Controls; Dictionary <string, int> diccon = new Dictionary <string, int>(); try { MiMFa_IOService.OpenDeserializeFile(SorterHistoryFileAddress, ref diccon); } catch { diccon.Clear(); for (int i = 0; i < ccc.Count; i++) { diccon.Add(ccc[i].Name, i); } } if (diccon.Count < parent.Controls.Count) { diccon.Clear(); for (int i = 0; i < ccc.Count; i++) { diccon.Add(ccc[i].Name, i); } } return(diccon); }
public MiMFa_Table GetTable(FetchPatern patern, List <MiMFa_XMLElement> xmls) { MiMFa_Table mdt = new MiMFa_Table(); if (patern.HTMLElementsPatern == null) { return(mdt); } List <HTMLElementPatern> continuehep = new List <HTMLElementPatern>(); MiMFa_CollectionService.CopyTo(ref continuehep, patern.HTMLElementsPatern); List <MiMFa_XMLElement> me = new List <MiMFa_XMLElement>(); foreach (var item in patern.HTMLElementsPatern) { me.Add(item.SampleHTMLElement); } MiMFa_XMLElement e = MiMFa_XMLElement.GetElementsCommonParent(me); while (continuehep.Count > 0) { if (e != null) { e = MiMFa_XMLElement.Find(xmls, e); } List <MiMFa_XMLElement> scope = e == null ? xmls : new List <MiMFa_XMLElement>() { e }; bool all = false; MiMFa_XMLElement elem = null; int len = continuehep.Count; for (int i = 0; i < len; i++) { MiMFa_XMLElement ele = null; mdt = GetTable(mdt, continuehep[i], scope, out ele); if (continuehep[i].All != MiMFa_Boolean.True) { continuehep.RemoveAt(i); i--; len--; } else if (ele != null) { elem = ele; all = true; } if (ele != null) { if (continuehep.Count - 1 > i + 1 && continuehep[i].SampleHTMLElement == continuehep[i + 1].SampleHTMLElement.Parent) { ele.StartTag = ""; } else { xmls = MiMFa_XMLElement.GetLastSplitIn(xmls, ele); } } } if (e == null) { break; } if (elem == null) { xmls = MiMFa_XMLElement.GetLastSplitIn(xmls, e); } else if (all) { xmls = MiMFa_XMLElement.GetLastSplitIn(xmls, elem); } else { break; } } // if (fetch_url.TransposeResult) { mdt = mdt.Transpose(true); } NumberOfLastTableRows = mdt.MainTable.Rows.Count - 1; NumberOfAllTableRows += NumberOfLastTableRows; if (string.IsNullOrWhiteSpace(fetch_url.TableAddress)) { fetch_url.TableAddress = TempDirectory + DateTime.Now.Ticks + MiMFa_Table.Extention; } if (NumberOfLastTableRows > 0) { try { if (!string.IsNullOrWhiteSpace(fetch_url.Source)) { DataColumn dcs = mdt.AddColumnSafe("auto_Source"); for (int i = 1; i < mdt.Rows.Count; i++) { mdt.Rows[i][dcs] = fetch_url.Source; } } } catch { } } try { MiMFa_Table nmt = null; MiMFa_IOService.OpenDeserializeFile(fetch_url.TableAddress, ref nmt); if (nmt != null) { nmt = MiMFa_Table.ConcatTable(nmt, mdt); } } catch { } MiMFa_IOService.SaveSerializeFile(fetch_url.TableAddress, mdt); return(mdt); }
public void Initialize(Type thisType, ReportStyle reportStyle, bool subjectIsReadOnly = true) { ReportStyleCreate(thisType, reportStyle, true); if (reportStyle == null && thisType == null && !subjectIsReadOnly) { try { reportStyle = new ReportStyle(); thisType = typeof(Exclusive.Collection.Instance.MiMFa_Instance); reportStyle.Address = MRLTools.Address.ReportStyleDirectory + MRLTools.Address.DefaultName + ReportStyle.Extension; MiMFa_IOService.OpenDeserializeFile(reportStyle.Address, ref reportStyle); } catch { } } if (reportStyle != null) { tstb_Subject.Text = reportStyle.Name; rtb_Code.Text = reportStyle.MRLCode; rtb_Template.Text = reportStyle.Css; rtb_Script.Text = reportStyle.Script; AddressViewer.Text = reportStyle.Address; if (tp_Main.SelectedIndex == 0) { ViewRefresh(false); } else if (tp_Main.SelectedIndex == 4) { rtb_HTML.Text = GetVeiwHTML(); } CodeRefresh(); } if (tstb_Subject.Text == "Default") { tstb_Subject.ReadOnly = false; } else { tstb_Subject.ReadOnly = subjectIsReadOnly; } //Restart(); if (TagList.Items.Count < 1) { string sreport = Environment.NewLine + "\t\t" + Environment.NewLine + "\t" + MRLTools.EndSignTag; string stable = Environment.NewLine + "\t\t\t" + Environment.NewLine + "\t\t" + MRLTools.EndSignTag; string srow = Environment.NewLine + "\t\t\t\t" + Environment.NewLine + "\t\t\t" + MRLTools.EndSignTag; string sdata = Environment.NewLine + "\t\t\t\t\t" + Environment.NewLine + "\t\t\t\t" + MRLTools.EndSignTag; string atable = Environment.NewLine + "\t\t\t" + Environment.NewLine + "\t\t" + MRLTools.EndSignAutoTag; string arow = Environment.NewLine + "\t\t\t\t" + Environment.NewLine + "\t\t\t" + MRLTools.EndSignAutoTag; string adata = Environment.NewLine + "\t\t\t\t\t" + Environment.NewLine + "\t\t\t\t" + MRLTools.EndSignAutoTag; TagList.Items.Clear(); TagList.DisplayMember = "Key"; TagList.ValueMember = "Value"; foreach (var item in MRLTools.SimplyTagsDic.Keys) { if (item.StartsWith(MRLTools.StartSignAttachTag)) { TagList.Items.Add(new KeyValuePair <string, string>(item, item + Environment.NewLine)); } } TagList.Items.Add(new KeyValuePair <string, string>("Header", "HEADER> " + Environment.NewLine + "\t")); TagList.Items.Add(new KeyValuePair <string, string>("Content", "CONTENT> " + Environment.NewLine + "\t")); TagList.Items.Add(new KeyValuePair <string, string>("Footer", "FOOTER> " + Environment.NewLine + "\t")); TagList.Items.Add(new KeyValuePair <string, string>("Report Tag", Environment.NewLine + "\t<REPORT" + sreport)); TagList.Items.Add(new KeyValuePair <string, string>("Report Table Tag", Environment.NewLine + "\t\t<T" + stable)); TagList.Items.Add(new KeyValuePair <string, string>("Row Tag", Environment.NewLine + "\t\t\t<R" + srow)); TagList.Items.Add(new KeyValuePair <string, string>("Cell Tag", Environment.NewLine + "\t\t\t\t<D" + sdata)); TagList.Items.Add(new KeyValuePair <string, string>("Header Row Tag", Environment.NewLine + "\t\t\t<H" + srow)); TagList.Items.Add(new KeyValuePair <string, string>("Footer Row Tag", Environment.NewLine + "\t\t\t<F" + srow)); TagList.Items.Add(new KeyValuePair <string, string>("Header Cell Tag", Environment.NewLine + "\t\t\t\t<S" + adata)); TagList.Items.Add(new KeyValuePair <string, string>("Auto Value Tag", Environment.NewLine + "\t\t" + MRLTools.StartSignAutoTag + "V" + atable)); TagList.Items.Add(new KeyValuePair <string, string>("Auto Report Table Tag", Environment.NewLine + "\t\t" + MRLTools.StartSignAutoTag + "T" + atable)); TagList.Items.Add(new KeyValuePair <string, string>("Auto Row Tag", Environment.NewLine + "\t\t\t" + MRLTools.StartSignAutoTag + "R" + arow)); TagList.Items.Add(new KeyValuePair <string, string>("Auto Cell Tag", Environment.NewLine + "\t\t\t\t" + MRLTools.StartSignAutoTag + "D" + adata)); TagList.Items.Add(new KeyValuePair <string, string>("Auto Header Row Tag", Environment.NewLine + "\t\t\t" + MRLTools.StartSignAutoTag + "H" + arow)); TagList.Items.Add(new KeyValuePair <string, string>("Auto Footer Row Tag", Environment.NewLine + "\t\t\t" + MRLTools.StartSignAutoTag + "F" + arow)); TagList.Items.Add(new KeyValuePair <string, string>("Auto Header Cell Tag", Environment.NewLine + "\t\t\t\t" + MRLTools.StartSignAutoTag + "S" + adata)); TagList.Items.Add(new KeyValuePair <string, string>("Command", " " + MRLTools.StartSignCommandTag + " " + MRLTools.EndSignCommandTag + " ")); TagList.Items.Add(new KeyValuePair <string, string>("Comment Tag", " " + MRLTools.StartSignComment + " " + MRLTools.EndSignComment + " ")); TagList.Items.Add(new KeyValuePair <string, string>("Depletable Tag", " " + MRLTools.StartSignDepletableTag + " " + MRLTools.EndSignDepletableTag + " ")); TagList.Items.Add(new KeyValuePair <string, string>("Number Cell Tag", Environment.NewLine + "\t\t\t\t<DN" + sdata)); TagList.Items.Add(new KeyValuePair <string, string>("Name Cell Tag", Environment.NewLine + "\t\t\t\t<DS" + sdata)); TagList.Items.Add(new KeyValuePair <string, string>("Text Type Tag", " <TEXT " + MRLTools.EndSignTag)); TagList.Items.Add(new KeyValuePair <string, string>("Image Type Tag", " <IMAGE " + MRLTools.EndSignTag)); TagList.Items.Add(new KeyValuePair <string, string>("Number Type Tag", " <NUMBER " + MRLTools.EndSignTag)); TagList.Items.Add(new KeyValuePair <string, string>("Date Type Tag", " <DATE " + MRLTools.EndSignTag)); TagList.Items.Add(new KeyValuePair <string, string>("Time Type Tag", " <TIME " + MRLTools.EndSignTag)); TagList.Items.Add(new KeyValuePair <string, string>("List Type Tag", " <LIST " + MRLTools.EndSignTag)); TagList.Items.Add(new KeyValuePair <string, string>("End Tag", " " + MRLTools.EndSignTag + Environment.NewLine)); TagList.Items.Add(new KeyValuePair <string, string>("End Auto Tag", " " + MRLTools.EndSignAutoTag + Environment.NewLine)); TagList.Items.Add(new KeyValuePair <string, string>("Counter Command", MRLTools.StartSignCommandTag + "i = i + 1;" + MRLTools.EndSignCommandTag)); EventList.Items.Clear(); EventList.DisplayMember = "Key"; EventList.ValueMember = "Value"; EventList.Items.Add(new KeyValuePair <string, string>("Click", "data-Click=\"\"")); EventList.Items.Add(new KeyValuePair <string, string>("DoubleClick", "data-DoubleClick=\"\"")); EventList.Items.Add(new KeyValuePair <string, string>("Drag", "data-Drag=\"\"")); EventList.Items.Add(new KeyValuePair <string, string>("DragEnd", "data-DragEnd=\"\"")); EventList.Items.Add(new KeyValuePair <string, string>("DragLeave", "data-DragLeave=\"\"")); EventList.Items.Add(new KeyValuePair <string, string>("DragOver", "data-DragOver=\"\"")); EventList.Items.Add(new KeyValuePair <string, string>("Focusing", "data-Focusing=\"\"")); EventList.Items.Add(new KeyValuePair <string, string>("GotFocus", "data-GotFocus=\"\"")); EventList.Items.Add(new KeyValuePair <string, string>("KeyDown", "data-KeyDown=\"\"")); EventList.Items.Add(new KeyValuePair <string, string>("KeyPress", "data-KeyPress=\"\"")); EventList.Items.Add(new KeyValuePair <string, string>("KeyUp", "data-KeyUp=\"\"")); EventList.Items.Add(new KeyValuePair <string, string>("LosingFocus", "data-LosingFocus=\"\"")); EventList.Items.Add(new KeyValuePair <string, string>("LostFocus", "data-LostFocus=\"\"")); EventList.Items.Add(new KeyValuePair <string, string>("MouseDown", "data-MouseDown=\"\"")); EventList.Items.Add(new KeyValuePair <string, string>("MouseEnter", "data-MouseEnter=\"\"")); EventList.Items.Add(new KeyValuePair <string, string>("MouseLeave", "data-MouseLeave=\"\"")); EventList.Items.Add(new KeyValuePair <string, string>("MouseMove", "data-MouseMove=\"\"")); EventList.Items.Add(new KeyValuePair <string, string>("MouseOver", "data-MouseOver=\"\"")); EventList.Items.Add(new KeyValuePair <string, string>("MouseUp", "data-MouseUp=\"\"")); MRLTemplate.Items.Clear(); MRLTemplate.DisplayMember = "Key"; MRLTemplate.ValueMember = "Value"; MRLTemplate.Items.Add(new KeyValuePair <string, string>("Header", ".HEADER")); MRLTemplate.Items.Add(new KeyValuePair <string, string>("Content", ".CONTENT")); MRLTemplate.Items.Add(new KeyValuePair <string, string>("Footer", ".FOOTER")); MRLTemplate.Items.Add(new KeyValuePair <string, string>("Report", ".REPORT")); MRLTemplate.Items.Add(new KeyValuePair <string, string>("Report Table", ".T{")); MRLTemplate.Items.Add(new KeyValuePair <string, string>("Row", ".R{")); MRLTemplate.Items.Add(new KeyValuePair <string, string>("Cell", ".D{")); MRLTemplate.Items.Add(new KeyValuePair <string, string>("Header Row", ".H{")); MRLTemplate.Items.Add(new KeyValuePair <string, string>("Footer Row", ".F{")); MRLTemplate.Items.Add(new KeyValuePair <string, string>("Header Cell", ".S{")); MRLTemplate.Items.Add(new KeyValuePair <string, string>("Auto Value", ".AV")); MRLTemplate.Items.Add(new KeyValuePair <string, string>("Auto Report Table", ".AT")); MRLTemplate.Items.Add(new KeyValuePair <string, string>("Auto Row", ".AR")); MRLTemplate.Items.Add(new KeyValuePair <string, string>("Auto Cell", ".AD")); MRLTemplate.Items.Add(new KeyValuePair <string, string>("Auto Header Row", ".AH{")); MRLTemplate.Items.Add(new KeyValuePair <string, string>("Auto Footer Row", ".AF")); MRLTemplate.Items.Add(new KeyValuePair <string, string>("Auto Header Cell", ".AS")); MRLTemplate.Items.Add(new KeyValuePair <string, string>("Number Cell", ".DN")); MRLTemplate.Items.Add(new KeyValuePair <string, string>("Name Cell", ".DS")); MRLTemplate.Items.Add(new KeyValuePair <string, string>("Text Type", ".TEXT")); MRLTemplate.Items.Add(new KeyValuePair <string, string>("Image Type", ".IMAGE")); MRLTemplate.Items.Add(new KeyValuePair <string, string>("Number Type", ".NUMBER")); MRLTemplate.Items.Add(new KeyValuePair <string, string>("Date Type", ".DATE")); MRLTemplate.Items.Add(new KeyValuePair <string, string>("Time Type", ".TIME")); MRLTemplate.Items.Add(new KeyValuePair <string, string>("List Type", ".LIST")); } if (thisType != null) { ThisType = thisType; List <string> ls = GetAllFieldAndProperty(); FeidList.Items.Clear(); foreach (var item in ls) { FeidList.Items.Add(item); } } }
public static object get(string name) { return(MiMFa_IOService.OpenDeserializeFile(MCL.Address.BaseOtherDirectory + name.ToLower() + MCL.Address.BinaryExtension)); }