本文整理汇总了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());
}
开发者ID:Lavan,项目名称:DdpNet,代码行数:28,代码来源:CollectionManagerTests.cs
示例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());
}
开发者ID:Lavan,项目名称:DdpNet,代码行数:16,代码来源:ChangedHandlerTests.cs
示例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;
}
开发者ID:eavia,项目名称:tts,代码行数:21,代码来源:GoodsLogic.cs
示例4: TriggerScriptChangedEvent
public void TriggerScriptChangedEvent(Changed val)
{
foreach (SceneObjectPart part in ChildrenList)
{
part.TriggerScriptChangedEvent(val);
}
}
开发者ID:KristenMynx,项目名称:Aurora-Sim,代码行数:7,代码来源:SceneObjectGroup.cs
示例5: TriggerScriptChangedEvent
public void TriggerScriptChangedEvent(Changed val)
{
if (ParentGroup != null && ParentGroup.Scene != null)
ParentGroup.Scene.EventManager.TriggerOnScriptChangedEvent(LocalId, (uint)val);
}
开发者ID:justasabc,项目名称:opensim,代码行数:5,代码来源:SceneObjectPart.cs
示例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;
}
开发者ID:soluclea,项目名称:LoonaProject,代码行数:8,代码来源:MadAtlasBrowser.cs
示例7: TriggerScriptChangedEvent
public void TriggerScriptChangedEvent(Changed val)
{
if (m_parentGroup != null && m_parentGroup.Scene != null)
m_parentGroup.Scene.EventManager.TriggerOnScriptChangedEvent(this, (uint)val);
}
开发者ID:KristenMynx,项目名称:Aurora-Sim,代码行数:5,代码来源:SceneObjectPart.cs
示例8: SendScriptEventToAllAttachments
private void SendScriptEventToAllAttachments(Changed c)
{
IAttachmentsModule attMod = Scene.RequestModuleInterface<IAttachmentsModule>();
if (attMod != null)
attMod.SendScriptEventToAttachments(UUID, "changed", new Object[] {c});
}
开发者ID:emperorstarfinder,项目名称:My-Aurora-Sim,代码行数:6,代码来源:ScenePresence.cs
示例9: TriggerScriptChangedEvent
public void TriggerScriptChangedEvent(Changed val)
{
SceneObjectPart[] parts = m_parts.GetArray();
for (int i = 0; i < parts.Length; i++)
parts[i].TriggerScriptChangedEvent(val);
}
开发者ID:justasabc,项目名称:opensim75grid,代码行数:6,代码来源:SceneObjectGroup.cs
示例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");
}
*/
}
开发者ID:kf6kjg,项目名称:halcyon,代码行数:12,代码来源:SceneObjectPart.cs
示例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;
}
开发者ID:AlexSneg,项目名称:VIRD-1.0,代码行数:70,代码来源:PresentationDesignerForm.cs
示例12: TriggerScriptChangedEvent
public void TriggerScriptChangedEvent(Changed val)
{
SceneObjectPart[] parts = this.GetParts();
foreach (SceneObjectPart part in parts)
part.TriggerScriptChangedEvent(val);
}
开发者ID:zwagoth,项目名称:halcyon,代码行数:7,代码来源:SceneObjectGroup.cs
示例13: TriggerScriptChangedEvent
public void TriggerScriptChangedEvent(Changed val)
{
m_childParts.ForEachPart((SceneObjectPart part) => {
part.TriggerScriptChangedEvent(val);
});
}
开发者ID:kf6kjg,项目名称:halcyon,代码行数:6,代码来源:SceneObjectGroup.cs
示例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));
}
开发者ID:Lavan,项目名称:DdpNet,代码行数:14,代码来源:CollectionManagerTests.cs
示例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;
}
开发者ID:eavia,项目名称:tts,代码行数:25,代码来源:GoodsLogic.cs
注:本文中的Changed类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论