Example #1
0
        public bool NavigateNext()
        {
            if (!IsGetTableRun)
            {
                return(false);
            }
            bool b = FetchQueue.Count > 0;

            fetch_try_interval = 0;
            if (b)
            {
                GettingTableStart(this, fetch_url = FetchQueue.Dequeue());
                if (fetch_url.IsLoop())
                {
                    FetchQueue.Enqueue(fetch_url);
                }
                fetch_timer.Interval = fetch_url.IntervalDelay;
                fetch_browser.Tag    = fetch_url.URL;
                fetch_browser.Navigate(new Uri(fetch_url.URL));
                if (fetch_url.IsInteractive())
                {
                    PauseFetch();
                    GettingTableInteractivePause(this, fetch_url, "Process is paused for get a new order!");
                }
            }
            else
            {
                IsGetTableRun = false;
                MiMFa_ControlService.WebBrowserDocument(ref fetch_browser, FinishDocument);
                GetTableComplete(this, fetch_url);
                fetch_url = new FetchPatern();
            }
            return(b);
        }
Example #2
0
        private void CodeRefresh()
        {
            //RichTextBox rtb = new RichTextBox();
            int sel = rtb_Code.SelectionIndent;
            int ss  = rtb_Code.SelectionStart;

            if (tscb_EditorStyle.SelectedIndex < 2)
            {
                RichTextBox rtb = rtb_Code;
                MiMFa_ControlService.RichTextBoxChangeWordColor(ref rtb, MRLTools.StartSignTag, MRLTools.EndSignTag, Color.Black);
                MiMFa_ControlService.RichTextBoxChangeWordColor(ref rtb, MRLTools.StartSignAttributeTag, MRLTools.EndSignAttributeTag, Color.Gray);
                MiMFa_ControlService.RichTextBoxChangeWordColor(ref rtb, MRLTools.StartSignAttachTag, MRLTools.EndSignAttachTag, Color.ForestGreen);
                MiMFa_ControlService.RichTextBoxChangeWordColor(ref rtb, MRLTools.StartSignAutoTag, MRLTools.EndSignAutoTag, Color.SlateBlue);
                MiMFa_ControlService.RichTextBoxChangeWordColor(ref rtb, MRLTools.StartSignFieldTag, MRLTools.EndSignFieldTag, Color.Red);
                MiMFa_ControlService.RichTextBoxChangeWordColor(ref rtb, "HEADER", ">", Color.Crimson);
                MiMFa_ControlService.RichTextBoxChangeWordColor(ref rtb, "CONTENT", ">", Color.Crimson);
                MiMFa_ControlService.RichTextBoxChangeWordColor(ref rtb, "FOOTER", ">", Color.Crimson);
                MiMFa_ControlService.RichTextBoxChangeWordColor(ref rtb, MRLTools.StartSignCommandTag[0].ToString(), MRLTools.EndSignCommandTag, Color.DarkViolet);
                MiMFa_ControlService.RichTextBoxChangeWordColor(ref rtb, MRLTools.StartSignCommandTag, MRLTools.EndSignCommandTag, Color.DarkViolet);
                MiMFa_ControlService.RichTextBoxChangeWordColor(ref rtb, MRLTools.StartSignParenthesis, MRLTools.EndSignParenthesis, Color.DarkCyan);
                MiMFa_ControlService.RichTextBoxChangeWordColor(ref rtb, "'", "'", Color.DarkRed);
                MiMFa_ControlService.RichTextBoxChangeWordColor(ref rtb, MRLTools.StartSignString, MRLTools.EndSignString, Color.DarkRed);
                MiMFa_ControlService.RichTextBoxChangeWordColor(ref rtb, MRLTools.StartSignStrongString, MRLTools.EndSignStrongString, Color.DarkRed);
                MiMFa_ControlService.RichTextBoxChangeWordColor(ref rtb, MRLTools.StartSignComment, MRLTools.EndSignComment, Color.LightGreen);
                MiMFa_ControlService.RichTextBoxChangeWordColor(ref rtb, MRLTools.StartSignDepletableTag, MRLTools.EndSignDepletableTag, Color.DarkGray);
                //rtb_Code = rtb;
            }
            rtb_Code.SelectionStart  = ss;
            rtb_Code.SelectionIndent = sel;
            ReportStyle.MRLCode      = rtb_Code.Text;
        }
 //Target
 private void StartMovingOrResizing(Control control, MouseEventArgs e, MoveOrResize WorkType)
 {
     MiMFa_ControlService.SetControlThreadSafe(control, new Action <object[]>((oa) =>
     {
         if (_moving || _resizing)
         {
             return;
         }
         if (WorkType != MoveOrResize.Move &&
             (MouseIsInRightEdge || MouseIsInLeftEdge || MouseIsInTopEdge || MouseIsInBottomEdge))
         {
             _resizing = true;
             _currentControlStartSize = control.Size;
         }
         else if (WorkType != MoveOrResize.Resize)
         {
             control.Dock   = DockStyle.None;
             _moving        = true;
             control.Cursor = Cursors.SizeAll;
         }
         else
         {
             control.Cursor = Cursors.Default;
         }
         _cursorStartPoint = new Point(e.X, e.Y);
         control.Capture   = true;
         _draging          = true;
     }), new object[] { });
 }
        private void SetSizeAndPositionOfControlsFromString(Control container, string controlsInfoStr)
        {
            List <object> controls = new List <object>();

            controls = MiMFa_ControlService.GetAllChildObjects(container, controls);
            string[] controlsInfo = controlsInfoStr.Split(new[] { "*" }, StringSplitOptions.RemoveEmptyEntries);
            Dictionary <string, string> controlsInfoDictionary = new Dictionary <string, string>();

            foreach (string controlInfo in controlsInfo)
            {
                string[] info = controlInfo.Split(new[] { ":" }, StringSplitOptions.RemoveEmptyEntries);
                controlsInfoDictionary.Add(info[0], info[1]);
            }
            foreach (Control control in controls)
            {
                string propertiesStr;
                controlsInfoDictionary.TryGetValue(control.Name, out propertiesStr);
                string[] properties = propertiesStr.Split(new[] { "," }, StringSplitOptions.RemoveEmptyEntries);
                if (properties.Length == 4)
                {
                    control.Left   = int.Parse(properties[0]);
                    control.Top    = int.Parse(properties[1]);
                    control.Width  = int.Parse(properties[2]);
                    control.Height = int.Parse(properties[3]);
                }
            }
        }
Example #5
0
 public void Clear()
 {
     try
     {
         General.MiMFa_Path.CreateAllDirectories(TempDirectory);
         Path        = string.Empty;
         Value       = null;
         WB.Visible  = false;
         WMP.Visible = false;
         WMP.URL     = string.Empty;
         MiMFa_ControlService.SetControlThreadSafe(
             WB,
             new Action <object[]>((arg) =>
         {
             MiMFa_ControlService.WebBrowserDocumentText(ref WB, string.Empty);
         }), new object[] { });
         MiMFa_ControlService.SetControlThreadSafe(
             WMP,
             new Action <object[]>((arg) =>
         {
             WMP.settings.autoStart = false;
             WMP.URL = "";
         }), new object[] { });
     }
     catch { }
     finally { ValueChanged(this, EventArgs.Empty); }
 }
Example #6
0
 public void ShowBrowser(object value, bool inCenter = false)
 {
     Clear();
     Value      = value;
     WB.Visible = true;
     MiMFa_ControlService.WebBrowserDocumentText(ref WB, ((SpecialView && inCenter) ? ShowSimplyStartHTML:StartHTML) + Display.Done(value) + EndHTML);
     ValueChanged(this, EventArgs.Empty);
 }
Example #7
0
 public static void Paste(Form mainForm)
 {
     try
     {
         ((TextBox)MiMFa_ControlService.FindFocusedControl(mainForm)).SelectedText = Clipboard.GetText();
     }
     catch { }
 }
Example #8
0
 public static void SelectAll(Form mainForm)
 {
     try
     {
         ((TextBox)MiMFa_ControlService.FindFocusedControl(mainForm)).SelectAll();
     }
     catch { }
 }
Example #9
0
 public static void Copy(Form mainForm)
 {
     try
     {
         Clipboard.SetText(((TextBox)MiMFa_ControlService.FindFocusedControl(mainForm)).SelectedText);
     }
     catch { }
 }
Example #10
0
 public static void Cut(Form mainForm)
 {
     try
     {
         TextBox tb = (TextBox)MiMFa_ControlService.FindFocusedControl(mainForm);
         Clipboard.SetText(tb.SelectedText);
         tb.SelectedText = "";
     }
     catch { }
 }
Example #11
0
 public void ShowReport(string html)
 {
     if (!this.Viewer.InvokeRequired)
     {
         MiMFa_ControlService.WebBrowserDocumentText(ref this.Viewer, html);
         Viewer.Document.Title = MainReport.Name + "";
         MRL.MCL.UserInterface = this.Viewer;
     }
     else
     {
         this.Viewer.Invoke(new Action <string>(ShowReport), html);
     }
 }
        private string GetSizeAndPositionOfControlsToString(Control container)
        {
            List <object> controls = new List <object>();

            controls = MiMFa_ControlService.GetAllChildObjects(container, controls);
            CultureInfo cultureInfo = new CultureInfo("en");
            string      info        = string.Empty;

            foreach (Control control in controls)
            {
                info += control.Name + ":" + control.Left.ToString(cultureInfo) + "," + control.Top.ToString(cultureInfo) + "," +
                        control.Width.ToString(cultureInfo) + "," + control.Height.ToString(cultureInfo) + "*";
            }
            return(info);
        }
 private void StopDragOrResizing(Control control, MoveOrResize WorkType)
 {
     MiMFa_ControlService.SetControlThreadSafe(control, new Action <object[]>((oa) =>
     {
         control.Dock        = _currentControlDock;
         _draging            = false;
         _resizing           = false;
         _moving             = false;
         control.Capture     = false;
         MouseIsInLeftEdge   = false;
         MouseIsInRightEdge  = false;
         MouseIsInTopEdge    = false;
         MouseIsInBottomEdge = false;
         UpdateMouseCursor(control, WorkType);
     }), new object[] { });
 }
Example #14
0
 public void ShowMediaPlayer(object value)
 {
     Clear();
     Value = value;
     //WMP.Visible = true;
     Path = TempDirectory + System.DateTime.Now.Ticks + ".mp4";
     File.WriteAllBytes(Path, MiMFa_IOService.Serialize(Value));
     MiMFa_ControlService.SetControlThreadSafe(
         WMP,
         new Action <object[]>((arg) =>
     {
         WMP.settings.autoStart = AutoStart;
         WMP.URL     = Path;
         WMP.Visible = true;
     }), new object[] { });
     ValueChanged(this, EventArgs.Empty);
 }
Example #15
0
 private void ViewRefresh(bool restart = true)
 {
     if (restart)
     {
         Restart(false);
     }
     pb.Visible = true;
     MiMFa_ControlService.ThreadExecuteInControl(
         Exclusive.Collection.MiMFa_ThreadingMethod.Default,
         wb_View, new Action <object[]>(
             (args) =>
     {
         MiMFa_ControlService.WebBrowserDocumentText(ref wb_View, GetVeiwHTML());
         pb.Visible = false;
     })
         , new object[] { });
 }
Example #16
0
        private void View_Click(object sender, EventArgs e)
        {
            Exclusive.ProgramingTechnology.CommandLanguage.MiMFa_CommandLanguage MCL = new Exclusive.ProgramingTechnology.CommandLanguage.MiMFa_CommandLanguage(Exclusive.Display.MiMFa_DisplayType.HTML);
            Form       f  = new Form();
            WebBrowser fv = new WebBrowser();

            fv.SuspendLayout();
            f.SuspendLayout();
            fv.Dock = DockStyle.Fill;
            f.Controls.Add(fv);
            MiMFa_ControlService.WebBrowserDocumentText(ref fv, "<html><body>" + MCL.CompileText(RTB.Text) + "</body></html>");
            fv.ResumeLayout();
            fv.PerformLayout();
            f.ResumeLayout();
            f.PerformLayout();
            f.TopMost = true;
            f.ShowDialog();
        }
Example #17
0
 public void OpenMediaPlayer(string path)
 {
     Clear();
     if (string.IsNullOrEmpty(path))
     {
         return;
     }
     Path = path;
     //WMP.Visible = true;
     MiMFa_ControlService.SetControlThreadSafe(
         WMP,
         new Action <object[]>((arg) =>
     {
         WMP.settings.autoStart = AutoStart;
         WMP.URL     = path;
         WMP.Visible = true;
     }), new object[] { });
     ValueChanged(this, EventArgs.Empty);
 }
Example #18
0
        private void CssRefresh()
        {
            //RichTextBox rtb = new RichTextBox();
            int sel = rtb_Template.SelectionIndent;
            int ss  = rtb_Template.SelectionStart;

            if (tscb_EditorStyle.SelectedIndex < 3)
            {
                RichTextBox rtb = rtb_Template;
                MiMFa_ControlService.RichTextBoxChangeWordColor(ref rtb, ".", "{", Color.Firebrick);
                MiMFa_ControlService.RichTextBoxChangeWordColor(ref rtb, "{", "}", Color.OrangeRed);
                MiMFa_ControlService.RichTextBoxChangeWordColor(ref rtb, ":", ";", Color.Blue);
                MiMFa_ControlService.RichTextBoxChangeWordColor(ref rtb, "<!-", "->", Color.LightGreen);
                //rtb_Template = rtb;
            }
            rtb_Template.SelectionStart  = ss;
            rtb_Template.SelectionIndent = sel;
            ReportStyle.Css = rtb_Template.Text;
        }
Example #19
0
 public void SetBrowser(WebBrowser wb)
 {
     fetch_browser = wb;
     fetch_browser.ScriptErrorsSuppressed = true;
     MiMFa_ControlService.WebBrowserDocument(ref fetch_browser, BeginDocument);
     fetch_browser.Navigated += (s, e) => { if (!IsGetTableCompleted)
                                            {
                                                if (!fetch_url.IsInteractive())
                                                {
                                                    fetch_url = GetCurrentPatern();
                                                }
                                                URLNavigated(fetch_browser, fetch_url);
                                            }
     };
     fetch_browser.NewWindow += (s, e) =>
     {
         e.Cancel = true;
         fetch_browser.Navigate(fetch_browser.StatusText);
     };
 }
Example #20
0
        private void HTMLRefresh()
        {
            Restart(false);
            rtb_HTML.Text = GetVeiwHTML();
            //RichTextBox rtb = new RichTextBox();
            int sel = rtb_HTML.SelectionIndent;
            int ss  = rtb_HTML.SelectionStart;

            if (tscb_EditorStyle.SelectedIndex < 5)
            {
                RichTextBox rtb = rtb_HTML;
                MiMFa_ControlService.RichTextBoxChangeWordColor(ref rtb, "\"", "\"", Color.DarkRed);
                MiMFa_ControlService.RichTextBoxChangeWordColor(ref rtb, "'", "'", Color.DarkRed);
                MiMFa_ControlService.RichTextBoxChangeWordColor(ref rtb, "<", ">", Color.Maroon);
                MiMFa_ControlService.RichTextBoxChangeWordColor(ref rtb, "<!--", "-->", Color.LightGreen);
                //rtb_HTML = rtb;
            }
            rtb_HTML.SelectionStart  = ss;
            rtb_HTML.SelectionIndent = sel;
        }
Example #21
0
        private void ScriptRefresh()
        {
            //RichTextBox rtb = new RichTextBox();
            int sel = rtb_Script.SelectionIndent;
            int ss  = rtb_Script.SelectionStart;

            if (tscb_EditorStyle.SelectedIndex < 4)
            {
                RichTextBox rtb = rtb_Script;
                MiMFa_ControlService.RichTextBoxChangeWordColor(ref rtb, "}", "{", Color.Black);
                MiMFa_ControlService.RichTextBoxChangeWordColor(ref rtb, "(", ")", Color.DarkCyan);
                MiMFa_ControlService.RichTextBoxChangeWordColor(ref rtb, "{", "}", Color.Black);
                MiMFa_ControlService.RichTextBoxChangeWordColor(ref rtb, ";", ";", Color.Maroon);
                MiMFa_ControlService.RichTextBoxChangeWordColor(ref rtb, "/*", "*/", Color.LightGreen);
                MiMFa_ControlService.RichTextBoxChangeWordColor(ref rtb, "//", Environment.NewLine, Color.LightGreen);
                //rtb_Script = rtb;
            }
            rtb_Script.SelectionStart  = ss;
            rtb_Script.SelectionIndent = sel;
            ReportStyle.Script         = rtb_Script.Text;
        }
Example #22
0
 public void ControlsSort(params Control[] childsByDecOrder)
 {
     try
     {
         Dictionary <string, int> diccon = GetDicClick(childsByDecOrder);
         List <int>     lin    = new List <int>();
         List <Control> lcon   = new List <Control>();
         List <int>     lout   = new List <int>();
         List <int>     lindex = new List <int>();
         Control        con_m  = null;
         StateOrders.Clear();
         foreach (var item in childsByDecOrder)
         {
             StateOrders.Add(item.Location, item.Size);
         }
         foreach (var item in diccon)
         {
             if ((con_m = MiMFa_ControlService.GetControlsByName(ControlsParent, item.Key)) != null)
             {
                 lcon.Add(con_m);
                 lin.Add(item.Value);
             }
         }
         MiMFa_CollectionService.Sort(lin, out lout, out lindex);
         lindex.Reverse();
         int index = 0;
         foreach (var item in StateOrders)
         {
             try
             {
                 lcon[lindex[index]].Size     = item.Value;
                 lcon[lindex[index]].Location = item.Key;
             }
             catch { }
             index++;
         }
     }
     catch { }
 }
Example #23
0
        public void SetHTML(string div)
        {
            MiMFa_ControlService.SetControlThreadSafe(WB,
                                                      new Action <object[]>((arg) =>
            {
                string dir = "";
                if (RTB.RightToLeft == RightToLeft.Yes)
                {
                    dir = "text-align:right;";
                }
                int l = 0;
                try { l = WB.DocumentText.Length; } catch { }
                if (l > 100)
                {
                    var elem          = WB.Document.CreateElement("div");
                    elem.InnerHtml    = div;
                    elem.DoubleClick += Element_DoubleClick;
                    WB.Document.Body.AppendChild(elem);
                    WB.Document.Window.ScrollTo(0, WB.Document.Body.ScrollRectangle.Height);
                    var elems = WB.Document.GetElementsByTagName("button");
                    if (elem != null)
                    {
                        foreach (HtmlElement item in elems)
                        {
                            item.Click += Item_Click;
                        }
                    }
                }
                else
                {
                    MiMFa_ControlService.WebBrowserDocumentText(ref WB, @"
<html style='width:100%; overflow-x:hidden;'>
<head>
<meta charset='UTF-8'/>
<style rel='style/sheet'>
body{
    width:100%;
    overflow-x:hidden;
    font-family:'B Nazanin';
}
.SEND{
    width:80%;
    color:#3F3F3F;
    background-color:#F7FAF7;
    padding-top:5pt;
    padding-left:10pt;
    padding-right:10pt;
    margin:10pt;
    margin-bottom:0pt;
    border:2 dotted #CECECE;
    font-Size:14pt;
    " + dir + @"
}
.RECIEVE{
    width:80%;
    color:#020033;
    background-color:#D8F7FF;
    padding-top:5pt;
    padding-left:10pt;
    padding-right:10pt;
    margin:10pt;
    margin-bottom:0pt;
    border:4 dotted #B2ACFF;
    radius:25px;
    font-Size:14pt;
    " + dir + @"
}
.DETAIL{
    width:100%;
    color:#606060;
    text-align:center;
    font-Size:9pt;
}
.ERROR{
    width:100%;
    color:#B80000;
    background-color:#FCFFE3;
    text-align:center;
    font-Size:10pt;
    margin:1pt;
    margin-top:10pt;
    padding:2pt;
}
.AutoIMG{
    height:200px !important;
    text-align:center !important;
}
.ALERT{
    width:100%;
    color:#B80000;
    background-color:#FCFFE3;
    font-Size:10pt;
    margin:1pt;
    margin-top:0pt;
    padding:2pt;
    " + dir + @"
}
</style>
</head>
<body>" + div + "</body></html>");
                }
            }), new object[] { });
        }
 private void MoveControl(Control control, MouseEventArgs e, MoveOrResize WorkType)
 {
     MiMFa_ControlService.SetControlThreadSafe(control, new Action <object[]>((oa) =>
     {
         if ((!_resizing && !_moving) || !_draging)
         {
             _resizing = _moving = _draging;
             UpdateMouseEdgeProperties(control, new Point(e.X, e.Y), WorkType);
             UpdateMouseCursor(control, WorkType);
         }
         if (_resizing)
         {
             if (MouseIsInLeftEdge)
             {
                 if (MouseIsInTopEdge)
                 {
                     control.Width  -= (e.X - _cursorStartPoint.X);
                     control.Left   += (e.X - _cursorStartPoint.X);
                     control.Height -= (e.Y - _cursorStartPoint.Y);
                     control.Top    += (e.Y - _cursorStartPoint.Y);
                 }
                 else if (MouseIsInBottomEdge)
                 {
                     control.Width -= (e.X - _cursorStartPoint.X);
                     control.Left  += (e.X - _cursorStartPoint.X);
                     control.Height = (e.Y - _cursorStartPoint.Y) + _currentControlStartSize.Height;
                 }
                 else
                 {
                     control.Width -= (e.X - _cursorStartPoint.X);
                     control.Left  += (e.X - _cursorStartPoint.X);
                 }
             }
             else if (MouseIsInRightEdge)
             {
                 if (MouseIsInTopEdge)
                 {
                     control.Width   = (e.X - _cursorStartPoint.X) + _currentControlStartSize.Width;
                     control.Height -= (e.Y - _cursorStartPoint.Y);
                     control.Top    += (e.Y - _cursorStartPoint.Y);
                 }
                 else if (MouseIsInBottomEdge)
                 {
                     control.Width  = (e.X - _cursorStartPoint.X) + _currentControlStartSize.Width;
                     control.Height = (e.Y - _cursorStartPoint.Y) + _currentControlStartSize.Height;
                 }
                 else
                 {
                     control.Width = (e.X - _cursorStartPoint.X) + _currentControlStartSize.Width;
                 }
             }
             else if (MouseIsInTopEdge)
             {
                 control.Height -= (e.Y - _cursorStartPoint.Y);
                 control.Top    += (e.Y - _cursorStartPoint.Y);
             }
             else if (MouseIsInBottomEdge)
             {
                 control.Height = (e.Y - _cursorStartPoint.Y) + _currentControlStartSize.Height;
             }
             else
             {
                 StopDragOrResizing(control, WorkType);
             }
         }
         else if (_moving)
         {
             _moveIsInterNal = !_moveIsInterNal;
             if (!_moveIsInterNal)
             {
                 int x            = (e.X - _cursorStartPoint.X) + control.Left;
                 int y            = (e.Y - _cursorStartPoint.Y) + control.Top;
                 control.Location = new Point(x, y);
             }
         }
     }), new object[] { });
 }
Example #25
0
 public void SaveExcel()
 {
     MiMFa_ControlService.DataTableToExcel(MiMFa_Convert.ToPropertiesDataTable(MRL.CL));
 }
Example #26
0
 public void Clear()
 {
     MiMFa_ControlService.WebBrowserDocument(ref Browser, StartHTML + EndHTML);
 }
Example #27
0
 public void ShowJust(string html)
 {
     MiMFa_ControlService.WebBrowserDocument(ref Browser, html);
     Browser.Document.Body.ScrollTop = Browser.Document.Body.ScrollRectangle.Size.Height;
 }