示例#1
0
        /// <summary>
        /// Initializes a new instance of the Visifire.Charts.DataSeries class
        /// </summary>
        public DataSeries()
        {
            //ToolTipText = "";
            DataMappings = new DataMappingCollection();
            //IsZIndexSet = false;


            // Apply default style from generic
#if WPF
            if (!_defaultStyleKeyApplied)
            {
                DefaultStyleKeyProperty.OverrideMetadata(typeof(DataSeries), new FrameworkPropertyMetadata(typeof(DataSeries)));
                _defaultStyleKeyApplied = true;
            }
#else
            DefaultStyleKey = typeof(DataSeries);
#endif

            //SetBinding(DataSeries.DataContextProperty, new Binding());

            // Initialize DataPoints list
            DataPoints = new DataPointCollection();

            // Initialize InternalDataPoints list
            InternalDataPoints = new List<DataPoint>();

            // Attach event handler for the Title collection changed event
            DataPoints.CollectionChanged += new System.Collections.Specialized.NotifyCollectionChangedEventHandler(DataPoints_CollectionChanged);

            DataMappings.CollectionChanged += new NotifyCollectionChangedEventHandler(DataMappings_CollectionChanged);

        }
        public override StepInput[] GetInputs(IOrchestrationComponent component)
        {
            List <StepInput> allInputs = new List <StepInput>();

            EndComponent          ec            = (EndComponent)component;
            DataMappingCollection outputMapping = ec.Mapping;

            foreach (DataMapping mapping in outputMapping)
            {
                allInputs.Add(new StepInput()
                {
                    Name = mapping.MappedVariableName
                });
            }

            return(allInputs.ToArray());
        }
        private void InitializeSeries()
        {
            dmc = new DataMappingCollection()
            { 
                new DataMapping(){ MemberName = "AxisXLabel",Path="Name"},
                new DataMapping(){ MemberName = "YValue",Path="TotalAmout"},
            };

            //IncomeSeries = new DataSeries();
            IncomeSeries.LegendText = LocalizedStrings.GetLanguageInfoByKey("Income");

            //ExpenseSeries = new DataSeries();
            ExpenseSeries.LegendText = LocalizedStrings.GetLanguageInfoByKey("Expense");

            this.IncomeSeries.DataMappings = dmc;
            this.ExpenseSeries.DataMappings = dmc;

        }
示例#4
0
        public HttpSolrServer(string url, IContentSerializerFactory contentSerializerFactory = null, ICacheHandler cacheHandler = null, bool ignoreStatusCheck = false)
        {
            //Argument Validation
            if (string.IsNullOrWhiteSpace(url))
            {
                throw new ArgumentNullException("url");
            }
            if (url.EndsWith("/"))
            {
                url = url.TrimEnd('/');
            }
            Uri solrUri;

            if (!Uri.TryCreate(url, UriKind.Absolute, out solrUri))
            {
                throw new ArgumentException("the URL is invalid", "url");
            }
            RequestHandler = new HttpWebRequestHandler();
            if (!RequestHandler.IsUriSupported(solrUri))
            {
                throw new ArgumentException("the URL is invalid", "url");
            }

            //Initialization
            RecheckInterval   = new TimeSpan(0, 1, 0);
            baseUriBuilder    = new SolrUriBuilder(solrUri);
            SerializerFactory = contentSerializerFactory ?? new ContentSerializerFactory();
            DataMapping       = new DataMappingCollection();
            Cache             = cacheHandler ?? null;
            IsReady           = true;
            if (ignoreStatusCheck)
            {
                _isOnline = true;
            }
            else
            {
                CheckStatus(true);
            }
        }
        public CategorySummary()
        {
            InitializeComponent();
            NeedRefreshData = false;
            var currencySymbol = AppSetting.Instance.DefaultCurrency.GetCurrencyStringWithNameFirst();
            chartTitleForCount = LocalizedStrings.GetLanguageInfoByKey("{0}({1})", new string[] { "CategoryTitleForCount", "ItemUnit" });
            chartTitleForAmount = "{0}({1})".FormatWith(LocalizedStrings.GetLanguageInfoByKey("CategoryTitleForAmount"), currencySymbol);

            DataMapping dm_Name = new DataMapping() { MemberName = "AxisXLabel", Path = "Name" };
            DataMapping dm_Count = new DataMapping() { MemberName = "YValue", Path = DependentValuePathForCount };
            DataMapping dm_TotalAmount = new DataMapping() { MemberName = "YValue", Path = DependentValuePathForAmount };
            MappingForCount = new DataMappingCollection() { dm_Name, dm_Count };
            MappingForTotalAmount = new DataMappingCollection() { dm_Name, dm_TotalAmount };

            this.PieChart.Series[0].DataMappings = MappingForCount;

            this.PieChart.Series[0].LabelText = "#AxisXLabel, {0}#YValue".FormatWith(AppSetting.Instance.DefaultCurrency.GetCurrentString());

            ChartTitle = new Title() { Text = string.Empty };
            summaryTitle = new Title() { Text = string.Empty };
            this.PieChart.Titles.Add(summaryTitle);
            this.PieChart.Titles.Add(ChartTitle);
            SetChartTitle(DependentValuePathForCount);
        }
示例#6
0
        /// <summary>
        /// Binds to an Object
        /// </summary>
        internal void BindData(Object dataSource, DataMappingCollection dataMappings)
        {   
            foreach (DataMapping dm in dataMappings)
            {   
                UpdateBindProperty(dm, dataSource);  
            }

            INotifyPropertyChanged iNotifyPropertyChanged = dataSource as INotifyPropertyChanged;

            if (iNotifyPropertyChanged != null)
            {
                // Use a WeakEventListener so that the backwards reference doesn't keep this object alive
                _weakEventListener = new WeakEventListener<DataPoint, object, PropertyChangedEventArgs>(this);

                _weakEventListener.OnEventAction = (instance, source, eventArgs) =>
                {
                    instance.iNotifyPropertyChanged_PropertyChanged(source, eventArgs);
                };

                _weakEventListener.OnDetachAction = (weakEventListener) => iNotifyPropertyChanged.PropertyChanged -= weakEventListener.OnEvent;

                iNotifyPropertyChanged.PropertyChanged += _weakEventListener.OnEvent;
            }
        }