예제 #1
0
        // 2009/6/2
        public static string Show(ChargingInfoHost host,
                                  string strText,
                                  InfoColor infocolor,
                                  string strCaption,
                                  double delayOpacity,
                                  bool bPassword,
                                  Font font = null)
        {
            ChargingInfoDlg dlg = new ChargingInfoDlg();

            if (font != null)
            {
                MainForm.SetControlFont(dlg, font, false);
            }

            dlg.Host         = host;
            dlg.DelayOpacity = delayOpacity;
            dlg.InfoColor    = infocolor;
            dlg.MessageText  = strText;
            if (strCaption != null)
            {
                dlg.Text = strCaption;
            }
            dlg.Password      = bPassword;
            dlg.StartPosition = FormStartPosition.CenterScreen;

            host.ap.LinkFormState(dlg, "ChargingInfoDlg_state");
            dlg.ShowDialog(host.window);
            host.ap.UnlinkFormState(dlg);

            return(dlg.FastInputText);
        }
예제 #2
0
        // 原始版本
        static string Show(IWin32Window owner,
                           string strText,
                           InfoColor infocolor,
                           string strCaption,
                           double delayOpacity,
                           Font font = null)
        {
            ChargingInfoDlg dlg = new ChargingInfoDlg();

            if (font != null)
            {
                MainForm.SetControlFont(dlg, font, false);
            }

            dlg.DelayOpacity = delayOpacity;
            dlg.InfoColor    = infocolor;
            dlg.MessageText  = strText;
            if (strCaption != null)
            {
                dlg.Text = strCaption;
            }
            dlg.StartPosition = FormStartPosition.CenterScreen;
            dlg.ShowDialog(owner);

            return(dlg.FastInputText);
        }
 public override void ActivateOptions()
 {
     IgnoresException = false;
     InfoColor        = InfoColor.IsNullOrEmpty() ? "\x1b[36m" : "\x1b[" + InfoColor;
     WarnColor        = WarnColor.IsNullOrEmpty() ? "\x1b[33m" : "\x1b[" + WarnColor;
     ErrorColor       = ErrorColor.IsNullOrEmpty() ? "\x1b[31m" : "\x1b[" + ErrorColor;
 }
예제 #4
0
        public override void ActivateOptions()
        {
            base.ActivateOptions();

            //whether we should add full exception to journal -> false = we do not add them / true = add rendered exceptions
            IgnoresException = true;

            InfoColor  = InfoColor.IsNullOrEmpty() ? "\x1b[36m" : "\x1b[" + InfoColor;
            WarnColor  = WarnColor.IsNullOrEmpty() ? "\x1b[33m" : "\x1b[" + WarnColor;
            ErrorColor = ErrorColor.IsNullOrEmpty() ? "\x1b[31m" : "\x1b[" + ErrorColor;

            try
            {
                LoggerPrefix = CloudConfigurationManager.GetSetting("LoggerNamePrefix");
            }
            catch
            {
                LoggerPrefix = null;
            }

            if (string.IsNullOrWhiteSpace(LoggerPrefix))
            {
                LoggerPrefix = null;
            }
        }
예제 #5
0
 static string Show(IWin32Window owner,
                    string strText,
                    InfoColor infocolor,
                    double delayOpacity)
 {
     return(Show(owner, strText, infocolor, null, delayOpacity));
 }
예제 #6
0
        //public override Grid expanderHeader
        //{
        //    get
        //    {
        //        return grdExpanderHeader;
        //    }
        //}
        //private void InitializePackageArea()
        //{
        //    //foreach (var type in TemplatePackage.TypeConditions)
        //    //{
        //    //    //foreach (var property in type.NDType.Properties)
        //    //    //{
        //    //    //    var column = new DataGridViewTextBoxColumn();
        //    //    //    column.HeaderText = (property.Title == null ? property.Property.Title : property.Title);
        //    //    //    column.Tag = property;
        //    //    //    column.Name = property.Property.Name;
        //    //    //    //column.CellType=GetType(string);
        //    //    //    dataGridView1.Columns.Add(column);
        //    //    //}
        //    //}

        //}


        //public I_SearchViewEntityArea Controller
        //{
        //    set;
        //    get;
        //}



        public bool AddControlPackageToHeader(object uiControlPackage, string title, InfoColor titleColor, string tooltip = "")
        {
            return(false);
            //////var labelControl = LabelHelper.GenerateLabelControl(title, tooltip, titleColor);
            ////////////uiControlPackage.RelatedUIControls.Add(new AG_RelatedConttol() { RelationType = AG_ControlRelationType.Label, RelatedUIControl = labelControl });
            //////stkHeaderControls.Children.Add(labelControl.Control as UIElement);
            ////////////stkHeaderControls.Children.Add(uiControlPackage.UIControl.Control as UIElement);
            //////return true;
        }
예제 #7
0
 internal void SetForegroundColor(object dataItem, InfoColor color)
 {
     System.Windows.Threading.Dispatcher.CurrentDispatcher.BeginInvoke(DispatcherPriority.Input, new Action(() =>
     {
         GridViewRow row = (GridViewRow)dataGrid.ItemContainerGenerator
                           .ContainerFromItem(dataItem);
         if (row != null)
         {
             row.Foreground = UIManager.GetColorFromInfoColor(color);
         }
     }));
 }
예제 #8
0
        public void SetForegroundColor(object dataItem, InfoColor color)
        {
            Control control = null;

            if (RelationshipUISettingDTO.Expander == false)
            {
                control = View as Control;
            }
            else
            {
                control = Expander;
            }
            control.Foreground = UIManager.GetColorFromInfoColor(color);
        }
 public void AddInfo(InfoColor infoColor, string descripiton, string header = "Informacja")
 {
     if (infoColor == InfoColor.Green)
     {
         infoManagers[0].Setup(descripiton, header);
     }
     else if (infoColor == InfoColor.Red)
     {
         infoManagers[1].Setup(descripiton, header);
     }
     else
     {
         infoManagers[2].Setup(descripiton, header);
     }
 }
예제 #10
0
 internal void SetForegroundColor(object dataItem, InfoColor color)
 {
     System.Windows.Threading.Dispatcher.CurrentDispatcher.BeginInvoke(DispatcherPriority.Input, new Action(() =>
     {
         var dataRow = this.DataControl.GetRowForItem(dataItem);
         var cell    = dataRow.GetCell(this);
         if (cell != null)
         {
             if (cell.Content != null)
             {
                 cell.Foreground = UIManager.GetColorFromInfoColor(color);
             }
         }
     }));
 }
예제 #11
0
        public void SetBorderColor(object dataItem, InfoColor color)
        {
            Control control = null;

            if (RelationshipUISettingDTO.Expander == false)
            {
                control = View as Control;
            }
            else
            {
                control = Expander;
            }

            control.BorderBrush     = UIManager.GetColorFromInfoColor(color);
            control.BorderThickness = new Thickness(1);
        }
        public object AddTreeNode(object parentNode, string title, string tooltip, InfoColor color, bool expand)
        {
            ItemCollection collection = null;

            if (parentNode != null)
            {
                collection = (parentNode as RadTreeViewItem).Items;
            }
            else
            {
                collection = treeData.Items;
            }
            var newNode = new RadTreeViewItem();

            newNode.Header     = title;
            newNode.Foreground = UIManager.GetColorFromInfoColor(color);
            if (!string.IsNullOrEmpty(tooltip))
            {
                ToolTipService.SetToolTip(newNode, tooltip);
            }
            collection.Add(newNode);
            newNode.IsExpanded = expand;
            return(newNode);
        }
        public object AddTreeNode(object parentNode, string title, bool expand, InfoColor color)
        {
            if (color == InfoColor.Null)
            {
                color = InfoColor.Black;
            }
            ItemCollection collection = null;

            if (parentNode != null)
            {
                collection = (parentNode as RadTreeViewItem).Items;
            }
            else
            {
                collection = treeData.Items;
            }
            var newNode = new RadTreeViewItem();

            newNode.Header     = title;
            newNode.Foreground = UIManager.GetColorFromInfoColor(color);
            newNode.IsExpanded = expand;
            collection.Add(newNode);
            return(newNode);
        }
예제 #14
0
 public void SetBorderColor(object dataItem, InfoColor color)
 {
     dataGridHelper.SetBorderColor(dataItem, color);
 }
예제 #15
0
 public void SetForegroundColor(object dataItem, InfoColor color)
 {
     DataGridColumn.SetForegroundColor(dataItem, color);
 }
예제 #16
0
 public void SetBorderColor(object dataItem, InfoColor color)
 {
     DataGridColumn.SetBorderColor(dataItem, color);
 }
예제 #17
0
        private void ChannelTable(int SatN, HtmlAgilityPack.HtmlNode N, ref StreamWriter FS1W, ref StreamWriter FS2W, bool TypeByPID)
        {
            PrepareInfoFlySat = true;

            List <List <HtmlAgilityPack.HtmlNode> > TableObj = new List <List <HtmlAgilityPack.HtmlNode> >();

            for (int i = 0; i < N.ChildNodes.Count; i++)
            {
                if (N.ChildNodes[i].Name == "tr")
                {
                    List <HtmlAgilityPack.HtmlNode> TableObjRow = new List <HtmlAgilityPack.HtmlNode>();
                    for (int ii = 0; ii < N.ChildNodes[i].ChildNodes.Count; ii++)
                    {
                        if (N.ChildNodes[i].ChildNodes[ii].Name == "td")
                        {
                            TableObjRow.Add(N.ChildNodes[i].ChildNodes[ii]);
                        }
                    }

                    if ((TableObjRow.Count > 3) || ((TableObjRow.Count == 1) && TableObjRow[0].InnerText.Contains("Stream")))
                    {
                        if ((!TableObjRow[0].InnerText.Contains("Txp No")) && (!TableObjRow[0].InnerText.Contains("Source")) && (!TableObjRow[0].InnerText.Contains("Date")))
                        {
                            TableObj.Add(TableObjRow);
                        }
                    }
                }
            }

            string[] SatTrans = null;
            string[] SatChan  = null;

            int RowN0 = 0;
            int RowN  = 0;

            int RowSpanCounter = 0;

            for (int i = 0; i < TableObj.Count; i++)
            {
                if (RowSpanCounter == 0)
                {
                    RowN0 = RowN;
                    RowN  = i;

                    try
                    {
                        SatTrans = new string[20];

                        int TdI = 0;
                        PrepareInfo(TableObj[i][TdI]);

                        // Txp No
                        SatTrans[0] = Prepare(InfoText[0]);

                        // Source
                        int TempI = 0;
                        SatTrans[1] = "";
                        for (int ii = 1; ii < (InfoText.Count - 1); ii++)
                        {
                            if (Prepare(InfoText[ii]) != "")
                            {
                                if (TempI > 0)
                                {
                                    SatTrans[1] += Separator;
                                }
                                SatTrans[1] += Prepare(InfoText[ii]);
                                TempI++;
                            }
                        }

                        // Date
                        SatTrans[2] += Prepare(InfoText[InfoText.Count - 1]);
                        TdI++;

                        // Freq, Pol
                        PrepareInfoFlySat = false;
                        PrepareInfo(TableObj[i][TdI]);
                        PrepareInfoFlySat = true;
                        TableObj[i][TdI].InnerText.ToString();

                        string TempS = InfoText[0].Trim();
                        TempI = TempS.IndexOf(" ");
                        if (TempI < 0)
                        {
                            throw new Exception("XXX");
                        }
                        SatTrans[3] += TempS.Substring(0, TempI);
                        SatTrans[4] += TempS.Substring(TempI + 1);

                        // Mode
                        SatTrans[5] += "";
                        for (int ii = 1; ii < InfoText.Count; ii++)
                        {
                            if (ii > 1)
                            {
                                SatTrans[5] += Separator;
                            }
                            SatTrans[5] += Prepare(InfoText[ii]);
                        }

                        // SR-FEC
                        TdI++;
                        PrepareInfo(TableObj[i][TdI]);
                        SatTrans[6] = "";
                        for (int ii = 0; ii < InfoText.Count; ii++)
                        {
                            if (ii > 0)
                            {
                                SatTrans[6] += Separator;
                            }
                            SatTrans[6] += Prepare(InfoText[ii]);
                        }

                        // Provider Name
                        TdI++;
                        PrepareInfo(TableObj[i][TdI]);
                        if (InfoText.Count > 0)
                        {
                            SatTrans[7] = Prepare(InfoText[0]);
                        }
                        else
                        {
                            SatTrans[7] = "";
                        }

                        // Encryption
                        TdI++;
                        TdI++;
                        TdI++;
                        TdI++;
                        PrepareInfo(TableObj[i][TdI]);
                        TempI       = 0;
                        SatTrans[8] = "";
                        for (int ii = 0; ii < InfoText.Count; ii++)
                        {
                            if (InfoColor[ii] == "")
                            {
                                if (TempI > 0)
                                {
                                    SatTrans[8] += Separator;
                                }
                                SatTrans[8] += Prepare(InfoText[ii]);
                                TempI++;
                            }
                        }

                        // ONID-TID
                        TempI        = 0;
                        SatTrans[9] += "";
                        for (int ii = 0; ii < InfoText.Count; ii++)
                        {
                            if (InfoColor[ii] != "")
                            {
                                if (TempI > 0)
                                {
                                    SatTrans[9] += Separator;
                                }
                                SatTrans[9] += Prepare(InfoText[ii]);
                                TempI++;
                            }
                        }

                        // FootPrints
                        TdI++;
                        PrepareInfo(TableObj[i][TdI]);
                        if (InfoText[0] == "")
                        {
                            InfoText.RemoveAt(0);
                            InfoColor.RemoveAt(0);
                        }
                        if (InfoText.Count < 1)
                        {
                            throw new Exception("XXX");
                        }

                        SatTrans[10] = "";
                        for (int ii = 0; ii < (InfoText.Count - 1); ii++)
                        {
                            if (ii > 0)
                            {
                                SatTrans[10] += Separator;
                            }
                            SatTrans[10] += InfoText[ii];
                        }
                        if (!InfoText[InfoText.Count - 1].Contains("dBW"))
                        {
                            if (InfoText.Count > 1)
                            {
                                SatTrans[10] += Separator;
                            }
                            SatTrans[10] += InfoText[InfoText.Count - 1];
                        }
                        SatTrans[10] = SatTrans[10].Replace(Separator, " ");
                        BeamListAdd(SatTrans[10]);

                        // EIRP(dBW)
                        if (InfoText[InfoText.Count - 1].Contains("dBW"))
                        {
                            SatTrans[11] = InfoText[InfoText.Count - 1];
                        }
                        else
                        {
                            SatTrans[11] = "";
                        }

                        // Comments
                        TdI++;
                        PrepareInfo(TableObj[i][TdI]);
                        TempI        = 0;
                        SatTrans[12] = "";
                        for (int ii = 0; ii < InfoText.Count; ii++)
                        {
                            if (InfoText[ii] != "")
                            {
                                if (TempI > 0)
                                {
                                    SatTrans[12] += Separator;
                                }
                                SatTrans[12] += Prepare(InfoText[ii]);
                                TempI++;
                            }
                        }

                        // Row
                        SatTrans[13] = RowN.ToString();


                        for (int ii = 0; ii < 14; ii++)
                        {
                            if (ii > 0)
                            {
                                FS1W.Write("\t");
                            }
                            FS1W.Write(SatTrans[ii]);
                        }
                        FS1W.WriteLine();

                        if (TableObj[i][0].Attributes.Contains("rowspan"))
                        {
                            RowSpanCounter = ToInt(TableObj[i][0].Attributes["rowspan"].Value);
                        }
                        else
                        {
                            RowSpanCounter = 1;
                        }
                        if (SpanChange[SatN].ContainsKey(RowN))
                        {
                            RowSpanCounter += SpanChange[SatN][RowN];
                        }
                    }
                    catch (Exception e)
                    {
                        string ErrMsg = "";
                        ErrMsg = ErrMsg + "Previous row: " + RowN0.ToString() + "\r\n";
                        ErrMsg = ErrMsg + "Current row: " + RowN.ToString() + "\r\n";
                        if (SatTrans != null)
                        {
                            ErrMsg = ErrMsg + "Transponder:";
                            for (int ii = 0; ii < 12; ii++)
                            {
                                ErrMsg = ErrMsg + "[" + SatTrans[ii] + "]";
                            }
                            ErrMsg = ErrMsg + "\r\n";
                        }
                        if (SatChan != null)
                        {
                            ErrMsg = ErrMsg + "Channel:";
                            for (int ii = 0; ii < 8; ii++)
                            {
                                ErrMsg = ErrMsg + "[" + SatChan[ii] + "]";
                            }
                            ErrMsg = ErrMsg + "\r\n";
                        }
                        ErrMsg = ErrMsg + "Parse error: " + e.Message + "\r\n" + e.StackTrace;
                        FS1W.Close();
                        FS2W.Close();
                        throw new Exception(ErrMsg);
                    }
                }
                else
                {
                    if (TableObj[i].Count > 4)
                    {
                        SatChan = new string[20];

                        // Channel Name
                        int TdI = 0;
                        SatChan[4] = Prepare(TableObj[i][TdI].InnerText);

                        // FTA
                        TdI++;
                        SatChan[5] = (TableObj[i][TdI].InnerText.Contains("F")) ? "Yes" : "No";

                        // V.PID
                        TdI++;
                        SatChan[6] = Prepare(TableObj[i][TdI].InnerText);

                        // A.PID
                        TdI++;
                        PrepareInfo(TableObj[i][TdI]);
                        for (int ii = InfoText.Count - 1; ii >= 0; ii--)
                        {
                            if (InfoText[ii].Contains("AC3"))
                            {
                                InfoText.RemoveAt(ii);
                                InfoColor.RemoveAt(ii);
                            }
                        }
                        SatChan[7] = LangList();

                        // SID
                        TdI++;
                        PrepareInfo(TableObj[i][TdI]);
                        SatChan[8] = "";
                        if (InfoText.Count > 0)
                        {
                            if (!InfoText[0].Contains("MPEG"))
                            {
                                SatChan[8] = Prepare(InfoText[0]);
                            }
                        }

                        // Type
                        SatChan[3] = "UNK";
                        if (TypeByPID)
                        {
                            SatChan[3] = "UNK";
                            if ((SatChan[6] == "") && (SatChan[7] == ""))
                            {
                                SatChan[3] = "DATA";
                            }
                            if ((SatChan[6] != "") && (SatChan[7] != ""))
                            {
                                SatChan[3] = "TV";
                            }
                            if ((SatChan[6] == "") && (SatChan[7] != ""))
                            {
                                SatChan[3] = "R";
                            }
                            if ((SatChan[6] != "") && (SatChan[7] == ""))
                            {
                                SatChan[3] = "IMG";
                            }
                        }

                        // Row
                        SatChan[9] = RowN.ToString();

                        // Freq
                        FS2W.Write(SatTrans[3]);

                        // Pol
                        FS2W.Write("\t");
                        FS2W.Write(SatTrans[4]);

                        // SR
                        FS2W.Write("\t");
                        FS2W.Write(SatTrans[6]);

                        // Beam
                        FS2W.Write("\t");
                        FS2W.Write(SatTrans[10]);

                        for (int ii = 3; ii < 10; ii++)
                        {
                            if (ii > 0)
                            {
                                FS2W.Write("\t");
                            }
                            FS2W.Write(SatChan[ii]);
                        }

                        FS2W.WriteLine();
                    }
                }
                RowSpanCounter--;
            }
            PrepareInfoFlySat = false;
        }
예제 #18
0
 public void ShowInfo(string title, List <ResultDetail> details, InfoColor infoColor)
 {
     MainForm.ShowInfo(title, details, UIManager.GetColorFromInfoColor(infoColor));
 }
예제 #19
0
 public virtual void AddUIControlPackage(object controlPackage, string title, InfoColor titleColor, string tooltip = "")
 {
 }
예제 #20
0
        private void ChannelTable(int SatN, HtmlAgilityPack.HtmlNode N, ref StreamWriter FS1W, ref StreamWriter FS2W, bool TypeByPID)
        {
            List <int>         Rowlist   = new List <int>();
            List <List <int> > RowlistTD = new List <List <int> >();

            for (int i = 0; i < N.ChildNodes.Count; i++)
            {
                if (N.ChildNodes[i].Name == "tr")
                {
                    Rowlist.Add(i);
                    List <int> RowlistTD_ = new List <int>();
                    for (int i_ = 0; i_ < N.ChildNodes[i].ChildNodes.Count; i_++)
                    {
                        if (N.ChildNodes[i].ChildNodes[i_].Name == "td")
                        {
                            RowlistTD_.Add(i_);
                        }
                    }
                    RowlistTD.Add(RowlistTD_);
                }
            }

            if (Rowlist.Count >= 4)
            {
                Rowlist.RemoveAt(Rowlist.Count - 1);
                RowlistTD.RemoveAt(RowlistTD.Count - 1);
                Rowlist.RemoveAt(0);
                Rowlist.RemoveAt(0);
                RowlistTD.RemoveAt(0);
                RowlistTD.RemoveAt(0);

                //FS1W.WriteLine("TABLE BEGIN");

                string[] SatTrans = null;
                string[] SatChan  = null;


                int  TransSpan = 0;
                bool FirstItem = false;
                for (int i = 0; i < Rowlist.Count; i++)
                {
                    HtmlAgilityPack.HtmlNode NN = N.ChildNodes[Rowlist[i]];
                    if (RowlistTD[i].Count >= 4)
                    {
                        string ChannelType = "";
                        SatChan = null;
                        int PrepareChannel = 0;
                        if (TransSpan == 0)
                        {
                            RowN0 = RowN;
                            RowN  = i + RowX;

                            FirstItem = true;
                            SatTrans  = new string[20];

                            TransSpan = 0;
                            if (NN.ChildNodes[RowlistTD[i][1]].Attributes.Contains("rowspan"))
                            {
                                TransSpan = ToInt(NN.ChildNodes[RowlistTD[i][0]].Attributes["rowspan"].Value);
                                TransSpan--;
                            }
                            if (SpanChange[SatN].ContainsKey(RowN))
                            {
                                TransSpan += SpanChange[SatN][RowN];
                            }

                            int SatTransI = 0;
                            int TDi       = 0;
                            HtmlAgilityPack.HtmlNode NNN = NN.ChildNodes[RowlistTD[i][TDi]];

                            for (int i_ = 0; i_ < NNN.ChildNodes.Count; i_++)
                            {
                                if (NNN.ChildNodes[i_].Name == "font")
                                {
                                    int Trans0 = 0;
                                    for (int ii_ = 0; ii_ < NNN.ChildNodes[i_].ChildNodes.Count; ii_++)
                                    {
                                        if (NNN.ChildNodes[i_].ChildNodes[ii_].Name == "font")
                                        {
                                            for (int iii_ = 0; iii_ < NNN.ChildNodes[i_].ChildNodes[ii_].ChildNodes.Count; iii_++)
                                            {
                                                if (NNN.ChildNodes[i_].ChildNodes[ii_].ChildNodes[iii_].Name == "br")
                                                {
                                                    SatTransI++;
                                                    Trans0++;
                                                }
                                                else
                                                {
                                                    if (Trans0 == 0)
                                                    {
                                                        string Temp  = NNN.ChildNodes[i_].ChildNodes[ii_].ChildNodes[iii_].InnerText;
                                                        int    TempI = Temp.IndexOf("&nbsp;");
                                                        SatTrans[SatTransI] = Temp.Substring(0, TempI);
                                                        SatTransI++;
                                                        SatTrans[SatTransI] = Temp.Substring(TempI + 6);
                                                    }
                                                    else
                                                    {
                                                        SatTrans[SatTransI] = Prepare(NNN.ChildNodes[i_].ChildNodes[ii_].ChildNodes[iii_].InnerText).Replace("tp ", "");
                                                    }
                                                }
                                            }
                                        }
                                    }
                                    while (Trans0 < 3)
                                    {
                                        SatTransI++;
                                        Trans0++;
                                    }
                                }
                            }

                            BeamListAdd(SatTrans[3]);

                            SatTransI++;
                            TDi++;

                            // System, Modulation, SR-FEC
                            PrepareInfo(NN.ChildNodes[RowlistTD[i][TDi]]);
                            if (InfoText.Count == 3)
                            {
                                SatTrans[SatTransI + 0] = InfoText[0];
                                SatTrans[SatTransI + 2] = InfoText[1] + "-" + InfoText[2];
                            }
                            if (InfoText.Count == 4)
                            {
                                SatTrans[SatTransI + 0] = InfoText[0];
                                SatTrans[SatTransI + 1] = InfoText[1];
                                SatTrans[SatTransI + 2] = InfoText[2] + "-" + InfoText[3];
                            }

                            SatTransI++;
                            SatTransI++;
                            SatTransI++;
                            TDi++;
                            TDi++;
                            TDi++;

                            // Provider name
                            SatTrans[SatTransI] = Prepare(NN.ChildNodes[RowlistTD[i][TDi]].InnerText);
                            ChannelType         = "";
                            string ChannelString  = NN.ChildNodes[RowlistTD[i][TDi]].InnerHtml.ToLowerInvariant();
                            int    ChannelStringT = ChannelString.IndexOf("<a");
                            if (ChannelStringT >= 0)
                            {
                                ChannelString = ChannelString.Substring(ChannelStringT);
                                int ChannelStringTX = ChannelString.IndexOf(">");
                                if (ChannelStringTX > 0)
                                {
                                    ChannelString = ChannelString.Substring(0, ChannelStringTX + 1);
                                    if (ChannelString.Contains("tvchannels"))
                                    {
                                        ChannelType = "TV";
                                    }
                                    if (ChannelString.Contains("radiochannels"))
                                    {
                                        ChannelType = "R";
                                    }
                                    //SatTrans[SatTransI] = "{" + ChannelString + "}";
                                }
                            }
                            SatTransI++;
                            TDi++;
                            TDi++;


                            // ONID-TID
                            SatTrans[SatTransI] = Prepare(NN.ChildNodes[RowlistTD[i][TDi]].InnerText);
                            SatTransI++;
                            TDi++;
                            TDi++;

                            if (RowlistTD[i].Count <= 10)
                            {
                                TDi--;
                            }

                            // C/N lock
                            SatTrans[SatTransI] = Prepare(NN.ChildNodes[RowlistTD[i][TDi]].InnerText);
                            SatTransI++;
                            TDi++;

                            // Encryption
                            PrepareInfo(NN.ChildNodes[RowlistTD[i][TDi]]);
                            SatTrans[SatTransI] = "";
                            for (int i_ = 0; i_ < InfoText.Count; i_++)
                            {
                                if (InfoText[i_] != "")
                                {
                                    if (SatTrans[SatTransI] != "")
                                    {
                                        SatTrans[SatTransI] = SatTrans[SatTransI] + "|";
                                    }
                                    SatTrans[SatTransI] = SatTrans[SatTransI] + InfoText[i_];
                                }
                            }
                            SatTransI++;
                            TDi++;

                            // Source
                            // Updated
                            try
                            {
                                PrepareInfo(NN.ChildNodes[RowlistTD[i][TDi]]);
                                SatTrans[SatTransI] = "";
                                for (int i_ = 0; i_ < (InfoText.Count - 1); i_++)
                                {
                                    if (InfoText[i_] != "")
                                    {
                                        if (SatTrans[SatTransI] != "")
                                        {
                                            SatTrans[SatTransI] = SatTrans[SatTransI] + "|";
                                        }
                                        SatTrans[SatTransI] = SatTrans[SatTransI] + InfoText[i_];
                                    }
                                }
                                if (InfoText.Count > 0)
                                {
                                    SatTrans[SatTransI + 1] = InfoText[InfoText.Count - 1];
                                }
                            }
                            catch
                            {
                            }
                            SatTransI++;
                            SatTransI++;
                            TDi++;


                            // Row
                            SatTrans[SatTransI] = RowN.ToString();

                            for (int ii = 0; ii < 15; ii++)
                            {
                                if (ii > 0)
                                {
                                    FS1W.Write("\t");
                                }
                                FS1W.Write(SatTrans[ii]);
                            }

                            FS1W.WriteLine();



                            if ((ChannelType != "") && ChannelFromFirstRow)
                            {
                                PrepareChannel = 2;
                            }
                        }
                        else
                        {
                            if (ChannelFromOtherRows)
                            {
                                PrepareChannel = 1;
                                TransSpan--;
                            }
                        }


                        if (PrepareChannel > 0)
                        {
                            SatChan = new string[20];

                            int TDi = 0;

                            if (PrepareChannel == 2)
                            {
                                TDi = 2;
                            }
                            else
                            {
                                if (FirstItem)
                                {
                                    TDi       = 0;
                                    FirstItem = false;
                                }
                            }

                            //SID
                            SatChan[1] = Prepare(NN.ChildNodes[RowlistTD[i][TDi]].InnerText).Replace("*", "");
                            TDi++;

                            //Name, Type
                            SatChan[2]  = Prepare(NN.ChildNodes[RowlistTD[i][TDi]].InnerText);
                            ChannelType = "UNK";
                            string ChannelString  = NN.ChildNodes[RowlistTD[i][TDi]].InnerHtml.ToLowerInvariant();
                            int    ChannelStringT = ChannelString.IndexOf("<a");
                            if (ChannelStringT >= 0)
                            {
                                ChannelString = ChannelString.Substring(ChannelStringT);
                                int ChannelStringTX = ChannelString.IndexOf(">");
                                if (ChannelStringTX > 0)
                                {
                                    ChannelString = ChannelString.Substring(0, ChannelStringTX + 1);
                                    if (ChannelString.Contains("tvchannels"))
                                    {
                                        ChannelType = "TV";
                                    }
                                    if (ChannelString.Contains("radiochannels"))
                                    {
                                        ChannelType = "R";
                                    }
                                    //SatTrans[SatTransI] = "{" + ChannelString + "}";
                                }
                            }

                            // FTA
                            SatChan[3] = "No";
                            if (NN.ChildNodes[RowlistTD[i][TDi]].Attributes["style"] != null)
                            {
                                string ColorVal = NN.ChildNodes[RowlistTD[i][TDi]].Attributes["style"].Value;
                                ColorVal = ColorVal.Substring(ColorVal.IndexOf("#")).ToUpperInvariant();
                                if (ColorVal == "#BBFFBB")
                                {
                                    SatChan[3] = "Yes";
                                }
                                if (ColorVal == "#FFFFBB")
                                {
                                    SatChan[3] = "Yes";
                                }
                            }

                            TDi++;
                            TDi++;

                            // VPID
                            {
                                SatChan[4] = Prepare(NN.ChildNodes[RowlistTD[i][TDi]].InnerText);
                                int ColSpan = 1;
                                if (NN.ChildNodes[RowlistTD[i][TDi]].Attributes.Contains("colspan"))
                                {
                                    ColSpan    = ToInt(NN.ChildNodes[RowlistTD[i][TDi]].Attributes["colspan"].Value);
                                    SatChan[5] = ColSpan.ToString();
                                }
                                if (ColSpan == 1)
                                {
                                    TDi++;
                                    SatChan[5] = Prepare(NN.ChildNodes[RowlistTD[i][TDi]].InnerText);
                                }
                                else
                                {
                                    if (ColSpan == 2)
                                    {
                                        SatChan[5] = "";
                                    }
                                }
                            }
                            TDi++;

                            // APID Lang.
                            PrepareInfo(NN.ChildNodes[RowlistTD[i][TDi]]);
                            if (PrepareChannel == 2)
                            {
                                if (InfoColor[0] == "darkgreen")
                                {
                                    InfoColor.RemoveAt(0);
                                    InfoText.RemoveAt(0);
                                }
                                if (InfoColor[0] == "blue")
                                {
                                    InfoColor.RemoveAt(0);
                                    InfoText.RemoveAt(0);
                                }
                            }
                            SatChan[6] = LangList();

                            // Type
                            if (TypeByPID)
                            {
                                ChannelType = "UNK";
                                if ((SatChan[5] == "") && (SatChan[6] == ""))
                                {
                                    ChannelType = "DATA";
                                }
                                if ((SatChan[5] != "") && (SatChan[6] != ""))
                                {
                                    ChannelType = "TV";
                                }
                                if ((SatChan[5] == "") && (SatChan[6] != ""))
                                {
                                    ChannelType = "R";
                                }
                                if ((SatChan[5] != "") && (SatChan[6] == ""))
                                {
                                    ChannelType = "IMG";
                                }
                            }
                            SatChan[0] = ChannelType;

                            PrepareChannel = 0;

                            // Row
                            SatChan[7] = RowN.ToString();
                        }


                        if (SatChan != null)
                        {
                            FS2W.Write(SatTrans[0]);
                            FS2W.Write("\t");
                            FS2W.Write(SatTrans[1]);
                            FS2W.Write("\t");
                            FS2W.Write(SatTrans[7]);
                            FS2W.Write("\t");
                            FS2W.Write(SatTrans[3]);
                            for (int ii = 0; ii < 8; ii++)
                            {
                                FS2W.Write("\t");
                                FS2W.Write(SatChan[ii]);
                            }
                            FS2W.WriteLine();
                        }
                    }
                }
                //FS1W.WriteLine("TABLE END");
            }
        }
 public void SetForegroundColor(object dataItem, InfoColor color)
 {
     MyControlHelper.SetForegroundColor(color);
 }
예제 #22
0
        // 原始版本
        static string Show(IWin32Window owner,
            string strText,
            InfoColor infocolor,
            string strCaption,
            double delayOpacity,
            Font font = null)
        {
            ChargingInfoDlg dlg = new ChargingInfoDlg();
            if (font != null)
                MainForm.SetControlFont(dlg, font, false);

            dlg.DelayOpacity = delayOpacity;
            dlg.InfoColor = infocolor;
            dlg.MessageText = strText;
            if (strCaption != null)
                dlg.Text = strCaption;
            dlg.StartPosition = FormStartPosition.CenterScreen;
            dlg.ShowDialog(owner);

            return dlg.FastInputText;
        }
예제 #23
0
 static string Show(IWin32Window owner,
     string strText,
     InfoColor infocolor,
     double delayOpacity)
 {
     return Show(owner, strText, infocolor, null, delayOpacity);
 }
예제 #24
0
 static string Show(IWin32Window owner,
     string strText,
     InfoColor infocolor)
 {
     return Show(owner, strText, infocolor, null, 1.0);
 }
예제 #25
0
        /// <summary>
        /// 显示快速操作对话框
        /// </summary>
        /// <param name="color">信息颜色</param>
        /// <param name="strCaption">对话框标题文字</param>
        /// <param name="strMessage">消息内容文字</param>
        /// <param name="nTarget">对话框关闭后要切换去的位置。为 READER_BARCODE READER_PASSWORD ITEM_BARCODE 之一</param>
        public void FastMessageBox(InfoColor color,
            string strCaption,
            string strMessage,
            int nTarget)
        {
            string strFastInputText = ChargingInfoDlg.Show(
                this.CharingInfoHost,
                strMessage,
                color,
                strCaption,
                this.InfoDlgOpacity,
                this.MainForm.DefaultFont);

            // this.SwitchFocus(nTarget, strFastInputText);
            if (string.IsNullOrEmpty(strFastInputText) == false)
            {
                this.textBox_input.Text = strFastInputText;
                AsyncDoAction(this._funcstate, strFastInputText);
            }
        }
예제 #26
0
 public void SetForegroundColor(object dataItem, InfoColor color)
 {
     dataGridHelper.SetForegroundColor(dataItem, color);
 }
예제 #27
0
        /*
        public const int READER_BARCODE = 0;
        public const int READER_PASSWORD = 1;
        public const int ITEM_BARCODE = 2;
         * */
        /// <summary>
        /// 显示快速操作对话框
        /// </summary>
        /// <param name="color">信息颜色</param>
        /// <param name="strCaption">对话框标题文字</param>
        /// <param name="strMessage">消息内容文字</param>
        /// <param name="nTarget">对话框关闭后要切换去的位置。为 READER_BARCODE READER_PASSWORD ITEM_BARCODE 之一</param>
        public void FastMessageBox(InfoColor color,
            string strCaption,
            string strMessage,
            int nTarget)
        {
            string strFastInputText = ChargingInfoDlg.Show(
                this.CharingInfoHost,
                strMessage,
                color,
                strCaption,
                this.InfoDlgOpacity,
                this.MainForm.DefaultFont);

            this.SwitchFocus(nTarget, strFastInputText);
        }
 public void SetBorderColor(object dataItem, InfoColor color)
 {
     this.BorderBrush     = UIManager.GetColorFromInfoColor(color);
     this.BorderThickness = new Thickness(1);
 }
예제 #29
0
 public void SetBackgroundColor(InfoColor color)
 {
     this.Background = UIManager.GetColorFromInfoColor(color);
 }
 public void SetBackgroundColor(object dataItem, InfoColor color)
 {
     this.Background = UIManager.GetColorFromInfoColor(color);
 }
예제 #31
0
        // 2009/6/2 
        public static string Show(ChargingInfoHost host,
            string strText,
            InfoColor infocolor,
            string strCaption,
            double delayOpacity,
            bool bPassword,
            Font font = null)
        {
            ChargingInfoDlg dlg = new ChargingInfoDlg();
            if (font != null)
                MainForm.SetControlFont(dlg, font, false);

            dlg.Host = host;
            dlg.DelayOpacity = delayOpacity;
            dlg.InfoColor = infocolor;
            dlg.MessageText = strText;
            if (strCaption != null)
                dlg.Text = strCaption;
            dlg.Password = bPassword;
            dlg.StartPosition = FormStartPosition.CenterScreen;

            host.ap.LinkFormState(dlg, "ChargingInfoDlg_state");
            dlg.ShowDialog(host.window);
            host.ap.UnlinkFormState(dlg);

            return dlg.FastInputText;
        }
예제 #32
0
 static string Show(IWin32Window owner,
                    string strText,
                    InfoColor infocolor)
 {
     return(Show(owner, strText, infocolor, null, 1.0));
 }