public TabContent(BrowserView browserView) { this.browserView = browserView; this.browser = browserView.Browser; this.browser.FinishLoadingFrameEvent += delegate(object sender, FinishLoadingEventArgs e) { if (e.IsMainFrame) { if (PropertyChangeEvent != null) { PropertyChangeEvent.Invoke("PageTitleChanged", null, browser.Title); } } }; browserContainer = CreateBrowserContainer(); toolBar = CreateToolBar(browserView); container = new DockPanel(); container.Children.Add(browserContainer); container.Margin = new Thickness(0, 30, 0, 0); this.Children.Add(toolBar); this.Children.Add(container); }
public TabContent(BrowserView browserView) { this.browserView = browserView; this.browser = browserView.Browser; this.browser.FinishLoadingFrameEvent += delegate(object sender, FinishLoadingEventArgs e) { if (e.IsMainFrame) { if (PropertyChangeEvent != null) { PropertyChangeEvent.Invoke("PageTitleChanged", null, browser.Title); } } }; this.browserContainer = CreateBrowserContainer(); this.browserContainer.Dock = DockStyle.Fill; this.toolBar = CreateToolBar(browserView); this.toolBar.Dock = DockStyle.Top; this.toolBar.AutoSize = true; this.ColumnCount = 1; this.Dock = System.Windows.Forms.DockStyle.Fill; this.Location = new System.Drawing.Point(0, 0); this.RowCount = 2; this.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 30F)); this.Controls.Add(toolBar, 0, 0); this.Controls.Add(browserContainer, 0, 1); }
public PIRender() { InitializeComponent(); OnPropertyChange += new PropertyChangeEvent(delegate(CPIProperty propertyEntity, object propertyObj) { }); }
public virtual void propertyChange(PropertyChangeEvent param1PropertyChangeEvent) { string str = param1PropertyChangeEvent.PropertyName; if ("resizable".Equals(str) || "state".Equals(str)) { Frame frame = outerInstance.Frame; if (frame != null) { outerInstance.setState(frame.ExtendedState, true); } if ("resizable".Equals(str)) { outerInstance.RootPane.repaint(); } } else if ("title".Equals(str)) { outerInstance.repaint(); } else if ("componentOrientation".Equals(str)) { outerInstance.revalidate(); outerInstance.repaint(); } else if ("iconImage".Equals(str)) { outerInstance.updateSystemIcon(); outerInstance.revalidate(); outerInstance.repaint(); } }
public void propertyChange(PropertyChangeEvent propEvent) { XMLParserNotification notification = (XMLParserNotification)propEvent; if (notificationListener != null) { notificationListener.notify(notification); return; } String msg; if (notification.getEvent() != null) { msg = Logging.getMessage(notification.getMessage(), notification.getEvent().ToString(), notification.getEvent().getLocation().getLineNumber(), notification.getEvent().getLocation().getColumnNumber(), notification.getEvent().getLocation().getCharacterOffset()); } else { msg = Logging.getMessage(notification.getMessage(), "", ""); } if (notification.getPropertyName().Equals(XMLParserNotification.EXCEPTION)) { Logging.logger().log(Level.WARNING, msg); } else if (notification.getPropertyName().Equals(XMLParserNotification.UNRECOGNIZED)) { Logging.logger().log(Level.WARNING, msg); } }
private void InternalDispatchEvent(CollectionEventKind kind, object item /* = null*/, int location /* = -1*/) { // copied from ArrayList //Debug.Log(string.Format("InternalDispatchEvent: {0}, {1}, {2}", kind, item, location)); if (HasEventListener(CollectionEvent.COLLECTION_CHANGE)) { var ce = new CollectionEvent(CollectionEvent.COLLECTION_CHANGE) { Kind = kind }; ce.Items.Add(item); ce.Location = location; DispatchEvent(ce); } // now dispatch a complementary PropertyChangeEvent if (HasEventListener(PropertyChangeEvent.PROPERTY_CHANGE) && (kind == CollectionEventKind.ADD || kind == CollectionEventKind.REMOVE)) { var objEvent = new PropertyChangeEvent(PropertyChangeEvent.PROPERTY_CHANGE) { Property = location.ToString() }; if (kind == CollectionEventKind.ADD) { objEvent.NewValue = item; } else { objEvent.OldValue = item; } DispatchEvent(objEvent); } }
/// <summary> /// Used for deffered parts /// </summary> /// <param name="e"></param> private void SkinPropertyChangeHandler(Event e) { if (null != SkinParts) { PropertyChangeEvent pce = (PropertyChangeEvent)e; string skinPartID = pce.Property; if (SkinParts.ContainsKey(skinPartID)) { var part = CoreReflector.GetValue(Skin, skinPartID); if (pce.NewValue == null) { if (!(part is IFactory)) { PartRemoved(skinPartID, part); } CoreReflector.SetValue(this, skinPartID, pce.NewValue); } else { part = pce.NewValue; if (!(part is IFactory)) { PartAdded(skinPartID, part); } } } } }
private BaseEvent SaveEventHelper(uint eventId, Name eventName, ulong timestamp) { AssertEventNameValidity(eventName); if (eventName.HasSelf() && !eventName.ToString().Contains("Property-Change")) { throw new Exception("Cannot record an event name containing \"Self\" keywords"); } BaseEvent eventRecord; if (ActionEvent.IsActionEvent(eventName)) { eventRecord = new ActionEvent(eventId, eventName, timestamp); } else if (PropertyChangeEvent.IsPropertyChangeEvent(eventName)) { eventRecord = new PropertyChangeEvent(eventId, eventName, timestamp); } else { throw new Exception("Unknown Event Type"); } AddRecord(eventRecord); return(eventRecord); }
private void AddProperty(string root, string propertyID, bool settable) { var prop = new NodeProperty(root + propertyID, propertyID, settable); prop.ChangeEvent += (diff) => PropertyChangeEvent?.Invoke(this, diff); Properties.Add(prop); }
// ---- private methods ---- private static void DispatchPropertyChangeEvent(PropertyChangeEvent evt) { if (evt != null) { evt(changeFlags); } }
public void propertyChange(PropertyChangeEvent evt) { //noinspection StringEquality if (evt.getPropertyName() == WorldWind.SHUTDOWN_EVENT) { this.shutdown(); } }
public void propertyChange(PropertyChangeEvent param1PropertyChangeEvent) { if ("contextualGroupHueColor".Equals(param1PropertyChangeEvent.PropertyName)) { Color color = (Color)param1PropertyChangeEvent.NewValue; outerInstance.commandButton.Background = color; } }
public void NewPropertyChangeEvent(PropertyChangeEvent e) { if ((int)e.NewValue == 0) { print("checked"); StartCoroutine(SpawnEnemy(nextSpawnCount)); nextSpawnCount++; } }
public void firePropertyChange(PropertyChangeEvent propertyChangeEvent) { if (propertyChangeEvent == null) { String msg = Logging.getMessage("nullValue.PropertyChangeEventIsNull"); Logging.logger().severe(msg); throw new ArgumentException(msg); } this.getChangeSupport().firePropertyChange(propertyChangeEvent); }
/// <summary> /// implementing XPropertyChangeListener method /// </summary> /// <param name="evt">The evt.</param> protected override void propertyChange(PropertyChangeEvent evt) { if (evt.Source == ((XModel)this.PagesSupplier).getCurrentController()) { if (evt.PropertyName.Equals("VisibleArea")) { refreshDrawViewProperties((XPropertySet)evt.Source); OnViewOrZoomChangeEvent(); } } }
public void propertyChange(PropertyChangeEvent param1PropertyChangeEvent) { if ("loaded".Equals(param1PropertyChangeEvent.PropertyName) && true.Equals(param1PropertyChangeEvent.NewValue)) { Tile tile = (Tile)param1PropertyChangeEvent.Source; if (tile.Zoom == outerInstance.Zoom) { outerInstance.repaint(); } } }
public void propertyChange(PropertyChangeEvent propertyChangeEvent) { if (propertyChangeEvent == null) { String msg = Logging.getMessage("nullValue.PropertyChangeEventIsNull"); Logging.logger().severe(msg); throw new ArgumentException(msg); } this.redraw(); // Queue a JOGL display request. }
/** * The property change listener for <em>this</em> instance. * Receives property change notifications that this instance has registered with other property change notifiers. * @param propertyChangeEvent the event * @throws ArgumentException if <code>propertyChangeEvent</code> is null */ public void propertyChange(PropertyChangeEvent propertyChangeEvent) { if (propertyChangeEvent == null) { string msg = Logging.getMessage("nullValue.PropertyChangeEventIsNull"); Logging.logger().severe(msg); throw new ArgumentException(msg); } // Notify all *my* listeners of the change that I caught base.firePropertyChange(propertyChangeEvent); }
//-------------------------------------------------------------------------- // // Event Handlers // //-------------------------------------------------------------------------- private void ViewportPropertyChangeHandler(Event e) { PropertyChangeEvent pce = (PropertyChangeEvent)e; switch (pce.Property) { case "contentWidth": case "contentHeight": InvalidateSkin(); break; } }
/// <summary> /// Notify the view that an item has been updated /// </summary> /// <param name="item"></param> /// <param name="property"></param> /// <param name="oldValue"></param> /// <param name="newValue"></param> public void ItemUpdated(object item, object property = null, object oldValue = null, object newValue = null) { PropertyChangeEvent pce = new PropertyChangeEvent(PropertyChangeEvent.PROPERTY_CHANGE) { Kind = PropertyChangeEventKind.UPDATE, Source = item, Property = property.ToString(), OldValue = oldValue, NewValue = newValue }; ItemUpdateHandler(pce); }
void XVetoableChangeListener.vetoableChange(PropertyChangeEvent aEvent) { if (VetoableChange != null) { try { VetoableChange.Invoke(this, new ForwardedEventArgs(aEvent)); } catch (Exception e) { Logger.Instance.Log(LogPriority.ALWAYS, this, "[ERROR] Could not forward vetoable property event: " + e); } } }
void XPropertyChangeListener.propertyChange(PropertyChangeEvent evt) { if (PropertyChange != null) { try { PropertyChange.Invoke(this, new ForwardedEventArgs(evt)); } catch (Exception e) { Logger.Instance.Log(LogPriority.ALWAYS, this, "[ERROR] Could not forward property change event: " + e); } } }
/** * Place the item at the specified index. * If an item was already at that index the new item will replace it and it * will be returned. * * Param: item the new value for the index * Param: index the index at which to place the item * Returns: the item that was replaced, null if none * @throws RangeError if index is less than 0 or greater than or equal to length */ public virtual object SetItemAt(object item, int index) { if (index < 0 || index >= Length) { throw new IndexOutOfRangeException("Range error"); } object oldItem = Source[index]; Source[index] = item; StopTrackUpdates(oldItem); StartTrackUpdates(item); //dispatch the appropriate events if (_dispatchEvents == 0) { var hasCollectionListener = HasEventListener(CollectionEvent.COLLECTION_CHANGE); var hasPropertyListener = HasEventListener(PropertyChangeEvent.PROPERTY_CHANGE); PropertyChangeEvent updateInfo = null; if (hasCollectionListener || hasPropertyListener) { updateInfo = new PropertyChangeEvent(PropertyChangeEvent.PROPERTY_CHANGE) { Kind = PropertyChangeEventKind.UPDATE, OldValue = oldItem, NewValue = item, Property = index.ToString() }; } if (hasCollectionListener) { CollectionEvent ce = new CollectionEvent(CollectionEvent.COLLECTION_CHANGE) { Kind = CollectionEventKind.REPLACE, Location = index }; ce.Items.Add(updateInfo); DispatchEvent(ce); } if (hasPropertyListener) { DispatchEvent(updateInfo); } } return(oldItem); }
private void RedispatchLayoutEvent(Event e) { PropertyChangeEvent pce = e as PropertyChangeEvent; if (null != pce) { switch (pce.Property) { case "verticalScrollPosition": case "horizontalScrollPosition": DispatchEvent(e); break; } } }
// ReSharper disable MemberCanBePrivate.Global protected void ItemUpdateHandler(Event e) // ReSharper restore MemberCanBePrivate.Global { PropertyChangeEvent pce = (PropertyChangeEvent)e; InternalDispatchEvent(CollectionEventKind.UPDATE, e); // need to dispatch object event now if (_dispatchEvents == 0 && HasEventListener(PropertyChangeEvent.PROPERTY_CHANGE)) { var objEvent = (PropertyChangeEvent)pce.Clone(); var index = GetItemIndex(e.Target); objEvent.Property = index + "." + pce.Property; DispatchEvent(objEvent); } }
protected internal void notifyListener(string field, System.Object oldValue, System.Object newValue) { if (listeners == null || listeners.Count == 0) { return; } else { PropertyChangeEvent event_Renamed = new PropertyChangeEvent(this, field, oldValue, newValue); for (int i = 0; i < listeners.Count; i++) { ((java.beans.PropertyChangeListener)listeners[i]).propertyChange(event_Renamed); } } }
protected override void propertyChange(PropertyChangeEvent evt) { //System.Diagnostics.Debug.WriteLine("property changed: " + evt.PropertyName); if (evt.Source == Shape && (evt.PropertyName.Equals("Position") || evt.PropertyName.Equals("Size")) && Shape is XPropertySet) { XPropertySet shapePropertySet = (XPropertySet)Shape; { // Rectangle propertyBoundRect = (Rectangle)shapePropertySet.getPropertyValue("BoundRect").Value; Rectangle propertyBoundRect = (Rectangle)shapePropertySet.getPropertyValue("FrameRect").Value; currentBoundRect.X = propertyBoundRect.X; currentBoundRect.Y = propertyBoundRect.Y; currentBoundRect.Width = propertyBoundRect.Width; currentBoundRect.Height = propertyBoundRect.Height; OnBoundRectChangeEvent(); } } }
//--------------------------------- // Viewport property changes //--------------------------------- private void ViewportPropertyChangeHandler(Event e) { PropertyChangeEvent pce = (PropertyChangeEvent)e; //Debug.Log("ViewportPropertyChangeHandler: " + pce.Property); switch (pce.Property) { case "contentWidth": ViewportContentWidthChangeHandler(e); break; case "contentHeight": ViewportContentHeightChangeHandler(e); break; case "horizontalScrollPosition": ViewportHorizontalScrollPositionChangeHandler(e); break; case "verticalScrollPosition": ViewportVerticalScrollPositionChangeHandler(e); break; } }
/// <summary> /// not implemented yet /// </summary> /// <param name="event_Renamed">The event_ renamed.</param> public virtual void propertyChange(PropertyChangeEvent event_Renamed) { Object source = event_Renamed.getSource; try { modifyObject(source); } catch (RetractException e) { TraceLogger.Instance.Debug(e); } catch (AssertException e) { TraceLogger.Instance.Debug(e); } }
// ---- private methods ---- private static void DispatchPropertyChangeEvent(PropertyChangeEvent evt) { if (evt != null) evt(changeFlags); }
protected virtual void vetoableChange(PropertyChangeEvent aEvent) { }
protected virtual void propertyChange(PropertyChangeEvent evt) { }
protected virtual void propertiesChange(PropertyChangeEvent[] aEvent) { }
public void propertyChange(PropertyChangeEvent eventJ) { PropertyChangeListener listener = (PropertyChangeListener)getListener(); listener.propertyChange(eventJ); }
public virtual void propertyChange(PropertyChangeEvent paramPropertyChangeEvent) { }
protected override void propertiesChange(PropertyChangeEvent[] aEvent) { foreach (PropertyChangeEvent evt in aEvent) { if (evt.Source == DrawPage) { System.Diagnostics.Debug.WriteLine(evt.PropertyName + " are changed to " + evt.NewValue.Value.ToString() + ", further: " + evt.Further); } } }
private BaseEvent SaveEventHelper(uint eventId, Name eventName, ulong timestamp) { AssertEventNameValidity(eventName); if (eventName.HasSelf()) throw new Exception("Cannot record an event name containing \"Self\" keywords"); BaseEvent eventRecord; if (ActionEvent.IsActionEvent(eventName)) { eventRecord = new ActionEvent(eventId, eventName, timestamp); } else if (PropertyChangeEvent.IsPropertyChangeEvent(eventName)) { eventRecord = new PropertyChangeEvent(eventId, eventName, timestamp); }else throw new Exception("Unknown Event Type"); AddRecord(eventRecord); return eventRecord; }
protected override void propertiesChange(PropertyChangeEvent[] aEvent) { }
protected override void vetoableChange(PropertyChangeEvent aEvent) { //TODO: check if the new name is unique }
public void propertyChange(PropertyChangeEvent @event) { throw new System.NotImplementedException(); }
/// <summary> /// Forwards the property change event to the listener delegate. /// </summary> /// <param name="event"> the property change event /// </param> /// <exception cref="PropertyVetoException"> if the recipient wishes the property /// change to be rolled back </exception> //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET: //ORIGINAL LINE: public void vetoableChange(PropertyChangeEvent event) throws PropertyVetoException public virtual void VetoableChange(PropertyChangeEvent @event) { Listener.VetoableChange(@event); }
protected override void vetoableChange(PropertyChangeEvent aEvent) { if (aEvent.Source == DrawPage) { System.Diagnostics.Debug.WriteLine(aEvent.PropertyName + " vetoable changed to " + aEvent.NewValue.Value.ToString() + ", further: " + aEvent.Further); } }