Exemplo n.º 1
0
        public void Load(XPathNavigator nav, string profileMainNodeName, ProfileItemPrivacyType profileItemPrivacyType)
        {
            var navPointer = nav.Select("/" + profileMainNodeName + "/Variables/Variable");

            while (navPointer.MoveNext())
            {
                var       type     = navPointer.Current.GetAttribute("Type", navPointer.Current.NamespaceURI);
                IVariable variable = null;
                if (type == "FsuipcVariable")
                {
                    variable = new FsuipcVariable();
                }
                if (type == "MemoryPatchVariable")
                {
                    variable = new MemoryPatchVariable();
                }
                if (type == "FakeVariable")
                {
                    variable = new FakeVariable();
                }
                if (variable != null)
                {
                    variable.Load(navPointer.Current);
                    (variable as VariableBase).SetPrivacyType(profileItemPrivacyType);
                    StoreVariable(variable);
                }
            }
        }
Exemplo n.º 2
0
        private void SynchronizeFsuipcVariable(FsuipcVariable mpv)
        {
            //if (mpv.GetValueToSet()!=null && mpv.GetValueToSet() == mpv.GetValueInMemory())
            //    mpv.SetValueToSet(null);

            var vts = mpv.GetValueToSet();

            if (vts != null)
            {
                if (!_fsuipcMethodInstance.AddVariableToWrite(mpv))
                {
                    InitializeFsuipcMethod();
                    return;
                }
                mpv.SetValueToSet(null);
            }

            if (!_fsuipcMethodInstance.AddVariableToRead(mpv))
            {
                InitializeFsuipcMethod();
            }
        }
 public FsuipcVariableEditor(IVariable variable)
 {
     _editableVariable = variable as FsuipcVariable;
     Initialize();
     GetDataFromVariable();
 }