static Separator()
        {
            DefaultStyleKeyProperty.OverrideMetadata(typeof(Separator), new FrameworkPropertyMetadata(typeof(Separator)));
            _dType = DependencyObjectType.FromSystemTypeInternal(typeof(Separator));

            IsEnabledProperty.OverrideMetadata(typeof(Separator), new FrameworkPropertyMetadata(BooleanBoxes.FalseBox));
        }
示例#2
0
文件: Hyperlink.cs 项目: hughbe/wpf
        //--------------------------------------------------------------------
        //
        // Constructors
        //
        //---------------------------------------------------------------------

        #region Constructors

        //
        // Static Ctor to create default style sheet
        //
        static Hyperlink()
        {
            DefaultStyleKeyProperty.OverrideMetadata(typeof(Hyperlink), new FrameworkPropertyMetadata(typeof(Hyperlink)));
            _dType = DependencyObjectType.FromSystemTypeInternal(typeof(Hyperlink));
            FocusableProperty.OverrideMetadata(typeof(Hyperlink), new FrameworkPropertyMetadata(true));
            EventManager.RegisterClassHandler(typeof(Hyperlink), Mouse.QueryCursorEvent, new QueryCursorEventHandler(OnQueryCursor));
        }
        private DependencyObjectCollection GetPickListDataource(string pickListName, bool allowCheck)
        {
            IPickListDataService plDataSrv = this.GetService <IPickListDataService>();
            DependencyObjectType type      = new DependencyObjectType(pickListName);

            type.RegisterSimpleProperty("Value", typeof(string));
            type.RegisterSimpleProperty("DisplayName", typeof(string));
            if (allowCheck)
            {
                type.RegisterSimpleProperty("Select", typeof(bool));
            }
            DependencyObjectCollection items = new DependencyObjectCollection(type);

            if (!allowCheck)
            {
                DependencyObject first = items.AddNew();
                first["Value"]       = "";
                first["DisplayName"] = "--空白值--";
            }
            foreach (var item in plDataSrv.GetPickListSortedData(pickListName))
            {
                DependencyObject obj = items.AddNew();
                obj["Value"]       = item.Id;
                obj["DisplayName"] = item.DisplayName;
                if (allowCheck)
                {
                    obj["Select"] = false;
                }
            }

            return(items);
        }
示例#4
0
        void ReportState(object sender, EventArgs e)
        {
            StringBuilder sb = new StringBuilder();
            TextBlock     tb = new TextBlock();
            //<SnippetGetMetadataInit>
            PropertyMetadata pm;

            //</SnippetGetMetadataInit>
            sb.Append("MyStateControl State default = ");
            //<SnippetGetMetadataType>
            pm = MyStateControl.StateProperty.GetMetadata(typeof(MyStateControl));
            //</SnippetGetMetadataType>
            sb.Append(pm.DefaultValue.ToString());
            sb.Append("\n");
            sb.Append("UnrelatedStateControl State default = ");
            //<SnippetGetMetadataDOType>
            DependencyObjectType dt = unrelatedInstance.DependencyObjectType;

            pm = UnrelatedStateControl.StateProperty.GetMetadata(dt);
            //</SnippetGetMetadataDOType>
            sb.Append(pm.DefaultValue.ToString());
            sb.Append("\n");
            sb.Append("MyAdvancedStateControl State default = ");
            //<SnippetGetMetadataDOInstance>
            pm = MyAdvancedStateControl.StateProperty.GetMetadata(advancedInstance);
            //</SnippetGetMetadataDOInstance>
            sb.Append(pm.GetType().ToString());
            sb.Append("\n");
            //</SnippetDefaultMetadataDOInstance>
            tb.Text = sb.ToString();
            root.Children.Add(tb);
        }
示例#5
0
 static ToolTip()
 {
     DefaultStyleKeyProperty.OverrideMetadata(typeof(ToolTip), new FrameworkPropertyMetadata(typeof(ToolTip)));
     _dType = DependencyObjectType.FromSystemTypeInternal(typeof(ToolTip));
     BackgroundProperty.OverrideMetadata(typeof(ToolTip), new FrameworkPropertyMetadata(SystemColors.InfoBrush));
     FocusableProperty.OverrideMetadata(typeof(ToolTip), new FrameworkPropertyMetadata(false));
 }
 // Token: 0x0600528C RID: 21132 RVA: 0x0017090C File Offset: 0x0016EB0C
 static Page()
 {
     Window.IWindowServiceProperty.OverrideMetadata(typeof(Page), new FrameworkPropertyMetadata(new PropertyChangedCallback(Page._OnWindowServiceChanged)));
     UIElement.FocusableProperty.OverrideMetadata(typeof(Page), new FrameworkPropertyMetadata(BooleanBoxes.FalseBox));
     FrameworkElement.DefaultStyleKeyProperty.OverrideMetadata(typeof(Page), new FrameworkPropertyMetadata(typeof(Page)));
     Page._dType = DependencyObjectType.FromSystemTypeInternal(typeof(Page));
 }
示例#7
0
文件: Tools.cs 项目: Ocun/VSTool
        /// <summary>
        /// 例如,根据colls 插入到表,colls应与表字段一致
        /// </summary>
        /// <param name="qurService"></param>
        /// <param name="businessTypeSrv"></param>
        /// <param name="entityD"></param>
        /// <param name="TableName"></param>
        private void Insert(IQueryService qurService,
                            DependencyObjectCollection colls, string typeKey)
        {
            var ItemDependencyObjectType = colls.ItemDependencyObjectType;
            //创建临时表
            DependencyObjectType tmpType = RegiesterType(ItemDependencyObjectType, null);

            qurService.CreateTempTable(tmpType);
            //创建DataTable
            var TempDt = new DataTable();

            TempDt = CreateDt(ItemDependencyObjectType, TempDt);
            DOCToDataTable(colls, TempDt);
            //插入临时表
            List <QueryProperty> propies = new List <QueryProperty>();

            InsertTemp(qurService, TempDt, tmpType.Name);

            if (TempDt == null)
            {
                return;
            }
            foreach (DataColumn row in TempDt.Columns)
            {
                propies.Add(OOQL.CreateProperty(row.ColumnName, row.ColumnName));
            }

            if (propies != null && propies.Count > 0)
            {
                QueryNode node = OOQL.Select(propies
                                             ).From(tmpType.Name);
                node = OOQL.Insert(typeKey, node, propies.Select(c => c.Alias).ToArray());
                qurService.ExecuteNoQueryWithManageProperties(node);
            }
        }
示例#8
0
        public static DependencyObject getParentFromTemplate(Object source, DependencyObjectType parentType, DependencyObjectType findStopType = null)
        {
            DependencyObject current = source as DependencyObject;
            DependencyObject result  = source as DependencyObject;

            while (current != null)
            {
                result = current;

                if (current is Visual)
                {
                    current = VisualTreeHelper.GetParent(current);
                }
                else
                {
                    // If we're in Logical Land then we must walk
                    // up the logical tree until we find a
                    // Visual/Visual3D to get us back to Visual Land.
                    current = LogicalTreeHelper.GetParent(current);
                }
                if (current != null)
                {
                    if (current.DependencyObjectType.IsSubclassOf(parentType))
                    {
                        return(current);
                    }
                    if (findStopType != null && current.DependencyObjectType.IsSubclassOf(findStopType))
                    {
                        return(null);
                    }
                }
            }
            return(current);
        }
        /// <summary>
        /// 创建临时表#Table_scan_detail
        /// </summary>
        /// <returns></returns>
        private void CreateTempTableScanDetail()
        {
            string tempName = "TEMP_SCAN_DETAIL" + "_" + DateTime.Now.ToString("HHmmssfff");
            DependencyObjectType    defaultType = new DependencyObjectType(tempName, new Attribute[] { });
            SimplePropertyAttribute tempAttr    = new SimplePropertyAttribute(GeneralDBType.String);

            #region 字段
            ////主键
            //defaultType.RegisterSimpleProperty("Table_scan_detail_ID", _businessTypeSrv.SimplePrimaryKeyType,
            //                                   Maths.GuidDefaultValue(), false,
            //                                   new Attribute[] { _businessTypeSrv.SimplePrimaryKey });
            //信息批号
            defaultType.RegisterSimpleProperty("info_lot_no", typeof(string),
                                               string.Empty, false, new Attribute[] { tempAttr });

            // 转入仓库
            defaultType.RegisterSimpleProperty("site_no", typeof(string),
                                               string.Empty, false, new Attribute[] { tempAttr });
            //条码编号
            defaultType.RegisterSimpleProperty("barcode_no", typeof(string),
                                               string.Empty, false, new Attribute[] { tempAttr });

            //料件编号
            defaultType.RegisterSimpleProperty("item_no", _businessTypeSrv.SimpleItemCodeType,
                                               string.Empty, false, new Attribute[] { _businessTypeSrv.SimpleItemCode });

            // 产品特征
            defaultType.RegisterSimpleProperty("item_feature_no", _businessTypeSrv.SimpleItemFeatureType,
                                               string.Empty, false, new Attribute[] { _businessTypeSrv.SimpleItemFeature });

            // 仓库
            defaultType.RegisterSimpleProperty("warehouse_no", typeof(string),
                                               string.Empty, false, new Attribute[] { tempAttr });
            //库位
            defaultType.RegisterSimpleProperty("storage_spaces_no", typeof(string),
                                               string.Empty, false, new Attribute[] { tempAttr });
            //批号
            defaultType.RegisterSimpleProperty("lot_no", _businessTypeSrv.SimpleLotCodeType,
                                               string.Empty, false, new Attribute[] { _businessTypeSrv.SimpleLotCode });
            //拣货数量
            defaultType.RegisterSimpleProperty("picking_qty", _businessTypeSrv.SimpleQuantityType,
                                               0m, false, new Attribute[] { _businessTypeSrv.SimpleQuantity });
            //拣货单位
            defaultType.RegisterSimpleProperty("picking_unit_no", typeof(string), string.Empty, false, new Attribute[] { tempAttr });

            //单号
            defaultType.RegisterSimpleProperty("doc_no", _businessTypeSrv.SimpleDocNoType, string.Empty, false, new Attribute[] { _businessTypeSrv.SimpleDocNo });

            //来源序号
            tempAttr = new SimplePropertyAttribute(GeneralDBType.Int32);
            defaultType.RegisterSimpleProperty("seq", typeof(int), 0, false, new Attribute[] { tempAttr });


            #endregion

            _TEMP_SCAN_DETAIL = defaultType;

            _querySrv.CreateTempTable(defaultType);
        }
示例#10
0
        /// <summary>
        /// 构建attrib_list返回值
        /// </summary>
        /// <returns></returns>
        private DependencyObjectType StructureAttribList()
        {
            DependencyObjectType type = new DependencyObjectType("attrib_list");

            type.RegisterSimpleProperty("attrib_value", typeof(decimal));   //测量值
            type.RegisterSimpleProperty("result_type", typeof(string));     //判定状态
            return(type);
        }
示例#11
0
        static StatusBarItem()
        {
            DefaultStyleKeyProperty.OverrideMetadata(typeof(StatusBarItem), new FrameworkPropertyMetadata(typeof(StatusBarItem)));
            _dType = DependencyObjectType.FromSystemTypeInternal(typeof(StatusBarItem));

            IsTabStopProperty.OverrideMetadata(typeof(StatusBarItem), new FrameworkPropertyMetadata(BooleanBoxes.FalseBox));
            AutomationProperties.IsOffscreenBehaviorProperty.OverrideMetadata(typeof(StatusBarItem), new FrameworkPropertyMetadata(IsOffscreenBehavior.FromClip));
        }
示例#12
0
        static CheckBox()
        {
            // Set the default Style
            DefaultStyleKeyProperty.OverrideMetadata(typeof(CheckBox), new FrameworkPropertyMetadata(typeof(CheckBox)));
            _dType = DependencyObjectType.FromSystemTypeInternal(typeof(CheckBox));

            KeyboardNavigation.AcceptsReturnProperty.OverrideMetadata(typeof(CheckBox), new FrameworkPropertyMetadata(BooleanBoxes.FalseBox));
        }
示例#13
0
 // Token: 0x06005844 RID: 22596 RVA: 0x00186E38 File Offset: 0x00185038
 static ToolBarTray()
 {
     FrameworkElement.DefaultStyleKeyProperty.OverrideMetadata(typeof(ToolBarTray), new FrameworkPropertyMetadata(typeof(ToolBarTray)));
     ToolBarTray._dType = DependencyObjectType.FromSystemTypeInternal(typeof(ToolBarTray));
     EventManager.RegisterClassHandler(typeof(ToolBarTray), Thumb.DragDeltaEvent, new DragDeltaEventHandler(ToolBarTray.OnThumbDragDelta));
     KeyboardNavigation.ControlTabNavigationProperty.OverrideMetadata(typeof(ToolBarTray), new FrameworkPropertyMetadata(KeyboardNavigationMode.Cycle));
     ControlsTraceLogger.AddControl(TelemetryControls.ToolBarTray);
 }
 private void RemovePropertyChanged(DependencyObjectType type, DependencyPropertyChangedEventHandler handler)
 {
     if (type != doType && !type.IsSubclassOf(doType))
     {
         throw new ArgumentException();
     }
     handlers.RemoveHandler(type, handler);
 }
示例#15
0
        static TabControl()
        {
            DefaultStyleKeyProperty.OverrideMetadata(typeof(TabControl), new FrameworkPropertyMetadata(typeof(TabControl)));
            _dType = DependencyObjectType.FromSystemTypeInternal(typeof(TabControl));
            IsTabStopProperty.OverrideMetadata(typeof(TabControl), new FrameworkPropertyMetadata(MS.Internal.KnownBoxes.BooleanBoxes.FalseBox));
            KeyboardNavigation.DirectionalNavigationProperty.OverrideMetadata(typeof(TabControl), new FrameworkPropertyMetadata(KeyboardNavigationMode.Contained));

            IsEnabledProperty.OverrideMetadata(typeof(TabControl), new UIPropertyMetadata(new PropertyChangedCallback(OnVisualStatePropertyChanged)));
        }
        //----------------------------------------------
        //
        // Constructors
        //
        //----------------------------------------------
        #region Constructors
        static ResizeGrip()
        {
            DefaultStyleKeyProperty.OverrideMetadata(typeof(ResizeGrip), new FrameworkPropertyMetadata(typeof(ResizeGrip)));
            _dType = DependencyObjectType.FromSystemTypeInternal(typeof(ResizeGrip));

            Window.IWindowServiceProperty.OverrideMetadata(
                typeof(ResizeGrip),
                new FrameworkPropertyMetadata(new PropertyChangedCallback(_OnWindowServiceChanged)));
        }
示例#17
0
        /// <summary>
        /// 构建reason_list返回值
        /// </summary>
        /// <returns></returns>
        private DependencyObjectType StructureReasonList()
        {
            DependencyObjectType type = new DependencyObjectType("reason_list");

            type.RegisterSimpleProperty("reason_no", typeof(string));        //缺点原因编号
            type.RegisterSimpleProperty("reason_code_name", typeof(string)); //缺点原因
            type.RegisterSimpleProperty("defect_qty", typeof(decimal));      //缺点数量
            return(type);
        }
示例#18
0
 // Token: 0x06005115 RID: 20757 RVA: 0x0016BD00 File Offset: 0x00169F00
 static Label()
 {
     EventManager.RegisterClassHandler(typeof(Label), AccessKeyManager.AccessKeyPressedEvent, new AccessKeyPressedEventHandler(Label.OnAccessKeyPressed));
     FrameworkElement.DefaultStyleKeyProperty.OverrideMetadata(typeof(Label), new FrameworkPropertyMetadata(typeof(Label)));
     Label._dType = DependencyObjectType.FromSystemTypeInternal(typeof(Label));
     Control.IsTabStopProperty.OverrideMetadata(typeof(Label), new FrameworkPropertyMetadata(BooleanBoxes.FalseBox));
     UIElement.FocusableProperty.OverrideMetadata(typeof(Label), new FrameworkPropertyMetadata(BooleanBoxes.FalseBox));
     ControlsTraceLogger.AddControl(TelemetryControls.Label);
 }
        public void IsInstanceOfType()
        {
            DependencyObjectType t  = DependencyObjectType.FromSystemType(typeof(TestDepObj));
            DependencyObjectType t2 = DependencyObjectType.FromSystemType(typeof(TestSubclass));

            Assert.IsTrue(t.IsInstanceOfType(new TestSubclass()));
            Assert.IsTrue(t2.IsSubclassOf(t));
            Assert.IsFalse(t.IsSubclassOf(t2));
        }
示例#20
0
 // Token: 0x060056AB RID: 22187 RVA: 0x0017FAA4 File Offset: 0x0017DCA4
 static TabControl()
 {
     FrameworkElement.DefaultStyleKeyProperty.OverrideMetadata(typeof(TabControl), new FrameworkPropertyMetadata(typeof(TabControl)));
     TabControl._dType = DependencyObjectType.FromSystemTypeInternal(typeof(TabControl));
     Control.IsTabStopProperty.OverrideMetadata(typeof(TabControl), new FrameworkPropertyMetadata(BooleanBoxes.FalseBox));
     KeyboardNavigation.DirectionalNavigationProperty.OverrideMetadata(typeof(TabControl), new FrameworkPropertyMetadata(KeyboardNavigationMode.Contained));
     UIElement.IsEnabledProperty.OverrideMetadata(typeof(TabControl), new UIPropertyMetadata(new PropertyChangedCallback(Control.OnVisualStatePropertyChanged)));
     ControlsTraceLogger.AddControl(TelemetryControls.TabControl);
 }
示例#21
0
 // Token: 0x06005488 RID: 21640 RVA: 0x00176574 File Offset: 0x00174774
 static ProgressBar()
 {
     UIElement.FocusableProperty.OverrideMetadata(typeof(ProgressBar), new FrameworkPropertyMetadata(BooleanBoxes.FalseBox));
     FrameworkElement.DefaultStyleKeyProperty.OverrideMetadata(typeof(ProgressBar), new FrameworkPropertyMetadata(typeof(ProgressBar)));
     ProgressBar._dType = DependencyObjectType.FromSystemTypeInternal(typeof(ProgressBar));
     RangeBase.MaximumProperty.OverrideMetadata(typeof(ProgressBar), new FrameworkPropertyMetadata(100.0));
     Control.ForegroundProperty.OverrideMetadata(typeof(ProgressBar), new FrameworkPropertyMetadata(new PropertyChangedCallback(ProgressBar.OnForegroundChanged)));
     ControlsTraceLogger.AddControl(TelemetryControls.ProgressBar);
 }
示例#22
0
 // Token: 0x06005963 RID: 22883 RVA: 0x0018ADB4 File Offset: 0x00188FB4
 static UserControl()
 {
     FrameworkElement.DefaultStyleKeyProperty.OverrideMetadata(typeof(UserControl), new FrameworkPropertyMetadata(typeof(UserControl)));
     UserControl._dType = DependencyObjectType.FromSystemTypeInternal(typeof(UserControl));
     UIElement.FocusableProperty.OverrideMetadata(typeof(UserControl), new FrameworkPropertyMetadata(BooleanBoxes.FalseBox));
     KeyboardNavigation.IsTabStopProperty.OverrideMetadata(typeof(UserControl), new FrameworkPropertyMetadata(BooleanBoxes.FalseBox));
     Control.HorizontalContentAlignmentProperty.OverrideMetadata(typeof(UserControl), new FrameworkPropertyMetadata(HorizontalAlignment.Stretch));
     Control.VerticalContentAlignmentProperty.OverrideMetadata(typeof(UserControl), new FrameworkPropertyMetadata(VerticalAlignment.Stretch));
 }
示例#23
0
        static RadioButton()
        {
            DefaultStyleKeyProperty.OverrideMetadata(typeof(RadioButton), new FrameworkPropertyMetadata(typeof(RadioButton)));
            _dType = DependencyObjectType.FromSystemTypeInternal(typeof(RadioButton));

            KeyboardNavigation.AcceptsReturnProperty.OverrideMetadata(typeof(RadioButton), new FrameworkPropertyMetadata(MS.Internal.KnownBoxes.BooleanBoxes.FalseBox));

            ControlsTraceLogger.AddControl(TelemetryControls.RadioButton);
        }
示例#24
0
        static GroupItem()
        {
            DefaultStyleKeyProperty.OverrideMetadata(typeof(GroupItem), new FrameworkPropertyMetadata(typeof(GroupItem)));
            _dType = DependencyObjectType.FromSystemTypeInternal(typeof(GroupItem));

            // GroupItems should not be focusable by default
            FocusableProperty.OverrideMetadata(typeof(GroupItem), new FrameworkPropertyMetadata(false));
            AutomationProperties.IsOffscreenBehaviorProperty.OverrideMetadata(typeof(GroupItem), new FrameworkPropertyMetadata(IsOffscreenBehavior.FromClip));
        }
示例#25
0
 // Token: 0x06005867 RID: 22631 RVA: 0x00187F98 File Offset: 0x00186198
 static ToolTip()
 {
     System.Windows.Controls.ToolTip.OpenedEvent = EventManager.RegisterRoutedEvent("Opened", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(ToolTip));
     System.Windows.Controls.ToolTip.ClosedEvent = EventManager.RegisterRoutedEvent("Closed", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(ToolTip));
     FrameworkElement.DefaultStyleKeyProperty.OverrideMetadata(typeof(ToolTip), new FrameworkPropertyMetadata(typeof(ToolTip)));
     System.Windows.Controls.ToolTip._dType = DependencyObjectType.FromSystemTypeInternal(typeof(ToolTip));
     Control.BackgroundProperty.OverrideMetadata(typeof(ToolTip), new FrameworkPropertyMetadata(SystemColors.InfoBrush));
     UIElement.FocusableProperty.OverrideMetadata(typeof(ToolTip), new FrameworkPropertyMetadata(false));
 }
示例#26
0
        public static void SetDefaultValue <TForClass>(this DependencyProperty property, object value)
            where TForClass : DependencyObject
        {
            if (value == null)
            {
                if (property.PropertyType.IsValueType)
                {
                    throw new ArgumentException("The new default value cannot be null.");
                }
            }
            else
            {
                if (!property.PropertyType.IsInstanceOfType(value))
                {
                    throw new ArgumentException("The new default value is not a valid type.");
                }
            }

            PropertyMetadata newPmd;

            PropertyMetadata pmd = property.GetMetadata(DependencyObjectType.FromSystemType(typeof(TForClass).BaseType ?? typeof(object)));

            if (pmd is FrameworkPropertyMetadata)
            {
                FrameworkPropertyMetadata fpmd = pmd as FrameworkPropertyMetadata;
                newPmd = new FrameworkPropertyMetadata()
                {
                    IsAnimationProhibited      = fpmd.IsAnimationProhibited,
                    DefaultUpdateSourceTrigger = fpmd.DefaultUpdateSourceTrigger,
                    AffectsRender        = fpmd.AffectsRender,
                    AffectsMeasure       = fpmd.AffectsMeasure,
                    AffectsArrange       = fpmd.AffectsArrange,
                    AffectsParentMeasure = fpmd.AffectsParentMeasure,
                    AffectsParentArrange = fpmd.AffectsParentArrange,
                    BindsTwoWayByDefault = fpmd.BindsTwoWayByDefault,
                    Inherits             = fpmd.Inherits,
                    IsNotDataBindable    = fpmd.IsNotDataBindable,
                    Journal = fpmd.Journal,
                    OverridesInheritanceBehavior   = fpmd.OverridesInheritanceBehavior,
                    SubPropertiesDoNotAffectRender = fpmd.SubPropertiesDoNotAffectRender
                };
            }
            else
            {
                newPmd = new PropertyMetadata();
            }

            if (pmd != null)
            {
                newPmd.CoerceValueCallback     = pmd.CoerceValueCallback;
                newPmd.PropertyChangedCallback = pmd.PropertyChangedCallback;
            }

            newPmd.DefaultValue = value;

            property.OverrideMetadata(typeof(TForClass), newPmd);
        }
        /// <summary>
        /// 创建存储传入参数集合的临时表
        /// </summary>
        private void CreateTemp()
        {
            IBusinessTypeService businessSrv = this.GetServiceForThisTypeKey <IBusinessTypeService>();

            string typeName = "Temp_Scan" + DateTime.Now.ToString("HHmmssfff");// 临时表表名的处理
            DependencyObjectType defaultType = new DependencyObjectType(typeName, new Attribute[] { });

            #region 单头
            defaultType.RegisterSimpleProperty("ID", businessSrv.SimplePrimaryKeyType, Maths.GuidDefaultValue(), false, new Attribute[] { businessSrv.SimplePrimaryKey });
            //人员
            defaultType.RegisterSimpleProperty("employee_no", businessSrv.GetBusinessType("BusinessCode"), string.Empty, false, new Attribute[] { businessSrv.GetSimplePropertyAttribute("BusinessCode") });
            SimplePropertyAttribute tempAttr = new SimplePropertyAttribute(GeneralDBType.String);
            tempAttr.Size = 10;
            //部门
            defaultType.RegisterSimpleProperty("picking_department_no", typeof(string), string.Empty, false, new Attribute[] { tempAttr });
            //工厂编号
            defaultType.RegisterSimpleProperty("site_no", businessSrv.GetBusinessType("Factory"), string.Empty, false, new Attribute[] { businessSrv.GetSimplePropertyAttribute("Factory") });
            //信息批号
            tempAttr.Size = 30;
            defaultType.RegisterSimpleProperty("info_lot_no", typeof(string), string.Empty, false, new Attribute[] { tempAttr });
            _tempScan = defaultType;
            _qurService.CreateTempTable(_tempScan);
            #endregion

            typeName    = "Temp_ScanDetail" + DateTime.Now.ToString("HHmmssfff");// 临时表表名的处理
            defaultType = new DependencyObjectType(typeName, new Attribute[] { });
            #region 单身
            defaultType.RegisterSimpleProperty("ID", businessSrv.SimplePrimaryKeyType, Maths.GuidDefaultValue(), false, new Attribute[] { businessSrv.SimplePrimaryKey });
            //信息批号
            tempAttr.Size = 30;
            defaultType.RegisterSimpleProperty("info_lot_no", typeof(string), string.Empty, false, new Attribute[] { tempAttr });
            //序号
            tempAttr = new SimplePropertyAttribute(GeneralDBType.Int32);
            defaultType.RegisterSimpleProperty("SequenceNumber", typeof(Int32), 0, false, new Attribute[] { tempAttr });
            //品号
            defaultType.RegisterSimpleProperty("item_no", businessSrv.GetBusinessType("ItemCode"), string.Empty, false, new Attribute[] { businessSrv.GetSimplePropertyAttribute("ItemCode") });
            //特征码
            defaultType.RegisterSimpleProperty("item_feature_no", businessSrv.GetBusinessType("ItemFeature"), string.Empty, false, new Attribute[] { businessSrv.GetSimplePropertyAttribute("ItemFeature") });
            //单位
            defaultType.RegisterSimpleProperty("picking_unit_no", businessSrv.GetBusinessType("UnitCode"), string.Empty, false, new Attribute[] { businessSrv.GetSimplePropertyAttribute("UnitCode") });
            //仓库
            defaultType.RegisterSimpleProperty("warehouse_no", businessSrv.GetBusinessType("WarehouseCode"), string.Empty, false, new Attribute[] { businessSrv.GetSimplePropertyAttribute("WarehouseCode") });
            //库位
            defaultType.RegisterSimpleProperty("storage_spaces_no", businessSrv.GetBusinessType("Bin"), string.Empty, false, new Attribute[] { businessSrv.GetSimplePropertyAttribute("Bin") });
            //批号
            defaultType.RegisterSimpleProperty("lot_no", businessSrv.GetBusinessType("LotCode"), string.Empty, false, new Attribute[] { businessSrv.GetSimplePropertyAttribute("LotCode") });
            //拣货数量
            defaultType.RegisterSimpleProperty("picking_qty", businessSrv.GetBusinessType("Quantity"), 0M, false, new Attribute[] { businessSrv.GetSimplePropertyAttribute("Quantity") });
            //条码编号
            tempAttr      = new SimplePropertyAttribute(GeneralDBType.String);
            tempAttr.Size = 1000;
            defaultType.RegisterSimpleProperty("barcode_no", typeof(string), string.Empty, false, new Attribute[] { tempAttr });
            _tempScanDetail = defaultType;
            _qurService.CreateTempTable(_tempScanDetail);
            #endregion
        }
        /// <summary>
        /// 创建服务返回集合
        /// </summary>
        /// <returns></returns>
        public DependencyObjectCollection CreateReturnCollection()
        {
            DependencyObjectType type = new DependencyObjectType("ReturnCollection");

            type.RegisterSimpleProperty("doc_no", typeof(string));

            DependencyObjectCollection collDepObj = new DependencyObjectCollection(type);

            return(collDepObj);
        }
 /// <summary>
 /// 组织新的数据类型
 /// </summary>
 /// <param name="sourceType">原数据类型</param>
 /// <param name="newType">新数据类型</param>
 /// <param name="businessTypeService"></param>
 public void BuildCollectionPorpertyType(IDataEntityType sourceType, IDataEntityType newType, IBusinessTypeService businessTypeService)
 {
     //集合属性需重新运用递归计算类型
     foreach (var subCollPro in sourceType.CollectionProperties)
     {
         DependencyObjectType subNewType = ConvertToDependencyObjectType(subCollPro.ItemDataEntityType, businessTypeService);
         (newType as DependencyObjectType).RegisterCollectionProperty(subCollPro.Name, subNewType);
         BuildCollectionPorpertyType(subCollPro.ItemDataEntityType, subNewType, businessTypeService);
     }
 }
示例#30
0
文件: TreeView.cs 项目: ash2005/z
        static TreeView()
        {
            DefaultStyleKeyProperty.OverrideMetadata(typeof(TreeView), new FrameworkPropertyMetadata(typeof(TreeView)));
            VirtualizingPanel.IsVirtualizingProperty.OverrideMetadata(typeof(TreeView), new FrameworkPropertyMetadata(BooleanBoxes.FalseBox));
            _dType = DependencyObjectType.FromSystemTypeInternal(typeof(TreeView));

            KeyboardNavigation.DirectionalNavigationProperty.OverrideMetadata(typeof(TreeView), new FrameworkPropertyMetadata(KeyboardNavigationMode.Contained));
            KeyboardNavigation.TabNavigationProperty.OverrideMetadata(typeof(TreeView), new FrameworkPropertyMetadata(KeyboardNavigationMode.None));
            VirtualizingStackPanel.ScrollUnitProperty.OverrideMetadata(typeof(TreeView), new FrameworkPropertyMetadata(ScrollUnit.Pixel));
        }
示例#31
0
 /// <summary>
 /// Determines whether [is subclass of] [the specified dependency object type].
 /// </summary>
 /// <param name="dependencyObjectType">Type of the dependency object.</param>
 /// <returns><c>true</c> if [is subclass of] [the specified dependency object type]; otherwise, <c>false</c>.</returns>
 public bool IsSubclassOf(DependencyObjectType dependencyObjectType)
 {
     if (dependencyObjectType != null)
     {
         for (var type = this.baseDType; type != null; type = type.baseDType)
         {
             if (type.Id == dependencyObjectType.Id)
             {
                 return true;
             }
         }
     }
     return false;
 }
示例#32
0
 /// <summary>
 /// Gets the updated d typed class listeners.
 /// </summary>
 /// <param name="dependencyType">Type of the dependency.</param>
 /// <param name="routedEvent">The routed event.</param>
 /// <param name="classListenersLists">The class listeners lists.</param>
 /// <param name="index">The index.</param>
 /// <returns>RoutedEventHandlerInfoList.</returns>
 private static RoutedEventHandlerInfoList GetUpdatedDTypedClassListeners(DependencyObjectType dependencyType, RoutedEvent routedEvent, out ClassHandlersStore classListenersLists, out int index)
 {
     classListenersLists = (ClassHandlersStore)dependencyTypedClassListeners[dependencyType];
     if (classListenersLists != null)
     {
         index = classListenersLists.GetHandlersIndex(routedEvent);
         if (index != -1)
         {
             return classListenersLists.GetExistingHandlers(index);
         }
     }
     var baseType = dependencyType;
     ClassHandlersStore store = null;
     RoutedEventHandlerInfoList handlers = null;
     var handlersIndex = -1;
     while ((handlersIndex == -1) && (baseType.Id != dependencyObjectType.Id))
     {
         baseType = baseType.BaseType;
         store = (ClassHandlersStore)dependencyTypedClassListeners[baseType];
         if (store != null)
         {
             handlersIndex = store.GetHandlersIndex(routedEvent);
             if (handlersIndex != -1)
             {
                 handlers = store.GetExistingHandlers(handlersIndex);
             }
         }
     }
     if (classListenersLists == null)
     {
         if (dependencyType.SystemType == typeof(UIElement))
         {
             classListenersLists = new ClassHandlersStore(80);
         }
         else
         {
             classListenersLists = new ClassHandlersStore(1);
         }
         dependencyTypedClassListeners[dependencyType] = classListenersLists;
     }
     index = classListenersLists.CreateHandlersLink(routedEvent, handlers);
     return handlers;
 }
示例#33
0
 /// <summary>
 /// Gets the d typed class listeners.
 /// </summary>
 /// <param name="dependencyType">Type of the dependency.</param>
 /// <param name="routedEvent">The routed event.</param>
 /// <param name="classListenersLists">The class listeners lists.</param>
 /// <param name="index">The index.</param>
 /// <returns>RoutedEventHandlerInfoList.</returns>
 internal static RoutedEventHandlerInfoList GetDTypedClassListeners(DependencyObjectType dependencyType, RoutedEvent routedEvent, out ClassHandlersStore classListenersLists, out int index)
 {
     classListenersLists = (ClassHandlersStore)dependencyTypedClassListeners[dependencyType];
     if (classListenersLists != null)
     {
         index = classListenersLists.GetHandlersIndex(routedEvent);
         if (index != -1)
         {
             return classListenersLists.GetExistingHandlers(index);
         }
     }
     lock (synchronized)
     {
         return GetUpdatedDTypedClassListeners(dependencyType, routedEvent, out classListenersLists, out index);
     }
 }
示例#34
0
 /// <summary>
 /// Gets the d typed class listeners.
 /// </summary>
 /// <param name="dependencyType">Type of the dependency.</param>
 /// <param name="routedEvent">The routed event.</param>
 /// <returns>RoutedEventHandlerInfoList.</returns>
 internal static RoutedEventHandlerInfoList GetDTypedClassListeners(DependencyObjectType dependencyType, RoutedEvent routedEvent)
 {
     int num;
     ClassHandlersStore store;
     return GetDTypedClassListeners(dependencyType, routedEvent, out store, out num);
 }
 public bool IsSubclassOf(DependencyObjectType dependencyObjectType)
 {
   throw new NotImplementedException();
 }
示例#36
0
        /// <summary>
        /// Froms the system type recursive.
        /// </summary>
        /// <param name="systemType">Type of the system.</param>
        /// <returns>DependencyObjectType.</returns>
        private static DependencyObjectType FromSystemTypeRecursive(Type systemType)
        {
            DependencyObjectType type = null;
            if (dependencyTypeFromCLRType.ContainsKey(systemType))
            {
                type = (DependencyObjectType)dependencyTypeFromCLRType[systemType];
            }

            if (type == null)
            {
                type = new DependencyObjectType();
                type.SystemType = systemType;
                dependencyTypeFromCLRType[systemType] = type;
                if (systemType != typeof(DependencyObject))
                {
                    type.baseDType = FromSystemTypeRecursive(systemType.BaseType);
                }
                type.Id = dependencyTypeCount++;
            }
            return type;
        }