Exemplo n.º 1
0
 //- $LoadControlData -//
 private static void LoadControlData(StringKeyValueMap stringKeyValueMap, String blogState)
 {
     var map = new Base64StorableMap(blogState);
     map.GetKeyList().ForEach((controlKey) =>
                              {
                                  String controlId = map[controlKey];
                                  String value = Http.Form.Get(controlId);
                                  //+ re-register
                                  StateTracker.Set(StateEntryType.ControlId, controlKey, controlId);
                                  //+ load
                                  if (!String.IsNullOrEmpty(value))
                                  {
                                      stringKeyValueMap.Add(controlKey, new StringKeyValue
                                                                        {
                                                                            Key = controlId,
                                                                            Value = value
                                                                        });
                                  }
                                  else
                                  {
                                      stringKeyValueMap.Add(controlKey, new StringKeyValue
                                                                        {
                                                                            Key = controlId,
                                                                            Value = null
                                                                        });
                                  }
                              });
 }
Exemplo n.º 2
0
 //- @OnInitProcessorExecute -//
 public override InitProcessor Execute()
 {
     StateTracker.InitState();
     if (Http.Method != HttpVerbs.Post)
     {
         return null;
     }
     //+ message
     String message = Http.Form.Get("__THEMELIAMESSAGE");
     if (!String.IsNullOrEmpty(message))
     {
         Int32 hashPosition = message.IndexOf("#");
         if (hashPosition > -1)
         {
             String messageParameterSeries = message.Substring(hashPosition + 1, message.Length - hashPosition - 1);
             StateTracker.PostedMessageParameterArray = messageParameterSeries.Split('#');
             message = message.Substring(0, hashPosition);
         }
         StateTracker.PostedMessage = message.Replace("@", "::");
         StateTracker.Message = StateTracker.PostedMessage;
     }
     //+ state
     StringKeyValueMap stringKeyValueMap = new StringKeyValueMap();
     String state = Http.Form.Get("__THEMELIASTATE");
     if (!String.IsNullOrEmpty(state))
     {
         String[] partArray = GetStatePartArray(state);
         LoadControlData(stringKeyValueMap, partArray[0]);
         LoadValueData(stringKeyValueMap, partArray[1]);
     }
     StateTracker.OriginalState = stringKeyValueMap;
     //+
     return null;
 }
Exemplo n.º 3
0
 public void Init()
 {
     //PostedMessage = String.Empty;
     //Message = String.Empty;
     //OutputMessage = String.Empty;
     //ValueData = new Nalarium.Data.Base64StorableMap();
     //ControlData = new Nalarium.Data.Base64StorableMap();
     //+
     if (Http.Method != HttpVerbs.Post)
     {
         return;
     }
     //+ message
     String message = Http.Form.Get("__THEMELIAMESSAGE");
     if (!String.IsNullOrEmpty(message))
     {
         Int32 hashPosition = message.IndexOf("#");
         if (hashPosition > -1)
         {
             String messageParameterSeries = message.Substring(hashPosition + 1, message.Length - hashPosition - 1);
             PostedMessageParameterArray = messageParameterSeries.Split('#');
             message = message.Substring(0, hashPosition);
         }
         PostedMessage = message.Replace("@", "::");
         Message = PostedMessage;
     }
     //+ state
     var stringKeyValueMap = new StringKeyValueMap();
     String state = Http.Form.Get("__THEMELIASTATE");
     if (!String.IsNullOrEmpty(state))
     {
         String[] partArray = GetStatePartArray(state);
         LoadControlData(stringKeyValueMap, partArray[0]);
         LoadValueData(stringKeyValueMap, partArray[1]);
     }
     StateMap = stringKeyValueMap;
 }
Exemplo n.º 4
0
 //- $LoadControlData -//
 private static void LoadValueData(StringKeyValueMap stringKeyValueMap, String blogState)
 {
     var map = new Base64StorableMap(blogState);
     map.GetKeyList().ForEach((key) => StateTracker.Set(StateEntryType.Value, key, map[key]));
 }
Exemplo n.º 5
0
 public StateData()
 {
     ValueData = new Base64StorableMap();
     ControlData = new Base64StorableMap();
     StateMap = new StringKeyValueMap();
 }