private void ContactUpdate_Before(object sender, ObjectEventArgs e)
 {
     ContactInfo contact = e.Object as ContactInfo;
     if (!DetectChange(contact, "ContactSalesForceLeadID", "ContactSalesForceLeadReplicationSuspensionDateTime", "ContactSalesForceLeadReplicationDisabled", "ContactSalesForceLeadReplicationDateTime"))
     {
         contact.SetValue("ContactSalesForceLeadReplicationSuspensionDateTime", null);
     }
 }
 private void SettingsKeyUpdate_After(object sender, ObjectEventArgs e)
 {
     SettingsKeyInfo setting = e.Object as SettingsKeyInfo;
     if (setting.KeyName == "CMSSalesForceLeadReplicationMapping")
     {
         SettingsKeyInfoProvider.SetValue("CMSSalesForceLeadReplicationMappingDateTime", DateTime.Now.ToString("s"));
     }
 }
Beispiel #3
0
        void Database_ObjectAppended(object sender, ObjectEventArgs e)
        {
            var obj = e.DBObject;

            if (obj is Entity)
            {
                AcApp.DocumentManager.MdiActiveDocument.Editor.WriteMessage(string.Format("\nObject added {0}\n", obj.GetRXClass().Name));
            }
        }
Beispiel #4
0
 private void RelationshipsNameDeleting(object sender, ObjectEventArgs e)
 {
     if ((e.Object is RelationshipNameInfo relationshipName) && _contentTypeSync.IsAtSynchronizedSite(relationshipName))
     {
         e.CallWhenFinished(
             () => RunSynchronization(async() => await _contentTypeSync.SyncRelationships())
             );
     }
 }
Beispiel #5
0
    private void Site_Insert_After(object sender, ObjectEventArgs e)
    {
        // Create new roles
        SiteInfo Site = (SiteInfo)e.Object;

        _ = GetOrCreateRole(_AuthenticatedRole, _AuthenticatedRoleDisplayName, _AuthenticatedRoleDescription, Site.SiteID);
        _ = GetOrCreateRole(_NotAuthenticatedRole, _NotAuthenticatedRoleDisplayName, _NotAuthenticatedRoleDescription, Site.SiteID);
        _ = GetOrCreateRole(_EveryoneRole, _EveryoneRoleDisplayName, _EveryoneRoleDescription, Site.SiteID);
    }
Beispiel #6
0
        private void ContactUpdate_Before(object sender, ObjectEventArgs e)
        {
            ContactInfo contact = e.Object as ContactInfo;

            if (!DetectChange(contact, "ContactSalesForceLeadID", "ContactSalesForceLeadReplicationSuspensionDateTime", "ContactSalesForceLeadReplicationDisabled", "ContactSalesForceLeadReplicationDateTime"))
            {
                contact.SetValue("ContactSalesForceLeadReplicationSuspensionDateTime", null);
            }
        }
Beispiel #7
0
        private void SettingsKeyUpdate_After(object sender, ObjectEventArgs e)
        {
            SettingsKeyInfo setting = e.Object as SettingsKeyInfo;

            if (setting.KeyName == "CMSSalesForceLeadReplicationMapping")
            {
                SettingsKeyProvider.SetValue("CMSSalesForceLeadReplicationMappingDateTime", DateTime.Now.ToString("s"));
            }
        }
Beispiel #8
0
        public override bool Do(ObjectEventArgs args)
        {
            if (Callback == null)
                return false;

            Callback(args);

            return true;
        }
Beispiel #9
0
        // Define callback for Database.ObjectModified event
        private void OnObjectModified(object sender, ObjectEventArgs e)
        {
            ObjectId id = e.DBObject.ObjectId;

            if (m_linkManager.Contains(id) &&
                !m_entitiesToUpdate.Contains(id))
            {
                m_entitiesToUpdate.Add(id);
            }
        }
Beispiel #10
0
        public override bool Call(ObjectEventArgs args)
        {
            if (TempCount-- <= 0)
            {
                Parent.RemoveEvent(this);
                return true;
            }

            return base.Call(args);
        }
Beispiel #11
0
        public object GetScaffold(Type type)
        {
            var obj = Activator.CreateInstance(type);

            var a1 = new ObjectEventArgs(type, obj);

            UIOMaticObjectService.OnScaffoldingObject(a1);

            return(a1.Object);
        }
 void Properties_ItemRemoved(object sender, ObjectEventArgs <ICalendarProperty, int> e)
 {
     if (e.First != null &&
         e.First.Name != null &&
         string.Equals(e.First.Name.ToUpper(), "UID"))
     {
         OnUIDChanged(e.First.Values.Cast <string>().FirstOrDefault(), null);
         e.First.ValueChanged -= Object_ValueChanged;
     }
 }
Beispiel #13
0
 void VlcMediaPlayer_SubItemChanged(object sender, ObjectEventArgs <Interop.Core.Events.MediaSubitemAddedArgs> e)
 {
     Dispatcher.BeginInvoke(DispatcherPriority.Normal, new Action(() =>
     {
         if (OnSubItemAdded != null)
         {
             OnSubItemAdded(this, new EventArgs());
         }
     }));
 }
Beispiel #14
0
 /// <summary>
 /// Добавление объекта в чертеж
 /// </summary>
 private void Database_ObjectAppended(object sender, ObjectEventArgs e)
 {
     //var ent = e.DBObject as Entity;
     //if (ent == null) return;
     //try
     //{
     //    DefineEnt(ent);
     //}
     //catch { }
 }
Beispiel #15
0
        private void UrlSlug_Insert_After(object sender, ObjectEventArgs e)
        {
            UrlSlugInfo UrlSlug = (UrlSlugInfo)e.Object;

            // Staging task should not be created, add entry so this task won't be generated
            UrlSlugStagingTaskIgnoreInfoProvider.SetUrlSlugStagingTaskIgnoreInfo(new UrlSlugStagingTaskIgnoreInfo()
            {
                UrlSlugStagingTaskIgnoreUrlSlugID = UrlSlug.UrlSlugID
            });
        }
Beispiel #16
0
 /// <summary>
 ///     Properties_s the item added.
 /// </summary>
 /// <param name="sender">The sender.</param>
 /// <param name="e">The e.</param>
 private void Properties_ItemAdded(object sender, ObjectEventArgs <ICalendarProperty, int> e)
 {
     if (e.First != null &&
         e.First.Name != null &&
         string.Equals(e.First.Name.ToUpper( ), "UID"))
     {
         OnUidChanged(null, e.First.Values.Cast <string>( ).FirstOrDefault( ));
         e.First.ValueChanged += Object_ValueChanged;
     }
 }
Beispiel #17
0
 private void _engine_ObjectMotion(object sender, ObjectEventArgs e)
 {
     if (e.Obj.TrackCollisions)
     {
         this.Dispatcher.Invoke((Action)(() =>
         {
             txtLocation.Text = e.Obj.Position.X + ", " + e.Obj.Position.Y;
         }));
     }
 }
 private void OwnerOnObjectEvent(object sender, ObjectEventArgs objectEventArgs)
 {
     if (objectEventArgs.Action == _decreaseEvent && CurrentValue != _minValue)
     {
         CurrentValue--;
     }
     else if (objectEventArgs.Action == _increseEvent && CurrentValue != _maxValue)
     {
         CurrentValue++;
     }
 }
Beispiel #19
0
 private void MediaPlayer_Playing(object sender, ObjectEventArgs <Meta.Vlc.Interop.Media.MediaState> e)
 {
     if (e.Value == Meta.Vlc.Interop.Media.MediaState.Playing)
     {
         if (mediaPlayer.VideoTrackCount <= 0)
         {
             _VideoAudioInfo.Duration = mediaPlayer.Media.Duration.TotalSeconds;
             waiting = false;
         }
     }
 }
Beispiel #20
0
 private void UpdateUserWidget(string type, ObjectEventArgs eventArgs)
 {
     if (eventArgs.Object is UserWidgetInfo userWidgetInfo)
     {
         WebFarmHelper.CreateTask(new UserWidgetWebFarmTask
         {
             Type     = type,
             CodeName = userWidgetInfo.UserWidgetCodeName
         });
     }
 }
Beispiel #21
0
        protected virtual void OnCurrentChanged(ObjectEventArgs e)
        {
            logger.DebugFormat("Current is {0}", e);

            var h = CurrentChanged;

            if (h != null)
            {
                h(this, e);
            }
        }
Beispiel #22
0
        private void OwnerOnObjectEvent(object sender, ObjectEventArgs objectEventArgs)
        {
            if (objectEventArgs.Action == _subscribeEvent)
            {
                _currentValue = _counterIncrementComponent.CurrentValue;

                var requiredItems = _currentValue;
                var newVectors    = _drawMethod(requiredItems, 4).ToList();
                _locations = newVectors;
            }
        }
Beispiel #23
0
 private void CategoryUpdated(object sender, ObjectEventArgs e)
 {
     if (e.Object is DocumentCategoryInfo category)
     {
         var node = _pageSync.GetSourceDocument(category.DocumentID);
         if ((node != null) && _pageSync.IsAtSynchronizedSite(node) && _pageSync.CanBePublished(node))
         {
             RunSynchronization(async() => await _pageSync.SyncPage(node));
         }
     }
 }
Beispiel #24
0
 private void AttachmentUpdated(object sender, ObjectEventArgs e)
 {
     if ((e.Object is AttachmentInfo attachment) && _assetSync.IsAtSynchronizedSite(attachment))
     {
         var node = _pageSync.GetSourceDocument(attachment.AttachmentDocumentID);
         if (node != null)
         {
             RunSynchronization(async() => await _assetSync.SyncAttachment(attachment));
         }
     }
 }
Beispiel #25
0
 private void ClassSiteChanged(object sender, ObjectEventArgs e)
 {
     if ((e.Object is ClassSiteInfo classSite) && _contentTypeSync.IsSynchronizedSite(classSite.SiteID))
     {
         var contentType = DataClassInfoProvider.GetDataClassInfo(classSite.ClassID);
         if (contentType?.ClassIsDocumentType == true)
         {
             RunSynchronization(async() => await _contentTypeSync.SyncContentType(contentType));
         }
     }
 }
Beispiel #26
0
        private void DataClass_Update_After(object sender, ObjectEventArgs e)
        {
            DataClassInfo Class = (DataClassInfo)e.Object;

            // If the "Continue" is false, it means that a DataClass_Update_Before found that the UrlPattern was changed
            // Otherwise the "Continue" will be true that this is the first time triggering it.
            if (!new RecursionControl("TriggerClassUpdateAfter_" + Class.ClassName).Continue)
            {
                DynamicRouteEventHelper.ClassUrlPatternChanged(Class.ClassName);
            }
        }
        private void UidChanged(object sender, ObjectEventArgs <string, string> e)
        {
            if (e.First != null && _lookup.ContainsKey(e.First))
            {
                _lookup.Remove(e.First);
            }

            if (e.Second != null)
            {
                _lookup[e.Second] = (TComponentType)sender;
            }
        }
Beispiel #28
0
 private void CategoryUpdating(object sender, ObjectEventArgs e)
 {
     if ((e.Object is CategoryInfo category) && _taxonomySync.IsAtSynchronizedSite(category))
     {
         if (category.AnyItemChanged(TaxonomySync.UsedCategoryColumns))
         {
             e.CallWhenFinished(
                 () => RunSynchronization(async() => await _taxonomySync.SyncCategories())
                 );
         }
     }
 }
Beispiel #29
0
 private void RelationshipNameUpdating(object sender, ObjectEventArgs e)
 {
     if ((e.Object is RelationshipNameInfo relationshipName) && _contentTypeSync.IsAtSynchronizedSite(relationshipName))
     {
         if (relationshipName.AnyItemChanged(ContentTypeSync.UsedRelationshipNameColumns))
         {
             e.CallWhenFinished(
                 () => RunSynchronization(async() => await _contentTypeSync.SyncRelationships())
                 );
         }
     }
 }
Beispiel #30
0
 private void PageTypeUpdating(object sender, ObjectEventArgs e)
 {
     if ((e.Object is DocumentTypeInfo contentType) && _contentTypeSync.IsAtSynchronizedSite(contentType))
     {
         if (contentType.AnyItemChanged(ContentTypeSync.UsedPageTypeColumns))
         {
             e.CallWhenFinished(
                 () => RunSynchronization(async() => await _contentTypeSync.SyncContentType(contentType))
                 );
         }
     }
 }
Beispiel #31
0
 private void OwnerOnObjectEvent(object sender, ObjectEventArgs objectEventArgs)
 {
     if (objectEventArgs.Action == _subscribeEvent)
     {
         _currentValue = _counterIncrementComponent.CurrentValue;
     }
     if (_colourFunc != null &&
         _colorEvent == objectEventArgs.Action)
     {
         _color = _colourFunc(Owner);
     }
 }
Beispiel #32
0
        private void BindActivatableToActivator(ObjectEventArgs oea)
        {
            object obj = oea.Object;

            if (obj is IActivatable)
            {
                Db4objects.Db4o.Internal.Transaction transaction = (Db4objects.Db4o.Internal.Transaction
                                                                    )oea.Transaction();
                ObjectReference objectReference = transaction.ReferenceForObject(obj);
                Bind(obj, ActivatorForObject(transaction, objectReference));
            }
        }
        private void DataClass_Update_Before(object sender, ObjectEventArgs e)
        {
            // Check if the Url Pattern is changing
            DataClassInfo Class = (DataClassInfo)e.Object;

            if (!Class.ClassURLPattern.Equals(ValidationHelper.GetString(e.Object.GetOriginalValue("ClassURLPattern"), "")))
            {
                // Add key that the "After" will check, if the Continue is "False" then this was hit, so we actually want to continue.
                RecursionControl TriggerClassUpdateAfter = new RecursionControl("TriggerClassUpdateAfter_" + Class.ClassName);
                var Trigger = TriggerClassUpdateAfter.Continue;
            }
        }
        private void UrlSlug_Update_Before_IsCustomRebuild(object sender, ObjectEventArgs e)
        {
            UrlSlugInfo UrlSlug = (UrlSlugInfo)e.Object;

            // If the Url Slug is custom or was custom, then need to rebuild after.
            if (UrlSlug.UrlSlugIsCustom || ValidationHelper.GetBoolean(UrlSlug.GetOriginalValue("UrlSlugIsCustom"), UrlSlug.UrlSlugIsCustom))
            {
                // Add hook so the Url Slug will be re-rendered after it's updated
                RecursionControl Trigger = new RecursionControl("UrlSlugNoLongerCustom_" + UrlSlug.UrlSlugGuid);
                var Triggered            = Trigger.Continue;
            }
        }
        public static void MediaFile_Insert_Before(object sender, ObjectEventArgs e)
        {
            MediaOptimizer optimizer = new MediaOptimizer();
            if (e.Object != null)
            {
                if (e.Object is MediaFileInfo)
                {
                    var image = (MediaFileInfo) e.Object;
                    if (image != null)
                    {
                        image.FileTitle = image.FileName.ToUpper();
                        IOptimizerResult result = null;
                        result = optimizer.Process(image);

                        if (result != null && result.OptimizedBytes != null && result.OptimizedBytes.Length > 0)
                        {
                            image.FileBinary = result.OptimizedBytes;
                            image.FileSize = result.OptimizedBytes.Length;
                        }
                    }
                    return;
                }

                if (e.Object is AttachmentInfo)
                {
                    var image = (AttachmentInfo)e.Object;
                    if (image != null)
                    {
                        image.AttachmentTitle = image.AttachmentName.ToUpper();
                        IOptimizerResult result = null;
                        result = optimizer.Process(image);

                        if (result != null && result.OptimizedBytes != null && result.OptimizedBytes.Length > 0)
                        {
                            image.AttachmentBinary = result.OptimizedBytes;
                            image.AttachmentSize = result.OptimizedBytes.Length;
                        }
                    }
                    return;
                }
            }
        }
    /// <summary>
    /// Generate the secure URL (original URL with hash)
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    private void HashGenerateSecureUrl(object sender, ObjectEventArgs e)
    {
        var url = e.Object.GetStringValue("HashUrl", string.Empty);
        var hashSecureUrl = "";

        var urlWithoutHash = URLHelper.RemoveParameterFromUrl(url, "hash");
        var newUrl = HttpUtility.UrlDecode(urlWithoutHash);
        var query = URLHelper.GetQuery(newUrl).TrimStart('?');

        int index = newUrl.IndexOfCSafe("/rest", true);
        if (index >= 0)
        {
            var domain = URLHelper.GetDomain(newUrl);
            newUrl = URLHelper.RemoveQuery(newUrl.Substring(index));

            var rewritten = BaseRESTService.RewriteRESTUrl(newUrl, query, domain, "GET");
            newUrl = rewritten[0].TrimStart('~') + "?" + rewritten[1];

            hashSecureUrl += URLHelper.AddParameterToUrl(urlWithoutHash, "hash", RESTService.GetHashForURL(newUrl, domain)) + Environment.NewLine;
            e.Object.SetValue("HashSecureUrl", hashSecureUrl);
        }
    }
Beispiel #37
0
 public void DbEvent_ObjectAppened_Handler_RoadPavenment(object sender, ObjectEventArgs e)
 {
     try
     {
         if (e.DBObject is Autodesk.Civil.DatabaseServices.Alignment)
         {
             cbAlignment.Items.Add(new AcadUtils.CbAutocadItem((e.DBObject as Alignment).Name,
                                             (e.DBObject as Alignment).ObjectId));
         }
         else if (e.DBObject is Autodesk.Civil.DatabaseServices.TinSurface)
         {
             cbSurfEx.Items.Add(new AcadUtils.CbAutocadItem((e.DBObject as TinSurface).Name,
                                             (e.DBObject as TinSurface).ObjectId));
             cbSurfPr.Items.Add(new AcadUtils.CbAutocadItem((e.DBObject as TinSurface).Name,
                                             (e.DBObject as TinSurface).ObjectId));
         }
     }
     catch (Exception ex)
     {
         LufsGenplan.AcadApp.AcaEd.WriteMessage("\nERROR: RoadPavenment.DbEvent_ObjectAppened_Handler() " + ex + "\n");
     }
 }
Beispiel #38
0
        private async void NewMediaOnParsedChanged( object sender, ObjectEventArgs<MediaParsedChangedArgs> e )
        {
            if ( lastMedia == null )
                throw new Exception( "No media loaded" );

            FileInfo mediaFile = new FileInfo( new Uri( lastMedia.Mrl ).LocalPath );
            VidereMedia media = new VidereMedia( mediaFile )
            {
                Duration = lastMedia.Duration,
                Name = lastMedia.GetMeta( MetaDataType.Title )
            };

            xZune.Vlc.MediaTrack vid = lastMedia.GetTracks( ).FirstOrDefault( O => O.Type == TrackType.Video );
            if ( vid?.VideoTrack != null )
            {
                VideoTrack vidTrack = vid.VideoTrack.Value;
                media.Video = new VideoInfo
                {
                    Width = vidTrack.Width,
                    Height = vidTrack.Height
                };
            }

            xZune.Vlc.MediaTrack aud = lastMedia.GetTracks( ).FirstOrDefault( O => O.Type == TrackType.Audio );
            if ( aud?.AudioTrack != null )
            {
                AudioTrack audTrack = aud.AudioTrack.Value;
                media.Audio = new AudioInfo
                {
                    Channels = audTrack.Channels,
                    Rate = audTrack.Rate
                };
            }

            await ViderePlayer.MainDispatcher.InvokeAsync( ( ) => OnMediaLoaded( new OnMediaLoadedEventArgs( media ) ) );
        }
		/// <summary>
		/// Play the media e.Media on device.
		/// </summary>
		/// <param name="sender">Sender.</param>
		/// <param name="e">Event arguments.</param>
		public void OnPlayMedia (Object sender, ObjectEventArgs<Media> args)
		{
			if (args.Object.Data != null)
			{
				switch (args.Object.Type) {
					case MediaType.MP3:
						PlayMedia (args.Object);
						break;
					case MediaType.WAV:
						PlayMedia (args.Object);
						break;
				case MediaType.OGG:
						PlayMedia (args.Object);
						break;
					case MediaType.FDL:
						break;
				}
			}
		}
		/// <summary>
		/// Get the input e.Input from the player.
		/// </summary>
		/// <param name="sender">Sender.</param>
		/// <param name="e">Event arguments.</param>
		public void OnGetInput (Object sender, ObjectEventArgs<Input> args)
		{
			var bar = SupportActionBar;
			var ft = this.SupportFragmentManager.BeginTransaction ();
			var activeFragment = this.SupportFragmentManager.FindFragmentByTag("active");

			// There could be only one dialog on screen
			if (screenStack.Peek() is GameDialogScreen)
				screenStack.Pop();

			// Now push new dialog to screen
			screenStack.Push(new GameDialogScreen (args.Object));

			bar.SetDisplayHomeAsUpEnabled (false);
			ft.SetTransition (global::Android.Support.V4.App.FragmentTransaction.TransitNone);
			ft.Replace (Resource.Id.fragment, screenStack.Peek(), "active");
			ft.Commit ();
		}
Beispiel #41
0
 /// <summary>
 /// The event handler occurring after the change of the object.
 /// </summary>
 /// <param name="args"></param>
 protected override void ObjectChangedEventHandler(ObjectEventArgs args)
 {
     VariablesEventHandler();
 }
Beispiel #42
0
 void iCalTimeZone_ChildAdded(object sender, ObjectEventArgs<ICalendarObject> e)
 {
     m_Evaluator.Clear();
 }
Beispiel #43
0
		protected virtual void PluginTrackable_ExecuteComplete(object sender, ObjectEventArgs<IPlugin> eventArgs)
		{
			ExecuteCompleted(this, eventArgs);
		}
Beispiel #44
0
 void Properties_ItemAdded(object sender, ObjectEventArgs<ICalendarProperty, int> e)
 {
     if (e.First != null &&
         e.First.Name != null &&
         string.Equals(e.First.Name.ToUpper(), "UID"))
     {
         OnUIDChanged(null, e.First.Values.Cast<string>().FirstOrDefault());
         e.First.ValueChanged += Object_ValueChanged;
     }
 }
Beispiel #45
0
		/// <summary>
		/// Raises the play media event.
		/// </summary>
		/// <param name="sender">Sender of event.</param>
		/// <param name="mediaObj">Media object.</param>
		public void OnPlayMedia(object sender, ObjectEventArgs<Media> mediaObj)
		{
			try
			{
				if (this.sound != null)
				{
					this.sound.PlaySound(mediaObj.Object);
				}
			}
			catch (InvalidCastException e)
			{
				this.LogMessage(LogLevel.Error, e.Message);
			}
		}
 void CalendarParameterList_ItemRemoved(object sender, ObjectEventArgs<ICalendarParameter> e)
 {
     e.Object.Parent = null;
 }
 void CalendarParameterList_ItemAdded(object sender, ObjectEventArgs<ICalendarParameter> e)
 {
     e.Object.Parent = m_Parent;
 }
Beispiel #48
0
		private void PluginTrackables_ItemRemoved(object sender, ObjectEventArgs<IPluginTrackable> eventArgs)
		{
			eventArgs.EventObject.ExecuteCompleted				-= PluginTrackable_ExecuteComplete;
			eventArgs.EventObject.ExecuteFailed					-= PluginTrackable_ExecuteFailed;
			eventArgs.EventObject.CommitCompleted				-= PluginTrackable_CommitCompleted;
			eventArgs.EventObject.CommitFailed					-= PluginTrackable_CommitFailed;
			eventArgs.EventObject.RollbackCompleted				-= PluginTrackable_RollbackCompleted;
			eventArgs.EventObject.RollbackFailed				-= PluginTrackable_RollbackFailed;

			eventArgs.EventObject.OperationProgressChanged		-= PluginTrackable_OperationProgressChanged;
			eventArgs.EventObject.TotalProgressChanged			-= PluginTrackable_TotalProgressChanged;

			if (eventArgs.EventObject is IPlugin)
				PluginRemoved(this, new ObjectEventArgs<IPlugin>((IPlugin)eventArgs.EventObject));
			else if(eventArgs.EventObject is IPluginContainer)
				UnsubscribeToPluginContainer((IPluginContainer)eventArgs.EventObject);
			else
				throw new NotImplementedException("Not implemented for " + eventArgs.EventObject.GetType().FullName);
		}
Beispiel #49
0
		protected virtual void PluginTrackable_RollbackCompleted(object sender, ObjectEventArgs<IPlugin> eventArgs)
		{
			RollbackCompleted(this, eventArgs);
		}
Beispiel #50
0
		/// <summary>
		/// Raises the command changed event.
		/// </summary>
		/// <param name="sender">Sender.</param>
		/// <param name="e">Object event args.</param>
		public void OnCommandChanged(object sender, ObjectEventArgs<WF.Player.Core.Command> e)
		{
			if (e.Object.Owner is UIObject)
			{
				this.RaiseDisplayChanged("Property", (UIObject)e.Object.Owner, "Commands");
			}
		}
Beispiel #51
0
        public void DbEvent_ObjectModified_Handler_RoadPavenment(object sender, ObjectEventArgs e)
        {
            try
            {
                if (e.DBObject is Alignment)
                {
                    AcadUtils.CbAutocadItem obj = new AcadUtils.CbAutocadItem((e.DBObject as Alignment).Name,
                                                    (e.DBObject as Alignment).ObjectId);
                    if (obj == null)
                    {
                        return;
                    }
                    for (int i = 0; i < cbAlignment.Items.Count; i++)
                    {
                        if ((cbAlignment.Items[i] as AcadUtils.CbAutocadItem).ID == obj.ID)
                        {
                            if ((cbAlignment.Items[i] as AcadUtils.CbAutocadItem).Name == cbAlignment.Text)
                            {
                                cbAlignment.Items.RemoveAt(i);
                                cbAlignment.Items.Insert(i, obj);
                                cbAlignment.SelectedItem = obj;
                                //TO DO check alignment data
                            }
                            else
                            {
                                cbAlignment.Items.RemoveAt(i);
                                cbAlignment.Items.Insert(i, obj);
                            }
                            break;
                        }
                    }
                }
                else if (e.DBObject is TinSurface)
                {
                    AcadUtils.CbAutocadItem obj = new AcadUtils.CbAutocadItem((e.DBObject as TinSurface).Name,
                                                    (e.DBObject as TinSurface).ObjectId);
                    if (obj == null)
                    {
                        return;
                    }
                    for (int i = 0; i < cbSurfEx.Items.Count; i++)
                    {
                        if ((cbSurfEx.Items[i] as AcadUtils.CbAutocadItem).ID == obj.ID)
                        {
                            if ((cbSurfEx.Items[i] as AcadUtils.CbAutocadItem).Name == cbSurfEx.Text)
                            {
                                cbSurfEx.Items.RemoveAt(i);
                                cbSurfEx.Items.Insert(i, obj);
                                cbSurfEx.SelectedItem = obj;
                            }
                            else
                            {
                                cbSurfEx.Items.RemoveAt(i);
                                cbSurfEx.Items.Insert(i, obj);
                            }
                            break;
                        }
                    }

                    for (int i = 0; i < cbSurfPr.Items.Count; i++)
                    {
                        if ((cbSurfPr.Items[i] as AcadUtils.CbAutocadItem).ID == obj.ID)
                        {
                            if ((cbSurfPr.Items[i] as AcadUtils.CbAutocadItem).Name == cbSurfPr.Text)
                            {
                                cbSurfPr.Items.RemoveAt(i);
                                cbSurfPr.Items.Insert(i, obj);
                                cbSurfPr.SelectedItem = obj;
                            }
                            else
                            {
                                cbSurfPr.Items.RemoveAt(i);
                                cbSurfPr.Items.Insert(i, obj);
                            }
                            break;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                LufsGenplan.AcadApp.AcaEd.WriteMessage("\nERROR: RoadPavenment.DbEvent_ObjectModified_Handler() " + ex + "\n");
            }
        }
 private void callback_ObjectOpenedForModify(object sender, ObjectEventArgs e)
 {
     WriteLine(String.Format("ObjectOpenedForModify - {0} {1}", e.DBObject.ToString(), e.DBObject.Id.ToString()));
 }
Beispiel #53
0
 void Children_ItemAdded(object sender, ObjectEventArgs<ICalendarObject, int> e)
 {
     m_Evaluator.Clear();
 }
Beispiel #54
0
 public void objOpenedForMod(object o, ObjectEventArgs e)
 {
     if (bCmdActive == false || bReposition == true)
         return;
     ObjectId objId = e.DBObject.ObjectId;
     Database db = HostApplicationServices.WorkingDatabase;
     Editor ed = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor;
     try
     {
         using (Transaction trans = db.TransactionManager.StartTransaction())
         {
             Entity ent = (Entity)trans.GetObject(objId, OpenMode.ForRead, false);
             //�ж϶����Ƿ�Ϊ��
             if (ent is BlockReference)
             {
                 BlockReference br = (BlockReference)ent;
                 //��ȡObjectID�Ͳ���㣬�������DZ��浽ȫ�ֱ���
                             blkObjIDs.Add(objId);
                             blkPositions.Add(br.Position);
             }
             trans.Commit();
         }
     }
     catch
     {
         ed.WriteMessage("ObjectOpenedForModify�¼��Ĵ����������");
     }
 }
 private void callback_ObjectUnappended(object sender, ObjectEventArgs e)
 {
     WriteLine(String.Format("ObjectUnappended - {0} {1}", e.DBObject.ToString(), e.DBObject.Id.ToString()));
 }
Beispiel #56
0
		protected virtual void PluginContainer_PluginRemoved(object sender, ObjectEventArgs<IPlugin> eventArgs)
		{
			PluginRemoved(this, eventArgs);
		}
Beispiel #57
0
		/// <summary>
		/// Raises the get input event.
		/// </summary>
		/// <param name="sender">Sender of event.</param>
		/// <param name="input">Object event arguments.</param>
		public void OnGetInput(object sender, ObjectEventArgs<Input> input)
		{
			this.ShowScreen(ScreenType.Dialog, input.Object);
		}
Beispiel #58
0
 void Properties_ItemAdded(object sender, ObjectEventArgs<ICalendarProperty> e)
 {
     if (e.Object != null &&
         e.Object.Name != null &&
         string.Equals(e.Object.Name.ToUpper(), "UID"))
     {
         OnUIDChanged(null, e.Object.Value != null ? e.Object.Value.ToString() : null);
         e.Object.ValueChanged += new EventHandler<ValueChangedEventArgs>(UID_ValueChanged);
     }
 }
 private void SecondPassProgressDataChanged(object sender, ObjectEventArgs<ProgressData> eventArgs)
 {
     OperationProgress = Math.Min(((IFFmpegWrapper) sender).CompletionProgress / 2 + 0.5, 1);
 }
 void Parameters_ItemAdded(object sender, ObjectEventArgs<ICalendarParameter> e)
 {
     OnItemAdded(e.Object);
 }