Esempio n. 1
0
        public static void Demo()
        {
            ListWithChangedEvent list     = new ListWithChangedEvent();
            EventListener        listener = new EventListener(list);

            list.Add("item 1");
            list[0] = "item_correct";
            list.Clear();
            listener.Detach();
        }
Esempio n. 2
0
            public static void Main()
            {
                ListWithChangedEvents list = new ListWithChangedEvents();
                EventListener listener = new EventListener(list);

                list.Add("item1");
                list.Clear();
                listener.Detach();
                Console.ReadKey();
            }
Esempio n. 3
0
    static void Main()
    {
        Student pesho = new Student("Pesho", 23);

        Console.WriteLine(pesho.Name);
        Console.WriteLine(pesho.Age);
        EventListener listener = new EventListener(pesho);

        pesho.Name = "gosho";
        listener.Detach();
    }
Esempio n. 4
0
    // Test the ListWithChangedEvent class.
    public static void Main () {
        // Create a new list.
        ListWithChangedEvent list = new ListWithChangedEvent();

        // Create a class that listens to the list's change event.
        EventListener listener = new EventListener(list);

        // Add and remove items from the list.
        list.Add("item 1");
        list.Clear();
        listener.Detach();
    }
Esempio n. 5
0
            // Test the ListWithChangedEvent class:
            static void Main()
            {
                // Create a new list:
                ListWithChangedEvent list = new ListWithChangedEvent();

                // Create a class that listens to the list's change event:
                EventListener listener = new EventListener(list);

                // Add and remove items from the list:
                list.Add("item 1");
                list.Clear();
                listener.Detach();
            }
Esempio n. 6
0
        new public SorentoLib.AJAJ.Respons Process(SorentoLib.Session Session, string Fullname, string Method)
        {
            SorentoLib.AJAJ.Respons result  = new SorentoLib.AJAJ.Respons();
            SorentoLib.AJAJ.Request request = new SorentoLib.AJAJ.Request(Session.Request.QueryJar.Get("data").Value);

            switch (Fullname.ToLower())
            {
                #region sXUL.EventListener
            case "sxul.eventlistener":
            {
                switch (Method.ToLower())
                {
                case "attach":
                {
                    result.Add("result", EventListener.Attach());
                    break;
                }

                case "detach":
                {
                    EventListener.Detach(request.Data.Get <Guid> ("eventlistenerid"));
                    break;
                }

                case "update":
                {
                    if (request.Data.ContainsKey("eventid"))
                    {
//								Hashtable item = (Hashtable)SNDK.Convert.FromXmlDocument (SNDK.Convert.XmlNodeToXmlDocument (request.GetXml ("eventdata") .SelectSingleNode ("(//eventdata)[1]")));


//								try
//								{
//									item = (Hashtable)SNDK.Convert.FromXmlDocument (SNDK.Convert.XmlNodeToXmlDocument (xmlDocument.SelectSingleNode ("(//didius.customer)[1]")));
//								}
//								catch
//								{
//									item = (Hashtable)SNDK.Convert.FromXmlDocument (xmlDocument);
//								}

//								XmlDocument test1 = request.GetXml ("eventdata");
//								Console.WriteLine (test1.InnerXml);
//								Hashtable test2 = (Hashtable)SNDK.Convert.FromXmlDocument (test1);
//								string test2 = test1.InnerXml;
//								Console.WriteLine (test2);
//								object test = request.getValue<object> ("eventdata");

                        EventListener.Update(request.Data.Get <Guid> ("eventlistenerid"), request.Data.Get <string> ("eventid"), request.Data.Get <Data> ("eventdata"));
                    }
                    else
                    {
                        List <Data> events = new List <Data> ();
                        foreach (Event event_ in EventListener.Update(request.Data.Get <Guid> ("eventlistenerid")))
                        {
                            events.Add(event_.ToData());
                        }

                        result.Add("sxul.events", events);
                    }
                    break;
                }
                }
                break;
            }
                #endregion

//				#region sXUL.Confog
//				case "sxul.config":
//				{
//					switch (Method.ToLower ())
//					{
//						case "set":
//						{
//							Config.Set (request.getValue<string> ("key"), request.getValue<string> ("value"));
//							break;
//						}
//
//						case "get":
//						{
//							result.Add (Config.Get (request.getValue<string> ("key")));
//							break;
//						}
//					}
//					break;
//				}
//				#endregion
            }

            return(result);
        }
Esempio n. 7
0
        public static void Main(string[] args)
        {
            int menu;

            do
            {
                Menu();
                string input;
                input = Console.ReadLine();
                if (Int32.TryParse(input, out menu))
                {
                    switch (menu)
                    {
                    case 1:
                        Console.WriteLine("--- Adding Artist ---");
                        AddArtist();
                        break;

                    case 2:
                        Console.WriteLine("--- Adding Curator ---");
                        AddCurator();
                        break;

                    case 3:
                        Console.WriteLine("--- Adding Art Piece ---");
                        AddArtpiece();
                        break;

                    case 4:
                        Console.WriteLine("--- Selling Art Piece ---");
                        SellArtPiece();
                        curatorInstance.ClearComm();
                        eventInstance.Detach();
                        break;

                    case 5:
                        Console.WriteLine("--- List Artists ---");
                        ListArtists();
                        break;

                    case 6:
                        Console.WriteLine("--- List Curators ---");
                        ListCurators();
                        break;

                    case 7:
                        Console.WriteLine("--- List Pieces ---");
                        ListPieces();
                        break;

                    case 9:
                        Console.WriteLine("Quiting application...");
                        break;

                    default:
                        Console.WriteLine("Choose a number between 1 to 9");
                        break;
                    }
                }
                else
                {
                    Console.WriteLine("Enter integer not words");
                }
            } while (menu != 9);
        }