Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
L

LeHuuTien

@LeHuuTien
About
Posts
17
Topics
6
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • How to make a list that contain lists which contain lists
    L LeHuuTien

    I have an example. I think my example can help you. I have a class

    public class Action_Info
    {
    public string valueResult { get; set; }
    public string valueError { get; set; }
    public string valueInfo { get; set; }
    public long timeWait { get; set; }
    }

    And a list:

    List<Action_Info> listActions;

    I have a xml file: <Script> <Action> <Result>Success</Result> <ErrorReason>None</ErrorReason> <InfoID></InfoID> <TimeWait>10941</TimeWait> </Action> <Action> <Result></Result> <ErrorReason></ErrorReason> <InfoID>NewRcvXbarRsData</InfoID> <TimeWait>17666</TimeWait> </Action> <Action> <Result></Result> <ErrorReason></ErrorReason> <InfoID>NewRcvXbarRsData</InfoID> <TimeWait>17953</TimeWait> </Action> </Script> Then I read from xml file to listActions:

    XDocument doc = XDocument.Load(filePathXML);
    listActions = doc.Descendants("Action").Select(d =>
    new Action_Info
    {
    valueResult = d.Element("Result").Value,
    valueError = d.Element("ErrorReason").Value,
    valueInfo = d.Element("InfoID").Value,
    timeWait = long.Parse(d.Element("TimeWait").Value)
    }).ToList();

    You can do what you want with your list.

    C# xml tutorial question

  • Time to draw 2 usercontrols on a form is depend on each other.
    L LeHuuTien

    I can confirm that both control are draw at the same time.

    C# help graphics

  • Time to draw 2 usercontrols on a form is depend on each other.
    L LeHuuTien

    Thank for your reply. My cpu has 2 core. The first I want control 1 to be stable, control 2 still not care. I measure time to draw control 1, AVG value = 15ms-> 20 ms, usually it ~ 10 ms, however when control 2 has been drawing, time to draw control 1 increase up to ~ 200ms. When control 2 complete it decrease down to ~ 10ms.(I want to both control are running at the same time, the drawing of controls is independence)

    C# help graphics

  • Time to draw 2 usercontrols on a form is depend on each other.
    L LeHuuTien

    usercontrol 2 will invoke draw function:

    public void DrawGraph(Graphics g)
    {
    g.SmoothingMode = SmoothingMode.HighSpeed;
    //Draw background
    _frameXBar.DrawBackground(g, XbarPos);
    _frameNumber.DrawBackground(g, NumberPos);
    _frameRS.DrawBackground(g, RsPos);

           //Draw XBar
           DrawXBarBase(g);
           DrawXbarGraph(g);
    
           ////Draw RS
           DrawRSBase(g);
           DrawRSGraph(g);
    
           ////Draw Number
           DrawNumber(g);
       }
    

    DrawGraph function will call some function: Ex:

    private void DrawRSGraph(Graphics g)
    {
    if (IsAllLine)
    {
    if (IsR)
    {
    if (IsFullLine)
    {
    DrawPolyline(_dataAllLineRFullNumber, g, _frameRS.Width, _frameRS.Height, CalculateHeightRS, RsPos);
    }
    else
    {
    DrawPolyline(_dataAllLineRPassNumber, g, _frameRS.Width, _frameRS.Height, CalculateHeightRS, RsPos);
    }
    }
    else
    {
    if (IsFullLine)
    {
    DrawPolyline(_dataAllLineSFullNumber, g, _frameRS.Width, _frameRS.Height, CalculateHeightRS, RsPos);
    }
    else
    {
    DrawPolyline(_dataAllLineSPassNumber, g, _frameRS.Width, _frameRS.Height, CalculateHeightRS, RsPos);
    }
    }
    }
    else
    {
    if (IsR)
    {
    if (IsFullLine)
    {
    DrawPolyline(_dataForLineRFullNumber, g, _frameRS.Width, _frameRS.Height, CalculateHeightRS, RsPos);
    }
    else
    {
    DrawPolyline(_dataForLineRPassNumber, g, _frameRS.Width, _frameRS.Height, CalculateHeightRS, RsPos);
    }
    }
    else
    {
    if (IsFullLine)
    {
    DrawPolyline(_dataForLineSFullNumber, g, _frameRS.Width, _frameRS.Height, CalculateHeightRS, RsPos);
    }
    else
    {
    DrawPolyline(_dataForLineSPassNumber, g, _

    C# help graphics

  • Time to draw 2 usercontrols on a form is depend on each other.
    L LeHuuTien

    usercontrol 1 will invoke 2 functions, one of it:

    public void DrawControl(Graphics g)
    {
    int X = 599;
    int Y = 10;
    int Width = 225;
    using (GraphicsPath path = GraphicsHelper.Create(X, Y, 224, 119, 5))
    {
    using (Pen frameWithBlackBgrd = new Pen(CWColors.FrameWithBlackBgrd))
    {
    g.DrawPath(frameWithBlackBgrd, path);
    }
    }

           if (GuiResInfoMng.Instance.Lang != null && GuiResInfoMng.Instance.Param != null)
           {
               using (SolidBrush fixedTextWithBlackBgrd = new SolidBrush(CWColors.FixedTextWithBlackBgrd))
               {
                   g.DrawString(GuiResInfoMng.Instance.Lang.GetStr(LangId.IDS\_COM\_TOTALCNT),
                       FontFactory.Instance.GetFont(LangId.FNT\_M2), fixedTextWithBlackBgrd, X, Y);
                   g.DrawString(GuiResInfoMng.Instance.Lang.GetStr(LangId.IDS\_COM\_PASS), FontFactory.Instance.GetFont(LangId.FNT\_M2),
                       fixedTextWithBlackBgrd, X, Y + 23);
                   g.DrawString(GuiResInfoMng.Instance.Lang.GetStr(LangId.IDS\_COM\_NG), FontFactory.Instance.GetFont(LangId.FNT\_M2),
                       fixedTextWithBlackBgrd, X - 1, Y + 46);
               }
           }
    
           using (SolidBrush variableText = new SolidBrush(CWColors.VariableText))
           {
               g.DrawString(ParamHelper.GetParamStr(ParamId.TOTALCOUNT).Trim(), FontFactory.Instance.GetFont(LangId.FNT\_M2), variableText, X + Width - 60, Y);
               g.DrawString(ParamHelper.GetParamStr(ParamId.PASSCOUNT).Trim(), FontFactory.Instance.GetFont(LangId.FNT\_M2), variableText, X + Width - 60, Y + 23);
               g.DrawString(ParamHelper.GetParamStr(ParamId.NGCOUNT).Trim(), FontFactory.Instance.GetFont(LangId.FNT\_M2), variableText, X + Width - 60, Y + 46);
           }
       }
    
    C# help graphics

  • Time to draw 2 usercontrols on a form is depend on each other.
    L LeHuuTien

    I want to redraw usercontrol 1 and usercontrol 2 follow cycle(usercontrol 1 and usercontrol 2 always redraw follow Timer.Interval of each control), so I use Timer.Elapsed event to do that. It draws line, text, ... Sorry for bad English.

    C# help graphics

  • Time to draw 2 usercontrols on a form is depend on each other.
    L LeHuuTien

    I create a usercontrol name: panel1, use timer.Elapsed += OnTimerTick; OnTimerTick will call draw a function. I add 2 panel1 name: panel11 and panel12 into a form. usercontrol 1 draw into panel11, usercontrol 2 draw into panel12.

    C# help graphics

  • Time to draw 2 usercontrols on a form is depend on each other.
    L LeHuuTien

    Hi all. I have a problem. really need some help. I have a form contains 2 usercontrols name: usercontrol 1 and usercontrol 2. I use System.Timers.Timer.Elapsed to redraw usercontrol 1 and usercontrol 2 follow interval(interval of usercontrol 1 = 100ms. interval of usercontrol 2 = 1000ms). I measure time to draw usercontrol 1 and usercontrol 2 and I realize that time to draw usercontrol 1 is increase when usercontrol 2 has been drawing, when usercontrol 2 complete, time to draw usercontrol 1 is decrease. Is there anyway to solve it(time to draw usercontrol 1 is stable, it's not depend on the drawing usercontrol 2).

    C# help graphics

  • What happen when use 2 timer on a form.
    L LeHuuTien

    Hi everybody. I have a problem, really need some helps. I have a usercontrol1(It's using Timer.Tick of System.Windows.Forms.Timer with an Interval to redraw something follow the Interval). I have a form. I added 2 usercontrol1 name: usercontrol1a and usercontrol1b, interval of usercontrol1a = 60ms, inter of usercontrol1b = 1000ms. on usercontrola I draw something, on usercontrol1b I also draw something. My problem is I want to know what happen while drawing usercontrolb come to the cycle draw of usercontrol1a.

    C# graphics help

  • CategoryName in PerformanceCounter
    L LeHuuTien

    Thank for your reply. But I want to see the amount of sent and received bytes process specific information. not from the Network Interface group.

    C#

  • CategoryName in PerformanceCounter
    L LeHuuTien

    Hi all. I want to get send bytes and receive bytes for all process and application are running. Anyone can tell me what CategoryName, CounterName and instance I have to choose.

    C#

  • Get all the network activity data in Resouce Monitor
    L LeHuuTien

    Thank for your reply. I already read all but not yet find answer.

    C# csharp sysadmin help

  • Get all the network activity data in Resouce Monitor
    L LeHuuTien

    Thank for your reply. But I have to write a application to get all the network activity data in Resouce Monitor not use tools.

    C# csharp sysadmin help

  • Get all the network activity data in Resouce Monitor
    L LeHuuTien

    Hi all. I want to get all the network activity data in Resouce Monitor use C#. Anyone can tell me, How I can do it. I really need some help. Hope someone can help me.

    C# csharp sysadmin help

  • #SNMP not return values of ifInObtets, ifOutObtets, ifSpeed when query.
    L LeHuuTien

    Hi all. when I get the value of ifInObtets with oid = 1.3.6.1.2.1.2.2.1.10, it's not return values.

    C# database

  • #SNMP Calculate Bandwidth Utilization
    L LeHuuTien

    Thank for your reply. the formula to calculate bandwidth utilization like that: http://www.cisco.com/c/en/us/support/docs/ip/simple-network-management-protocol-snmp/8141-calculate-bandwidth-snmp.html[^] Can you tell me how can I get "the number of seconds in ..." in this formula.

    C# question help learning

  • #SNMP Calculate Bandwidth Utilization
    L LeHuuTien

    Hello everyone. I'm beginner with open source SNMP class library(#SNMP Library). I want to calculate Bandwidth Utilization based on ifInObtets and ifOutOctets. How can I do? How can I get values fInObtets and ifOutOctets. I need help. Hope someone can help me.

    C# question help learning
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups