示例#1
0
        void CultureResources_DataChanged(object sender, EventArgs e)
        {
            // reset the attachment list data context so that the strings get updated
            var data = AttachmentView.DataContext;

            AttachmentView.DataContext = null;
            AttachmentView.DataContext = data;

            PrintDate.Text = " " + CultureResources.ConvertDateTimeToStringForDisplay(DateTime.Now);
            this.InvalidateVisual();
        }
示例#2
0
        public PrintPreview(CaseObject caseObj, BitmapImage bitmapSource)
        {
            m_caseObj = caseObj;
            InitializeComponent();
            CultureResources.registerDataProvider(this);
            MainImage.Source = bitmapSource;

            CaseId.Text     = caseObj.CaseId;
            CreateTime.Text = " " + CultureResources.ConvertDateTimeToStringForDisplay(caseObj.createTime);
            SiteId.Text     = caseObj.systemInfo.SystemType + " " + caseObj.systemInfo.BaseLocation;

            CultureResources.getDataProvider().DataChanged += new EventHandler(CultureResources_DataChanged);
            this.Unloaded += new System.Windows.RoutedEventHandler(PrintPreview_Unloaded);
        }
示例#3
0
        public PrintPreview(CaseObject caseObj, double width, double height)
        {
            InitializeComponent();
            CultureResources.registerDataProvider(this);

            MainDisplay.DataContext = caseObj;
            this.Width  = width;
            this.Height = height;

            PrintDate.Text      = " " + CultureResources.ConvertDateTimeToStringForDisplay(DateTime.Now);
            CaseCreateTime.Text = " " + CultureResources.ConvertDateTimeToStringForDisplay(caseObj.createTime);

            CultureResources.getDataProvider().DataChanged += new EventHandler(CultureResources_DataChanged);
            this.Unloaded += new System.Windows.RoutedEventHandler(PrintPreview_Unloaded);
        }
示例#4
0
        public PrintPreview(CaseObject CaseObj /*, BitmapSource bitmapSource*/) :
            base()
        {
            InitializeComponent();
            CultureResources.registerDataProvider(this);

            MainDisplay.DataContext = CaseObj;

            PrintDate.Text = " " + CultureResources.ConvertDateTimeToStringForDisplay(DateTime.Now);

            foreach (result result in CaseObj.ResultsList)
            {
                ResultItem resultItem = new ResultItem(result);

                ResultsView.Children.Add(resultItem);
            }

            CultureResources.getDataProvider().DataChanged += new EventHandler(CultureResources_DataChanged);
            this.Unloaded += new System.Windows.RoutedEventHandler(PrintPreview_Unloaded);
        }
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            DateTime time = (DateTime)value;

            return(CultureResources.ConvertDateTimeToStringForDisplay(time));
        }
示例#6
0
 void CultureResources_DataChanged(object sender, EventArgs e)
 {
     CreateTime.Text = " " + CultureResources.ConvertDateTimeToStringForDisplay(m_caseObj.createTime);
     this.InvalidateVisual();
 }
示例#7
0
 void CultureResources_DataChanged(object sender, EventArgs e)
 {
     PrintDate.Text      = " " + CultureResources.ConvertDateTimeToStringForDisplay(DateTime.Now);
     CaseCreateTime.Text = " " + CultureResources.ConvertDateTimeToStringForDisplay(((CaseObject)MainDisplay.DataContext).createTime);
     this.InvalidateVisual();
 }
示例#8
0
 void CultureResources_DataChanged(object sender, EventArgs e)
 {
     CreateTime.Text = (result.CreateTime == String.Empty) ? result.CreateTime : CultureResources.ConvertDateTimeToStringForDisplay(DateTime.Parse(result.CreateTime, CultureResources.getDefaultDisplayCulture()));
 }
示例#9
0
        public ResultItem(result res)
        {
            InitializeComponent();
            CultureResources.registerDataProvider(this);
            this.result = res;
            string decision = result.Decision.Replace(" ", "");

            if (!String.IsNullOrEmpty(L3.Cargo.Common.Resources.ResourceManager.GetString(decision)))
            {
                var binding = new Binding(decision);
                binding.Source = CultureResources.getDataProvider();
                BindingOperations.SetBinding(Decision, TextBlock.TextProperty, binding);
            }
            else
            {
                Decision.Text = result.Decision;
            }

            CreateTime.Text = (result.CreateTime == String.Empty) ? result.CreateTime : CultureResources.ConvertDateTimeToStringForDisplay(DateTime.Parse(result.CreateTime, CultureResources.getDefaultDisplayCulture()));
            Comment.Text    = result.Comment;

            string reason = result.Reason.Replace(" ", "");

            if (!String.IsNullOrEmpty(L3.Cargo.Common.Resources.ResourceManager.GetString(reason)))
            {
                var binding = new Binding(reason);
                binding.Source = CultureResources.getDataProvider();
                BindingOperations.SetBinding(Reason, TextBlock.TextProperty, binding);
            }
            else
            {
                Reason.Text = result.Reason;
            }

            User.Text         = result.User;
            StationType.Text  = result.StationType;
            AnalysisTime.Text = result.AnalysisTime;

            CultureResources.getDataProvider().DataChanged += new EventHandler(CultureResources_DataChanged);

            this.Unloaded += new RoutedEventHandler(ResultItem_Unloaded);
        }