Example #1
0
 protected override void OnSetState(Csla.Serialization.Mobile.SerializationInfo info, StateMode mode)
 {
   _username = (string)info.Values["_username"].Value;
   _password = (string)info.Values["_password"].Value;
   _roles = (string)info.Values["_roles"].Value;
   base.OnSetState(info, mode);
 }
Example #2
0
 protected override void OnGetState(Csla.Serialization.Mobile.SerializationInfo info, StateMode mode)
 {
   info.AddValue("_username", _username);
   info.AddValue("_password", _password);
   info.AddValue("_roles", _roles);
   base.OnGetState(info, mode);
 }
Example #3
0
 protected override void OnSetState(SerializationInfo info, StateMode mode)
 {
     this.Name = info.GetValue <string>("Name");
 }
 /// <summary>
 /// Override this method to insert your field values
 /// into the MobileFormatter serialzation stream.
 /// </summary>
 /// <param name="info">
 /// Object containing the data to serialize.
 /// </param>
 /// <param name="mode">
 /// The StateMode indicating why this method was invoked.
 /// </param>
 protected override void OnGetState(SerializationInfo info, StateMode mode)
 {
     info.AddValue("_bindingEdit", _bindingEdit);
     base.OnGetState(info, mode);
 }
Example #5
0
 protected override void OnSetState(SerializationInfo info, StateMode mode)
 {
     base.OnSetState(info, mode);
     _name = info.GetValue <string>("_name");
 }
Example #6
0
 protected override void OnSetState(Csla.Serialization.Mobile.SerializationInfo info, StateMode mode)
 {
     _username = (string)info.Values["_username"].Value;
     _password = (string)info.Values["_password"].Value;
     _roles    = (string)info.Values["_roles"].Value;
     base.OnSetState(info, mode);
 }
Example #7
0
 protected override void OnSetState(Csla.Serialization.Mobile.SerializationInfo info, StateMode mode)
 {
     base.OnSetState(info, mode);
     _customerId = info.GetValue <int>("_customerId");
 }
Example #8
0
    /// <summary>
    /// Sets the state of the object from serialization.
    /// </summary>
    /// <param name="info">Serialization state</param>
    /// <param name="mode">Serialization mode</param>
    protected override void OnSetState(SerializationInfo info, StateMode mode)
    {
      if (mode == StateMode.Serialization)
      {
        _stateStack.Clear();

        if (info.Values.ContainsKey("_stateStack"))
        {
          //string xml = info.GetValue<string>("_stateStack");
          byte[] xml = info.GetValue<byte[]>("_stateStack");
          MobileList<SerializationInfo> list = (MobileList<SerializationInfo>)MobileFormatter.Deserialize(xml);
          SerializationInfo[] layers = list.ToArray();
          Array.Reverse(layers);
          foreach (SerializationInfo layer in layers)
            _stateStack.Push(layer);
        }
      }

      _bindingEdit = info.GetValue<bool>("_bindingEdit");
      base.OnSetState(info, mode);
    }
Example #9
0
    /// <summary>
    /// Override this method to retrieve your field values
    /// from the MobileFormatter serialzation stream.
    /// </summary>
    /// <param name="info">
    /// Object containing the data to serialize.
    /// </param>
    /// <param name="mode">
    /// The StateMode indicating why this method was invoked.
    /// </param>
    protected override void OnSetState(SerializationInfo info, StateMode mode)
    {
      _stateStack.Clear();

      _bindingEdit = info.GetValue<bool>("_bindingEdit");
      base.OnSetState(info, mode);
    }
Example #10
0
    /// <summary>
    /// Override this method to retrieve your field values
    /// from the MobileFormatter serialzation stream.
    /// </summary>
    /// <param name="info">
    /// Object containing the data to serialize.
    /// </param>
    /// <param name="mode">
    /// The StateMode indicating why this method was invoked.
    /// </param>
    protected override void OnSetState(SerializationInfo info, StateMode mode)
    {
      _processThroughPriority = info.GetValue<int>("_processThroughPriority");
      _ruleSet = info.GetValue<string>("_ruleSet");
      _cascadeOnDirtyProperties = info.GetValue<bool>("_cascadeWhenChanged");
      //_isBusy = info.GetValue<bool>("_isBusy");
#if SILVERLIGHT || NETFX_CORE
      if (mode == StateMode.Serialization)
      {
        _stateStack.Clear();

        if (info.Values.ContainsKey("_stateStack"))
        {
          byte[] xml = info.GetValue<byte[]>("_stateStack");
          MobileList<SerializationInfo> list = (MobileList<SerializationInfo>)MobileFormatter.Deserialize(xml);
          SerializationInfo[] layers = list.ToArray();
          Array.Reverse(layers);
          foreach (SerializationInfo layer in layers)
            _stateStack.Push(layer);
        }
      }
#endif
      base.OnSetState(info, mode);
    }
Example #11
0
        /// <summary>
        /// Override this method to retrieve your field values
        /// from the MobileFormatter serialzation stream.
        /// </summary>
        /// <param name="info">
        /// Object containing the data to serialize.
        /// </param>
        /// <param name="mode">
        /// The StateMode indicating why this method was invoked.
        /// </param>
        protected override void OnSetState(SerializationInfo info, StateMode mode)
        {
            _ruleName = info.GetValue<string>("_ruleName");
              _description = info.GetValue<string>("_description");
              _property = info.GetValue<string>("_property");
              _severity = info.GetValue<RuleSeverity>("_severity");
              _originProperty = info.GetValue<string>("_originProperty");

              base.OnSetState(info, mode);
        }
Example #12
0
 internal static extern bool ilDisable(StateMode Mode);
Example #13
0
 protected override void OnGetState(SerializationInfo info, StateMode mode)
 {
     info.AddValue("Name", Name);
 }
 protected override void OnSetState(SerializationInfo info, StateMode mode)
 {
     base.OnSetState(info, mode);
     Result = info.GetValue <bool>("Result");
 }
    //ノード初期化 TODO:最適化
    private void Init()
    {
        //ステートがアニメーションならば
        if (o.GetComponent <AnimationState>() != null)
        {
            var cla = o.GetComponent <AnimationState>();
            states    = cla.characterProperty.States;
            stateMode = StateMode.Animation;
        }
        //ノーマル(UIとか)
        else if (o.GetComponent <StateMachineMonoBehaiviour>() != null)
        {
            var cla = o.GetComponent <StateMachineMonoBehaiviour>();
            states = cla.states;
        }
        else
        {
            return;
        }
        if (states.Count == 0)
        {
            return;
        }

        nodeDictionary = new Dictionary <string, Node>();
        //playModeStateChangedイベントにメソッド登録
        EditorApplication.playModeStateChanged += OnChangedPlayMode;//プレイモードの変更時メソッド
        stateClass = o.GetComponent <StateMachineMonoBehaiviour>();
        int id = 0;

        foreach (StateString ss in states)
        {
            nodeDictionary.Add(ss.getStateName(), new Node(ss.getStateName(), ss.nodePosition, id, ss, o));
            id++;                                        //ウィンドウID
        }
        root = nodeDictionary[states[0].getStateName()]; //基底ノード

        //ステートを見て関係を格納
        foreach (StateJudge judge in states[0].stateJudges)
        {
            if (nodeDictionary[judge.nextState] != null)
            {
                root.childs.Add(nodeDictionary[judge.nextState]);
            }
        }
        for (int i = 1; i < states.Count; i++)
        {
            Node nowNode = nodeDictionary[states[i].getStateName()];
            if (states[i].stateJudges.Count > 0)
            {
                foreach (StateJudge judge in states[i].stateJudges)
                {
                    if (nodeDictionary[judge.nextState] != null)
                    {
                        nowNode.childs.Add(nodeDictionary[judge.nextState]);
                    }
                }
            }
        }
        stateBuffer = states;
    }
Example #16
0
 public State(PacketStream stream, StateMode mode)
 {
     throw new NotImplementedException();
 }
Example #17
0
 private void atContinue()
 {
     atReadyActiveState();
     stateMode = StateMode.Active;
 }
Example #18
0
 public void doChangeThisStateToFinished()
 {
     Debugger.printLog("doChangeThisStateToFinished: " + name);
     stateMode = StateMode.Finished;
 }
Example #19
0
 protected override void OnSetState(SerializationInfo info, StateMode mode)
 {
     Name = info.GetValue<string>("Name");
       base.OnSetState(info, mode);
 }
Example #20
0
 protected override void OnSetState(SerializationInfo info, StateMode mode)
 {
     base.OnSetState(info, mode);
     if (info.Values.ContainsKey("OrderId"))
     {
         _bag["OrderId"] = info.GetValue <System.Int32>("OrderId");
     }
     if (info.Values.ContainsKey("UserId"))
     {
         _bag["UserId"] = info.GetValue <System.String>("UserId");
     }
     if (info.Values.ContainsKey("OrderDate"))
     {
         _bag["OrderDate"] = info.GetValue <System.DateTime>("OrderDate");
     }
     if (info.Values.ContainsKey("ShipAddr1"))
     {
         _bag["ShipAddr1"] = info.GetValue <System.String>("ShipAddr1");
     }
     if (info.Values.ContainsKey("ShipAddr2"))
     {
         _bag["ShipAddr2"] = info.GetValue <System.String>("ShipAddr2");
     }
     if (info.Values.ContainsKey("ShipCity"))
     {
         _bag["ShipCity"] = info.GetValue <System.String>("ShipCity");
     }
     if (info.Values.ContainsKey("ShipState"))
     {
         _bag["ShipState"] = info.GetValue <System.String>("ShipState");
     }
     if (info.Values.ContainsKey("ShipZip"))
     {
         _bag["ShipZip"] = info.GetValue <System.String>("ShipZip");
     }
     if (info.Values.ContainsKey("ShipCountry"))
     {
         _bag["ShipCountry"] = info.GetValue <System.String>("ShipCountry");
     }
     if (info.Values.ContainsKey("BillAddr1"))
     {
         _bag["BillAddr1"] = info.GetValue <System.String>("BillAddr1");
     }
     if (info.Values.ContainsKey("BillAddr2"))
     {
         _bag["BillAddr2"] = info.GetValue <System.String>("BillAddr2");
     }
     if (info.Values.ContainsKey("BillCity"))
     {
         _bag["BillCity"] = info.GetValue <System.String>("BillCity");
     }
     if (info.Values.ContainsKey("BillState"))
     {
         _bag["BillState"] = info.GetValue <System.String>("BillState");
     }
     if (info.Values.ContainsKey("BillZip"))
     {
         _bag["BillZip"] = info.GetValue <System.String>("BillZip");
     }
     if (info.Values.ContainsKey("BillCountry"))
     {
         _bag["BillCountry"] = info.GetValue <System.String>("BillCountry");
     }
     if (info.Values.ContainsKey("Courier"))
     {
         _bag["Courier"] = info.GetValue <System.String>("Courier");
     }
     if (info.Values.ContainsKey("TotalPrice"))
     {
         _bag["TotalPrice"] = info.GetValue <System.Decimal>("TotalPrice");
     }
     if (info.Values.ContainsKey("BillToFirstName"))
     {
         _bag["BillToFirstName"] = info.GetValue <System.String>("BillToFirstName");
     }
     if (info.Values.ContainsKey("BillToLastName"))
     {
         _bag["BillToLastName"] = info.GetValue <System.String>("BillToLastName");
     }
     if (info.Values.ContainsKey("ShipToFirstName"))
     {
         _bag["ShipToFirstName"] = info.GetValue <System.String>("ShipToFirstName");
     }
     if (info.Values.ContainsKey("ShipToLastName"))
     {
         _bag["ShipToLastName"] = info.GetValue <System.String>("ShipToLastName");
     }
     if (info.Values.ContainsKey("AuthorizationNumber"))
     {
         _bag["AuthorizationNumber"] = info.GetValue <System.Int32>("AuthorizationNumber");
     }
     if (info.Values.ContainsKey("Locale"))
     {
         _bag["Locale"] = info.GetValue <System.String>("Locale");
     }
 }
Example #21
0
 public void doContinue()
 {
     stateMode = StateMode.Continue;
 }
Example #22
0
        /// <summary>
        /// Override this method to retrieve your field values
        /// from the MobileFormatter serialzation stream.
        /// </summary>
        /// <param name="info">
        /// Object containing the data to serialize.
        /// </param>
        /// <param name="mode">
        /// The StateMode indicating why this method was invoked.
        /// </param>
        protected override void OnSetState(SerializationInfo info, StateMode mode)
        {
            string type = (string)info.Values["_businessObjectType"].Value;
            Type   businessObjecType = Csla.Reflection.MethodCaller.GetType(type);

            SetPropertyList(businessObjecType);

            if (mode == StateMode.Serialization)
            {
                _stateStack.Clear();
                if (info.Values.ContainsKey("_stateStack"))
                {
                    var stackArray = info.GetValue <byte[][]>("_stateStack");
                    foreach (var item in stackArray.Reverse())
                    {
                        _stateStack.Push(item);
                    }
                }

                _fieldData = new IFieldData[_propertyList.Count];
            }

            foreach (IPropertyInfo property in _propertyList)
            {
                if (info.Values.ContainsKey(property.Name))
                {
                    SerializationInfo.FieldData value = info.Values[property.Name];

                    IFieldData data = GetOrCreateFieldData(property);
                    if (value.Value != null &&
                        mode == StateMode.Undo &&
                        typeof(IMobileObject).IsAssignableFrom(Nullable.GetUnderlyingType(property.Type) ?? property.Type) &&
                        !typeof(IUndoableObject).IsAssignableFrom(Nullable.GetUnderlyingType(property.Type) ?? property.Type))
                    {
                        data.Value = SerializationFormatterFactory.GetFormatter().Deserialize((byte[])value.Value);
                    }
                    else
                    {
                        data.Value = value.Value;
                    }

                    if (!value.IsDirty)
                    {
                        data.MarkClean();
                    }
                }
                else if (mode == StateMode.Undo && !((property.RelationshipType & RelationshipTypes.PrivateField) == RelationshipTypes.PrivateField))
                {
                    IFieldData data = GetFieldData(property);
                    if (data != null)
                    {
                        if (!info.Values.ContainsKey("child_" + property.Name) || !info.GetValue <bool>("child_" + property.Name))
                        {
                            _fieldData[property.Index] = null;
                        }

                        // We don't want to reset children during an undo.
                        else if (!typeof(IMobileObject).IsAssignableFrom(data.Value.GetType()))
                        {
                            data.Value = property.DefaultValue;
                        }
                    }
                }
            }
            base.OnSetState(info, mode);
        }
Example #23
0
 /// <summary>
 /// Override this method to insert your field values
 /// into the MobileFormatter serialzation stream.
 /// </summary>
 /// <param name="info">
 /// Object containing the data to serialize.
 /// </param>
 /// <param name="mode">
 /// The StateMode indicating why this method was invoked.
 /// </param>
 protected override void OnGetState(SerializationInfo info, StateMode mode)
 {
   info.AddValue("_bindingEdit", _bindingEdit);
   base.OnGetState(info, mode);
 }
Example #24
0
 /// <summary>
 /// Method called by MobileFormatter when an object
 /// should be deserialized. The data should be
 /// deserialized from the SerializationInfo parameter.
 /// </summary>
 /// <param name="info">
 /// Object containing the serialized data.
 /// </param>
 /// <param name="mode">Serialization mode.</param>
 protected override void OnSetState(SerializationInfo info, StateMode mode)
 {
     _forceInit = _forceInit && false;
     base.OnSetState(info, mode);
 }
Example #25
0
 protected override void OnGetState(Csla.Serialization.Mobile.SerializationInfo info, StateMode mode)
 {
     info.AddValue("_username", _username);
     info.AddValue("_password", _password);
     info.AddValue("_roles", _roles);
     base.OnGetState(info, mode);
 }
Example #26
0
        /// <summary>
        /// Override this method to retrieve your field values
        /// from the MobileFormatter serialzation stream.
        /// </summary>
        /// <param name="info">
        /// Object containing the data to serialize.
        /// </param>
        /// <param name="mode">
        /// The StateMode indicating why this method was invoked.
        /// </param>
        protected override void OnSetState(SerializationInfo info, StateMode mode)
        {
            string type = (string)info.Values["_businessObjectType"].Value;
            Type   businessObjecType = Csla.Reflection.MethodCaller.GetType(type);

            SetPropertyList(businessObjecType);

            if (mode == StateMode.Serialization)
            {
                _stateStack.Clear();
                if (info.Values.ContainsKey("_stateStack"))
                {
                    //string xml = info.GetValue<string>("_stateStack");
                    byte[] xml = info.GetValue <byte[]>("_stateStack");
                    MobileList <SerializationInfo> list   = (MobileList <SerializationInfo>)MobileFormatter.Deserialize(xml);
                    SerializationInfo[]            layers = list.ToArray();
                    Array.Reverse(layers);
                    foreach (SerializationInfo layer in layers)
                    {
                        _stateStack.Push(layer);
                    }
                }
            }

            // Only clear this list on serialization, otherwise you'll lose
            // your children during an undo.
            if (mode == StateMode.Serialization)
            {
                _fieldData = new IFieldData[_propertyList.Count];
            }

            foreach (IPropertyInfo property in _propertyList)
            {
                if (info.Values.ContainsKey(property.Name))
                {
                    SerializationInfo.FieldData value = info.Values[property.Name];

                    IFieldData data = GetOrCreateFieldData(property);
                    if (value.Value != null &&
                        mode == StateMode.Undo &&
                        typeof(IMobileObject).IsAssignableFrom(Nullable.GetUnderlyingType(property.Type) ?? property.Type) &&
                        !typeof(IUndoableObject).IsAssignableFrom(Nullable.GetUnderlyingType(property.Type) ?? property.Type))
                    {
                        data.Value = MobileFormatter.Deserialize((byte[])value.Value);
                    }
                    else
                    {
                        data.Value = value.Value;
                    }

                    if (!value.IsDirty)
                    {
                        data.MarkClean();
                    }
                }
                else if (mode == StateMode.Undo && !((property.RelationshipType & RelationshipTypes.PrivateField) == RelationshipTypes.PrivateField))
                {
                    IFieldData data = GetFieldData(property);
                    if (data != null)
                    {
                        if (!info.Values.ContainsKey("child_" + property.Name) || !info.GetValue <bool>("child_" + property.Name))
                        {
                            _fieldData[property.Index] = null;
                        }

                        // We don't want to reset children during an undo.
                        else if (!typeof(IMobileObject).IsAssignableFrom(data.Value.GetType()))
                        {
                            data.Value = property.DefaultValue;
                        }
                    }
                }
            }

            base.OnSetState(info, mode);
        }
Example #27
0
 protected override void OnGetState(Csla.Serialization.Mobile.SerializationInfo info, StateMode mode)
 {
     base.OnGetState(info, mode);
     info.AddValue("_customerId", _customerId);
 }
Example #28
0
 public StateModeActivation GetMode(StateMode mode)
 {
     return(State_getMode(GetNativeReference(), mode));
 }
Example #29
0
 public static void RegisterForBinding(this IBindingContainer bindingContainer, StateMode stateMode)
 {
     BinderBase binder = BindingHelpers.CreateBinder(bindingContainer, stateMode);
 }
Example #30
0
 private static extern StateModeActivation State_getMode(IntPtr state_reference, StateMode mode);
Example #31
0
 protected override void OnGetState(SerializationInfo info, StateMode mode)
 {
     base.OnGetState(info, mode);
     info.AddValue("_name", _name);
 }
Example #32
0
 /// <summary>
 /// Override this method to retrieve your field values
 /// from the MobileFormatter serialzation stream.
 /// </summary>
 /// <param name="info">
 /// Object containing the data to serialize.
 /// </param>
 /// <param name="mode">
 /// The StateMode indicating why this method was invoked.
 /// </param>
 protected override void OnSetState(SerializationInfo info, StateMode mode)
 {
     base.OnSetState(info, mode);
     _value = info.GetValue <C>("Csla.Xaml.SingleCriteria._value");
 }
Example #33
0
 /// <summary>
 /// Override this method to insert your field values
 /// into the MobileFormatter serialzation stream.
 /// </summary>
 /// <param name="info">
 /// Object containing the data to serialize.
 /// </param>
 /// <param name="mode">
 /// The StateMode indicating why this method was invoked.
 /// </param>
 protected override void OnGetState(SerializationInfo info, StateMode mode)
 {
     base.OnGetState(info, mode);
     info.AddValue("Csla.Xaml.SingleCriteria._value", _value);
 }
Example #34
0
 protected virtual void OnSetState(SerializationInfo info, StateMode mode)
 {
 }
Example #35
0
    /// <summary>
    /// Override this method to insert your field values
    /// into the MobileFormatter serialzation stream.
    /// </summary>
    /// <param name="info">
    /// Object containing the data to serialize.
    /// </param>
    /// <param name="mode">
    /// The StateMode indicating why this method was invoked.
    /// </param>
    protected override void OnGetState(SerializationInfo info, StateMode mode)
    {
      info.AddValue("_processThroughPriority", _processThroughPriority);
      info.AddValue("_ruleSet", _ruleSet);
      info.AddValue("_cascadeWhenChanged", _cascadeOnDirtyProperties);
      //info.AddValue("_isBusy", _isBusy);
#if SILVERLIGHT || NETFX_CORE
      if (mode == StateMode.Serialization)
      {
        if (_stateStack.Count > 0)
        {
          MobileList<SerializationInfo> list = new MobileList<SerializationInfo>(_stateStack.ToArray());
          byte[] xml = MobileFormatter.Serialize(list);
          info.AddValue("_stateStack", xml);
        }
      }
#endif
      base.OnGetState(info, mode);
    }
Example #36
0
 /// <summary>
 /// Override this method to manually get custom field
 /// values from the serialization stream.
 /// </summary>
 /// <param name="info">Serialization info.</param>
 /// <param name="mode">Serialization mode.</param>
 protected override void OnGetState(SerializationInfo info, StateMode mode)
 {
     base.OnGetState(info, mode);
     info.AddValue("NameValuePair._key", _key);
     info.AddValue("NameValuePair._value", _value);
 }
Example #37
0
 protected override void OnGetState(SerializationInfo info, StateMode mode)
 {
     info.AddValue("Name", Name);
       base.OnGetState(info, mode);
 }
Example #38
0
 /// <summary>
 /// Override this method to manually set custom field
 /// values into the serialization stream.
 /// </summary>
 /// <param name="info">Serialization info.</param>
 /// <param name="mode">Serialization mode.</param>
 protected override void OnSetState(SerializationInfo info, StateMode mode)
 {
     base.OnSetState(info, mode);
     _key   = info.GetValue <K>("NameValuePair._key");
     _value = info.GetValue <V>("NameValuePair._value");
 }
Example #39
0
        /// <summary>
        /// Override this method to insert your field values
        /// into the MobileFormatter serialzation stream.
        /// </summary>
        /// <param name="info">
        /// Object containing the data to serialize.
        /// </param>
        /// <param name="mode">
        /// The StateMode indicating why this method was invoked.
        /// </param>
        protected override void OnGetState(SerializationInfo info, StateMode mode)
        {
            info.AddValue("_ruleName", _ruleName);
              info.AddValue("_description", _description);
              info.AddValue("_property", _property);
              info.AddValue("_severity", (int)_severity);
              info.AddValue("_originProperty", _originProperty);

              base.OnGetState(info, mode);
        }
Example #40
0
    /// <summary>
    /// Gets the state of the object for serialization.
    /// </summary>
    /// <param name="info">Serialization state</param>
    /// <param name="mode">Serialization mode</param>
    protected override void OnGetState(SerializationInfo info, StateMode mode)
    {
      if (mode == StateMode.Serialization)
      {
        if (_stateStack.Count > 0)
        {
          MobileList<SerializationInfo> list = new MobileList<SerializationInfo>(_stateStack.ToArray());
          byte[] xml = MobileFormatter.Serialize(list);
          info.AddValue("_stateStack", xml);
        }
      }

      info.AddValue("_bindingEdit", _bindingEdit);
      base.OnGetState(info, mode);
    }
Example #41
0
 protected virtual void OnSetState(SerializationInfo info, StateMode mode)
 { }
Example #42
0
 public void doPause()
 {
     stateMode = StateMode.Paused;
 }