本文整理汇总了C#中Changed类的典型用法代码示例。如果您正苦于以下问题:C# Changed类的具体用法?C# Changed怎么用?C# Changed使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Changed类属于命名空间,在下文中一共展示了Changed类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CollectionManager_Changed_ChangeUntypedObject
public void CollectionManager_Changed_ChangeUntypedObject()
{
var remoteMethodCall = new Mock<IDdpRemoteMethodCall>();
var collectionManager = new CollectionManager(remoteMethodCall.Object);
var objectToAdd = new TestDdpObject { integerField = 101, StringProperty = "addedTest"};
collectionManager.Added(new Added { Collection = "Test", Fields = JObject.FromObject(objectToAdd), Id = "1" });
var changed = new Changed
{
Cleared = null,
Collection = "Test",
Fields = new Dictionary<string, JToken>() {{"StringProperty", JToken.FromObject("changed!")}},
ID = "1"
};
collectionManager.Changed(changed);
var collection = collectionManager.GetCollection<TestDdpObject>("Test");
Assert.AreEqual(1, collection.Count);
objectToAdd.StringProperty = "changed!";
objectToAdd.Id = "1";
AssertDdpObjectsEqual(objectToAdd, collection.First());
}
示例2: ChangedHandler_HandleMessage_DeserializsAndCallsCollectionManager
public void ChangedHandler_HandleMessage_DeserializsAndCallsCollectionManager()
{
var connectionMock = new Mock<IDdpConnectionSender>();
var collectionMock = new Mock<ICollectionManager>();
var resultHandlerMock = new Mock<IResultHandler>();
var testObject = new SimpleDdpObject { IsTrue = false };
var added = new Changed { Collection = "Tests", Fields = null, ID = "1" };
var handler = new ChangedHandler();
handler.HandleMessage(connectionMock.Object, collectionMock.Object, resultHandlerMock.Object,
JsonConvert.SerializeObject(added));
collectionMock.Verify(collection => collection.Changed(It.IsAny<Changed>()), Times.Once());
}
示例3: AddChangedToGoods
public bool AddChangedToGoods(Goods g, Changed c)
{
try
{
using (TransactionScope scope = new TransactionScope())
{
g.ChangedSet.Add(c);
g.Quantity = g.Quantity + c.Value;
this.ObjectContext.SaveChanges(SaveOptions.None);
scope.Complete();
this.ObjectContext.AcceptAllChanges();
return true;
}
}
catch
{
}
return false;
}
示例4: TriggerScriptChangedEvent
public void TriggerScriptChangedEvent(Changed val)
{
foreach (SceneObjectPart part in ChildrenList)
{
part.TriggerScriptChangedEvent(val);
}
}
示例5: TriggerScriptChangedEvent
public void TriggerScriptChangedEvent(Changed val)
{
if (ParentGroup != null && ParentGroup.Scene != null)
ParentGroup.Scene.EventManager.TriggerOnScriptChangedEvent(LocalId, (uint)val);
}
示例6: Show
public static void Show(MadAtlas atlas, string currentGUID, Changed changedCallback, ScriptableObject parent) {
//var window = ScriptableObject.CreateInstance<MadAtlasBrowser>();
var browser = EditorWindow.GetWindow<MadAtlasBrowser>(true, "Atlas Browser", true);
browser.atlas = atlas;
browser.changedCallback = changedCallback;
browser.selectedItemGUID = currentGUID;
browser.parent = parent;
}
示例7: TriggerScriptChangedEvent
public void TriggerScriptChangedEvent(Changed val)
{
if (m_parentGroup != null && m_parentGroup.Scene != null)
m_parentGroup.Scene.EventManager.TriggerOnScriptChangedEvent(this, (uint)val);
}
示例8: SendScriptEventToAllAttachments
private void SendScriptEventToAllAttachments(Changed c)
{
IAttachmentsModule attMod = Scene.RequestModuleInterface<IAttachmentsModule>();
if (attMod != null)
attMod.SendScriptEventToAttachments(UUID, "changed", new Object[] {c});
}
示例9: TriggerScriptChangedEvent
public void TriggerScriptChangedEvent(Changed val)
{
SceneObjectPart[] parts = m_parts.GetArray();
for (int i = 0; i < parts.Length; i++)
parts[i].TriggerScriptChangedEvent(val);
}
示例10: TriggerScriptChangedEvent
public void TriggerScriptChangedEvent(Changed val)
{
if (m_parentGroup != null && m_parentGroup.Scene != null)
{
m_parentGroup.Scene.EventManager.TriggerOnScriptChangedEvent(LocalId, (uint)val);
}
/*else
{
m_log.ErrorFormat("[SCENE]: Not triggering script changed event for '{0}' because {1}", this.Name, m_parentGroup == null ? "Group is null" : "Scene is null");
}
*/
}
示例11: PresentationDesignerForm
public PresentationDesignerForm(PresentationInfo aPresentationInfo)
{
m_PresentationInfo = aPresentationInfo;
m_Presentation = aPresentationInfo.CreatePresentationStub();
PresentationController.CreatePresentationController();
PresentationController.Instance.PresentationChanged = false;
PresentationChanged = new Changed(() =>
{
this.saveMenuButton.Enabled = PresentationController.Instance.PresentationChanged;
this.savePresentationToolButton.Enabled = PresentationController.Instance.PresentationChanged;
this.ChangedStatus.Visible = PresentationController.Instance.PresentationChanged;
this.ChangedStatus.Text = PresentationController.Instance.ChangedTextStatus;
});
PresentationController.Instance.OnChanged += PresentationChanged;
PresentationController.Instance.OnPresentationLockChanged += new PresentationLockChanged(Instance_OnPresentationLockChanged);
PresentationController.Instance.OnPresentationRemoved += new Changed(Instance_OnPresentationRemoved);
PresentationController.Instance.OnPresentationLockedExternally += new PresentationLockedExternally(Instance_OnPresentationLockedExternally);
PresentationController.Instance.OnPresentationUnlockedExternally += new PresentationUnlockedExternally(Instance_OnPresentationUnlockedExternally);
PresentationController.Instance.OnSlideSelectionChanged += new SlideSelectionChanged(Instance_OnSlideSelectionChanged);
PresentationController.Instance.OnOtherUserLockForShow += new SlideChanged(Instance_OnOtherUserLockForShow);
UndoService.CreateUndoService();
PresentationController.Instance.AssignPresentation(m_Presentation, m_PresentationInfo);
InitializeComponent();
RefreshTitle();
this.statusStrip.ContextMenuStrip = null;
this.ChangedStatus.Visible = false;
this.WindowState = FormWindowState.Maximized;
UndoService.Instance.OnHistoryChanged += new HistoryChanged(OnHistoryChanged);
identity = Thread.CurrentPrincipal as UserIdentity;
slideDiagram.SwitchPlayerMode(false);
toolStripEx2.Enabled = false;
PresentationController.Instance.RefreshLockingInfo();
LockingInfo li = ((PresentationInfoExt)m_PresentationInfo).LockingInfo;
if (li != null)
{
string info = String.Format(lockedByUser,
string.IsNullOrEmpty(li.UserIdentity.User.FullName) ? li.UserIdentity.User.Name : li.UserIdentity.User.FullName,
li.RequireLock == RequireLock.ForShow ? "для показа" : "для редактирования");
this.LockingStatus.Visible = true;
this.LockingStatus.Text = info;
if (li.RequireLock == RequireLock.ForShow)
{
layoutPreviewMenuButton.Enabled = false;
previewToolButton.Enabled = false;
}
}
if (layoutPreviewMenuButton.Enabled || previewToolButton.Enabled)
{
layoutPreviewMenuButton.Enabled = previewToolButton.Enabled = !LayoutController.Instance.IsShownByPlayer();
}
SlideGraphController.Instance.OnSlideHover += new EventHandler<SlideEventArgs>(Instance_OnSlideHover);
updateMenuButton.Enabled = !DesignerClient.Instance.IsStandAlone;
refreshDisplayMenuButton.Enabled = !DesignerClient.Instance.IsStandAlone;
refreshSlidesMenuButton.Enabled = !DesignerClient.Instance.IsStandAlone;
commonSourcesRefreshMenuButton.Enabled = !DesignerClient.Instance.IsStandAlone;
equipmentRefreshMenuButton.Enabled = !DesignerClient.Instance.IsStandAlone;
toXmlMenuButton.Enabled = !DesignerClient.Instance.IsStandAlone;
LayoutController.Instance.OnShownStatusChanged += new Action<bool>(Instance_OnShownStatusChanged);
layoutPreviewMenuButton.Visible = previewToolButton.Visible = !DesignerClient.Instance.IsStandAlone;
}
示例12: TriggerScriptChangedEvent
public void TriggerScriptChangedEvent(Changed val)
{
SceneObjectPart[] parts = this.GetParts();
foreach (SceneObjectPart part in parts)
part.TriggerScriptChangedEvent(val);
}
示例13: TriggerScriptChangedEvent
public void TriggerScriptChangedEvent(Changed val)
{
m_childParts.ForEachPart((SceneObjectPart part) => {
part.TriggerScriptChangedEvent(val);
});
}
示例14: CollectionManager_Changed_NotExist
public void CollectionManager_Changed_NotExist()
{
var collectionManager = new CollectionManager(null);
var changed = new Changed
{
Cleared = null,
Collection = "Test",
Fields = new Dictionary<string, JToken>() { { "StringProperty", JToken.FromObject("changed!") } },
ID = "1"
};
ExceptionAssert.Throws<InvalidOperationException>(() => collectionManager.Changed(changed));
}
示例15: UpdateingGoodsWithChanged
public bool UpdateingGoodsWithChanged(Goods g, Changed c)
{
try
{
using (TransactionScope scope = new TransactionScope())
{
c.Value = c.GoodsItemSet.Sum(x => x.Quantity);
c.SumCost = c.GoodsItemSet.Sum(p => (decimal)p.Quantity * c.PieceCost);
this.ObjectContext.SaveChanges();
g.Quantity = g.Quantity + c.Value;
this.ObjectContext.SaveChanges();
scope.Complete();
this.ObjectContext.AcceptAllChanges();
return true;
}
}
catch
{
}
return false;
}