Пример #1
0
        //private void ImproveUIPerformance()
        //{
        //    RunTypeInitializers(Assembly.GetAssembly(typeof(LayoutHelper))); //Core
        //    RunTypeInitializers(Assembly.GetAssembly(typeof(TextEdit))); //Editors
        //    RunTypeInitializers(Assembly.GetAssembly(typeof(DockLayoutManager))); //Docking
        //    RunTypeInitializers(Assembly.GetAssembly(typeof(GridControl))); //Grid
        //    RunTypeInitializers(Assembly.GetAssembly(typeof(BarManager))); //BarManager
        //}

        //private static void RunTypeInitializers(Assembly a)
        //{
        //    Type[] types = a.GetExportedTypes();
        //    for (int i = 0; i < types.Length; i++)
        //    {
        //        RuntimeHelpers.RunClassConstructor(types[i].TypeHandle);
        //    }
        //}

        private static void InitImageSelectorStrategies()
        {
            ImageSelector.AddGetImageStrategy(typeof(TreeItem), o =>
            {
                var item = o as TreeItem;
                if (item == null || string.IsNullOrEmpty(item.ImageName))
                {
                    return(null);
                }
                return(ResourceHelper.GetImageByName("wmsMLC.DCL.Resources", "ImageResources", item.ImageName));
            });
        }
Пример #2
0
 private static void InitImageSelectorStrategies()
 {
     ImageSelector.AddGetImageStrategy(typeof(UserGroup), o => ImageResources.DCLDefault16.GetBitmapImage());
     ImageSelector.AddGetImageStrategy(typeof(CustomParam), o => ImageResources.DCLDefault16.GetBitmapImage());
     ImageSelector.AddGetImageStrategy(typeof(MotionAreaGroupTr), o => ImageResources.DCLDefault16.GetBitmapImage());
     ImageSelector.AddGetImageStrategy(typeof(IPackingViewModel), o => ImageResources.DCLPackingPanel16.GetBitmapImage());
     ImageSelector.AddGetImageStrategy(typeof(IChatViewModel), o => ImageResources.DCLDefault16.GetBitmapImage());
     ImageSelector.AddGetImageStrategy(typeof(ObjectTreeMenu), o =>
     {
         var item = o as ObjectTreeMenu;
         if (item == null || string.IsNullOrEmpty(item.ObjectTreePictureSmall))
         {
             return(null);
         }
         return(ResourceHelper.GetImageByName("wmsMLC.DCL.Resources", "ImageResources",
                                              item.ObjectTreePictureSmall));
     });
 }