internal void OnItemDeleted(object sender, EventArgs args) { Assert.ArgumentNotNull(sender, "sender"); Assert.ArgumentNotNull(args, "args"); var sitecoreArgs = args as SitecoreEventArgs; if (sitecoreArgs == null) return; var arguments = new ItemDeletedEventArgs((Item)sitecoreArgs.Parameters[0], (ID)sitecoreArgs.Parameters[1]); if (arguments.Item == null) return; try { //Reset Caches ResetDynamicSitesCache(arguments.Item); } catch (NullReferenceException) { //Do nothing. } catch (Exception e) { Log.Error(String.Format("[DynamicSites] Error: {0} \r\n Stack: {1}", e.Message, e.StackTrace), e); } }
private static void OnItemDeleted(ItemDeletedEventArgs e) { if (IsHonestyItem(e.Item)) { _Items.Remove(e.Item); } }
protected virtual void OnItemDeleted(ItemDeletedEventArgs e) { if (ItemDeleted != null) { ItemDeleted(this, e); } }
private void OnDeleteCommandExecuted(object selectedItem) { switch (selectedItem.GetType().Name) { case "HSPerson": //DataSource.Person lDeletItem = lDataContext.Persons.SingleOrDefault(p => p.Id == (selectedItem as HSPerson).Id); //if (lDeletItem != null) //{ // lDataContext.Persons.DeleteOnSubmit(lDeletItem); // try // { // lDataContext.SubmitChanges(); // } // catch (Exception ex) // { // Console.WriteLine(ex); // // Provide for exceptions. // } //} break; case "HSEmployee": break; case "HSCustomer": break; } ItemDeletedEventArgs lItem = selectedItem as Telerik.Windows.Controls.Data.DataForm.ItemDeletedEventArgs; }
internal void OnItemDeleted(object sender, EventArgs args) { Assert.ArgumentNotNull(sender, "sender"); Assert.ArgumentNotNull(args, "args"); var sitecoreArgs = args as SitecoreEventArgs; if (sitecoreArgs == null) { return; } var arguments = new ItemDeletedEventArgs((Item)sitecoreArgs.Parameters[0], (ID)sitecoreArgs.Parameters[1]); if (arguments.Item == null) { return; } try { //Reset Caches ResetDynamicSitesCache(arguments.Item); } catch (NullReferenceException) { //Do nothing. } catch (Exception e) { Log.Error(String.Format("[DynamicSites] Error: {0} \r\n Stack: {1}", e.Message, e.StackTrace), e); } }
private void TypeContextBase_ItemDeleted(object sender, ItemDeletedEventArgs <_I> e) { foreach (var item in this.GetTables()) { var tableInfo = item.TableInfo; this.DeleteType(ref tableInfo, e.ItemPath); item.TableInfo = tableInfo; } }
public static void OnDeleted(ItemDeletedEventArgs e) { Item item = e.Item; if (HotItems.ContainsKey(item)) { HotItems.Remove(item); CheckTimer(); } }
private static void OnItemDeleted(ItemDeletedEventArgs e) { if (!e.Item.HonestyItem) { return; } lock (_ItemsLock) { _Items.Remove(e.Item); } }
private void OnItemDeleted(object sender, ItemDeletedEventArgs e) { this.Dispatcher.BeginInvoke(() => { if (e.Error != null) { MessageBox.Show(e.Error.Message, e.Error.GetType().Name, MessageBoxButton.OK); return; } App.DataProvider.ClearCache(); this.NavigationService.Navigate(new Uri("/Views/List.xaml", UriKind.Relative)); }); }
/// <summary> /// Raise when a diagram element is deleted /// </summary> /// <param name="sender"></param> /// <param name="args"></param> private void MainWindow_ItemDeleted(object sender, ItemDeletedEventArgs args) { if (args.Item is WireViewModel connector) { connector.State = BinaryState.Zero; if (connector.TargetNode is BaseGateViewModel targetNode) { targetNode.ResetState(); } } else if (args.Item is BaseGateViewModel node) { node.State = BinaryState.Zero; } }
/// <summary> /// Method will execute when ItemDeletedCommand executed /// </summary> /// <param name="param"> /// </param> private void ItemDeletedCommandExecute(object param) { ItemDeletedEventArgs args = param as ItemDeletedEventArgs; if (args.Item is BrainstormingConnectorVM) { BrainstormingConnectorVM connectorVM = args.Item as BrainstormingConnectorVM; BrainstormingNodeVM sourceNode = connectorVM.SourceNode as BrainstormingNodeVM; if (sourceNode != null) { sourceNode.ChildCount--; } } else if (args.Item is BrainstormingNodeVM && args.Item != this.Rootnode) { this.Updatebowtielayout((args.Item as BrainstormingNodeVM).Type); } }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void BlogEntry_ItemDeleted(object sender, ItemDeletedEventArgs e) { core.Search.DeleteFromIndex(this); ActionableItem.CleanUp(core, this); }
void Forum_ItemDeleted(object sender, ItemDeletedEventArgs e) { long postAdjust = forumPosts; long topicAdjust = forumTopics; List<long> parentIds = new List<long>(); List<long> childIds = new List<long>(); childIds.Add(Id); List<Forum> children = GetForums(); /* Delete Children First */ foreach (Forum child in children) { childIds.Add(child.Id); child.Delete(true); } if (!e.ParentDeleted) { foreach (ParentTreeNode parent in Parents.Nodes) { parentIds.Add(parent.ParentId); } /* Update parent forums */ { UpdateQuery uQuery = new UpdateQuery(typeof(Forum)); uQuery.AddField("forum_posts", new QueryOperation("forum_posts", QueryOperations.Subtraction, postAdjust)); uQuery.AddField("forum_topics", new QueryOperation("forum_topics", QueryOperations.Subtraction, topicAdjust)); uQuery.AddCondition("forum_id", ConditionEquality.In, parentIds); db.Query(uQuery); } /* Update forum statistics */ { UpdateQuery uQuery = new UpdateQuery(typeof(ForumSettings)); uQuery.AddField("forum_posts", new QueryOperation("forum_posts", QueryOperations.Subtraction, postAdjust)); uQuery.AddField("forum_topics", new QueryOperation("forum_topics", QueryOperations.Subtraction, topicAdjust)); uQuery.AddCondition("forum_item_id", ownerKey.Id); uQuery.AddCondition("forum_item_type_id", ownerKey.TypeId); db.Query(uQuery); } /* Delete topics */ { DeleteQuery dQuery = new DeleteQuery(typeof(ForumTopic)); dQuery.AddCondition("forum_id", ConditionEquality.In, childIds); db.Query(dQuery); } /* Delete posts and update post counts */ { DeleteQuery dQuery = new DeleteQuery(typeof(TopicPost)); dQuery.AddCondition("forum_id", ConditionEquality.In, childIds); db.Query(dQuery); } /* */ { DeleteQuery dQuery = new DeleteQuery(typeof(TopicReadStatus)); dQuery.AddCondition("forum_id", ConditionEquality.In, childIds); db.Query(dQuery); } /* */ { DeleteQuery dQuery = new DeleteQuery(typeof(ForumReadStatus)); dQuery.AddCondition("forum_id", ConditionEquality.In, childIds); db.Query(dQuery); } } }
/// <summary> /// Lorsque l'on supprime un élément de la liste /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Item_RequestDeleteItem(object sender, ItemDeletedEventArgs e) { e.Flp.Controls.Remove(e.Flp.Controls.Find((sender as FileListItem).Name, true).First()); }
void TopicPost_ItemDeleted(object sender, ItemDeletedEventArgs e) { core.Search.DeleteFromIndex(this); }
protected virtual void OnItemDeleted(ItemDeletedEventArgs e) { if ( ItemDeleted != null ) ItemDeleted(this, e); }
void ForumTopic_ItemDeleted(object sender, ItemDeletedEventArgs e) { /* */ }
private void ItemDeletedNotification(object sender, ItemDeletedEventArgs args) { Assert.ArgumentNotNull(sender, "sender"); Assert.ArgumentNotNull(args, "args"); if ((WebUtil.GetQueryString("mo") == "preview") && (args.Item.ID.ToString() == WebUtil.GetQueryString("fo"))) { SheerResponse.SetAttribute("scPostAction", "value", "back:" + Sitecore.Globalization.Translate.Text("The current item has been deleted.\n\nThe browser will now go back to the previous page.\n\nIf the previous page has been cached by the browser,\nthe latest changes may not be visible. In that case\nclick the Refresh button to reload the page.")); } Item folder = this.ContentEditorDataContext.GetFolder(); if (Settings.ContentEditor.ClassicFrameEventPropagation || ((folder != null) && ((folder.ID == args.Item.ID) || (folder.ID == args.ParentID)))) { SheerResponse.Eval("scContent.postMessage(\"" + string.Concat(new object[] { "notification:itemdeleted(item=", GetUri(args.Item), ",parentid=", args.ParentID, ",index=", args.Index, ")" }) + "\")"); } }
void Comment_ItemDeleted(object sender, ItemDeletedEventArgs e) { ActionableItem.CleanUp(core, this); }