Esempio n. 1
0
        /// <summary>
        /// Saves settings the user confirmed.
        /// </summary>
        /// <returns>Always returns <c>true</c>.</returns>
        public bool Apply()
        {
            if (this.analyzer != null)
            {
                if (this.maximumLineLengthTextBox.Text.Length == 0)
                {
                    this.analyzer.ClearSetting(
                        this.tabControl.LocalSettings,
                        Strings.MaximumLineLength);
                }
                else
                {
                    int maximumLineLength = int.Parse(
                        this.maximumLineLengthTextBox.Text,
                        CultureInfo.CurrentCulture);
                    var newIntProperty = new IntProperty(
                        this.analyzer,
                        Strings.MaximumLineLength,
                        maximumLineLength);
                    this.analyzer.SetSetting(
                        this.tabControl.LocalSettings,
                        newIntProperty);
                }
            }

            this.Dirty = false;

            return(true);
        }
Esempio n. 2
0
        public void ToString_AsExpected()
        {
            var p = new IntProperty(PropertyType.UIA_HeadingLevelPropertyId, "heading");
            var c = p == 12;

            Assert.AreEqual("heading == 12", c.ToString());
        }
        /// <summary>
        /// Refreshes the merged override state of properties on the page.
        /// </summary>
        public void RefreshSettingsOverrideState()
        {
            this.writeCacheParentProperty = this.tabControl.ParentSettings == null
                                                ? null
                                                : this.tabControl.ParentSettings.GlobalSettings.GetProperty(this.writeCachePropertyDescriptor.PropertyName) as
                                            BooleanProperty;

            this.autoUpdateParentProperty = this.tabControl.ParentSettings == null
                                                ? null
                                                : this.tabControl.ParentSettings.GlobalSettings.GetProperty(this.autoUpdateCheckPropertyDescriptor.PropertyName) as
                                            BooleanProperty;

            this.daysToCheckParentProperty = this.tabControl.ParentSettings == null
                                                 ? null
                                                 : this.tabControl.ParentSettings.GlobalSettings.GetProperty(this.daysToCheckPropertyDescriptor.PropertyName) as
                                             IntProperty;

            this.maxViolationCountParentProperty = this.tabControl.ParentSettings == null
                                                       ? null
                                                       : this.tabControl.ParentSettings.GlobalSettings.GetProperty(this.maxViolationCountPropertyDescriptor.PropertyName)
                                                   as IntProperty;

            this.cultureParentProperty = this.tabControl.ParentSettings == null
                                             ? null
                                             : this.tabControl.ParentSettings.GlobalSettings.GetProperty(this.culturePropertyDescriptor.PropertyName) as StringProperty;

            this.SetBoldState();
        }
Esempio n. 4
0
 public static void Draw(IntProperty property, GUISkin skin, int minimumValue, int maximumValue)
 {
     using (new GUILayout.HorizontalScope(skin.FindStyle("Property")))
     {
         property.SetRandomized(
             ToggleButtonDrawer.Draw(
                 new GUIContent(skin.FindStyle("RandomManualIcons").hover.background),
                 new GUIContent(skin.FindStyle("RandomManualIcons").normal.background),
                 "This property is set to manual.",
                 "This property is set to random.",
                 skin.FindStyle("ToggleButton"),
                 property.Randomized));
         if (property.Randomized)
         {
             EditorGUILayout.LabelField(property.Name, skin.label);
             property.SetMinMax(
                 IntValueDrawer.Draw(
                     new GUIContent("Min"), property.Min, minimumValue, property.Max, skin, true),
                 IntValueDrawer.Draw(
                     new GUIContent("Max"), property.Max, property.Min, maximumValue, skin, true));
         }
         else
         {
             property.SetValue(
                 IntValueDrawer.Draw(new GUIContent(property.Name),
                                     property.Value, minimumValue, maximumValue, skin, false));
         }
     }
 }
Esempio n. 5
0
 private bool InventoryEmpty(SaveComponent inventoryComponent)
 {
     for (int i = 0; i < inventoryComponent.DataFields.Count; i++)
     {
         if (inventoryComponent.DataFields[i].PropertyName == "mInventoryStacks")
         {
             ArrayProperty inventoryArray = (ArrayProperty)inventoryComponent.DataFields[i];
             for (int j = 0; j < ((ArrayProperty)inventoryComponent.DataFields[i]).Elements.Count; j++)
             {
                 StructProperty    inventoryStruct = (StructProperty)inventoryArray.Elements[j];
                 DynamicStructData inventoryItem   = (DynamicStructData)inventoryStruct.Data;
                 for (int k = 0; k < inventoryItem.Fields.Count; k++)
                 {
                     if (inventoryItem.Fields[k].PropertyName == "NumItems")
                     {
                         IntProperty itemCount = (IntProperty)inventoryItem.Fields[k];
                         if (itemCount.Value != 0)
                         {
                             return(false);
                         }
                     }
                 }
             }
             return(true);
         }
     }
     return(true);
 }
Esempio n. 6
0
        public Property <T> RegisterProperty <T>(String propertyName) where T : struct
        {
            IUpdateable property;

            if (typeof(T) == typeof(Boolean))
            {
                property = new BoolProperty(this, m_Animator, propertyName);
            }
            else if (typeof(T) == typeof(Int32))
            {
                property = new IntProperty(this, m_Animator, propertyName);
            }
            else if (typeof(T) == typeof(Single))
            {
                property = new FloatProperty(this, m_Animator, propertyName);
            }
            else if (typeof(T) == typeof(Vector3))
            {
                property = new Vector3Property(this, m_Animator, propertyName);
            }
            else
            {
                if (typeof(T) != typeof(Quaternion))
                {
                    throw new NotSupportedException("'" + typeof(T).Name + "' Type not supported!");
                }
                property = new QuaternionProperty(this, m_Animator, propertyName);
            }
            m_Properties.Add(propertyName, property);
            return((Property <T>)property);
        }
Esempio n. 7
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            ReflectedClass.CreateReflectedAssembly();

            List<ReflectedProperty> Properties = new List<ReflectedProperty>();

            IntProperty HealthProperty = new IntProperty("Health");
            Properties.Add(HealthProperty);

            FloatProperty MassProperty = new FloatProperty("Mass");
            MassProperty.Category = "Physics";
            Properties.Add(MassProperty);

            List<string> TeamValues = new List<string>(new string[] {
                "Humans",
                "Aliens",
                "Neutral",
            });
            Properties.Add(new EnumProperty("Team", "ETeam", TeamValues));

            ReflectedClass TestClass = ReflectedClass.Create("GameUnit", Properties);
            ReflectedClass.SaveReflectedAssembly();

            TestClassInstance = TestClass.Construct();
            Debug.WriteLine(TestClassInstance.ToString());

            PropertyInfo[] Members = TestClassInstance.GetType().GetProperties();
            foreach (PropertyInfo Prop in Members)
            {
                Debug.WriteLine("  {0} = {1}", Prop.Name, Prop.GetValue(TestClassInstance, null));
            }

            PropertyGridControl.SelectedObject = TestClassInstance;
        }
 protected MsmqIntegrationInputMessage(SizeQuota bufferSizeQuota)
     : base(22, bufferSizeQuota)
 {
     this.acknowledge      = new ByteProperty(this, UnsafeNativeMethods.PROPID_M_ACKNOWLEDGE);
     this.adminQueue       = new StringProperty(this, UnsafeNativeMethods.PROPID_M_ADMIN_QUEUE, initialQueueNameLength);
     this.adminQueueLength = new IntProperty(this, UnsafeNativeMethods.PROPID_M_ADMIN_QUEUE_LEN, initialQueueNameLength);
     this.appSpecific      = new IntProperty(this, UnsafeNativeMethods.PROPID_M_APPSPECIFIC);
     this.arrivedTime      = new IntProperty(this, UnsafeNativeMethods.PROPID_M_ARRIVEDTIME);
     this.senderIdType     = new IntProperty(this, UnsafeNativeMethods.PROPID_M_SENDERID_TYPE);
     this.authenticated    = new ByteProperty(this, UnsafeNativeMethods.PROPID_M_AUTHENTICATED);
     this.bodyType         = new IntProperty(this, UnsafeNativeMethods.PROPID_M_BODY_TYPE);
     this.correlationId    = new BufferProperty(this, UnsafeNativeMethods.PROPID_M_CORRELATIONID,
                                                UnsafeNativeMethods.PROPID_M_CORRELATIONID_SIZE);
     this.destinationQueue       = new StringProperty(this, UnsafeNativeMethods.PROPID_M_DEST_FORMAT_NAME, initialQueueNameLength);
     this.destinationQueueLength = new IntProperty(this, UnsafeNativeMethods.PROPID_M_DEST_FORMAT_NAME_LEN, initialQueueNameLength);
     this.extension = new BufferProperty(this, UnsafeNativeMethods.PROPID_M_EXTENSION,
                                         bufferSizeQuota.AllocIfAvailable(initialExtensionLength));
     this.extensionLength          = new IntProperty(this, UnsafeNativeMethods.PROPID_M_EXTENSION_LEN, initialExtensionLength);
     this.label                    = new StringProperty(this, UnsafeNativeMethods.PROPID_M_LABEL, initialLabelLength);
     this.labelLength              = new IntProperty(this, UnsafeNativeMethods.PROPID_M_LABEL_LEN, initialLabelLength);
     this.priority                 = new ByteProperty(this, UnsafeNativeMethods.PROPID_M_PRIORITY);
     this.responseFormatName       = new StringProperty(this, UnsafeNativeMethods.PROPID_M_RESP_FORMAT_NAME, initialQueueNameLength);
     this.responseFormatNameLength = new IntProperty(this, UnsafeNativeMethods.PROPID_M_RESP_FORMAT_NAME_LEN, initialQueueNameLength);
     this.sentTime                 = new IntProperty(this, UnsafeNativeMethods.PROPID_M_SENTTIME);
     this.timeToReachQueue         = new IntProperty(this, UnsafeNativeMethods.PROPID_M_TIME_TO_REACH_QUEUE);
     this.privacyLevel             = new IntProperty(this, UnsafeNativeMethods.PROPID_M_PRIV_LEVEL);
 }
Esempio n. 9
0
        private void reachspecSizeBox_Changed(object sender, EventArgs e)
        {
            int n = reachableNodesList.SelectedIndex;

            if (n < 0 || n >= reachSpecs.Count)
            {
                return;
            }

            if (AllowChanges)
            {
                int selectedIndex = reachSpecSizeSelector.SelectedIndex;

                IExportEntry reachSpec          = export.FileRef.Exports[reachSpecs[n]];
                Unreal.PropertyCollection props = reachSpec.GetProperties();

                IntProperty radius = props.GetProp <IntProperty>("CollisionRadius");
                IntProperty height = props.GetProp <IntProperty>("CollisionHeight");

                if (radius != null && height != null)
                {
                    int radVal    = -1;
                    int heightVal = -1;

                    Point size = getDropdownSizePair(selectedIndex);
                    radVal    = size.X;
                    heightVal = size.Y;

                    radius.Value = radVal;
                    height.Value = heightVal;
                    reachSpec.WriteProperties(props);
                    reachSpecSelection_Changed(null, null);
                }
            }
        }
 protected MsmqIntegrationInputMessage(SizeQuota bufferSizeQuota)
     : base(22, bufferSizeQuota)
 {
     this.acknowledge = new ByteProperty(this, UnsafeNativeMethods.PROPID_M_ACKNOWLEDGE);
     this.adminQueue = new StringProperty(this, UnsafeNativeMethods.PROPID_M_ADMIN_QUEUE, initialQueueNameLength);
     this.adminQueueLength = new IntProperty(this, UnsafeNativeMethods.PROPID_M_ADMIN_QUEUE_LEN, initialQueueNameLength);
     this.appSpecific = new IntProperty(this, UnsafeNativeMethods.PROPID_M_APPSPECIFIC);
     this.arrivedTime = new IntProperty(this, UnsafeNativeMethods.PROPID_M_ARRIVEDTIME);
     this.senderIdType = new IntProperty(this, UnsafeNativeMethods.PROPID_M_SENDERID_TYPE);
     this.authenticated = new ByteProperty(this, UnsafeNativeMethods.PROPID_M_AUTHENTICATED);
     this.bodyType = new IntProperty(this, UnsafeNativeMethods.PROPID_M_BODY_TYPE);
     this.correlationId = new BufferProperty(this, UnsafeNativeMethods.PROPID_M_CORRELATIONID,
                                             UnsafeNativeMethods.PROPID_M_CORRELATIONID_SIZE);
     this.destinationQueue = new StringProperty(this, UnsafeNativeMethods.PROPID_M_DEST_FORMAT_NAME, initialQueueNameLength);
     this.destinationQueueLength = new IntProperty(this, UnsafeNativeMethods.PROPID_M_DEST_FORMAT_NAME_LEN, initialQueueNameLength);
     this.extension = new BufferProperty(this, UnsafeNativeMethods.PROPID_M_EXTENSION,
                                         bufferSizeQuota.AllocIfAvailable(initialExtensionLength));
     this.extensionLength = new IntProperty(this, UnsafeNativeMethods.PROPID_M_EXTENSION_LEN, initialExtensionLength);
     this.label = new StringProperty(this, UnsafeNativeMethods.PROPID_M_LABEL, initialLabelLength);
     this.labelLength = new IntProperty(this, UnsafeNativeMethods.PROPID_M_LABEL_LEN, initialLabelLength);
     this.priority = new ByteProperty(this, UnsafeNativeMethods.PROPID_M_PRIORITY);
     this.responseFormatName = new StringProperty(this, UnsafeNativeMethods.PROPID_M_RESP_FORMAT_NAME, initialQueueNameLength);
     this.responseFormatNameLength = new IntProperty(this, UnsafeNativeMethods.PROPID_M_RESP_FORMAT_NAME_LEN, initialQueueNameLength);
     this.sentTime = new IntProperty(this, UnsafeNativeMethods.PROPID_M_SENTTIME);
     this.timeToReachQueue = new IntProperty(this, UnsafeNativeMethods.PROPID_M_TIME_TO_REACH_QUEUE);
     this.privacyLevel = new IntProperty(this, UnsafeNativeMethods.PROPID_M_PRIV_LEVEL);
 }
Esempio n. 11
0
            public override Property Copy()
            {
                var copy = new IntProperty(Info);

                copy.Value = Value;
                return(copy);
            }
        public ResponseWrapper <CreateIntPropertyModel> CreateIntProperty(CreateIntPropertyInputModel model)
        {
            var newEntity = new IntProperty
            {
                MaxValue   = model.MaxValue,
                MinValue   = model.MinValue,
                PropertyId = model.PropertyId,
                Property   =
                    new Property
                {
                    Name         = model.Property.Name,
                    PropertyType = model.Property.PropertyType,
                    EntityId     = model.Property.EntityId,
                },
            };

            context
            .IntProperties
            .Add(newEntity);

            context.SaveChanges();
            var response = new CreateIntPropertyModel
            {
                IntPropertyId = newEntity.IntPropertyId,
                MaxValue      = newEntity.MaxValue,
                MinValue      = newEntity.MinValue,
                PropertyId    = newEntity.PropertyId,
            };

            return(new ResponseWrapper <CreateIntPropertyModel>(_validationDictionary, response));
        }
Esempio n. 13
0
        public override int GetHashCode()
        {
            unchecked
            {
                // Choose large primes to avoid hashing collisions
                const int HashingBase       = (int)2166136261;
                const int HashingMultiplier = 16777619;

                int hash = HashingBase;
                hash = (hash * HashingMultiplier) ^ ByteProperty.GetHashCode();
                hash = (hash * HashingMultiplier) ^ ShortByteProperty.GetHashCode();
                hash = (hash * HashingMultiplier) ^ IntProperty.GetHashCode();
                hash = (hash * HashingMultiplier) ^ UIntProperty.GetHashCode();
                hash = (hash * HashingMultiplier) ^ ShortProperty.GetHashCode();
                hash = (hash * HashingMultiplier) ^ UShortProperty.GetHashCode();
                hash = (hash * HashingMultiplier) ^ LongProperty.GetHashCode();
                hash = (hash * HashingMultiplier) ^ ULongProperty.GetHashCode();
                hash = (hash * HashingMultiplier) ^ FloatPropertyOne.GetHashCode();
                hash = (hash * HashingMultiplier) ^ FloatPropertyTwo.GetHashCode();
                hash = (hash * HashingMultiplier) ^ DoublePropertyOne.GetHashCode();
                hash = (hash * HashingMultiplier) ^ DoublePropertyTwo.GetHashCode();
                hash = (hash * HashingMultiplier) ^ CharProperty.GetHashCode();
                hash = (hash * HashingMultiplier) ^ BoolProperty.GetHashCode();
                hash = (hash * HashingMultiplier) ^ DecimalProperty.GetHashCode();
                return(hash);
            }
        }
Esempio n. 14
0
 public void SetInt(string tag, int val)
 {
     value[tag] = new IntProperty()
     {
         value = val
     };
 }
Esempio n. 15
0
        ////////////////////////////////////////////////////////////////////////////////////////////////////

        ////////////////////////////////////////////////////////////////////////////////////////////////////
        /// <summary>   Constructs an ItemisedClass from an existing class </summary>
        /// <remarks>   The existing class must already contain an "items" property</remarks>
        /// <param name="source">  The class from which the ItemisedClass is constructed </param>
        ////////////////////////////////////////////////////////////////////////////////////////////////////
        public ItemisedClass(ConfigClass source)
            : base(source.Name, source.ParentName) {
            _items = this["items"] as IntProperty;
            foreach (ConfigProperty e in source)
                base.Add(e);
            RenumberItems();
        }
Esempio n. 16
0
 protected void EnsureSenderIdTypeProperty(int value)
 {
     if (this.senderIdType == null)
     {
         this.senderIdType = new IntProperty(this, UnsafeNativeMethods.PROPID_M_SENDERID_TYPE);
     }
     this.senderIdType.Value = value;
 }
Esempio n. 17
0
        public void Intをモデルに読み込むことができる()
        {
            var intModel = new IntProperty();

            Load(intModel, 91);

            intModel.IntValue.Value.Is(91);
        }
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

        private void AppendIntValue(ref CommandLineBuilder builder, Rule rule, IntProperty property, int value)
        {
            string switchPrefix = !string.IsNullOrWhiteSpace(property.SwitchPrefix) ? property.SwitchPrefix : rule.SwitchPrefix;

            string evaluatedSwitch = $"{switchPrefix ?? string.Empty}{property.Switch ?? string.Empty}{property.Separator ?? string.Empty}";

            builder.AppendSwitchUnquotedIfNotNull(evaluatedSwitch, $"{value}");
        }
Esempio n. 19
0
 protected void EnsureBodyTypeProperty(int value)
 {
     if (this.bodyType == null)
     {
         this.bodyType = new IntProperty(this, UnsafeNativeMethods.PROPID_M_BODY_TYPE);
     }
     this.bodyType.Value = value;
 }
Esempio n. 20
0
 public void TestSizeOfSetPropertyExistsFalse()
 {
     using (var e = new MockA11yElement())
     {
         var p = new IntProperty(PropertyType.UIA_SizeOfSetPropertyId);
         Assert.IsFalse(p.Exists.Matches(e));
     } // using
 }
Esempio n. 21
0
 public void TestPositionInSetPropertyExistsTrue()
 {
     using (var e = new MockA11yElement())
     {
         e.PositionInSet = 1;
         var p = new IntProperty(PropertyType.UIA_PositionInSetPropertyId);
         Assert.IsTrue(p.Exists.Matches(e));
     } // using
 }
Esempio n. 22
0
 protected virtual void OnEnable()
 {
     state = RedpointCenter.Instance.GetRedpointState(m_RedpointId);
     count = RedpointCenter.Instance.GetRedpointCount(m_RedpointId);
     if (state != null && count != null)
     {
         UpdateRedpoint(state.Fetch(), count.Fetch());
     }
 }
 public HeightLayerProperties()
 {
     Frequency   = new FloatProperty("Frequency", 4f);
     Amplitude   = new FloatProperty("Amplitude", 1f);
     Octaves     = new IntProperty("Octaves", 2);
     Lacunarity  = new FloatProperty("Lacunarity", 2f);
     Persistance = new FloatProperty("Persistance", 0.5f);
     Offset      = new Vector3Property("Offset");
     Opacity     = 1f;
 }
Esempio n. 24
0
        protected void EnsureTimeToReachQueueProperty(int value)
        {
            if (this.timeToReachQueue == null)
            {
                this.timeToReachQueue = new IntProperty(this,
                                                        UnsafeNativeMethods.PROPID_M_TIME_TO_REACH_QUEUE);
            }

            this.timeToReachQueue.Value = value;
        }
Esempio n. 25
0
        public Preferences(Utilities.IniFile iniFile)
        {
            m_iniFile = iniFile;

            Sensitivity = new IntProperty("global", "Sensitivity", 50);
            Axis        = new IntProperty("global", "Axis", 0);
            Modifier    = new IntProperty("global", "Modifier", 131072);

            Load();
        }
        public void TestIntPropertyExistsTrue()
        {
            using (var e = new MockA11yElement())
            {
                e.Orientation = OrientationType.None;

                var p = new IntProperty(PropertyType.UIA_OrientationPropertyId);
                Assert.IsTrue(p.Exists.Matches(e));
            } // using
        }
Esempio n. 27
0
        public Reward(IntProperty quantity, string assetName) : this()
        {
            RewardQuantity = quantity.Value;

            if (assetName.Contains(':'))
            {
                string[] parts = assetName.Split(':');
                if (parts[0].Equals("HomebaseBannerIcon", StringComparison.CurrentCultureIgnoreCase))
                {
                    Package p = Utils.GetPropertyPakPackage($"/Game/Items/BannerIcons/{parts[1]}.{parts[1]}");
                    if (p.HasExport() && !p.Equals(default))
Esempio n. 28
0
        public CompletionReward(IntProperty completionCount)
        {
            string all         = Localizations.GetLocalization("AthenaChallengeDetailsEntry", "CompletionRewardFormat_All", "Complete <text color=\"FFF\" case=\"upper\" fontface=\"black\">all {0} challenges</> to earn the reward item");
            string allFormated = ReformatString(all, completionCount.Value.ToString(), true);
            string any         = Localizations.GetLocalization("AthenaChallengeDetailsEntry", "CompletionRewardFormat", "Complete <text color=\"FFF\" case=\"upper\" fontface=\"black\">any {0} challenges</> to earn the reward item");
            string anyFormated = ReformatString(any, completionCount.Value.ToString(), false);

            CompletionText = completionCount.Value >= 0 ? anyFormated : allFormated;

            Reward = null;
        }
        public void TestIntPropertyEqualsFalse()
        {
            using (var e = new MockA11yElement())
            {
                e.HeadingLevel = HeadingLevelType.HeadingLevel1;

                var p         = new IntProperty(PropertyType.UIA_HeadingLevelPropertyId);
                var condition = p == HeadingLevelType.HeadingLevel2;
                Assert.IsFalse(condition.Matches(e));
            } // using
        }
Esempio n. 30
0
        public void OnIntChangedTest()
        {
            bool isCalled = false;

            var intProp = new IntProperty();
            var intVm   = new IntViewModel(intProp);

            intVm.OnChanged.Subscribe(x => isCalled = true);

            intVm.IntValue.Value = 24;
            isCalled.IsTrue();
        }
Esempio n. 31
0
    private void Update()
    {
        if (Input.GetKeyDown(KeyCode.A) && !dead)
        {
            life -= 10;

            if (life <= 0)
            {
                dead.SetValue(true);
            }
        }
    }
Esempio n. 32
0
            public override int GetHashCode()
            {
                int hash = 1;

                hash = hash * 17 + IntProperty.GetHashCode();
                hash = hash * 31 + StringProperty.GetHashCode();
                if (ChildrenProperty != null)
                {
                    hash = ChildrenProperty.Aggregate(hash, (current, someValueClass) => current * 13 + someValueClass.GetHashCode());
                }
                return(hash);
            }
Esempio n. 33
0
        /// <summary>
        /// Validates the properties of this object. This method should be called
        /// after initialization is complete.
        /// </summary>
        internal void Validate(this IntProperty type)
        {
            (type as BaseProperty).Validate();

            if (null != type.MaxValue && null != type.MinValue)
            {
                if (type.MinValue > type.MaxValue)
                {
                    string minValuePropertyId = GetPropertyId("MinValue", type.Name, type);
                    ErrorUtilities.ThrowArgument(Strings.MinValueShouldNotBeGreaterThanMaxValue, minValuePropertyId);
                }
            }
        }
 protected MsmqInputMessage(int additionalPropertyCount, SizeQuota bufferSizeQuota)
     : base(12 + additionalPropertyCount)
 {
     this.maxBufferSize = bufferSizeQuota.MaxSize;
     this.body = new BufferProperty(this, UnsafeNativeMethods.PROPID_M_BODY,
         bufferSizeQuota.AllocIfAvailable(initialBodySize));
     this.bodyLength = new IntProperty(this, UnsafeNativeMethods.PROPID_M_BODY_SIZE);
     this.messageId = new BufferProperty(this, UnsafeNativeMethods.PROPID_M_MSGID,
         UnsafeNativeMethods.PROPID_M_MSGID_SIZE);
     this.lookupId = new LongProperty(this, UnsafeNativeMethods.PROPID_M_LOOKUPID);
     this.cls = new ShortProperty(this, UnsafeNativeMethods.PROPID_M_CLASS);
     this.senderId = new BufferProperty(this, UnsafeNativeMethods.PROPID_M_SENDERID, initialSenderIdSize);
     this.senderIdLength = new IntProperty(this, UnsafeNativeMethods.PROPID_M_SENDERID_LEN);
     this.senderCertificate = new BufferProperty(this, UnsafeNativeMethods.PROPID_M_SENDER_CERT,
         bufferSizeQuota.AllocIfAvailable(initialCertificateSize));
     this.senderCertificateLength = new IntProperty(this, UnsafeNativeMethods.PROPID_M_SENDER_CERT_LEN);
     if (Msmq.IsAdvancedPoisonHandlingSupported)
     {
         this.lastMovedTime = new IntProperty(this, UnsafeNativeMethods.PROPID_M_LAST_MOVE_TIME);
         this.abortCount = new IntProperty(this, UnsafeNativeMethods.PROPID_M_ABORT_COUNT);
         this.moveCount = new IntProperty(this, UnsafeNativeMethods.PROPID_M_MOVE_COUNT);
     }
 }
Esempio n. 35
0
 private static bool SaveIntProperty(XmlNode rootNode, IntProperty property, string propertyName)
 {
     XmlNode newChild = rootNode.OwnerDocument.CreateElement("IntegerProperty");
     rootNode.AppendChild(newChild);
     XmlAttribute node = rootNode.OwnerDocument.CreateAttribute("Name");
     node.Value = propertyName;
     newChild.Attributes.Append(node);
     newChild.InnerText = property.Value.ToString(CultureInfo.InvariantCulture);
     return true;
 }
Esempio n. 36
0
 ////////////////////////////////////////////////////////////////////////////////////////////////////
 /// <summary>   Visit int property. </summary>
 /// <param name="node"> The node. </param>
 ////////////////////////////////////////////////////////////////////////////////////////////////////
 protected virtual void VisitIntProperty(IntProperty node) {
     //nothing to be done for basic type
 }
Esempio n. 37
0
        /// <summary>
        /// Saves the given int property into the given node.
        /// </summary>
        /// <param name="rootNode">The node under which to store the new property node.</param>
        /// <param name="property">The property to save.</param>
        /// <param name="propertyName">The name of the property.</param>
        /// <returns>Returns true if the property was written.</returns>
        private static bool SaveIntProperty(XmlNode rootNode, IntProperty property, string propertyName)
        {
            Param.AssertNotNull(rootNode, "rootNode");
            Param.AssertNotNull(property, "property");
            Param.AssertValidString(propertyName, "propertyName");

            // Create and append the root node for this property.
            XmlNode propertyNode = rootNode.OwnerDocument.CreateElement("IntegerProperty");
            rootNode.AppendChild(propertyNode);

            XmlAttribute propertyNameAttribute = rootNode.OwnerDocument.CreateAttribute("Name");
            propertyNameAttribute.Value = propertyName;
            propertyNode.Attributes.Append(propertyNameAttribute);

            // Add the value.
            int propertyValue = property.Value;
            propertyNode.InnerText = propertyValue.ToString(CultureInfo.InvariantCulture);

            return true;
        }
Esempio n. 38
0
 ////////////////////////////////////////////////////////////////////////////////////////////////////
 /// <summary>   Visit configuration int. </summary>
 /// <remarks>   Neil MacMullen, 18/02/2011. </remarks>
 /// <param name="node"> The node. </param>
 ////////////////////////////////////////////////////////////////////////////////////////////////////
 protected override void VisitIntProperty(IntProperty node) {
     AppendLineIndented(node.Name + "=" + TextFile.ToString(node.Value) + ";");
     base.VisitIntProperty(node);
 }
    /// <summary>
    /// Initializes the options panel values just before the panel is shown to user for the first time.
    /// </summary>
    /// <returns>The options panel widget.</returns>
    /// <remarks>Will only be called if the user really gets to see the options panel.</remarks>
    public override Control CreatePanelWidget()
    {
      // Get the write cache setting.
      this.writeCachePropertyDescriptor = this.SettingsHandler.Core.PropertyDescriptors["WriteCache"] as PropertyDescriptor<bool>;

      this.writeCacheParentProperty = this.SettingsHandler.ParentSettings == null
                                        ? null
                                        : this.SettingsHandler.ParentSettings.GlobalSettings.GetProperty(this.writeCachePropertyDescriptor.PropertyName) as
                                          BooleanProperty;

      BooleanProperty mergedWriteCacheProperty = this.SettingsHandler.MergedSettings == null
                                                  ? null
                                                  : this.SettingsHandler.MergedSettings.GlobalSettings.GetProperty(this.writeCachePropertyDescriptor.PropertyName) as
                                                    BooleanProperty;

      this.enableCacheCheckBox.Active = mergedWriteCacheProperty == null ? this.writeCachePropertyDescriptor.DefaultValue : mergedWriteCacheProperty.Value;

      // Errors As Warnings
      this.violationsAsErrorsPropertyDescriptor = this.SettingsHandler.Core.PropertyDescriptors["ViolationsAsErrors"] as PropertyDescriptor<bool>;

      this.violationsAsErrorsParentProperty = this.SettingsHandler.ParentSettings == null
                                          ? null
                                          : this.SettingsHandler.ParentSettings.GlobalSettings.GetProperty(this.violationsAsErrorsPropertyDescriptor.PropertyName) as
                                            BooleanProperty;

      BooleanProperty mergedViolationsAsErrorsProperty = this.SettingsHandler.MergedSettings == null
                                                          ? null
                                                          : this.SettingsHandler.MergedSettings.GlobalSettings.GetProperty(
                                                           this.violationsAsErrorsPropertyDescriptor.PropertyName) as BooleanProperty;

      this.violationsAsErrorsCheckBox.Active = mergedViolationsAsErrorsProperty == null
                                                    ? this.violationsAsErrorsPropertyDescriptor.DefaultValue
                                                    : mergedViolationsAsErrorsProperty.Value;

      // Get the max violation count setting
      this.maxViolationCountPropertyDescriptor = this.SettingsHandler.Core.PropertyDescriptors["MaxViolationCount"] as PropertyDescriptor<int>;

      this.maxViolationCountParentProperty = this.SettingsHandler.ParentSettings == null
                                              ? null
                                              : this.SettingsHandler.ParentSettings.GlobalSettings.GetProperty(this.maxViolationCountPropertyDescriptor.PropertyName) as
                                                IntProperty;

      IntProperty mergedMaxViolationCountProperty = this.SettingsHandler.MergedSettings == null
                                                      ? null
                                                      : this.SettingsHandler.MergedSettings.GlobalSettings.GetProperty(
                                                      this.maxViolationCountPropertyDescriptor.PropertyName) as IntProperty;

      this.maxViolationCountSpinButton.Value = Convert.ToDouble(mergedMaxViolationCountProperty == null
                                                ? this.maxViolationCountPropertyDescriptor.DefaultValue.ToString(CultureInfo.InvariantCulture)
                                                : mergedMaxViolationCountProperty.Value.ToString(CultureInfo.InvariantCulture));

      // Get the culture setting
      this.culturePropertyDescriptor = this.SettingsHandler.Core.PropertyDescriptors["Culture"] as PropertyDescriptor<string>;

      this.cultureParentProperty = this.SettingsHandler.ParentSettings == null
                                    ? null
                                    : this.SettingsHandler.ParentSettings.GlobalSettings.GetProperty(this.culturePropertyDescriptor.PropertyName) as StringProperty;

      StringProperty mergedCultureProperty = this.SettingsHandler.MergedSettings == null
                                              ? null
                                              : this.SettingsHandler.MergedSettings.GlobalSettings.GetProperty(this.culturePropertyDescriptor.PropertyName) as
                                                StringProperty;

      int cultureComboBoxIndex = this.cultureComboBoxValues.IndexOf(mergedCultureProperty == null
                                  ? this.culturePropertyDescriptor.DefaultValue.ToString(CultureInfo.InvariantCulture)
                                  : mergedCultureProperty.Value.ToString(CultureInfo.InvariantCulture));
      Gtk.TreeIter cultureIter;
      this.cultureComboBox.Model.IterNthChild(out cultureIter, cultureComboBoxIndex);
      this.cultureComboBox.SetActiveIter(cultureIter);

      return base.CreatePanelWidget();
    }
Esempio n. 40
0
 ////////////////////////////////////////////////////////////////////////////////////////////////////
 /// <summary>   Constructs a new ItemisedClass from scratch </summary>
 /// <remarks>  The items property is automatically added to the new class</remarks>
 /// <param name="name"> The name of the class. </param>
 ////////////////////////////////////////////////////////////////////////////////////////////////////
 public ItemisedClass(string name)
     : base(name, "") {
     _items = new IntProperty("items", 0);
     base.Add(_items);
 }
        /// <summary>
        /// Refreshes the merged override state of properties on the page.
        /// </summary>
        public void RefreshSettingsOverrideState()
        {
            this.writeCacheParentProperty = this.tabControl.ParentSettings == null
                                                ? null
                                                : this.tabControl.ParentSettings.GlobalSettings.GetProperty(this.writeCachePropertyDescriptor.PropertyName) as
                                                  BooleanProperty;

            this.autoUpdateParentProperty = this.tabControl.ParentSettings == null
                                                ? null
                                                : this.tabControl.ParentSettings.GlobalSettings.GetProperty(this.autoUpdateCheckPropertyDescriptor.PropertyName) as
                                                  BooleanProperty;

            this.daysToCheckParentProperty = this.tabControl.ParentSettings == null
                                                 ? null
                                                 : this.tabControl.ParentSettings.GlobalSettings.GetProperty(this.daysToCheckPropertyDescriptor.PropertyName) as
                                                   IntProperty;

            this.maxViolationCountParentProperty = this.tabControl.ParentSettings == null
                                                       ? null
                                                       : this.tabControl.ParentSettings.GlobalSettings.GetProperty(this.maxViolationCountPropertyDescriptor.PropertyName)
                                                         as IntProperty;

            this.cultureParentProperty = this.tabControl.ParentSettings == null
                                             ? null
                                             : this.tabControl.ParentSettings.GlobalSettings.GetProperty(this.culturePropertyDescriptor.PropertyName) as StringProperty;

            this.SetBoldState();
        }
        /// <summary>
        /// Initializes the page.
        /// </summary>
        /// <param name="propertyControl">The tab control object.</param>
        public void Initialize(PropertyControl propertyControl)
        {
            Param.AssertNotNull(propertyControl, "propertyControl");

            this.tabControl = propertyControl;

            // Get the cache setting.
            this.writeCachePropertyDescriptor = this.tabControl.Core.PropertyDescriptors["WriteCache"] as PropertyDescriptor<bool>;

            this.writeCacheParentProperty = this.tabControl.ParentSettings == null
                                                ? null
                                                : this.tabControl.ParentSettings.GlobalSettings.GetProperty(this.writeCachePropertyDescriptor.PropertyName) as
                                                  BooleanProperty;

            var mergedWriteCacheProperty = this.tabControl.MergedSettings == null
                                               ? null
                                               : this.tabControl.MergedSettings.GlobalSettings.GetProperty(this.writeCachePropertyDescriptor.PropertyName) as
                                                 BooleanProperty;

            this.enableCache.Checked = mergedWriteCacheProperty == null ? this.writeCachePropertyDescriptor.DefaultValue : mergedWriteCacheProperty.Value;

            this.autoUpdateCheckPropertyDescriptor = this.tabControl.Core.PropertyDescriptors["AutoCheckForUpdate"] as PropertyDescriptor<bool>;

            this.autoUpdateParentProperty = this.tabControl.ParentSettings == null
                                                ? null
                                                : this.tabControl.ParentSettings.GlobalSettings.GetProperty(this.autoUpdateCheckPropertyDescriptor.PropertyName) as
                                                  BooleanProperty;

            var mergedAutoUpdateProperty = this.tabControl.MergedSettings == null
                                               ? null
                                               : this.tabControl.MergedSettings.GlobalSettings.GetProperty(this.autoUpdateCheckPropertyDescriptor.PropertyName) as
                                                 BooleanProperty;

            this.autoUpdateCheckBox.Checked = mergedAutoUpdateProperty == null ? this.autoUpdateCheckPropertyDescriptor.DefaultValue : mergedAutoUpdateProperty.Value;

            this.daysToCheckPropertyDescriptor = this.tabControl.Core.PropertyDescriptors["DaysToCheckForUpdates"] as PropertyDescriptor<int>;

            this.daysToCheckParentProperty = this.tabControl.ParentSettings == null
                                                 ? null
                                                 : this.tabControl.ParentSettings.GlobalSettings.GetProperty(this.daysToCheckPropertyDescriptor.PropertyName) as
                                                   IntProperty;

            var mergedDaysToCheckProperty = this.tabControl.MergedSettings == null
                                                ? null
                                                : this.tabControl.MergedSettings.GlobalSettings.GetProperty(this.daysToCheckPropertyDescriptor.PropertyName) as
                                                  IntProperty;

            this.daysMaskedTextBox.Text = mergedDaysToCheckProperty == null
                                              ? this.daysToCheckPropertyDescriptor.DefaultValue.ToString(CultureInfo.InvariantCulture)
                                              : mergedDaysToCheckProperty.Value.ToString(CultureInfo.InvariantCulture);

            this.maxViolationCountPropertyDescriptor = this.tabControl.Core.PropertyDescriptors["MaxViolationCount"] as PropertyDescriptor<int>;

            this.maxViolationCountParentProperty = this.tabControl.ParentSettings == null
                                                       ? null
                                                       : this.tabControl.ParentSettings.GlobalSettings.GetProperty(this.maxViolationCountPropertyDescriptor.PropertyName)
                                                         as IntProperty;

            var mergedMaxViolationCountProperty = this.tabControl.MergedSettings == null
                                                      ? null
                                                      : this.tabControl.MergedSettings.GlobalSettings.GetProperty(this.maxViolationCountPropertyDescriptor.PropertyName)
                                                        as IntProperty;

            this.maxViolationCountMaskedTextBox.Text = mergedMaxViolationCountProperty == null
                                                           ? this.maxViolationCountPropertyDescriptor.DefaultValue.ToString(CultureInfo.InvariantCulture)
                                                           : mergedMaxViolationCountProperty.Value.ToString(CultureInfo.InvariantCulture);

            // Culture
            this.culturePropertyDescriptor = this.tabControl.Core.PropertyDescriptors["Culture"] as PropertyDescriptor<string>;

            this.cultureParentProperty = this.tabControl.ParentSettings == null
                                             ? null
                                             : this.tabControl.ParentSettings.GlobalSettings.GetProperty(this.culturePropertyDescriptor.PropertyName) as StringProperty;

            var mergedCultureProperty = this.tabControl.MergedSettings == null
                                            ? null
                                            : this.tabControl.MergedSettings.GlobalSettings.GetProperty(this.culturePropertyDescriptor.PropertyName) as StringProperty;

            this.cultureComboBox.SelectedIndex =
                this.cultureComboBox.FindStringExact(
                    mergedCultureProperty == null
                        ? this.culturePropertyDescriptor.DefaultValue.ToString(CultureInfo.InvariantCulture)
                        : mergedCultureProperty.Value.ToString(CultureInfo.InvariantCulture));

            this.SetBoldState();

            // Reset the dirty flag to false now.
            this.dirty = false;
            this.tabControl.DirtyChanged();
        }
Esempio n. 43
0
 public PrivateComputerProperties()
     : base(2)
 {
     this.version = new IntProperty(this, UnsafeNativeMethods.PROPID_PC_VERSION);
     this.activeDirectory = new BooleanProperty(this, UnsafeNativeMethods.PROPID_PC_DS_ENABLED);
 }
 public MsmqRetryQueueMessage()
     : base(2)
 {
     this.lookupId = new LongProperty(this, UnsafeNativeMethods.PROPID_M_LOOKUPID);
     this.lastMoveTime = new IntProperty(this, UnsafeNativeMethods.PROPID_M_LAST_MOVE_TIME);
 }
Esempio n. 45
0
 public static void GetElementTypeString(IntProperty obj, MethodReturnEventArgs<string> e)
 {
     e.Result = "int";
     PropertyActions.DecorateElementType(obj, e, true);
 }
Esempio n. 46
0
 public static void GetPropertyType(IntProperty obj, MethodReturnEventArgs<Type> e)
 {
     e.Result = typeof(int);
     PropertyActions.DecorateParameterType(obj, e, true, obj.IsList, obj.HasPersistentOrder);
 }
Esempio n. 47
0
 public static void GetPropertyTypeString(IntProperty obj, MethodReturnEventArgs<string> e)
 {
     GetElementTypeString(obj, e);
     PropertyActions.DecorateParameterType(obj, e, true, obj.IsList, obj.HasPersistentOrder);
 }
        /// <summary>
        /// Saves settings the user confirmed.
        /// </summary>
        /// <returns>Always returns <c>true</c>.</returns>
        public bool Apply()
        {
            if (this.analyzer != null)
            {
                if (this.maximumLineLengthTextBox.Text.Length == 0)
                {
                    this.analyzer.ClearSetting(
                        this.tabControl.LocalSettings,
                        Strings.MaximumLineLength);
                }
                else
                {
                    int maximumLineLength = int.Parse(
                        this.maximumLineLengthTextBox.Text,
                        CultureInfo.CurrentCulture);
                    var newIntProperty = new IntProperty(
                        this.analyzer,
                        Strings.MaximumLineLength,
                        maximumLineLength);
                    this.analyzer.SetSetting(
                        this.tabControl.LocalSettings,
                        newIntProperty);
                }
            }

            this.Dirty = false;

            return true;
        }