Dec 28, 2009

Infragistics - WINLABEL

Infragistics - WINLABEL CONTROL


The WinLabel™ control is a basic label type control. Much of the included functionality in the intrinsic label (autosize, mnemonics, image and text) is provided as well as some additional functionality, including:
1. Appearance support -- Full Appearance support including alphablending, gradients, etc.
2. HotTracking -- Alter the appearance of the label when the mouse is over the element.
3. BorderStyleInner/BorderStyleOuter -- The two borderstyles can be used to create additional border effects - "bump" border, etc. The InnerBorderPadding controls the space allocated between the inner and outer border.
4. ImageSize -- Control the size of the image displayed in the label.
5. WrapText -- Determines whether text will wrap when the element is not wide enough to display the entire text.

Infragistics - WINLABEL

Infragistics - WINLABEL






EXAMPLE (FONT)

using Infragistics.Win;

private void SetGridFont()
{
  FontData fd= this.ultraGrid1.DisplayLayout.Appearance.FontData;
  fd.Bold = DefaultableBoolean.True ;
  fd.Italic = DefaultableBoolean.True;
  fd.Name = "Times New Roman";
  fd.Underline = DefaultableBoolean.True;
}

EXAMPLE (TEXT)
 
public override string Text {get; set;}


EXAMPLE (AUTO HIDE)

using Infragistics.Shared;
using Infragistics.Win;
using Infragistics.Win.Misc;

private void CreateShapeImage(Infragistics.Win.Misc.UltraButton button)
{
    // create a bitmap that will be used to provide the shape
    // of the button.
    Bitmap bitmap = new Bitmap(100,100);

    // create a temporary graphics object so we can render into it
    using (Graphics g = Graphics.FromImage(bitmap))
    {
       // draw the background in white. whatever color is in the lower left hand pixel will be assumed to be transparent
       g.Clear( Color.White );
       // draw our circle in a different color
       g.DrawEllipse( Pens.Black , 0, 0, 99, 99 );
       // make sure to fill it in or the only displayed part of the button will be the outline of the circle
       g.FillEllipse( Brushes.Black, 0, 0, 99, 99 );
    }

    // set the shape
    button.ShapeImage = bitmap;

    // autosize to the shape image
    button.AutoSize = true;
}


More resources related to Infragistics:

Nested tables in Ultragrid

WinToolTipManager



.NET Remoting Interview Questions

.NET Remoting Interview Questions

1. What’s a Windows process?
sol: It’s an application that’s running and had been allocated memory.

2. What’s typical about a Windows process in regards to memory allocation?
Sol: Each process is allocated its own block of available RAM space, no process can access another process’ code or data. If the process crashes, it dies alone without taking the entire OS or a bunch of other applications down.

3. Why do you call it a process? What’s different between process and application in .NET, not common computer usage, terminology?
sol: A process is an instance of a running application. An application is an executable on the hard drive or network. There can be numerous processes launched of the same application (5 copies of Word running), but 1 process can run just 1 application.

4. What distributed process frameworks outside .NET do you know?
Sol: Distributed Computing Environment/Remote Procedure Calls (DEC/RPC), Microsoft Distributed Component Object Model (DCOM), Common Object Request Broker Architecture(CORBA), and Java Remote Method Invocation (RMI).

5. What are possible implementations of distributed applications in .NET?
Sol: .NET Remoting and ASP.NET Web Services. If we talk about the Framework Class Library, noteworthy classes are in System.Runtime.Remoting and System.Web.Services.

6. When would you use .NET Remoting and when Web services?
sol: Use remoting for more efficient exchange of information when you control both ends of the application. Use Web services for open-protocol-based information exchange when you are just a client or a server with the other end belonging to someone else.

7. What’s a proxy of the server object in .NET Remoting?
sol: It’s a fake copy of the server object that resides on the client side and behaves as if it was the server. It handles the communication between real server object and the client object. This process is also known as marshaling.

8. What are remotable objects in .NET Remoting?
sol: Remotable objects are the objects that can be marshaled across the application domains. You can marshal by value, where a deep copy of the object is created and then passed to the receiver. You can also marshal by reference, where just a reference to an existing object is passed.

9. What are channels in .NET Remoting?
sol: Channels represent the objects that transfer the other serialized objects from one application domain to another and from one computer to another, as well as one process to another on the same box. A channel must exist before an object can be transferred.

10. What security measures exist for .NET Remoting in System.Runtime.Remoting?
sol: None. Security should be taken care of at the application level. Cryptography and other security techniques can be applied at application or server level.

11. What is a formatter?
sol: A formatter is an object that is responsible for encoding and serializing data into messages on one end, and deserializing and decoding messages into data on the other end.

12. Choosing between HTTP and TCP for protocols and Binary and SOAP for formatters, what are the trade-offs?
sol: Binary over TCP is the most effiecient, SOAP over HTTP is the most interoperable.

13. What’s SingleCall activation mode used for?
sol: If the server object is instantiated for responding to just one single request, the request should be made in SingleCall mode.

14. What’s Singleton activation mode?
sol: A single object is instantiated regardless of the number of clients accessing it. Lifetime of this object is determined by lifetime lease.

15. How do you define the lease of the object?
sol: By implementing ILease interface when writing the class code.

16. Can you configure a .NET Remoting object via XML file?
sol: Yes, via machine.config and application level .config file (or web.config in ASP.NET). Application-level XML settings take precedence over machine.config.

17. How can you automatically generate interface for the remotable object in .NET with Microsoft tools?
sol: Use the Soapsuds tool.

Dec 11, 2009

Infragistics - WINTOOLTIPMANGER


Infragistics - WINTOOLTIPMANGER



WinToolTipManager adds an extender property called "UltraToolTip" to anycontrol. The UltraToolTip property allows for a control to be managed by the WinToolTipManager. This allows a tooltip to automatically display when the mouse hovers over the control.






1. Namespaces Used :


using Infragistics.Win;
using Infragistics.Win.UltraWinToolTip;


2. Place an UltraToolTipManager component on the Form

WinToolTip

3. In order to set up WinToolTip properties, you must first get the ToolTipInfo for the control. Do this using the GetUltraToolTip method of the WinToolTipManager. Place the following code in the Form_Load event.



// Get the ToolTipInfo for TextBox1
UltraToolTipInfo toolTipInfo =
this.ultraToolTipManager1.GetUltraToolTip(this.textBox1);


4. Set the ToolTipText


// Set the ToolTipText.
toolTipInfo.ToolTipText = "Enter some text here.";


5. Set optional properties


// Set the ToolTipTitle
toolTipInfo.ToolTipTitle = "This is textBox1";

// Apply an image
toolTipInfo.ToolTipImage = ToolTipImage.Info;

// Apply an appearance
toolTipInfo.Appearance.BackColor = Color.White;
toolTipInfo.Appearance.BackColor2 = Color.Chartreuse;
toolTipInfo.Appearance.BackGradientStyle = GradientStyle.Circular;
toolTipInfo.Appearance.ForeColor = Color.Black;

// Apply an appearance to the Title.
toolTipInfo.ToolTipTitleAppearance.ForeColor = Color.Red;


6. Run the application
Run the application and hover the mouse over the TextBox. The WinToolTip will display after a delay specified by the InitialDelay property of the WinToolTipManager (half a second by default).




WinToolTip

Dec 9, 2009

Monthly Winner of Nov 2009 - DNS

Monthly Winner of November 2009 - DNS

It feels great to share with you all that I won Monthly award again in Dotnetspider for the month of November 2009.

Prize : iBall Black Stereo Speakers-i2 - 460