コード例 #1
0
ファイル: EventListener.cs プロジェクト: sundowndk/Didius
        public static void Update(Guid Id, string EventId, string EventData)
        {
            if (EventId != string.Empty)
            {
                Event e = new Event (Id, EventId, EventData);
                e.Save ();

            //				Console.WriteLine ("EVENT:\n");
            //				Console.WriteLine ("\tID:"+ EventId);
            //				Console.WriteLine ("\tDATA:"+ EventData);
            //				EventListener eventlistener = EventListener.Load (Id);
            //				eventlistener.Save ();
            }
        }
コード例 #2
0
ファイル: Event.cs プロジェクト: sundowndk/Didius
        public static Event Load(Guid Id)
        {
            Event result;

            try
            {
                Hashtable item = (Hashtable)SNDK.Convert.FromXmlDocument (SNDK.Convert.XmlNodeToXmlDocument (SorentoLib.Services.Datastore.Get<XmlDocument> (DatastoreAisle, Id.ToString ()).SelectSingleNode ("(//didius.event)[1]")));
                result = new Event ();

                result._id = new Guid ((string)item["id"]);

                if (item.ContainsKey ("createtimestamp"))
                {
                    result._createtimestamp = int.Parse ((string)item["createtimestamp"]);
                }

                if (item.ContainsKey ("updatetimestamp"))
                {
                    result._updatetimestamp = int.Parse ((string)item["updatetimestamp"]);
                }

                if (item.ContainsKey ("name"))
                {
                    result._name = (string)item["name"];
                }

                if (item.ContainsKey ("ownerid"))
                {
                    result._ownerid = new Guid ((string)item["ownerid"]);
                }

                if (item.ContainsKey ("data"))
                {
                    result._data = (string)item["data"];
                }
            }
            catch (Exception exception)
            {
                // LOG: LogDebug.ExceptionUnknown
                SorentoLib.Services.Logging.LogDebug (string.Format (SorentoLib.Strings.LogDebug.ExceptionUnknown, "DIDIUS.EVENTLISTENER", exception.Message));

                // EXCEPTION: Excpetion.EventListenerLoadGuid
                throw new Exception (string.Format (Strings.Exception.EventListenerLoadGuid, Id));
            }

            return result;
        }