示例#1
0
 public override void GoToState(ConfigLeafNode theLeafNode, LeafState nextState)
 {
     if (nextState == LeafState.DPAPIMACHINEEncrypted) return;
     string text = _isCommitted ? "<Reset Value>" : StringContent;
     switch (nextState)
     {
         case LeafState.DPAPIUSerEncrypted :
             theLeafNode.State = new DPAPIUserState(text);
             break;
         case LeafState.Plain:
             theLeafNode.State = new PlainLeafNodeState(text);
             break;
     }
 }
 public abstract void GoToState(ConfigLeafNode theLeafNode, LeafState nextState);
        public void GoToState(ConfigLeafNode theLeafNode, LeafState nextState)
        {
            if (nextState == LeafState.Plain) return;

            EncryptedLeafNodeState newState = null;

            if (nextState == LeafState.DPAPIMACHINEEncrypted)
            {
                newState = new DPAPIMachineState(StringContent);
            }

            if (nextState == LeafState.DPAPIUSerEncrypted)
            {
                newState = new DPAPIUserState(StringContent);
            }
            theLeafNode.State = newState;
        }