Example #1
0
 public static void PrintEvent(Event eventToPrint)
 {
     if (eventToPrint != null)
     {
         EventEngine.AddOutput(eventToPrint.ToString());
     }
 }
    void HandleNotification(Event pushEvent)
    {
        PluginResult result = new PluginResult(PluginResult.Status.OK, pushEvent);
        result.KeepCallback = true;
        DispatchCommandResult(result);

    }
 public static void PrintEvent(Event eventToPrint)
 {
     if (eventToPrint != null)
     {
         Output.Append(eventToPrint + "\n");
     }
 }
Example #4
0
 protected override uint GetResourceHandleFromEvent(Event ev)
 {
     if (ev is CreateEvent)
     {
         CreateEvent createEvent = ev as CreateEvent;
         return createEvent.Result;
     }
     else if (ev is CloseEvent)
     {
         CloseEvent closeEvent = ev as CloseEvent;
         return closeEvent.Socket;
     }
     else if (ev is ConnectEvent)
     {
         ConnectEvent connEvent = ev as ConnectEvent;
         return connEvent.Socket;
     }
     else if (ev is SendEvent)
     {
         SendEvent sendEvent = ev as SendEvent;
         return sendEvent.Socket;
     }
     else if (ev is ReceiveEvent)
     {
         ReceiveEvent recvEvent = ev as ReceiveEvent;
         return recvEvent.Socket;
     }
     else
     {
         throw new NotImplementedException("Should not get here");
     }
 }
 public async Task<IdentityResult> Create(Event item)
 {             
     item.Id = Guid.NewGuid().ToString();            
     context.Events.Add(item);
     var result = await SaveChangesAsync();
     return result;
 }
Example #6
0
        public static Event CustomCategorize(Event e)
        {
            string b = e.BodyText.ToLower();
            if (b.Contains("arabisk") ||
                b.Contains("anden etnisk") ||
                b.Contains("mellemøst") ||
                b.Contains(" mørk i huden"))
            {
                e.Race = 0;
            } else if(b.Contains("svensk ")) {
                e.Race = 1;
            }
            else if (b.Contains("østeuro") ||
              b.Contains("rumæn") ||
              b.Contains("polak") ||
              b.Contains("polsk"))
            {
                e.Race = 2;
            }
            else if (b.Contains("afrikan"))
            {
                e.Race = 3;
            }
            else if (b.Contains("sigøjn") ||
                b.Contains(" roma"))
            {
                e.Race = 4;
            }

            return e;
        }
        public ActionResult Save(Event updatedEvent, FormCollection formData)
        {
            var action = new DataAction(formData);

            try
            {
                switch (action.Type)
                {
                    case DataActionTypes.Insert: // your Insert logic
                        _db.Events.Add(updatedEvent);
                        break;
                    case DataActionTypes.Delete: // your Delete logic
                        updatedEvent = _db.Events.SingleOrDefault(ev => ev.id == updatedEvent.id);
                        _db.Events.Remove(updatedEvent);
                        break;
                    default:// "update" // your Update logic
                        updatedEvent = _db.Events.SingleOrDefault(
                        ev => ev.id == updatedEvent.id);
                        UpdateModel(updatedEvent);
                        break;
                }
                _db.SaveChanges();
                action.TargetId = updatedEvent.id;
            }
            catch (Exception e)
            {
                action.Type = DataActionTypes.Error;
            }
            return (new AjaxSaveResponse(action));
        }
Example #8
0
 public DragRezult(bool e)
 {
     mRezult = Rezult.Nodrag;
     mOnEndDrag = null;
     mOnDrag = null;
     mOnPaint = null;
 }
Example #9
0
 public DragRezult(Event onDrag, Event onEndDrag, EventPaint onPaint)
 {
     mRezult = Rezult.Drag;
     mOnDrag = onDrag;
     mOnEndDrag = onEndDrag;
     mOnPaint = onPaint;
 }
 public void AddEvent(DateTime date, string title, string location)
 {
     Event newEvent = new Event(date, title, location);
     title.Add(title.ToLower(), newEvent);
     date.Add(newEvent);
     Messages.EventAdded();
 }
Example #11
0
 public DelayedEvent(IEventable target, Event<IEventable> @event, int delay, object[] parameters)
 {
     Target = target;
     Event = @event;
     _delay = delay;
     Parameters = parameters;
 }
        private void ActiveRecord_Received(object sender, Event.DeliverCSAttendEventArgs e)
        {
            IEnumerable<UDT.CSAttend> CSAttends = e.ActiveRecords;
            if (CSAttends.Count() == 0)
                return;

            this.circularProgress.Visible = true;
            this.circularProgress.IsRunning = true;

            this.DisableButtons();

            try
            {
                this.InitCSAttend(CSAttends.ElementAt(0).CourseID.ToString());
                if (this.chkShowLog.Checked)
                    this.AppendCSAttendLog(CSAttends.ElementAt(0).CourseID.ToString());
                this.CheckedManualCSAttend(CSAttends.ElementAt(0));
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }

            this.EnableButtons();

            this.circularProgress.Visible = false;
            this.circularProgress.IsRunning = false;
        }
        public async Task<IEnumerable<Event>> ProcessAsync(Event evnt)
        {
            var shardKeyArrived = evnt.GetBody<ShardKeyArrived>();
            TheTrace.TraceInformation("Got {0} from {1}", shardKeyArrived.ShardKey, 
                shardKeyArrived.Source.TypeName);

            var account = CloudStorageAccount.Parse(shardKeyArrived.Source.ConnectionString);
            var client = account.CreateCloudTableClient();
            var table = client.GetTableReference(shardKeyArrived.Source.DynamicProperties["TableName"].ToString());

            var entities = table.ExecuteQuery(new TableQuery().Where(
                TableQuery.GenerateFilterCondition("PartitionKey", "eq", shardKeyArrived.ShardKey)));

            bool hasAnything = false;
            foreach (var entity in entities)
            {
                await _pusher.PushAsync(entity, shardKeyArrived.Source);
                hasAnything = true;
            }

            if (hasAnything)
            {
                await _pusher.FlushAsync();
            }

            return Enumerable.Empty<Event>();
        }
Example #14
0
        private static void OnAddBookBuff(Event e)
        {
            Sim actor = e.Actor as Sim;
            if (actor == null) return;

            BookWritten target = e.TargetObject as BookWritten;
            if (target == null) return;

            BookWrittenData data = target.Data as BookWrittenData;
            if (data == null) return;

            if (actor.SimDescription.ChildOrBelow) return;

            if (actor.SimDescription.Teen)
            {
                if (!Woohooer.Settings.AllowTeen(true)) return;
            }

            if (actor.BuffManager == null) return;

            switch (data.Genre)
            {
                case BookData.BookGenres.Romance:
                //case BookData.BookGenres.Poetry:
                case BookData.BookGenres.Trashy:
                    actor.BuffManager.AddElement(BuffNames.InTheMood, sBookOrigin);
                    break;
            }
        }
Example #15
0
        public ActionResult Create(CreateEventViewModel eventToRegister)
        {
            if(!this.ModelState.IsValid)
            {
                return this.View(eventToRegister);
            }

            var userId = this.User.Identity.GetUserId();

            var eventToCreate = new Event()
            {
                Name = eventToRegister.Name,
                Description = eventToRegister.Description,
                CreatedOn = DateTime.Now,
                StartDate = eventToRegister.StartDate,
                OrganiserId = userId,
                Coordinates = eventToRegister.Coordinates,
                LocationId = 1
            };

            var createdEvent = this.eventsServices.CreateEvent(eventToCreate);
            IIdentifierProvider provider = new IdentifierProvider();
            string encodedId = provider.EncodeId(createdEvent.Id);

            return this.Redirect("~/Events/" + encodedId);
        }
Example #16
0
        public async Task<IEnumerable<Event>> ProcessAsync(Event evnt)
        {
            var events = new List<Event>();
            var items = (await _dynamoStore.ListAsync(
                _configurationValueProvider.GetValue(Constants.SweepRootPathKey)))
                .ToArray();

            var notProcessed = items.Where(x => !x.IsVirtualFolder)
                .GroupBy(z => z.Id.Replace(Constants.StatusPostfix, ""))
                .Where(f => f.Count() == 1)
                .Select(w => w.Single());

            foreach (var blob in notProcessed)
            {
                events.Add(new Event(new NewFileArrived()
                {
                    FileId = blob.Id
                }));
                await _dynamoStore.InsertAsync(new SimpleBlob()
                {
                    Id = blob.Id + Constants.StatusPostfix,
                    Body = new MemoryStream(BitConverter.GetBytes(1)) // status 1
                });
            }

            return events;
        }
 public override void FireEvent(Event e)
 {
     if (e.Type == EventType.Render)
     {
         Console.WriteLine(e.Parameters["text"]);
     }
 }
Example #18
0
        public bool HandleEvent(ISkinLayout skin, Rectangle layout, IGameContext context, Event @event)
        {
            var mousePressEvent = @event as MousePressEvent;
            if (mousePressEvent != null)
            {
                if (!layout.Contains(mousePressEvent.MouseState.X, mousePressEvent.MouseState.Y))
                {
                    return false;
                }

                State = LinkState.Clicked;

                Click?.Invoke(this, new EventArgs());

                return true;
            }

            var mouseReleaseEvent = @event as MouseReleaseEvent;
            if (mouseReleaseEvent != null)
            {
                if (!layout.Contains(mouseReleaseEvent.MouseState.X, mouseReleaseEvent.MouseState.Y))
                {
                    return false;
                }

                State = LinkState.None;
            }

            return false;
        }
Example #19
0
        public void setLock(Event.Event  evt,int cctvid,string desc1,string desc2,int preset)
        {
            try
            {
                unlock();
                this.cctvid=cctvid;
                this.desc1=desc1;
                this.desc2=desc2;
                this.preset=preset;
                this.evt = evt;
                byte[] codebig5 =/* RemoteInterface.Util.StringToUTF8Bytes(desc2);*/         RemoteInterface.Util.StringToBig5Bytes(desc2);

                desc2 =      System.Web.HttpUtility.UrlEncode(codebig5);
                codebig5 = /* RemoteInterface.Util.StringToUTF8Bytes(desc1);   */         RemoteInterface.Util.StringToBig5Bytes(desc1);
                desc1 = System.Web.HttpUtility.UrlEncode(codebig5);
                 string uristr=string.Format(LockWindows.lockurlbase,this.wid,this.cctvid,desc1,desc2,preset);
               //  string uristr = string.Format(LockWindows.lockurlbase, 3, this.cctvid, desc1, desc2, preset);
                //只鎖定 第3號視窗

                System.Net.WebRequest web = System.Net.HttpWebRequest.Create(new Uri(uristr
                     ,UriKind.Absolute)
                 );

                System.IO.Stream stream = web.GetResponse().GetResponseStream();
                System.IO.StreamReader rd = new System.IO.StreamReader(stream);
                string res = rd.ReadToEnd();
                isLock = true;
            }
            catch (Exception ex)
            {
                isLock = false;
            }
        }
Example #20
0
 public void HandleEvent(Event e)
 {
     switch (state)
     {
         case State.LOCKED:
             switch (e)
             {
                 case Event.COIN:
                     state = State.UNLOCKED;
                     turnstileController.Unlock();
                     break;
                 case Event.PASS:
                     turnstileController.Alarm();
                     break;
             }
             break;
         case State.UNLOCKED:
             switch (e)
             {
                 case Event.COIN:
                     turnstileController.Thankyou();
                     break;
                 case Event.PASS:
                     state = State.LOCKED;
                     turnstileController.Lock();
                     break;
             }
             break;
     }
 }
        public static IEventFrequencyBuilder Create(Event aEvent)
        {
            IEventFrequencyBuilder builder;
            switch(aEvent.FrequencyTypeOptions)
            {
                case FrequencyTypeEnum.None:
                    builder = new OneTimeEventBuilder(aEvent);
                    break;

                case FrequencyTypeEnum.Daily:
                    builder = new DailyEventBuilder();
                    break;

                case FrequencyTypeEnum.Weekly:
                    builder = new WeeklyEventBuilder(aEvent);
                    break;

                case FrequencyTypeEnum.Monthly:
                    builder = new MonthlyEventBuilder(aEvent);
                    break;

                default:
                    Trace.TraceError("Unknown frequency type '{0}'", aEvent.FrequencyTypeOptions);
                    builder = null;
                    break;
            }
            return builder;
        }
Example #22
0
        public override bool VisitEvent(Event @event)
        {
            if (!VisitDeclaration(@event))
                return false;

            string msg;
            if (HasInvalidDecl(@event, out msg))
            {
                @event.ExplicitlyIgnore();
                Log.Debug("Event '{0}' was ignored due to {1} decl",
                    @event.Name, msg);
                return false;
            }

            foreach (var param in @event.Parameters)
            {
                if (HasInvalidDecl(param, out msg))
                {
                    @event.ExplicitlyIgnore();
                    Log.Debug("Event '{0}' was ignored due to {1} param",
                        @event.Name, msg);
                    return false;
                }

                if (HasInvalidType(param.Type, out msg))
                {
                    @event.ExplicitlyIgnore();
                    Log.Debug("Event '{0}' was ignored due to {1} param",
                        @event.Name, msg);
                    return false;
                }
            }

            return true;
        }
Example #23
0
		public void WhenCreatingEvent_ThenCanCastToCovariantBase()
		{
			IEvent<FooArgs> args = new Event<object, FooArgs>(this, new FooArgs());
			var covariant = (IEvent<EventArgs>)args;

			Assert.NotNull(covariant);
		}
Example #24
0
        public void Create_Event()
        {
            var ebEvent = new Event
            {
                Name = new MultipartTextField { Html = "Test event" },
                Description = new MultipartTextField { Html = "Test event description" },
                Start = new DateTimeTimezoneField { Timezone = "Europe/London" },
                End = new DateTimeTimezoneField { Timezone = "Europe/London" },
                OnlineEvent = true,
                Currency = "GBP",
                CategoryId = 108,
                SubcategoryId = 8001
            };

            ebEvent.TicketClasses.Add(new TicketClass
                {
                    Name = "General admission ticket",
                    Cost = new CurrencyField { Currency = "GBP", Value = 10, Display = "£10".UrlEncode() },
                    Free = false,
                    Fee = new CurrencyField { Currency = "GBP", Value = 10, Display = "£10".UrlEncode()  },
                    QuantityTotal = 1000,
                    MinimumQuantity = 1,
                    MaximumQuantity = 10
                });

            // post
            Assert.DoesNotThrow(() => Context.Create<Event>(ebEvent));
            Assert.That(ebEvent, Is.Not.Null);
            Assert.Greater(ebEvent.Id, 0);
        }
Example #25
0
 /// <summary>
 /// Creates a new assetSchedule from and old assetSchedule and a new Event
 /// </summary>
 /// <param name="oldSchedule"></param>
 /// <param name="newEvent"></param>
 public StateHistory(StateHistory oldSchedule, Event newEvent)
 {
     Events = new Stack<Event>(oldSchedule.Events);
     InitialState = oldSchedule.InitialState;  //Should maybe be a deep copy -->not for this one
     Events.Push(newEvent);
 //    Asset = newAssetSched.Asset;
 }
Example #26
0
 // sends an event to be processed immediately, warning: use with caution!
 public void SendImmediateEvent(Event ev)
 {
     for (int i = 0; i < m_lsUpdateStack.Count; i++)
     {
         m_lsUpdateStack[i].obj.ProcessEvent(ev);
     }
 }
        public static void AddOutlookID(ref Event ev, AppointmentItem ai)
        {
            //Add the Outlook appointment ID into Google event.
            //This will make comparison more efficient and set the scene for 2-way sync.

            addOGCSproperty(ref ev, oEntryID, OutlookCalendar.Instance.IOutlook.GetGlobalApptID(ai));
        }
Example #28
0
 public void AddEvent(DateTime date, string title, string location)
 {
     Event newEvent = new Event(date, title, location);
     this.dictByTitle.Add(title.ToLower(), newEvent);
     this.orderedByDate.Add(newEvent);
     Messages.EventAdded(this.Output);
 }
Example #29
0
 /// <summary>
 /// Returns an header from an InfoEvent.
 /// </summary>
 /// <param name="Event"></param>
 /// <returns></returns>
 public short GetHeader(Event Event)
 {
     using (DictionaryAdapter<string, short> DA = new DictionaryAdapter<string, short>(InfoEvents))
     {
         return DA.TryPopValue(Event.GetType().Name);
     }
 }
 public static void PrintEvent(Event eventToPrint)
 {
     if (eventToPrint != null)
     {
         output.AppendFormat("{0}{1}", eventToPrint, Environment.NewLine);
     }
 }
Example #31
0
        public async Task <ActionResult> CreateEvent(EventEditModel model)
        {
            if (ModelState.IsValid)
            {
                try
                {
                    if (model.Tickets.Any())
                    {
                        if (await IsEventSlugUnique(model.Slug, model.EventId))
                        {
                            var eventObj = new Event
                            {
                                OrganizerId = model.OrganizerId,
                                CategoryId  = model.CategoryId,
                                TopicId     = model.TopicId,
                                SubTopicId  = model.SubTopicId,
                                EventId     = Guid.NewGuid(),
                                Title       = model.Title,
                                Description = model.Description,
                                Image       = model.Image ?? PlaceholderImagePath,
                                Slug        = model.Slug,
                                Published   = model.Published,
                                StartDate   = model.StartDate,
                                EndDate     = model.EndDate,
                                Venue       = new Venue
                                {
                                    VenueId = Guid.NewGuid(),
                                    Name    = model.VenueName,
                                    Address = model.VenueAddress,
                                    City    = model.VenueCity,
                                    Country = model.VenueCountry
                                }
                            };

                            UnitOfWork.EventRepository.Add(eventObj);

                            foreach (var ticketVm in model.Tickets)
                            {
                                eventObj.Tickets.Add(new Ticket
                                {
                                    TicketId = Guid.NewGuid(),
                                    EventId  = eventObj.EventId,
                                    Title    = ticketVm.Title,
                                    Quantity = ticketVm.Quantity,
                                    Price    = ticketVm.Price,
                                    Type     = ticketVm.Price == decimal.Zero ? TicketType.Free : TicketType.Paid
                                });
                            }

                            await UnitOfWork.SaveChangesAsync();

                            return(RedirectToAction("MyEvents", "Event"));
                        }
                        ModelState.AddModelError("", "Url kısaltması özel olmalıdır");
                    }
                    else
                    {
                        ModelState.AddModelError("", "Etkinliğe en az bir bilet eklenmelidir");
                    }
                }
                catch
                {
                    //TODO: Log error
                    ModelState.AddModelError("", "Etkinlik oluşturulurken bir hata oluştu");
                }
            }
            else
            {
                ModelState.AddModelError("", "Lütfen tüm alanları doğru şekilde doldurunuz");
            }

            model.Organizers = new SelectList(await UnitOfWork.OrganizerRepository.GetAllAsync(), "OrganizerId", "Name",
                                              model.OrganizerId);
            model.Categories = new SelectList(await UnitOfWork.CategoryRepository.GetAllAsync(), "CategoryId", "Name",
                                              model.CategoryId);
            model.Topics = new SelectList(await UnitOfWork.TopicRepository.GetAllAsync(), "TopicId", "Name",
                                          model.TopicId);
            model.SubTopics = new SelectList(await UnitOfWork.SubTopicRepository.GetSubTopicsAsync(model.TopicId),
                                             "SubTopicId", "Name", model.SubTopicId);

            return(View(model));
        }
Example #32
0
 /// <summary>
 /// Respond to GUI input events in editor.
 /// </summary>
 /// <param name="currEvent">The current event</param>
 /// <param name="active">Is it the active shape?</param>
 /// <returns>Did the shape handle the event?</returns>
 public override bool HandleEditorEvent(Event currEvent, bool active)
 {
     return(false);
 }
 public bool SendEvent(Event ev)
 {
     return(true);
 }
Example #34
0
        internal static string DoTextField(RecycledTextEditor editor, int id, Rect position, string text, GUIStyle style, string allowedletters, out bool changed, bool reset, bool multiline, bool passwordField)
        {
            Event  current = Event.current;
            string result  = text;

            if (text == null)
            {
                text = string.Empty;
            }
            if (showMixedValue)
            {
                text = string.Empty;
            }
            if (HasKeyboardFocus(id) && Event.current.type != EventType.Layout)
            {
                if (editor.IsEditingControl(id))
                {
                    editor.position        = position;
                    editor.style           = style;
                    editor.controlID       = id;
                    editor.multiline       = multiline;
                    editor.isPasswordField = passwordField;
                    editor.DetectFocusChange();
                }
                else if (editingTextField)
                {
                    editor.BeginEditing(id, text, position, style, multiline, passwordField);
                    if (GUI.skin.settings.cursorColor.a > 0f)
                    {
                        editor.SelectAll();
                    }
                }
            }
            if (editor.controlID == id && GUIUtility.keyboardControl != id)
            {
                editor.controlID = 0;
            }
            bool      flag           = false;
            string    text2          = editor.text;
            EventType typeForControl = current.GetTypeForControl(id);

            switch (typeForControl)
            {
            case EventType.MouseDown:
                if (position.Contains(current.mousePosition) && current.button == 0)
                {
                    if (editor.IsEditingControl(id))
                    {
                        if (Event.current.clickCount == 2 && GUI.skin.settings.doubleClickSelectsWord)
                        {
                            editor.MoveCursorToPosition(Event.current.mousePosition);
                            editor.SelectCurrentWord();
                            editor.MouseDragSelectsWholeWords(true);
                            editor.DblClickSnap(TextEditor.DblClickSnapping.WORDS);
                            s_DragToPosition = false;
                        }
                        else if (Event.current.clickCount == 3 && GUI.skin.settings.tripleClickSelectsLine)
                        {
                            editor.MoveCursorToPosition(Event.current.mousePosition);
                            editor.SelectCurrentParagraph();
                            editor.MouseDragSelectsWholeWords(true);
                            editor.DblClickSnap(TextEditor.DblClickSnapping.PARAGRAPHS);
                            s_DragToPosition = false;
                        }
                        else
                        {
                            editor.MoveCursorToPosition(Event.current.mousePosition);
                            s_SelectAllOnMouseUp = false;
                        }
                    }
                    else
                    {
                        GUIUtility.keyboardControl = id;
                        editor.BeginEditing(id, text, position, style, multiline, passwordField);
                        editor.MoveCursorToPosition(Event.current.mousePosition);
                        if (GUI.skin.settings.cursorColor.a > 0f)
                        {
                            s_SelectAllOnMouseUp = true;
                        }
                    }
                    GUIUtility.hotControl = id;
                    current.Use();
                }
                break;

            case EventType.MouseUp:
                if (GUIUtility.hotControl == id)
                {
                    if (s_Dragged && s_DragToPosition)
                    {
                        editor.MoveSelectionToAltCursor();
                        flag = true;
                    }
                    else if (s_PostPoneMove)
                    {
                        editor.MoveCursorToPosition(Event.current.mousePosition);
                    }
                    else if (s_SelectAllOnMouseUp)
                    {
                        if (GUI.skin.settings.cursorColor.a > 0f)
                        {
                            editor.SelectAll();
                        }
                        s_SelectAllOnMouseUp = false;
                    }
                    editor.MouseDragSelectsWholeWords(false);
                    s_DragToPosition = true;
                    s_Dragged        = false;
                    s_PostPoneMove   = false;
                    if (current.button == 0)
                    {
                        GUIUtility.hotControl = 0;
                        current.Use();
                    }
                }
                break;

            case EventType.MouseMove:
            case EventType.KeyUp:
            case EventType.ScrollWheel:
                switch (typeForControl)
                {
                case EventType.ValidateCommand:
                    if (GUIUtility.keyboardControl == id)
                    {
                        string commandName = current.commandName;
                        switch (commandName)
                        {
                        case "Cut":
                        case "Copy":
                            if (editor.hasSelection)
                            {
                                current.Use();
                            }
                            break;

                        case "Paste":
                            if (editor.CanPaste())
                            {
                                current.Use();
                            }
                            break;

                        case "SelectAll":
                            current.Use();
                            break;

                        case "UndoRedoPerformed":
                            editor.text = text;
                            current.Use();
                            break;

                        case "Delete":
                            current.Use();
                            break;
                        }
                    }
                    break;

                case EventType.ExecuteCommand:
                    if (GUIUtility.keyboardControl == id)
                    {
                        string commandName = current.commandName;
                        switch (commandName)
                        {
                        case "OnLostFocus":
                            if (activeEditor != null)
                            {
                                activeEditor.EndEditing();
                            }
                            current.Use();
                            break;

                        case "Cut":
                            editor.BeginEditing(id, text, position, style, multiline, passwordField);
                            editor.Cut();
                            flag = true;
                            break;

                        case "Copy":
                            editor.Copy();
                            current.Use();
                            break;

                        case "Paste":
                            editor.BeginEditing(id, text, position, style, multiline, passwordField);
                            editor.Paste();
                            flag = true;
                            break;

                        case "SelectAll":
                            editor.SelectAll();
                            current.Use();
                            break;

                        case "Delete":
                            editor.BeginEditing(id, text, position, style, multiline, passwordField);
                            if (Application.platform == RuntimePlatform.OSXPlayer || Application.platform == RuntimePlatform.OSXEditor || (Application.platform == RuntimePlatform.WebGLPlayer && SystemInfo.operatingSystem.StartsWith("Mac")))
                            {
                                editor.Delete();
                            }
                            else
                            {
                                editor.Cut();
                            }
                            flag = true;
                            current.Use();
                            break;
                        }
                    }
                    break;

                case EventType.DragExited:
                    break;

                case EventType.ContextClick:
                    if (position.Contains(current.mousePosition))
                    {
                        if (!editor.IsEditingControl(id))
                        {
                            GUIUtility.keyboardControl = id;
                            editor.BeginEditing(id, text, position, style, multiline, passwordField);
                            editor.MoveCursorToPosition(Event.current.mousePosition);
                        }
                        //ShowTextEditorPopupMenu();
                        Event.current.Use();
                    }
                    break;

                default:
                    break;
                }
                break;

            case EventType.MouseDrag:
                if (GUIUtility.hotControl == id)
                {
                    if (!current.shift && editor.hasSelection && s_DragToPosition)
                    {
                        editor.MoveAltCursorToPosition(Event.current.mousePosition);
                    }
                    else
                    {
                        if (current.shift)
                        {
                            editor.MoveCursorToPosition(Event.current.mousePosition);
                        }
                        else
                        {
                            editor.SelectToPosition(Event.current.mousePosition);
                        }
                        s_DragToPosition     = false;
                        s_SelectAllOnMouseUp = !editor.hasSelection;
                    }
                    s_Dragged = true;
                    current.Use();
                }
                break;

            case EventType.KeyDown:
                if (GUIUtility.keyboardControl == id)
                {
                    char character = current.character;
                    if (editor.IsEditingControl(id) && editor.HandleKeyEvent(current))
                    {
                        current.Use();
                        flag = true;
                    }
                    else if (current.keyCode == KeyCode.Escape)
                    {
                        if (editor.IsEditingControl(id))
                        {
                            /*if (style == EditorStyles.toolbarSearchField || style == EditorStyles.searchField)
                             * {
                             *      EditorGUI.s_OriginalText = string.Empty;
                             * }*/
                            editor.text = s_OriginalText;
                            editor.EndEditing();
                            flag = true;
                        }
                    }
                    else if (character == '\n' || character == '\u0003')
                    {
                        if (!editor.IsEditingControl(id))
                        {
                            editor.BeginEditing(id, text, position, style, multiline, passwordField);
                            editor.SelectAll();
                        }
                        else
                        {
                            if (multiline && !current.alt && !current.shift && !current.control)
                            {
                                editor.Insert(character);
                                flag = true;
                                break;
                            }
                            editor.EndEditing();
                        }
                        current.Use();
                    }
                    else if (character == '\t' || current.keyCode == KeyCode.Tab)
                    {
                        if (multiline && editor.IsEditingControl(id))
                        {
                            bool flag2 = allowedletters == null || allowedletters.IndexOf(character) != -1;
                            bool flag3 = !current.alt && !current.shift && !current.control && character == '\t';
                            if (flag3 && flag2)
                            {
                                editor.Insert(character);
                                flag = true;
                            }
                        }
                    }
                    else if (character != '\u0019' && character != '\u001b')
                    {
                        if (editor.IsEditingControl(id))
                        {
                            bool flag4 = (allowedletters == null || allowedletters.IndexOf(character) != -1) && character != '\0';
                            if (flag4)
                            {
                                editor.Insert(character);
                                flag = true;
                            }
                            else
                            {
                                if (Input.compositionString != string.Empty)
                                {
                                    editor.ReplaceSelection(string.Empty);
                                    flag = true;
                                }
                                current.Use();
                            }
                        }
                    }
                }
                break;

            case EventType.Repaint:
            {
                string text3;
                if (editor.IsEditingControl(id))
                {
                    text3 = ((!passwordField) ? editor.text : string.Empty.PadRight(editor.text.Length, '*'));
                }
                else if (showMixedValue)
                {
                    text3 = s_MixedValueContent.text;
                }
                else
                {
                    text3 = ((!passwordField) ? text : string.Empty.PadRight(text.Length, '*'));
                }
                if (!string.IsNullOrEmpty(s_UnitString) && !passwordField)
                {
                    text3 = text3 + " " + s_UnitString;
                }
                if (GUIUtility.hotControl == 0)
                {
                    //EditorGUIUtility.AddCursorRect(position, MouseCursor.Text);
                }
                if (!editor.IsEditingControl(id))
                {
                    BeginHandleMixedValueContentColor();
                    style.Draw(position, RuntimeEditorGUIUtility.TempContent(text3), id, false);
                    EndHandleMixedValueContentColor();
                }
                else
                {
                    editor.DrawCursor(text3);
                }
                break;
            }
            }
            if (GUIUtility.keyboardControl == id)
            {
                //GUIUtility.textFieldInput = true;
            }
            editor.UpdateScrollOffsetIfNeeded(current);
            changed = false;
            if (flag)
            {
                changed = (text2 != editor.text);
                current.Use();
            }
            if (changed)
            {
                GUI.changed = true;
                return(editor.text);
            }
            RecycledTextEditor.s_AllowContextCutOrPaste = true;
            return(result);
        }
Example #35
0
        internal static void DoNumberField(RecycledTextEditor editor, Rect position, Rect dragHotZone, int id, bool isDouble, ref double doubleVal, ref long longVal, string formatString, GUIStyle style)
        {
            string allowedletters = (!isDouble) ? s_AllowedCharactersForInt : s_AllowedCharactersForFloat;
            //if (draggable)
            //{
            //EditorGUI.DragNumberValue(editor, position, dragHotZone, id, isDouble, ref doubleVal, ref longVal, formatString, style, dragSensitivity);
            //}
            Event  current = Event.current;
            string text;

            if (HasKeyboardFocus(id) || (current.type == EventType.MouseDown && current.button == 0 && position.Contains(current.mousePosition)))
            {
                if (!editor.IsEditingControl(id))
                {
                    text = (s_RecycledCurrentEditingString = ((!isDouble) ? longVal.ToString(formatString) : doubleVal.ToString(formatString)));
                }
                else
                {
                    text = s_RecycledCurrentEditingString;
                    if (current.type == EventType.ValidateCommand && current.commandName == "UndoRedoPerformed")
                    {
                        text = ((!isDouble) ? longVal.ToString(formatString) : doubleVal.ToString(formatString));
                    }
                }
            }
            else
            {
                text = ((!isDouble) ? longVal.ToString(formatString) : doubleVal.ToString(formatString));
            }
            if (GUIUtility.keyboardControl == id)
            {
                bool flag;
                text = DoTextField(editor, id, position, text, style, allowedletters, out flag, false, false, false);
                if (flag)
                {
                    GUI.changed = true;
                    s_RecycledCurrentEditingString = text;
                    if (isDouble)
                    {
                        string a = text.ToLower();
                        if (a == "inf" || a == "infinity")
                        {
                            doubleVal = double.PositiveInfinity;
                        }
                        else if (a == "-inf" || a == "-infinity")
                        {
                            doubleVal = double.NegativeInfinity;
                        }
                        else
                        {
                            text = text.Replace(',', '.');
                            if (!double.TryParse(text, NumberStyles.Float, CultureInfo.InvariantCulture.NumberFormat, out doubleVal))
                            {
                                //s_RecycledCurrentEditingFloat = doubleVal;
                                //doubleVal = (EditorGUI.s_RecycledCurrentEditingFloat = ExpressionEvaluator.Evaluate<double>(text));
                                return;
                            }
                            if (double.IsNaN(doubleVal))
                            {
                                doubleVal = 0.0;
                            }
                            s_RecycledCurrentEditingFloat = doubleVal;
                        }
                    }
                    else
                    {
                        if (!long.TryParse(text, out longVal))
                        {
                            //longVal = (EditorGUI.s_RecycledCurrentEditingInt = ExpressionEvaluator.Evaluate<long>(text));
                            return;
                        }
                        s_RecycledCurrentEditingInt = longVal;
                    }
                }
            }
            else
            {
                bool flag;
                text = DoTextField(editor, id, position, text, style, allowedletters, out flag, false, false, false);
            }
        }
 static FilterReturn Filter(IntPtr xevent, Event evnt)
 {
     return(FilterReturn.Remove);
 }
Example #37
0
 /// <summary>
 /// Serialize event-data to JSON.
 /// </summary>
 /// <param name="eventData">The event-data to serialize.</param>
 private string SerializeEventData(Event eventData)
 {
     return(JsonConvert.SerializeObject(eventData, _serializerSettings));
 }
Example #38
0
 private bool IsZoomEvent(Event evnt)
 => evnt.GetTypeString() == "SetPlayerDistance";
Example #39
0
 public override PropertyViewModel CreatePropertyViewModel(Event Event)
 {
     return(new LinePropertyViewModel(Logger, Name, Event.LineIndex + 1));
 }
Example #40
0
        // Zoom Event Format:
        // {"time":[time],"data":["SetPlayerDistance","[distance]"]}
        private void AddLongZoomToConfig()
        {
            Event startZoom =
                new Event
            {
                time = (double)ZEMLZStartTimeNUD.Value,
                data = new string[]
                {
                    "SetPlayerDistance",
                    ZEMLZStartZoomNUD.Value.ToString()
                }
            };

            Event endZoom =
                new Event
            {
                time = (double)ZEMLZEndTimeNUD.Value,
                data = new string[]
                {
                    "SetPlayerDistance",
                    ZEMLZEndZoomNUD.Value.ToString()
                }
            };

            // Make sure there aren't any other zooms nearby (within 1ms) with the same zoom level.
            // If the user already added the key zooms in, we want to make sure we're using those
            string millesecondTime = startZoom.time.ToString("0.###");

            int[] currentlySelectedEvent = new int[]
            {
                ConfigPreviewRTBZEM.SelectionStart,
                ConfigPreviewRTBZEM.SelectionLength,
            };

            // If the time currently doesn't exist, then we know that there isn't a nearby time
            if (!ConfigPreviewRTBZEM.Text.Contains(millesecondTime))
            {
            }
            // But if that time does exist, we need to make sure its not a zoom event
            else
            {
                Event compareTo = FindEventToCompareTo(millesecondTime);
                if (compareTo.Equals(new Event()))
                {
                    return;
                }

                if (compareTo.GetTypeString() == "SetPlayerDistance")
                {
                    startZoom.time = compareTo.time;

                    if (startZoom.GetEventData()[1].Equals(compareTo.GetEventData()[1]))
                    {
                        MessageBox.Show("There is a zoom event at the same time as your start zoom" +
                                        " but they do not share the same zoom value. If you are sure you want to do" +
                                        " that, please increase your start time by at least 1 millesecond.", "Are you sure about that?");

                        return;
                    }
                }
            }

            // Reselect what was selected previously.
            ConfigPreviewRTBZEM.SelectionStart  = currentlySelectedEvent[0];
            ConfigPreviewRTBZEM.SelectionLength = currentlySelectedEvent[1];

            // Now that we've made sure we're using the right zoom, let's start making the long zoom.
            double zoomsPerSecond      = (double)ZEMLZDesiredEventsPerSecNUD.Value;
            double timeBetweenEachZoom = 1d / zoomsPerSecond;

            double timeRange      = (double)(ZEMLZEndTimeNUD.Value - ZEMLZStartTimeNUD.Value);
            int    numberOfEvents = (int)Math.Ceiling(timeRange / timeBetweenEachZoom);

            double zoomRange = (double)(ZEMLZEndZoomNUD.Value - ZEMLZStartZoomNUD.Value);
            // Minus 1, the starting event.
            double zoomBetweenEachZoom = zoomRange / numberOfEvents - 1;

            double currentTime = startZoom.time + timeBetweenEachZoom;
            double currentZoom = double.Parse(startZoom.GetEventData()[1]);

            List <Event> events = new List <Event>();

            while (currentTime <= endZoom.time)
            {
                events.Add(
                    new Event()
                {
                    time = currentTime,
                    data = new string[]
                    {
                        "SetPlayerDistance",
                        currentZoom.ToString(),
                    }
                }
                    );

                currentTime += timeBetweenEachZoom;
                currentZoom += zoomBetweenEachZoom;
            }

            // Replace end zoom from config (if it exists)
            if (currentTime > endZoom.time && ConfigPreviewRTBZEM.Text.Contains(endZoom.ToString()))
            {
                ConfigPreviewRTBZEM.Text.Replace(endZoom.ToString(),
                                                 new Event()
                {
                    time = currentTime,
                    data = new string[]
                    {
                        "SetPlayerDistance",
                        currentZoom.ToString()
                    }
                }.ToString());
            }
            // Otherwise add it to the events list
            else
            {
                events.Add(
                    new Event()
                {
                    time = currentTime,
                    data = new string[]
                    {
                        "SetPlayerDistance",
                        currentZoom.ToString()
                    }
                });
            }

            // Finally, add our list of Events to the events in the map.
            Map map = MakeMapFromText(ConfigPreviewRTBZEM.Text);
            // Get events from map
            List <Event> mapEvents = map.events.ToList();

            // Add our long zoom events
            mapEvents.AddRange(events);
            // Sort all events by time
            mapEvents.Sort((x, y) => x.time.CompareTo(y.time));
            // Insert back into map
            map.events = mapEvents.ToArray();
            // Turn new map w/ long zooms into text in the config preview
            ConfigPreviewRTBZEM.Text = MakeTextFromMap(map);
        }
        private void runReporttoolStripButton_Click(object sender, EventArgs e)
        {
            Customer s         = (Customer)supplierkryptonComboBox.SelectedItem;
            bool     allStatus = statuskryptonComboBox2.Text == "ALL";
            bool     status    = true;

            if (!allStatus)
            {
                status = Boolean.Parse(statuskryptonComboBox2.Text);
            }
            string type = trtypekryptonComboBox1.Text;

            IList trs = r_sup.GetAllTransactions(s.ID, startdateKryptonDateTimePicker.Value, enDatekryptonDateTimePicker1.Value,
                                                 allStatus, status);

            transactionkryptonDataGridView.Rows.Clear();
            if (trs.Count > 0)
            {
                foreach (object ev in trs)
                {
                    if (ev is Event)
                    {
                        Event t = (Event)ev;
                        if (type != "ALL")
                        {
                            if (t.STOCK_CARD_ENTRY_TYPE.ToString() != type)
                            {
                                continue;
                            }
                        }
                        int r = transactionkryptonDataGridView.Rows.Add();
                        transactionkryptonDataGridView[datetrColumn.Index, r].Value = t.TRANSACTION_DATE;
                        transactionkryptonDataGridView[typeTrColumn.Index, r].Value = t.STOCK_CARD_ENTRY_TYPE.ToString();
                        transactionkryptonDataGridView[codeTrColumn.Index, r].Value = t.CODE;
                        transactionkryptonDataGridView[postedColumn.Index, r].Value = t.POSTED.ToString();
                        Customer sup = (Customer)r_sup.GetById((Customer)t.VENDOR);
                        Employee emp = (Employee)r_emp.GetById(t.EMPLOYEE);
                        transactionkryptonDataGridView[supplierColumn.Index, r].Value   = sup.NAME;
                        transactionkryptonDataGridView[supCodeColumn.Index, r].Value    = sup.CODE;
                        transactionkryptonDataGridView[supAddressColumn.Index, r].Value = sup.ADDRESS;
                        transactionkryptonDataGridView[employeeColumn.Index, r].Value   = emp.CODE;
                        if (t is SalesOrder)
                        {
                            SalesOrder p = (SalesOrder)t;
                            p.TOP      = (TermOfPayment)r_top.GetById(p.TOP);
                            p.CURRENCY = (Currency)r_ccy.GetById(p.CURRENCY);
                            transactionkryptonDataGridView[topColumn.Index, r].Value    = p.TOP.CODE;
                            transactionkryptonDataGridView[amountColumn.Index, r].Value = p.NET_TOTAL;
                            transactionkryptonDataGridView[ccyColumn.Index, r].Value    = p.CURRENCY.CODE;
                        }
                        if (t is CustomerInvoice)
                        {
                            CustomerInvoice p = (CustomerInvoice)t;
                            p.TOP      = (TermOfPayment)r_top.GetById(p.TOP);
                            p.CURRENCY = (Currency)r_ccy.GetById(p.CURRENCY);
                            transactionkryptonDataGridView[topColumn.Index, r].Value    = p.TOP.CODE;
                            transactionkryptonDataGridView[amountColumn.Index, r].Value = p.NET_TOTAL;
                            transactionkryptonDataGridView[ccyColumn.Index, r].Value    = p.CURRENCY.CODE;
                        }
                        if (t is POS)
                        {
                            POS p = (POS)t;
                            p.TOP      = (TermOfPayment)r_top.GetById(p.TOP);
                            p.CURRENCY = (Currency)r_ccy.GetById(p.CURRENCY);
                            transactionkryptonDataGridView[topColumn.Index, r].Value    = p.TOP.CODE;
                            transactionkryptonDataGridView[amountColumn.Index, r].Value = p.NET_TOTAL;
                            transactionkryptonDataGridView[ccyColumn.Index, r].Value    = p.CURRENCY.CODE;
                        }
                    }
                    if (ev is EventJournal)
                    {
                        EventJournal t = (EventJournal)ev;
                        if (type != "ALL")
                        {
                            if (t.VENDOR_BALANCE_ENTRY_TYPE.ToString() != type)
                            {
                                continue;
                            }
                        }
                        int r = transactionkryptonDataGridView.Rows.Add();
                        transactionkryptonDataGridView[datetrColumn.Index, r].Value = t.TRANSACTION_DATE;
                        transactionkryptonDataGridView[typeTrColumn.Index, r].Value = t.VENDOR_BALANCE_ENTRY_TYPE.ToString();
                        transactionkryptonDataGridView[codeTrColumn.Index, r].Value = t.CODE;
                        transactionkryptonDataGridView[postedColumn.Index, r].Value = t.POSTED.ToString();
                        Customer sup = (Customer)r_sup.GetById((Customer)t.VENDOR);
                        Employee emp = (Employee)r_emp.GetById(t.EMPLOYEE);
                        transactionkryptonDataGridView[supplierColumn.Index, r].Value   = sup.NAME;
                        transactionkryptonDataGridView[supCodeColumn.Index, r].Value    = sup.CODE;
                        transactionkryptonDataGridView[supAddressColumn.Index, r].Value = sup.ADDRESS;
                        transactionkryptonDataGridView[employeeColumn.Index, r].Value   = emp.CODE;
                        if (t is Receipt)
                        {
                            Receipt p = (Receipt)t;
                            p.CURRENCY = (Currency)r_ccy.GetById(p.CURRENCY);
                            transactionkryptonDataGridView[amountColumn.Index, r].Value = p.NET_AMOUNT;
                            transactionkryptonDataGridView[ccyColumn.Index, r].Value    = p.CURRENCY.CODE;
                        }
                        if (t is CustomerOutStandingInvoice)
                        {
                            CustomerOutStandingInvoice p = (CustomerOutStandingInvoice)t;
                            p.CURRENCY = (Currency)r_ccy.GetById(p.CURRENCY);
                            transactionkryptonDataGridView[amountColumn.Index, r].Value = p.NET_AMOUNT;
                            transactionkryptonDataGridView[ccyColumn.Index, r].Value    = p.CURRENCY.CODE;
                        }
                        if (t is ARCreditNote)
                        {
                            ARCreditNote p = (ARCreditNote)t;
                            p.CURRENCY = (Currency)r_ccy.GetById(p.CURRENCY);
                            transactionkryptonDataGridView[amountColumn.Index, r].Value = p.NET_AMOUNT;
                            transactionkryptonDataGridView[ccyColumn.Index, r].Value    = p.CURRENCY.CODE;
                        }
                    }
                }
            }
        }
 public override void ApplyEffectKind(Person person, Event e)
 {
     GameObjects.PersonDetail.Stunt stunt = person.Scenario.GameCommonData.AllStunts.GetStunt(increment);
     person.Stunts.AddStunt(stunt);
 }
            public void OnCanvasTreeGUI(Rect rect, Event e)
            {
                bool active = element.active;

                if (active)
                {
                    GUINode ele = element;
                    while (ele.parent != null)
                    {
                        ele    = ele.parent;
                        active = active && ele.active;
                        if (!active)
                        {
                            break;
                        }
                    }
                }
                GUI.enabled = active;


                var  rs       = rect.HorizontalSplit(LineHeight);
                Rect selfRect = rs[0];

                if (GUINodeSelection.node == this.element && e.type == EventType.Repaint)
                {
                    new GUIStyle("SelectionRect").Draw(selfRect, false, false, false, false);
                }
                selfRect.xMin += 20 * element.depth;
                Rect childrenRect = rs[1];

                childrenRect.xMin += 20 * element.depth;

                //Rect topR = new Rect(selfRect.position, new Vector2(selfRect.width, gapHeight));
                Rect sf   = new Rect(selfRect.position, new Vector2(selfRect.width, SingleLineHeight));
                Rect butR = new Rect(new Vector2(selfRect.x, selfRect.yMin + SingleLineHeight), new Vector2(selfRect.width, gapHeight));

                if (children.Count > 0)
                {
                    var rss = sf.VerticalSplit(12);
                    foldOn = EditorGUI.Foldout(rss[0], foldOn, "", false);
                    nameLabel.OnGUI(rss[1]);
                    //GUI.Label(rss[1], element.name);
                    if (tree.HandleEve)
                    {
                        Eve(selfRect, rss[1], /*topR,*/ butR, e);
                    }
                    if (!foldOn)
                    {
                        return;
                    }
                    float y = 0;
                    for (int i = 0; i < children.Count; i++)
                    {
                        Rect r = new Rect(rect.x, childrenRect.y + y, rect.width, children[i].Height);
                        y += children[i].Height;
                        children[i].OnCanvasTreeGUI(r, e);
                    }
                }
                else
                {
                    nameLabel.OnGUI(sf);

                    //GUI.Label(sf, element.name);
                    if (tree.HandleEve)
                    {
                        Eve(selfRect, sf, /*topR,*/ butR, e);
                    }
                }
                GUI.enabled = true;
            }
Example #44
0
 internal void ResetToDefault()
 {
     this.Load();
     this.m_event = Event.KeyboardEvent(this.m_DefaultShortcut);
 }
Example #45
0
 public bool UpdateEvent(int conventionId, int eventId, Event ev)
 {
     return(conventionsRepository.UpdateEvent(conventionId, eventId, ev));
 }
            private void MouseDragEve(Rect r, Rect sf, /*Rect tr,*/ Rect br, Event e)
            {
                bool    CouldPutdown = r.Contains(e.mousePosition) && GUINodeSelection.dragNode != null && GUINodeSelection.dragNode != this.element;
                GUINode tmp          = this.element;

                while (tmp.parent != null)
                {
                    tmp = tmp.parent;
                    if (tmp == GUINodeSelection.dragNode)
                    {
                        CouldPutdown = false;
                        break;
                    }
                }
                if (CouldPutdown)
                {
                    if (sf.Contains(e.mousePosition))
                    {
                        GUI.Box(sf, "", "SelectionRect");
                    }
                    //else if (tr.Contains(e.mousePosition))
                    //{
                    //    if (!(element is GUICanvas))
                    //        GUI.Box(new Rect(tr.x, tr.y - SingleLineHeight, tr.width, SingleLineHeight), "", "PR Insertion");
                    //}
                    else if (br.Contains(e.mousePosition))
                    {
                        if (!(element is GUICanvas))
                        {
                            GUI.Box(sf, "", "PR Insertion");
                        }
                    }
                }
                if (CouldPutdown && e.type == EventType.MouseUp)
                {
                    if (sf.Contains(e.mousePosition))
                    {
                        this.element.Node(GUINodeSelection.dragNode);
                    }
                    //else if (tr.Contains(e.mousePosition))
                    //{
                    //    if (!(element is GUICanvas))
                    //    {
                    //        ElementSelection.dragElement.parent = this.element.parent;
                    //        element.parent.Children.Remove(ElementSelection.dragElement);
                    //        element.parent.Children.Insert(element.siblingIndex /*- 1*/, ElementSelection.dragElement);
                    //        dragTrunk.parent = this.parent;
                    //        parent.children.Remove(dragTrunk);
                    //        parent.children.Insert(element.siblingIndex /*- 1*/, dragTrunk);
                    //    }

                    //}
                    else if (br.Contains(e.mousePosition))
                    {
                        if (!(element is GUICanvas))
                        {
                            (this.element.parent as GUINode).Node(GUINodeSelection.dragNode);
                            GUINodeSelection.dragNode.siblingIndex = element.siblingIndex + 1;
                        }
                    }

                    GUINodeSelection.dragNode = null;
                }
                else if (GUINodeSelection.node == this.element)
                {
                    if (e.type == EventType.MouseDrag)
                    {
                        GUINodeSelection.dragNode = GUINodeSelection.node;
                    }
                    else if (e.type == EventType.MouseUp)
                    {
                        GUINodeSelection.dragNode = null;
                    }
                }
            }
Example #47
0
 public List <ulong> GetUsersSubscribedToEvent(Event @event)
 {
     return(GetUsersSubscribedToEvent((int)@event));
 }
Example #48
0
 public Task <object> handler(Event k8Event, Context k8Context)
 {
     return(Task.FromResult <object>(k8Event.Data));
 }
    void Input()
    {
        Event   guiEvent = Event.current;
        Vector3 mousePos = HandleUtility.GUIPointToWorldRay(guiEvent.mousePosition).origin;

        mousePos.z = 0;

        if (guiEvent.type == EventType.MouseDown && guiEvent.button == 0 && guiEvent.shift && !mode3D)
        {
            if (selectedSegmentIndex != -1)
            {
                Undo.RecordObject(creator, "Split segment");
                Path.SplitSegment(mousePos, selectedSegmentIndex);
            }
            else if (!Path.IsClosed)
            {
                Undo.RecordObject(creator, "Add segment");
                Path.AddSegment(mousePos);
            }
        }

        if (guiEvent.type == EventType.MouseDown && guiEvent.button == 1)
        {
            float minDstToAnchor     = creator.anchorDiameter * 2f;
            int   closestAnchorIndex = -1;

            for (int i = 0; i < Path.NumPoints; i += 3)
            {
                float dst = Vector3.Distance(mousePos, Path[i]);
                if (dst < minDstToAnchor)
                {
                    minDstToAnchor     = dst;
                    closestAnchorIndex = i;
                }
            }

            if (closestAnchorIndex != -1)
            {
                Undo.RecordObject(creator, "Delete segment");
                Path.DeleteSegment(closestAnchorIndex);
            }
        }

        if (guiEvent.type == EventType.MouseMove && !mode3D)
        {
            float minDstToSegment         = segmentSelectDistanceThreshold;
            int   newSelectedSegmentIndex = -1;

            for (int i = 0; i < Path.NumSegments; i++)
            {
                Vector3[] points = Path.GetPointsInSegment(i);
                float     dst    = HandleUtility.DistancePointBezier(mousePos, points[0], points[3], points[1], points[2]);
                if (dst < minDstToSegment)
                {
                    minDstToSegment         = dst;
                    newSelectedSegmentIndex = i;
                }
            }

            if (newSelectedSegmentIndex != selectedSegmentIndex)
            {
                selectedSegmentIndex = newSelectedSegmentIndex;
                HandleUtility.Repaint();
            }
        }

        HandleUtility.AddDefaultControl(0);
    }
Example #50
0
 public bool CreateEvent(int conventionId, Event ev)
 {
     return(conventionsRepository.CreateEvent(conventionId, ev));
 }
Example #51
0
        public void Test_getEventByName_EvDoesntExist()
        {
            EventRepository evRep = EventRepository.getInstance();

            Event ev = evRep.getEventByName("nepostojeći događaj");
        }
Example #52
0
 public void UnSubscribe(ulong userId, Event @event)
 {
     UnSubscribe(userId, new List <int> {
         (int)@event
     });
 }
 //Creates the context menu for the selected variable
 void CreateVariableContextMenu(Rect parentWindow, Rect menuRect, AddressableAssetProfileSettings.ProfileIdData variable, Event evt)
 {
     if (menuRect.Contains(evt.mousePosition))
     {
         GenericMenu menu = new GenericMenu();
         //Displays name of selected variable so user can be confident they're deleting/renaming the right one
         menu.AddDisabledItem(new GUIContent(variable.ProfileName));
         menu.AddSeparator("");
         menu.AddItem(new GUIContent("Rename Variable (All Profiles)"), false, () => { RenameVariable(variable, parentWindow, menuRect); });
         menu.AddItem(new GUIContent("Delete Variable (All Profiles)"), false, () => { DeleteVariable(variable); });
         menu.ShowAsContext();
         evt.Use();
     }
 }
Example #54
0
 protected EventBase()
 {
     m_ImguiEvent = null;
     LocalInit();
 }
Example #55
0
 public string VisitEvent(Event @event)
 {
     throw new NotImplementedException();
 }
        public override void ProcessInput(Event ev)
        {
            base.ProcessInput(ev);

            Find.WindowStack.Add(new Dialog_InfoCard(printer.PawnBeingCrafted()));
        }
Example #57
0
 public string GetReportDataByEventId(string EventId)
 {
     try
     {
         ReportDTO reportDTO = new ReportDTO
         {
             RegisteredReportDTOs   = new List <RegisteredReportDTO>(),
             NotAttendedReportDTOs  = new List <NotAttendedReportDTO>(),
             UnregisteredReportDTOs = new List <UnregisteredReportDTO>()
         };
         List <FeedbackQuestion> questions = feedBackQuestionRepository.GetQuestions();
         string reporttemplatePath         = ConfigurationManager.AppSettings["ReportTemplate"].ToString();
         string exportPath = ConfigurationManager.AppSettings["ExportPath"].ToString();
         Event  evt        = eventRepository.FindEvent(EventId);
         string url        = "";
         if (evt != null)
         {
             if (questions != null && questions.Count > 0)
             {
                 List <RegisteredVolunteerFeedback> registeredVolunteerFeedbackList = RegisteredVolunteerFeedbackRepository.GetRegisteredFeeackListByEvent(EventId);
                 if (registeredVolunteerFeedbackList != null && registeredVolunteerFeedbackList.Count > 0)
                 {
                     int loopCount = registeredVolunteerFeedbackList.Count / questions.Count;
                     int ansCount  = 0;
                     for (int i = 0; i < loopCount; i++)
                     {
                         RegisteredReportDTO registeredReportDTO = new RegisteredReportDTO
                         {
                             EventName           = evt.EventName,
                             BeneficaryName      = evt.BeneficaryName,
                             EventDate           = Convert.ToDateTime(evt.EventDate).ToShortDateString(),
                             Location            = evt.Location,
                             EmployeeID          = registeredVolunteerFeedbackList[ansCount].EmployeeID,
                             FeedbackTextNumber1 = registeredVolunteerFeedbackList[ansCount].FeedbackText,
                             FeedbackTextNumber2 = registeredVolunteerFeedbackList[ansCount + 1].FeedbackText,
                             FeedbackTextNumber3 = registeredVolunteerFeedbackList[ansCount + 2].FeedbackText
                         };
                         reportDTO.RegisteredReportDTOs.Add(registeredReportDTO);
                         ansCount += questions.Count;
                     }
                 }
             }
             List <NotAttendedVolunteerFeedback> notAttendedVolunteerFeedbackList = notAttendedVolunteerFeedbackRepository.GetNotAttendedVolunteerFeedbackList(EventId);
             if (notAttendedVolunteerFeedbackList != null && notAttendedVolunteerFeedbackList.Count > 0)
             {
                 foreach (NotAttendedVolunteerFeedback notAttendedVolunteerFeedback in notAttendedVolunteerFeedbackList)
                 {
                     NotAttendedReportDTO notAttendedReportDTO = new NotAttendedReportDTO();
                     notAttendedReportDTO.EventName      = evt.EventName;
                     notAttendedReportDTO.BeneficaryName = evt.BeneficaryName;
                     notAttendedReportDTO.EventDate      = Convert.ToDateTime(evt.EventDate).ToShortDateString();
                     notAttendedReportDTO.Location       = evt.Location;
                     notAttendedReportDTO.EmployeeID     = notAttendedVolunteerFeedback.EmployeeID;
                     notAttendedReportDTO.FeedbackText   = notAttendedVolunteerFeedback.FeedbackText;
                     reportDTO.NotAttendedReportDTOs.Add(notAttendedReportDTO);
                 }
             }
             List <UnRegisteredVolunteerFeedback> unRegisteredVolunteerFeedbackList = unRegisteredVolunteerFeedbackRepository.GetUnRegisteredVolunteerFeedbackList(EventId);
             if (unRegisteredVolunteerFeedbackList != null && unRegisteredVolunteerFeedbackList.Count > 0)
             {
                 foreach (UnRegisteredVolunteerFeedback unRegisteredVolunteerFeedback in unRegisteredVolunteerFeedbackList)
                 {
                     UnregisteredReportDTO unregisteredReportDTO = new UnregisteredReportDTO();
                     unregisteredReportDTO.EventName      = evt.EventName;
                     unregisteredReportDTO.BeneficaryName = evt.BeneficaryName;
                     unregisteredReportDTO.EventDate      = Convert.ToDateTime(evt.EventDate).ToShortDateString();
                     unregisteredReportDTO.Location       = evt.Location;
                     unregisteredReportDTO.EmployeeID     = unRegisteredVolunteerFeedback.EmployeeID;
                     unregisteredReportDTO.FeedbackText   = unRegisteredVolunteerFeedback.FeedbackText;
                     reportDTO.UnregisteredReportDTOs.Add(unregisteredReportDTO);
                 }
             }
             if (reportDTO.RegisteredReportDTOs.Count > 0 || reportDTO.NotAttendedReportDTOs.Count > 0 || reportDTO.UnregisteredReportDTOs.Count > 0)
             {
                 CreateExcel createExcel = new CreateExcel();
                 url = createExcel.WriteToExcel(reportDTO, reporttemplatePath, exportPath, evt.EventName);
             }
         }
         return(url);
     }
     catch (Exception ex)
     {
         ExceptionLogger logger = new ExceptionLogger()
         {
             ControllerName      = "ExcelReport",
             ActionrName         = "GetReportDataByEventId",
             ExceptionMessage    = ex.Message,
             ExceptionStackTrace = ex.StackTrace,
             LogDateTime         = DateTime.Now
         };
         ExceptionRepository exceptionRepository = new ExceptionRepository();
         exceptionRepository.AddException(logger);
         throw ex;
     }
 }
        //Displays all variables for the currently selected profile and initializes each variable's context menu
        void VariablesPane(Rect variablesPaneRect)
        {
            DrawOutline(variablesPaneRect, 1);
            Event evt = Event.current;

            AddressableAssetProfileSettings.BuildProfile selectedProfile = GetSelectedProfile();

            if (selectedProfile == null)
            {
                return;
            }
            if (evt.isMouse || evt.isKey)
            {
                m_ProfileTreeView.lastClickedProfile = ProfileIndex;
            }

            //ensures amount of visible text is not affected by label width
            float fieldWidth = variablesPaneRect.width - (2 * k_ItemRectPadding) + m_LabelWidth + m_FieldBufferWidth;

            if (!EditorGUIUtility.labelWidth.Equals(m_LabelWidth))
            {
                EditorGUIUtility.labelWidth = m_LabelWidth;
            }

            int maxLabelLen = 0;
            int maxFieldLen = 0;

            GUILayout.BeginArea(variablesPaneRect);
            EditorGUI.indentLevel++;
            List <ProfileGroupType> groupTypes      = CreateGroupTypes(selectedProfile);
            HashSet <string>        drawnGroupTypes = new HashSet <string>();

            //Displaying Path Groups
            foreach (ProfileGroupType groupType in groupTypes)
            {
                bool?foldout;
                m_foldouts.TryGetValue(groupType.GroupTypePrefix, out foldout);
                GUILayout.Space(5);
                m_foldouts[groupType.GroupTypePrefix] = EditorGUILayout.Foldout(foldout != null ? foldout.Value : true, groupType.GroupTypePrefix, true);
                //Specific Grouped variables
                List <ProfileGroupType.GroupTypeVariable> pathVariables = new List <ProfileGroupType.GroupTypeVariable>();
                pathVariables.Add(groupType.GetVariableBySuffix("BuildPath"));
                drawnGroupTypes.Add(groupType.GetName(groupType.GetVariableBySuffix("BuildPath")));
                pathVariables.Add(groupType.GetVariableBySuffix("LoadPath"));
                drawnGroupTypes.Add(groupType.GetName(groupType.GetVariableBySuffix("LoadPath")));

                if (m_foldouts[groupType.GroupTypePrefix].Value)
                {
                    EditorGUI.indentLevel++;

                    //Displaying Path Groups
                    foreach (var variable in pathVariables)
                    {
                        Rect   newPathRect = EditorGUILayout.BeginVertical();
                        string newPath     = EditorGUILayout.TextField(groupType.GetName(variable), variable.Value);
                        EditorGUILayout.EndVertical();
                        if (evt.type == EventType.ContextClick)
                        {
                            CreateVariableContextMenu(variablesPaneRect, newPathRect, settings.profileSettings.GetProfileDataByName(groupType.GetName(variable)), evt);
                        }
                        if (newPath != variable.Value && ProfileIndex == m_ProfileTreeView.lastClickedProfile)
                        {
                            Undo.RecordObject(settings, "Variable value changed");
                            settings.profileSettings.SetValue(selectedProfile.id, groupType.GetName(variable), newPath);
                            AddressableAssetUtility.OpenAssetIfUsingVCIntegration(settings);
                        }
                    }
                    EditorGUI.indentLevel--;
                }
            }

            //Display all other variables
            for (var i = 0; i < settings.profileSettings.profileEntryNames.Count; i++)
            {
                AddressableAssetProfileSettings.ProfileIdData curVariable = settings.profileSettings.profileEntryNames[i];
                if (!drawnGroupTypes.Contains(curVariable.ProfileName))
                {
                    GUILayout.Space(5);
                    Rect   newValueRect = EditorGUILayout.BeginVertical();
                    string newValue     = EditorGUILayout.TextField(curVariable.ProfileName, selectedProfile.values[i].value);
                    EditorGUILayout.EndVertical();
                    if (newValue != selectedProfile.values[i].value && ProfileIndex == m_ProfileTreeView.lastClickedProfile)
                    {
                        Undo.RecordObject(settings, "Variable value changed");
                        settings.profileSettings.SetValue(selectedProfile.id, settings.profileSettings.profileEntryNames[i].ProfileName, newValue);
                        AddressableAssetUtility.OpenAssetIfUsingVCIntegration(settings);
                    }

                    if (evt.type == EventType.ContextClick)
                    {
                        CreateVariableContextMenu(variablesPaneRect, newValueRect, curVariable, evt);
                    }
                }
                maxLabelLen = Math.Max(maxLabelLen, curVariable.ProfileName.Length);
            }

            EditorGUI.indentLevel--;
            GUILayout.EndArea();

            //Update the label width to the maximum of the minimum acceptable label width and the amount of
            //space required to contain the longest variable name
            m_LabelWidth       = Mathf.Max(maxLabelLen * k_ApproxCharWidth, k_MinLabelWidth);
            m_FieldBufferWidth = Mathf.Clamp((maxFieldLen * k_ApproxCharWidth) - fieldWidth, 0f, float.MaxValue);
        }
Example #59
0
 protected override void onMouseOut(Event e)
 {
     gotoAndStop(0);
 }
Example #60
0
 public virtual void ProcessEvent(Event ev)
 {
 }