Exemple #1
0
        public Shortcut()
        {
            this.nameProp = new NameProperty();
            this.Name     = "";

            //assign the type of the shortcut
            if (this is WebPageShortcut)
            {
                this.type = ShortcutType.WebPage;
            }
            else if (this is MSEdgeShortcut)
            {
                this.type = ShortcutType.MSEdge;
            }
            else if (this is FileShortcut)
            {
                this.type = ShortcutType.File;
            }
            else if (this is FolderShortcut)
            {
                this.type = ShortcutType.Folder;
            }
            else if (this is BatchShortcut)
            {
                this.type = ShortcutType.Batch;
            }
        }
Exemple #2
0
        public Appearance(IOutputter outputter, IReadOnlyList <CProperty> appearanceProps) : base(null, outputter)
        {
            properties = appearanceProps.ToList();

            // Create any properties that aren't guaranteed to exist (some DLCs added more properties)
            if (TorsoDeco == null)
            {
                properties.Add(NameProperty.Create("nmTorsoDeco"));
            }
            if (LeftForearm == null)
            {
                properties.Add(NameProperty.Create("nmLeftForearm"));
            }
            if (RightForearm == null)
            {
                properties.Add(NameProperty.Create("nmRightForearm"));
            }
            if (LeftArmDeco == null)
            {
                properties.Add(NameProperty.Create("nmLeftArmDeco"));
            }
            if (RightArmDeco == null)
            {
                properties.Add(NameProperty.Create("nmRightArmDeco"));
            }
            if (Thighs == null)
            {
                properties.Add(NameProperty.Create("nmThighs"));
            }
        }
Exemple #3
0
        /// <summary>
        /// Horrid masterpiece
        /// </summary>
        public static void AppendFrom(this SpriteData spriteData, SpriteData appendSpriteData)
        {
            foreach (var name in appendSpriteData.SpriteNames)
            {
                if (spriteData.SpriteNames.All(s => s.Key != name.Key))
                {
                    spriteData.SpriteNames.Add(name.Key, name.Value);
                }
            }
            foreach (var category in appendSpriteData.SpriteCategories)
            {
                NameProperty.SetValue(category.Value, category.Value.Name.Replace("append_", ""));

                if (spriteData.SpriteCategories.FirstOrDefault(s => s.Value.Name == category.Value.Name) is var kvp && kvp.Value != null)
                {
                    var sheetCount = kvp.Value.SpriteSheetCount;

                    kvp.Value.SheetSizes = kvp.Value.SheetSizes.Concat(category.Value.SheetSizes).ToArray();

                    kvp.Value.SpriteParts.AddRange(category.Value.SpriteParts.Select(p =>
                    {
                        p.SheetID += sheetCount;
                        return(p);
                    }));
                    kvp.Value.SpriteSheets.AddRange(category.Value.SpriteSheets);
                }
Exemple #4
0
    public void NamePropertyTest3()
    {
        VcfRow row  = VcfRow.Parse("FN:", new VcfDeserializationInfo()) !;
        var    prop = new NameProperty(row, VCdVersion.V3_0);

        Assert.IsNotNull(prop.Value);
    }
Exemple #5
0
        public CProperty GetProperty()
        {
            // First, read the length and value of the following property name string
            int    propNameLength = GetInt();
            string propName       = GetString(propNameLength);

            SkipPadding();

            // If this is a "None" ending type property, just return - nothing else will follow this
            if (propName == "None")
            {
                return(null);
            }

            // Get the property type string
            int    typeNameLength = GetInt();
            string typeName       = GetString(typeNameLength);

            SkipPadding();

            // Skip past the size of the following data and its padding
            GetInt();
            SkipPadding();

            // Finally, read the data based on the property type
            CProperty returnProperty;

            switch (typeName)
            {
            case "ArrayProperty":
                returnProperty = new ArrayProperty(propName, this);
                break;

            case "IntProperty":
                returnProperty = new IntProperty(propName, this);
                break;

            case "StrProperty":
                returnProperty = new StrProperty(propName, this);
                break;

            case "NameProperty":
                returnProperty = new NameProperty(propName, this);
                break;

            case "StructProperty":
                returnProperty = new StructProperty(propName, this, _outputter);
                break;

            case "BoolProperty":
                returnProperty = new BoolProperty(propName, this);
                break;

            default:
                throw new Exception($"Unexpected property type: {typeName}");
            }

            returnProperty.ParseData();
            return(returnProperty);
        }
Exemple #6
0
        /// <summary>
        /// Construct the device by obtainin the device properties and the sub data.
        ///
        /// NOTE:
        /// There is a difference with the device id and the id.
        /// The id indicates the object id within the windows portable device.
        /// The device id indicates the object id within the operating system.
        ///
        /// The initial id for all windows portable devices is hard coded to "DEVICE"
        /// </summary>
        /// <param name="deviceId"></param>
        public Device(string deviceId, bool withDeviceItems = true) : base("DEVICE")
        {
            DeviceId        = deviceId;
            ComDeviceObject = new PortableDeviceClass();
            Connect();
            IPortableDeviceValues deviceProperties = ExtractDeviceProperties(ComDeviceObject);

            ContentType     = new ContentTypeProperty(deviceProperties);
            DeviceType      = new TypeProperty(deviceProperties);
            FirmwareVersion = new FirmwareVersionProperty(deviceProperties);
            FriendlyName    = new FriendlyNameProperty(deviceProperties);
            Manufacturer    = new ManufacturerProperty(deviceProperties);
            Model           = new ModelProperty(deviceProperties);
            Name            = new NameProperty(deviceProperties);
            SerialNumber    = new SerialNumberProperty(deviceProperties);

            if (withDeviceItems == true)
            {
                LoadDeviceData(ComDeviceObject);

                do
                {
                    System.Threading.Thread.Sleep(100);
                } while (UtilityHelper.threadList.Count > 0);
            }
            Disconnect();
        }
Exemple #7
0
        private bool IsInFolderList(string objectId, IPortableDeviceContent content)
        {
            bool result = false;

            DeviceContent = content;

            IPortableDeviceProperties properties;

            content.Properties(out properties);

            IPortableDeviceKeyCollection keys;

            properties.GetSupportedProperties(objectId, out keys);

            IPortableDeviceValues values;

            properties.GetValues(objectId, keys, out values);

            var theContentType = new ContentTypeProperty(values);
            var theName        = new NameProperty(values);

            if (LoadFolders.Count == 0 || LoadFolders.Contains(theName.Value.ToUpper()))
            {
                result = true;
            }

            return(result);
        }
        public void Deserialize(IMEPackage pcc)
        {
            PropertyCollection properties = pcc.Exports[Index].GetProperties();

            if (pcc.Game == MEGame.ME3)
            {
                int off = pcc.Exports[Index].propsEnd() + 8;
                ValueOffset = off;
                DataSize    = BitConverter.ToInt32(memory, off);
                DataOffset  = BitConverter.ToInt32(memory, off + 4);
            }
            else if (pcc.Game == MEGame.ME2)
            {
                int off = pcc.Exports[Index].propsEnd() + 0x28;
                ValueOffset = off;
                DataSize    = BitConverter.ToInt32(memory, off);
                DataOffset  = BitConverter.ToInt32(memory, off + 4);
            }
            NameProperty nameProp = properties.GetProp <NameProperty>("Filename");

            FileName = nameProp != null ? nameProp.Value : null;
            Id       = properties.GetProp <IntProperty>("Id");

            /*for (int i = 0; i < props.Count; i++)
             * {
             *  if (pcc.Names[props[i].Name] == "Filename")
             *      FileName = pcc.Names[props[i].Value.IntValue];
             *  if (pcc.Names[props[i].Name] == "Id")
             *      Id = props[i].Value.IntValue;
             * }*/
        }
Exemple #9
0
        public void Deserialize(IMEPackage pcc)
        {
            PropertyCollection properties = export.GetProperties();
            int off;

            switch (pcc.Game)
            {
            case MEGame.ME3:
                off = export.propsEnd() + 8;
                break;

            case MEGame.ME2:
                off = export.propsEnd() + 0x28;
                break;

            default:
                throw new Exception("Can oly read WwiseStreams for ME3 and ME2!");
            }
            ValueOffset = off;
            DataSize    = BitConverter.ToInt32(memory, off);
            DataOffset  = BitConverter.ToInt32(memory, off + 4);
            NameProperty nameProp = properties.GetProp <NameProperty>("Filename");

            FileName = nameProp?.Value;
            Id       = properties.GetProp <IntProperty>("Id");
        }
Exemple #10
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="source"></param>
        /// <param name="property"></param>
        /// <returns></returns>
        private String GetField(INameImportSource source, NameProperty property)
        {
            if (this.mappings.ContainsKey(property))
            {
                return(source.Get(this.mappings[property]));
            }

            return(null);
        }
Exemple #11
0
    public void ToStringTest()
    {
        var adr = new NameProperty(LAST_NAME, FIRST_NAME, MIDDLE_NAME, PREFIX, SUFFIX);

        string s = adr.ToString();

        Assert.IsNotNull(s);
        Assert.AreNotEqual(0, s.Length);
    }
        private static JsonExtensionDataItem UnpackExtensionDataMember(object Item)
        {
            PropertyInfo          NameProperty;
            JsonExtensionDataItem ReturnValue = null;
            PropertyInfo          ValueProperty;

            NameProperty  = FindProperty(Item, "Name");
            ValueProperty = FindProperty(Item, "Value");
            if (NameProperty != null && ValueProperty != null)
            {
                string Name;
                object Value;

                Name  = NameProperty.GetValue(Item).ToString();
                Value = ValueProperty.GetValue(Item);
                if (Value != null)
                {
                    switch (Value.GetType().Name)
                    {
                    case "DataNode`1":
                        PropertyInfo ItemValueProperty;
                        PropertyInfo TypeProperty;

                        TypeProperty      = FindProperty(Value, "DataType");
                        ItemValueProperty = FindProperty(Value, "Value");
                        if (TypeProperty != null && ItemValueProperty != null)
                        {
                            Type   DataType;
                            object ItemValue;

                            DataType  = (Type)TypeProperty.GetValue(Value);
                            ItemValue = ItemValueProperty.GetValue(Value);

                            ReturnValue = new JsonExtensionDataItem(Name, DataType, ItemValue);
                        }
                        break;

                    case "ClassDataNode":
                        JsonExtensionDataItemCollection NewItems;

                        NewItems    = UnpackExtensionDataMembers(Value);
                        ReturnValue = new JsonExtensionDataItem(Name, NewItems);
                        break;

                    case "CollectionDataNode":
                        break;

                    default:
                        Console.WriteLine("WTF");
                        break;
                    }
                }
            }

            return(ReturnValue);
        }
Exemple #13
0
 private void AddTemplateName()
 {
     NameProperty            = SettingsPanel.AddUIComponent <StringPropertyPanel>();
     NameProperty.Text       = NodeMarkup.Localize.TemplateEditor_Name;
     NameProperty.FieldWidth = 230;
     NameProperty.UseWheel   = false;
     NameProperty.Init();
     NameProperty.Value           = EditObject.Name;
     NameProperty.OnValueChanged += NameSubmitted;
 }
 private void AddTemplateName()
 {
     NameProperty                   = ComponentPool.Get <StringPropertyPanel>(PropertiesPanel, "Name");
     NameProperty.Text              = NodeMarkup.Localize.TemplateEditor_Name;
     NameProperty.FieldWidth        = 230;
     NameProperty.SubmitOnFocusLost = true;
     NameProperty.Init();
     NameProperty.Value           = EditObject.Name;
     NameProperty.OnValueChanged += (name) => OnChanged();
 }
Exemple #15
0
        public static StructProperty CreateAppearanceProperty()
        {
            var props = new CProperty[]
            {
                NameProperty.Create("nmHead"),
                IntProperty.Create("iGender", 1),
                IntProperty.Create("iRace"),
                NameProperty.Create("nmHaircut"),
                IntProperty.Create("iHairColor"),
                IntProperty.Create("iFacialHair"),
                NameProperty.Create("nmBeard"),
                IntProperty.Create("iSkinColor"),
                IntProperty.Create("iEyeColor"),
                NameProperty.Create("nmFlag"),
                IntProperty.Create("iVoice"),
                IntProperty.Create("iAttitude"),
                IntProperty.Create("iArmorDeco"),
                IntProperty.Create("iArmorTint"),
                IntProperty.Create("iArmorTintSecondary"),
                IntProperty.Create("iWeaponTint"),
                IntProperty.Create("iTattooTint"),
                NameProperty.Create("nmWeaponPattern"),
                NameProperty.Create("nmPawn", "None"),
                NameProperty.Create("nmTorso"),
                NameProperty.Create("nmArms"),
                NameProperty.Create("nmLegs"),
                NameProperty.Create("nmHelmet"),
                NameProperty.Create("nmEye", "DefaultEyes"),
                NameProperty.Create("nmTeeth", "DefaultTeeth"),
                NameProperty.Create("nmFacePropLower"),
                NameProperty.Create("nmFacePropUpper"),
                NameProperty.Create("nmPatterns"),
                NameProperty.Create("nmVoice"),
                NameProperty.Create("nmLanguage", "None"),
                NameProperty.Create("nmTattoo_LeftArm"),
                NameProperty.Create("nmTattoo_RightArm"),
                NameProperty.Create("nmScars"),
                NameProperty.Create("nmTorso_Underlay"),
                NameProperty.Create("nmArms_Underlay"),
                NameProperty.Create("nmLegs_Underlay"),
                NameProperty.Create("nmFacePaint"),
                NameProperty.Create("nmLeftArm"),
                NameProperty.Create("nmRightArm"),
                NameProperty.Create("nmLeftArmDeco"),
                NameProperty.Create("nmRightArmDeco"),
                NameProperty.Create("nmLeftForearm"),
                NameProperty.Create("nmRightForearm"),
                NameProperty.Create("nmThighs"),
                NameProperty.Create("nmShins", "None"),
                NameProperty.Create("nmTorsoDeco")
            };
            var structProp = StructProperty.Create("kAppearance", props);

            return(structProp);
        }
Exemple #16
0
    public void NamePropertyTest1()
    {
        var adr = new NameProperty(LAST_NAME, FIRST_NAME, MIDDLE_NAME, PREFIX, SUFFIX, propertyGroup: GROUP);

        Assert.IsNotNull(adr);
        Assert.AreEqual(LAST_NAME, adr.Value.LastName[0]);
        Assert.AreEqual(FIRST_NAME, adr.Value.FirstName[0]);
        Assert.AreEqual(MIDDLE_NAME, adr.Value.MiddleName[0]);
        Assert.AreEqual(PREFIX, adr.Value.Prefix[0]);
        Assert.AreEqual(SUFFIX, adr.Value.Suffix[0]);
        Assert.AreEqual(GROUP, adr.Group);
        Assert.IsFalse(adr.IsEmpty);
    }
        private void SaveChanges()
        {
            var name       = NameProperty.Value;
            var messageBox = default(YesNoMessageBox);

            if (!string.IsNullOrEmpty(name) && name != EditObject.Name && (EditObject.Manager as TemplateManager <TemplateType>).ContainsName(name, EditObject))
            {
                messageBox                = MessageBox.Show <YesNoMessageBox>();
                messageBox.CaptionText    = NodeMarkup.Localize.TemplateEditor_NameExistCaption;
                messageBox.MessageText    = string.Format(NameExistMessage, name);
                messageBox.OnButton1Click = AgreeExistName;
                messageBox.OnButton2Click = EditName;
            }
            else
            {
                AgreeExistName();
            }


            bool AgreeExistName()
            {
                if (EditObject.IsAsset)
                {
                    messageBox ??= MessageBox.Show <YesNoMessageBox>();
                    messageBox.CaptionText    = RewriteCaption;
                    messageBox.MessageText    = $"{IsAssetMessage} {RewriteMessage}";
                    messageBox.OnButton1Click = Save;
                    return(false);
                }
                else
                {
                    return(Save());
                }
            }

            bool EditName()
            {
                NameProperty.Edit();
                return(true);
            }

            bool Save()
            {
                OnApplyChanges();
                (EditObject.Manager as TemplateManager <TemplateType>).TemplateChanged(EditObject);
                EndEditTemplate();
                RefreshSelectedItem();
                return(true);
            }
        }
        public void NamePropertyWrite()
        {
            using (var stream = new MemoryStream())
                using (var writer = new BinaryWriter(stream))
                {
                    var prop = new NameProperty(NameName)
                    {
                        Value = NameValue
                    };

                    prop.Serialize(writer, BuildVersion);

                    Assert.AreEqual(17, prop.SerializedLength);
                    CollectionAssert.AreEqual(NameBytes, stream.ToArray());
                }
        }
        private void BitMexREST_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
        {
            string nameProperty = e.PropertyName;

            if (IsNameProperty("ValidRest"))
            {
                ValidRest = BitMexREST.ValidRest;
            }
            if (IsNameProperty("AccountBalance"))
            {
                BalanceRest = BitMexREST.AccountBalance;
            }

            bool IsNameProperty(string NameProperty)
            => string.IsNullOrWhiteSpace(nameProperty) || nameProperty.Trim() == NameProperty.Trim();
        }
Exemple #20
0
        public Item(string objectId, IPortableDeviceContent content)
            : base(objectId)
        {
            DeviceContent = content;

            IPortableDeviceProperties properties;

            content.Properties(out properties);

            IPortableDeviceKeyCollection keys;

            properties.GetSupportedProperties(objectId, out keys);

            IPortableDeviceValues values;

            properties.GetValues(objectId, keys, out values);

            ContentType = new ContentTypeProperty(values);
            Name        = new NameProperty(values);

            // Only load the sub information if the current object is a folder or functional object.

            switch (ContentType.Type)
            {
            case WindowsPortableDeviceEnumerators.ContentType.FunctionalObject:
            {
                //TODO: Replace it back to LoadDeviceItems if not correct
                LoadDeviceItemsByThread(content);
                break;
            }

            case WindowsPortableDeviceEnumerators.ContentType.Folder:
            {
                OriginalFileName = new OriginalFileNameProperty(values);
                LoadDeviceItems(content);
                break;
            }

            case WindowsPortableDeviceEnumerators.ContentType.Image:
            case WindowsPortableDeviceEnumerators.ContentType.Video:
            case WindowsPortableDeviceEnumerators.ContentType.Audio:
            {
                OriginalFileName = new OriginalFileNameProperty(values);
                break;
            }
            }
        }
Exemple #21
0
        protected override void AppendNameViews(IEnumerable <NameProperty?> value)
        {
            Debug.Assert(value != null);

            NameProperty name = value.FirstOrDefault(x => x != null && (Options.IsSet(VcfOptions.WriteEmptyProperties) || !x.IsEmpty))

                                ?? (Options.IsSet(VcfOptions.WriteEmptyProperties) ? new NameProperty() : new NameProperty(new string[] { "?" }));

            BuildProperty(VCard.PropKeys.N, name);

            string?sortString = name.Parameters.SortAs?.FirstOrDefault(x => !string.IsNullOrWhiteSpace(x))?.Trim();

            if (sortString != null)
            {
                var sortStringProp = new TextProperty(sortString, name.Group);
                sortStringProp.Parameters.Language = name.Parameters.Language;
                BuildProperty(VCard.PropKeys.SORT_STRING, sortStringProp);
            }
        }
Exemple #22
0
    /// <summary>
    /// Copy ctor
    /// </summary>
    /// <param name="vCard">The vCard to clone.</param>
    private VCard(VCard vCard)
    {
        Version = vCard.Version;

        Func <ICloneable?, object?> cloner = Cloned;

        foreach (KeyValuePair <VCdProp, object> kvp in vCard._propDic)
        {
            Set(kvp.Key, kvp.Value switch
            {
                XmlProperty xmlProp => xmlProp.Clone(),
                IEnumerable <XmlProperty?> xmlPropEnumerable => xmlPropEnumerable.Select(cloner).Cast <XmlProperty?>().ToArray(),
                ProfileProperty profProp => profProp.Clone(),
                TextProperty txtProp => txtProp.Clone(),
                IEnumerable <TextProperty?> txtPropEnumerable => txtPropEnumerable.Select(cloner).Cast <TextProperty?>().ToArray(),
                DateTimeProperty dtTimeProp => dtTimeProp.Clone(),
                IEnumerable <DateTimeProperty?> dtTimePropEnumerable => dtTimePropEnumerable.Select(cloner).Cast <DateTimeProperty?>().ToArray(),
                AddressProperty adrProp => adrProp.Clone(),
                IEnumerable <AddressProperty?> adrPropEnumerable => adrPropEnumerable.Select(cloner).Cast <AddressProperty?>().ToArray(),
                NameProperty nameProp => nameProp.Clone(),
                IEnumerable <NameProperty?> namePropEnumerable => namePropEnumerable.Select(cloner).Cast <NameProperty?>().ToArray(),
                RelationProperty relProp => relProp.Clone(),
                IEnumerable <RelationProperty?> relPropEnumerable => relPropEnumerable.Select(cloner).Cast <RelationProperty?>().ToArray(),
                OrganizationProperty orgProp => orgProp.Clone(),
                IEnumerable <OrganizationProperty?> orgPropEnumerable => orgPropEnumerable.Select(cloner).Cast <OrganizationProperty?>().ToArray(),
                StringCollectionProperty strCollProp => strCollProp.Clone(),
                IEnumerable <StringCollectionProperty?> strCollPropEnumerable => strCollPropEnumerable.Select(cloner).Cast <StringCollectionProperty?>().ToArray(),
                GenderProperty sexProp => sexProp.Clone(),
                IEnumerable <GenderProperty?> sexPropEnumerable => sexPropEnumerable.Select(cloner).Cast <GenderProperty?>().ToArray(),
                GeoProperty geoProp => geoProp.Clone(),
                IEnumerable <GeoProperty?> geoPropEnumerable => geoPropEnumerable.Select(cloner).Cast <GeoProperty?>().ToArray(),
                DataProperty dataProp => dataProp.Clone(),
                IEnumerable <DataProperty?> dataPropEnumerable => dataPropEnumerable.Select(cloner).Cast <DataProperty?>().ToArray(),
                NonStandardProperty nStdProp => nStdProp.Clone(),
                IEnumerable <NonStandardProperty?> nStdPropEnumerable => nStdPropEnumerable.Select(cloner).Cast <NonStandardProperty?>().ToArray(),
                PropertyIDMappingProperty pidMapProp => pidMapProp.Clone(),
                IEnumerable <PropertyIDMappingProperty?> pidMapPropEnumerable => pidMapPropEnumerable.Select(cloner).Cast <PropertyIDMappingProperty?>().ToArray(),
                TimeZoneProperty tzProp => tzProp.Clone(),
                IEnumerable <TimeZoneProperty?> tzPropEnumerable => tzPropEnumerable.Select(cloner).Cast <TimeZoneProperty?>().ToArray(),

                ICloneable cloneable => cloneable.Clone(), // AccessProperty, KindProperty, TimeStampProperty, UuidProperty
                _ => kvp.Value
            });
Exemple #23
0
        /// <summary>
        /// This is overridden to allow copying of the additional properties
        /// </summary>
        /// <param name="p">The PDI object from which the settings are to be copied</param>
        protected override void Clone(PDIObject p)
        {
            VCard o = (VCard)p;

            this.ClearProperties();

            groupName = o.Group;

            fn     = (FormattedNameProperty)o.FormattedName.Clone();
            name   = (NameProperty)o.Name.Clone();
            title  = (TitleProperty)o.Title.Clone();
            role   = (RoleProperty)o.Role.Clone();
            mailer = (MailerProperty)o.Mailer.Clone();
            url    = (UrlProperty)o.Url.Clone();
            org    = (OrganizationProperty)o.Organization.Clone();
            uid    = (UniqueIdProperty)o.UniqueId.Clone();
            bday   = (BirthDateProperty)o.BirthDate.Clone();
            rev    = (LastRevisionProperty)o.LastRevision.Clone();
            tz     = (TimeZoneProperty)o.TimeZone.Clone();
            geo    = (GeographicPositionProperty)o.GeographicPosition.Clone();
            key    = (PublicKeyProperty)o.PublicKey.Clone();
            photo  = (PhotoProperty)o.Photo.Clone();
            logo   = (LogoProperty)o.Logo.Clone();
            sound  = (SoundProperty)o.Sound.Clone();

            this.Notes.CloneRange(o.Notes);
            this.Addresses.CloneRange(o.Addresses);
            this.Labels.CloneRange(o.Labels);
            this.Telephones.CloneRange(o.Telephones);
            this.EMailAddresses.CloneRange(o.EMailAddresses);
            this.Agents.CloneRange(o.Agents);
            this.CustomProperties.CloneRange(o.CustomProperties);

            addProfile     = o.AddProfile;
            mimeName       = (MimeNameProperty)o.MimeName.Clone();
            mimeSource     = (MimeSourceProperty)o.MimeSource.Clone();
            prodId         = (ProductIdProperty)o.ProductId.Clone();
            nickname       = (NicknameProperty)o.Nickname.Clone();
            sortString     = (SortStringProperty)o.SortString.Clone();
            classification = (ClassificationProperty)o.Classification.Clone();
            categories     = (CategoriesProperty)o.Categories.Clone();
        }
Exemple #24
0
        static SideAppBar()
        {
            NameProperty
            .OverrideMetadata(typeof(SideAppBar), new FrameworkPropertyMetadata("SideAppBar1"));
            DefaultStyleKeyProperty
            .OverrideMetadata(typeof(SideAppBar), new FrameworkPropertyMetadata(typeof(SideAppBar)));
            WidthProperty
            .OverrideMetadata(typeof(SideAppBar), new FrameworkPropertyMetadata(Convert.ToDouble(48)));
            HorizontalAlignmentProperty
            .OverrideMetadata(typeof(SideAppBar), new FrameworkPropertyMetadata(HorizontalAlignment.Left));
            VerticalAlignmentProperty
            .OverrideMetadata(typeof(SideAppBar), new FrameworkPropertyMetadata(VerticalAlignment.Stretch));
            MarginProperty
            .OverrideMetadata(typeof(SideAppBar), new FrameworkPropertyMetadata(new Thickness(0, 40, 0, 0)));

            /////////////////////////////////////////////////////////////////////////////////
            /// Routed Events:
            /////////////////////////////////////////////////////////////////////////////////
            EventManager.RegisterClassHandler(typeof(SideAppBar), SizeChangedEvent, new RoutedEventHandler(OnLoaded));
        }
Exemple #25
0
        /// <summary>
        /// Construct the device by obtainin the device properties and the sub data.
        ///
        /// NOTE:
        /// There is a difference with the device id and the id.
        /// The id indicates the object id within the windows portable device.
        /// The device id indicates the object id within the operating system.
        ///
        /// The initial id for all windows portable devices is hard coded to "DEVICE"
        /// </summary>
        /// <param name="deviceId"></param>
        public Device(string deviceId) : base("DEVICE")
        {
            DeviceId        = deviceId;
            ComDeviceObject = new PortableDeviceClass();
            Connect();
            IPortableDeviceValues deviceProperties = ExtractDeviceProperties(ComDeviceObject);

            ContentType     = new ContentTypeProperty(deviceProperties);
            DeviceType      = new TypeProperty(deviceProperties);
            FirmwareVersion = new FirmwareVersionProperty(deviceProperties);
            FriendlyName    = new FriendlyNameProperty(deviceProperties);
            Manufacturer    = new ManufacturerProperty(deviceProperties);
            Model           = new ModelProperty(deviceProperties);
            Name            = new NameProperty(deviceProperties);
            SerialNumber    = new SerialNumberProperty(deviceProperties);

            LoadDeviceData(ComDeviceObject);

            Disconnect();
        }
Exemple #26
0
        private Character(IOutputter outputter, string nickname) : base(null, outputter)
        {
            properties.Add(StrProperty.Create("strFirstName", "New"));
            properties.Add(StrProperty.Create("strLastName", "Character"));
            properties.Add(StrProperty.Create("strNickName"));
            properties.Add(NameProperty.Create("CharacterTemplateName", "Soldier"));
            properties.Add(NameProperty.Create("m_SoldierClassTemplateName", "Rookie"));
            properties.Add(NameProperty.Create("Country", "Country_USA"));
            var appearance = Appearance.CreateAppearanceProperty();

            properties.Add(appearance);
            Appearance = new Appearance(outputter, appearance.Properties.Properties);
            properties.Add(BoolProperty.Create("AllowedTypeSoldier", true));
            properties.Add(BoolProperty.Create("AllowedTypeVIP"));
            properties.Add(BoolProperty.Create("AllowedTypeDarkVIP"));
            properties.Add(StrProperty.Create("PoolTimestamp", DateTime.Now.ToString("MMMM d, yyyy - h:m tt")));
            properties.Add(StrProperty.Create("BackgroundText"));
            NickName.Data = $"'{nickname}'";
            IsDirty       = true;
        }
Exemple #27
0
        protected virtual string GetComment()
        {
            NameProperty tagProp = export.GetProperty<NameProperty>("Tag");
            if (tagProp != null)
            {
                string name = tagProp.Value;
                if (name != export.ObjectName)
                {
                    string retval = name;

                    if (tagProp.Value.Number != 0)
                    {
                        retval += "_" + tagProp.Value.Number;
                    }
                    NodeTag = retval;
                    return retval;
                }
            }
            return "";
        }
Exemple #28
0
        public string GetPropertyStringOrName(string name, int index = -1)
        {
            UProperty p = GetProperty(name, index);

            if (p == null)
            {
                return(null);
            }

            if (p.GetType() == typeof(NameProperty))
            {
                NameProperty np = (NameProperty)p;
                return(np.data);
            }
            else if (p.GetType() == typeof(StrProperty))
            {
                StrProperty np = (StrProperty)p;
                return(np.data);
            }
            return(null);
        }
Exemple #29
0
        /// <summary>
        /// The method can be called to clear all current property values from the vCard.  The version is left
        /// unchanged.
        /// </summary>
        public void ClearProperties()
        {
            groupName = null;

            fn     = null;
            name   = null;
            title  = null;
            role   = null;
            mailer = null;
            url    = null;
            org    = null;
            uid    = null;
            bday   = null;
            rev    = null;
            tz     = null;
            geo    = null;
            key    = null;
            photo  = null;
            logo   = null;
            sound  = null;

            notes       = null;
            addrs       = null;
            labels      = null;
            phones      = null;
            email       = null;
            agents      = null;
            customProps = null;

            addProfile     = false;
            mimeName       = null;
            mimeSource     = null;
            prodId         = null;
            nickname       = null;
            sortString     = null;
            classification = null;
            categories     = null;
        }
 set => SetValue(NameProperty, value);
Exemple #31
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="source"></param>
        /// <param name="property"></param>
        /// <returns></returns>
        private String GetField(INameImportSource source, NameProperty property)
        {
            if(this.mappings.ContainsKey(property))
                return source.Get(this.mappings[property]);

            return null;
        }
Exemple #32
0
 /// <summary>
 /// Adds a mapping from a column in the input data source to a name property.
 /// </summary>
 /// <param name="property">The property to map to.</param>
 /// <param name="column">The column index to map from.</param>
 public void AddMapping(NameProperty property, Int32 column)
 {
     this.mappings.Add(property, column);
 }