コード例 #1
0
ファイル: DataStore.cs プロジェクト: zmyer/service-fabric
            public ListElement(long id, T value, string traceType, ListElementState state = ListElementState.Invalid)
            {
                this.traceType = traceType;

                if (id == ForbiddenId)
                {
                    TestableAssertHelper.FailInvalidOperation(this.traceType, "DataStore.ListElement", "id == ForbiddenId: {0}", ForbiddenId);
                }

                this.id       = id;
                this.value    = value;
                this.State    = state;
                this.Next     = null;
                this.Previous = null;
                this.DequeueCommittingTransaction = null;
                this.stateMachineLock             = new object();
            }
コード例 #2
0
ファイル: DataStore.cs プロジェクト: zmyer/service-fabric
            private void TransitionToState(ListElementState targetState, ListElementState allowedCurrentState)
            {
                lock (this.stateMachineLock)
                {
                    if (allowedCurrentState != this.State)
                    {
                        throw new InvalidOperationException(
                                  string.Format(
                                      "Invalid listElement state transition. \n\tCurrent state: {0}\n\tTarget state: {1}\n\tAllowed current state: {2}",
                                      this.State,
                                      targetState,
                                      allowedCurrentState));
                    }

                    this.State = targetState;
                }
            }
コード例 #3
0
ファイル: DataStore.cs プロジェクト: zmyer/service-fabric
 public static IListElement <T> CreateQueueListElement(long id, T value, string traceType, ListElementState state = ListElementState.Invalid)
 {
     return(new ListElement(id, value, traceType, state));
 }