當前位置: 首頁>>代碼示例>>C#>>正文


C# Changed類代碼示例

本文整理匯總了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;未經允許,請勿轉載。