コード例 #1
0
ファイル: AmbethIocRunner.cs プロジェクト: vogelb/ambeth
        protected virtual void ExtendProperties(MethodInfo frameworkMethod, Properties props)
        {
            IList <IAnnotationInfo <TestProperties> > testPropertiesList = FindAnnotations <TestProperties>(testClass, frameworkMethod);

            foreach (IAnnotationInfo <TestProperties> testPropertiesItem in testPropertiesList)
            {
                TestProperties testProperties     = testPropertiesItem.Annotation;
                Type           testPropertiesType = testProperties.Type;
                if (testPropertiesType != null && !typeof(IPropertiesProvider).Equals(testPropertiesType))
                {
                    IPropertiesProvider propertiesProvider = (IPropertiesProvider)Activator.CreateInstance(testPropertiesType);
                    propertiesProvider.FillProperties(props);
                }
                String testPropertiesFile = testProperties.File;
                if (testPropertiesFile != null && testPropertiesFile.Length > 0)
                {
                    props.Load(testPropertiesFile);
                }
                String testPropertyName  = testProperties.Name;
                String testPropertyValue = testProperties.Value;
                if (testPropertyName != null && testPropertyName.Length > 0)
                {
                    if (testPropertyValue != null && testPropertyValue.Length > 0)
                    {
                        // Override intended
                        props.Set(testPropertyName, testPropertyValue);
                    }
                }
            }
        }
コード例 #2
0
 /// <summary>
 /// Register a properties provider with this ribbon control
 /// </summary>
 /// <param name="propertiesProvider">properties provider</param>
 protected void AddPropertiesProvider(IPropertiesProvider propertiesProvider)
 {
     foreach (PropertyKey propertyKey in propertiesProvider.SupportedProperties)
     {
         _mapProperties[propertyKey] = propertiesProvider;
     }
 }
コード例 #3
0
 internal MixpanelService(IMixpanelOptions options, IPropertiesProvider defaultPropertiesProvider, ITimeProvider timeProvider, IEventTracker eventTracker)
 {
     _defaultPropertiesProvider = defaultPropertiesProvider;
     _tracker      = eventTracker;
     _options      = options;
     _timeProvider = timeProvider;
 }
コード例 #4
0
 public XmlSerializerExtensionServiceProvider(IPropertiesProvider propertiesProvider, object targetObject, object targetProperty, string sourceValue)
 {
     this.propertiesProvider = propertiesProvider;
     this.targetObject       = targetObject;
     this.sourceValue        = sourceValue;
     this.targetProperty     = targetProperty;
 }
コード例 #5
0
        public override object ProvideValue(IServiceProvider serviceProvider)
        {
            IProvideTargetValue valueService = IServiceProviderHelper <IProvideTargetValue> .GetService(serviceProvider, typeof(ColorBlendExtension).ToString());

            styleParameterSerivce = IServiceProviderHelper <IPropertiesProvider> .GetService(serviceProvider, typeof(ColorBlendExtension).ToString());

            string[] extenderParameters = valueService.SourceValue.Split(',');

            if (extenderParameters.Length < 4)
            {
                throw new ArgumentException("parameters not valid!");
            }

            this.themePropertyName = extenderParameters[0].Trim();
            if (string.IsNullOrEmpty(ThemePropertyName))
            {
                throw new InvalidOperationException("The first argument of RelativeColor exptrssion should be the name of the ThemeProperty");
            }

            int.TryParse(extenderParameters[1].Trim(), out colorADiff);
            double.TryParse(extenderParameters[2].Trim(), out colorHDiff);
            double.TryParse(extenderParameters[3].Trim(), out colorSDiff);
            double.TryParse(extenderParameters[4].Trim(), out colorLDiff);

            return(this);
        }
コード例 #6
0
 public IFileProcessor CreateProcessor(IPropertiesProvider Parameters)
 {
     string value;
     string value1;
     byte separator = Parameters.TryGetValue("Separator", out value) ? byte.Parse(value, NumberStyles.HexNumber) : (byte)0xFF;
     int length = Parameters.TryGetValue("SeparatorLength", out value1) ? byte.Parse(value1, NumberStyles.HexNumber) : 1024;
     return new AutoSplitFileProcessor(separator, length);
 }
コード例 #7
0
 public ChildRecordsSynchronizer(Expression <Func <TParentRecord, IList <TChildRecord> > > childrenSelector,
                                 IRecordsComparer <TChildRecord> recordsComparer,
                                 IPropertiesProvider <TChildRecord> propertiesProvider)
     : base(recordsComparer, propertiesProvider)
 {
     DetectForeignKeyProperty(childrenSelector);
     ChildrenSelector = childrenSelector.Compile();
 }
コード例 #8
0
        public void Setup()
        {
            _currentRecords     = Substitute.For <IList <IMockRecord> >();
            _propertiesProvider = Substitute.For <IPropertiesProvider <IMockRecord> >();


            _recordsComparer     = Substitute.For <IRecordsComparer <IMockRecord> >();
            _recordsSynchronizer = RecordsSynchronizerFactory <IMockRecord> .Create(_recordsComparer, _propertiesProvider);
        }
コード例 #9
0
ファイル: Themes.cs プロジェクト: configare/hispeed
        private static object GetRelativeColorDef(IPropertiesProvider propertiesProvider, string themeParameterName, HslColor baseHslColor, Color currentColor, IValueProvider originalValueProvider)
        {
            ColorBlendExtension extension = originalValueProvider as ColorBlendExtension;

            if (extension == null)
            {
                return(new ColorBlendExtension(propertiesProvider, themeParameterName, baseHslColor, currentColor, currentColor));
            }
            else
            {
                return(new ColorBlendExtension(propertiesProvider, themeParameterName, baseHslColor, currentColor, extension.OriginalColor));
            }
        }
コード例 #10
0
        private static void checkDefaultProvider(IPropertiesProvider provider)
        {
            // check the expected default values
            // the ID should be a valid guid
            TestUtilities.checkGuid(provider.ID, true);
            Assert.AreEqual(BasicPropertiesProvider.DefaultProviderName, provider.Name, false);
            Assert.AreEqual(string.Empty, provider.ToolTip);

            // the groups and properties in the specified provider should not
            // be null references and should be empty
            TestUtilities.checkEmpty(provider.Groups, "Groups");
            TestUtilities.checkEmpty(provider.Properties, "Properties");
        }
コード例 #11
0
        public override object ProvideValue(IServiceProvider serviceProvider)
        {
            IProvideTargetValue service = IServiceProviderHelper <IProvideTargetValue> .GetService(serviceProvider, typeof(ParameterReferenceExtension).ToString());

            this.styleParameterSerivce = IServiceProviderHelper <IPropertiesProvider> .GetService(serviceProvider, typeof(ParameterReferenceExtension).ToString());

            this.themePropertyName = service.SourceValue.Trim();
            if (string.IsNullOrEmpty(this.themePropertyName))
            {
                throw new InvalidOperationException("The first argument of RelativeColor exptrssion should be the name of the ThemeProperty");
            }
            return((object)this);
        }
コード例 #12
0
        public ColorBlendExtension(IPropertiesProvider parameterProvider, string parameterName, HslColor blendColor, Color currentColor, Color originalColor)
        {
            this.styleParameterSerivce = parameterProvider;
            this.themePropertyName     = parameterName;

            this.originalColor = originalColor;

            HslColor currentHslColor = HslColor.FromColor(currentColor);

            this.colorADiff = currentHslColor.A - blendColor.A;
            this.colorHDiff = currentHslColor.H - blendColor.H;
            this.colorSDiff = currentHslColor.S - blendColor.S;
            this.colorLDiff = currentHslColor.L - blendColor.L;
        }
コード例 #13
0
 private byte[] GetBootloaderConfigurationFileImage(IPropertiesProvider PropertiesProvider)
 {
     var configuration =
         new XDocument(
             new XElement("properties",
                          PropertiesProvider.GetProperties()
                                            .Select(p =>
                                                    new XElement("property",
                                                                 new XAttribute("key", p.Key),
                                                                 new XAttribute("value", p.Value)))));
     var ms = new MemoryStream();
     configuration.Save(ms);
     return ms.ToArray();
 }
コード例 #14
0
        /// <summary>
        /// Handles IUICommandHandler.UpdateProperty function for this ribbon control
        /// </summary>
        /// <param name="key">The Property Key to update</param>
        /// <param name="currentValue">A pointer to the current value for key. This parameter can be null</param>
        /// <param name="newValue">When this method returns, contains a pointer to the new value for key</param>
        /// <returns>Returns S_OK if successful, or an error value otherwise</returns>
        public virtual HRESULT UpdateProperty(ref PropertyKey key, PropVariantRef currentValue, ref PropVariant newValue)
        {
            // check if property is registered with this ribbon control
            if (_mapProperties.ContainsKey(key))
            {
                // find property provider
                IPropertiesProvider propertiesProvider = _mapProperties[key];

                // delegates execution to property provider
                return(propertiesProvider.UpdateProperty(ref key, currentValue, ref newValue));
            }

            Debug.WriteLine(string.Format("Class {0} does not support property: {1}.", GetType(), RibbonProperties.GetPropertyKeyName(ref key)));
            return(HRESULT.S_OK);
        }
コード例 #15
0
        public IRecordsSynchronizer <TChildRecord> AddChild <TChildRecord>(
            Expression <Func <TRecord, IList <TChildRecord> > > childRecordsSelector,
            IRecordsComparer <TChildRecord> recordsComparer,
            IPropertiesProvider <TChildRecord> propertiesProvider
            )
            where TChildRecord : class
        {
            var child = new ChildRecordsSynchronizer <TRecord, TChildRecord>(
                childRecordsSelector,
                recordsComparer,
                propertiesProvider);

            AddChild(child);

            return(child);
        }
コード例 #16
0
 public IFileMap CreateFileMap(IPropertiesProvider Parameters, List<IFileProcessor> Processors)
 {
     return new SingleFileMap(Parameters["From"], Parameters["To"], Processors);
 }
コード例 #17
0
 public IFileMap CreateFileMap(IPropertiesProvider Parameters, List<IFileProcessor> Processors)
 {
     string value;
     string searchPattern = Parameters.TryGetValue("Pattern", out value) ? value : "*";
     return new FolderMap(Parameters["From"], searchPattern, Parameters["To"], Processors);
 }
コード例 #18
0
 public RecordsSynchronizer(IRecordsComparer <TRecord> recordsComparer,
                            IPropertiesProvider <TRecord> propertiesProvider)
 {
     _recordsComparer    = recordsComparer;
     _propertiesProvider = propertiesProvider;
 }
コード例 #19
0
 public PartiallyLoadableStyleSheet(IPropertiesProvider propertiesProvider, string partiallyLoadedXmlData, string themeLocation) : base(themeLocation)
 {
     this.propertiesProvider     = propertiesProvider;
     this.partiallyLoadedXmlData = partiallyLoadedXmlData;
 }
コード例 #20
0
 public IFileProcessor CreateProcessor(IPropertiesProvider Parameters)
 {
     return new HexToBinFileProcessor(Parameters.GetValue("TrimStart", false));
 }
コード例 #21
0
 internal MixpanelService(IMixpanelOptions options, IPropertiesProvider defaultPropertiesProvider, ITimeProvider timeProvider)
     : this(options, defaultPropertiesProvider, timeProvider, GetTracker(options))
 {
 }
コード例 #22
0
 public MixpanelService(IMixpanelOptions options, IPropertiesProvider defaultPropertiesProvider)
     : this(options, defaultPropertiesProvider, new Clock(), GetTracker(options))
 {
 }
コード例 #23
0
ファイル: Themes.cs プロジェクト: configare/hispeed
        public static void ApplyColorBlendToGroups(PropertySettingGroupCollection groups, HslColor baseColor, string themeParameterName, IPropertiesProvider propertiesProvider)
        {
            foreach (PropertySettingGroup group in groups)
            {
                foreach (IPropertySetting setting in group.PropertySettings)
                {
                    RadProperty prop = setting.Property;
                    if (prop.PropertyType == typeof(Color))
                    {
                        if (setting is AnimatedPropertySetting)
                        {
                            AnimatedPropertySetting animatedSetting = (AnimatedPropertySetting)setting;

                            object value = animatedSetting.StartValue;
                            if (value != null)
                            {
                                Color color = (Color)value;
                                if (ShouldApplyBaseColor(baseColor, color))
                                {
                                    object relativeColorDef =
                                        GetRelativeColorDef(propertiesProvider, themeParameterName, baseColor, color,
                                                            animatedSetting.GetStartValueProvider());
                                    animatedSetting.StartValue = relativeColorDef;
                                }
                            }

                            object endValue = animatedSetting.EndValue;
                            if (endValue != null)
                            {
                                Color color = (Color)endValue;
                                if (ShouldApplyBaseColor(baseColor, color))
                                {
                                    animatedSetting.EndValue =
                                        GetRelativeColorDef(propertiesProvider, themeParameterName, baseColor, color,
                                                            animatedSetting.GetEndValueProvider());
                                }
                            }
                        }
                        else //actualSetting is PropertySetting
                        {
                            PropertySetting propertySetting = (PropertySetting)setting;
                            object          value           = propertySetting.Value;
                            if (value != null)
                            {
                                Color color = (Color)value;
                                if (ShouldApplyBaseColor(baseColor, color))
                                {
                                    propertySetting.Value =
                                        GetRelativeColorDef(propertiesProvider, themeParameterName, baseColor, color,
                                                            propertySetting.GetValueProvider());
                                }
                            }
                        }
                    }
                }
            }
        }
コード例 #24
0
ファイル: BaseRibbonControl.cs プロジェクト: ldh9451/XLE
 /// <summary>
 /// Register a properties provider with this ribbon control
 /// </summary>
 /// <param name="propertiesProvider">properties provider</param>
 protected void AddPropertiesProvider(IPropertiesProvider propertiesProvider)
 {
     foreach (PropertyKey propertyKey in propertiesProvider.SupportedProperties)
     {
         _mapProperties[propertyKey] = propertiesProvider;
     }
 }
コード例 #25
0
 public static void SetSimplePropertiesToInstance(this IPropertiesProvider propertiesProvider, dynamic instance)
 {
     SetSimplePropertiesToInstance(propertiesProvider.GetSimpleProperties(), instance);
 }
コード例 #26
0
 public static IRecordsSynchronizer <TRecord> Create(IRecordsComparer <TRecord> recordsComparer,
                                                     IPropertiesProvider <TRecord> propertiesProvider)
 {
     return(new RecordsSynchronizer <TRecord>(recordsComparer, propertiesProvider));
 }
コード例 #27
0
ファイル: Themes.cs プロジェクト: configare/hispeed
        public static void ApplyColorBlendToStyleSheet(HslColor baseColor, string themeParameterName, IPropertiesProvider propertiesProvider, StyleSheet style)
        {
            PropertySettingGroupCollection groups = style.PropertySettingGroups;

            ApplyColorBlendToGroups(groups, baseColor, themeParameterName, propertiesProvider);
        }