Archive for March, 2008

h1

GMT problem for CZ

March 31, 2008

One time I solved this complication. I need to know difference of time between Prague (GMT +1) and the rest of the world. Complication was evocated by summer time. Summer time has been established for reducation of energy wasting. Summer time has no any effect for energy wasting now.

Nobody knew which time is right (summer or winter).

Solution:
Right time is Winter time (GMT +1).
Wrong time is summer time (GMT +2)

h1

WCSF links

March 31, 2008
h1

Getting object from GridControl

March 26, 2008

I have binded collection of entities in the GridView. This Grid control is composed from N GridViews. Question is, how to get selected entity from this grid view??

public static Flight GetSelectedFlight(GridControl gridControl)
{
   int rowHandle = ((GridView)gridControl.MainView).FocusedRowHandle;
   if (rowHandle < 0) return Factories.Flights.CreateEmptyFlight;
   Flight flight = gridControl.FocusedView.GetRow(rowHandle) as Flight;
   return flight;
}
  • GridControl.MainView method is actual used View of GridControl.
  • RowHandle < 0 means: there is not selected value
h1

http://localhost/…Service.svc could not locate service dependency ‘….’

March 25, 2008

[ComponentDependency("blabla")]

bylo ve tride, ktera se vkladala do collectiony.
Pri vkladani dochazi ke Copy (asi), kazdopadne se volala ComponentDependency a vyhucelo to, protoze tato
trida nema WorkItem.Items collection.

public class FlightDetailAllTopViewStrategy : IFlightDetailTopViewStrategy
{ [ComponentDependency("blabla")]
public Flight Flight
{
    get { return _flight; }
    set { _flight = value; }
} }
http://richnewman.wordpress.com/2007/10/07/table-of-contents-for-%e2%80%98introduction-to-cabscsf%e2%80%99-articles-2/

if the object does not exist in the appropriate Items collection when we try to inject it then the CAB will throw a DependencyMissingException.
slo o to, ze jednotlive strategie dedi po jednom interfacu. Problem je, ze object builder nemuze vytvorit instanci dane strategie, kdyz je typu interface
Object builder totiz nevi, jakeho typu strategie bude.

proto se mi jako jednoduche reseni jevi tohle:

IFlightDetailTopViewStrategy Strategy
        {
            get
            {
                return(IFlightDetailTopViewStrategy)
                WorkItem.Items[Constants.Flights.ItemNames.DetailTopViewDetailStrategy];
            }
        }   
h1

Next Money Trick

March 24, 2008

200 & 50 – pade nahore, musi se jednou stranou dotykat knihy na 200,- ;)

h1

next few trics ;)

March 24, 2008
a very amazing magic trick-revealed
Magic Trick Revealed – The Unbreakable Match!
Appearing Cane Magic Trick Revealed
$1 Bill Magic Trick Revealed by LearnMagicTricks.org
h1

Make a Quarter Appear from a Dollar Bill Tutorial

March 24, 2008
h1

Vanish a Coin with a Pen Tutorial in 1 Minute!

March 24, 2008
h1

Event subscriber

March 21, 2008

private object _flightCodeLocker = new object();
/// <summary>
/// Used for adding handlers to lueFlightCode
/// </summary>
public event EventHandler FlightCodeEditValueChanged
{
  add
  {
    lock (_flightCodeLocker)
    {
       lueFlightCode.EditValueChanged +=
value;
    }
  }
 
remove
 
{
   
lock (_flightCodeLocker)
    {
      lueFlightCode.EditValueChanged -=
value;
    }
  }
}

h1

Let’s go Donkey Kong!

March 19, 2008