Example #1
0
 public static void PlatformInit(PlatformRegister platformRegister)
 {
     if (Platform == null)
     {
         Platform = platformRegister;
         Platform._mainWindowInstance = Platform.CreateMainWindow();
         RootMethodItem.MenuElement   = Platform.CreateMainMenuItem(RootMethodItem);
     }
     else
     {
         throw new Exception("Платформа уже зарегистрированна. Нельзя зарегистрировать больше одной платформы");
     }
 }
Example #2
0
        //public IReadOnlyCollection<IImageTypeInfo> FormateRegisters { get; }
        //
        //#region FormatReg
        //public Registers RegisterFormat(IImageTypeInfo formatRegister)
        //{
        //    imageTypeInfos.Add(formatRegister);
        //    imageTypeInfosFromTImage.Add(formatRegister.ImageType, formatRegister);
        //    imageTypeInfosFromTLayer.Add(formatRegister.LayerType, formatRegister);
        //    FormateRegistered?.Invoke(formatRegister);
        //    return this;
        //}
        //#endregion FormatReg

        public Registers RegisterPlatform(PlatformRegister platformRegister)
        {
            if (PlatformRegister._instance == null)
            {
                Platform = platformRegister;
                PlatformRegister._instance                       = platformRegister;
                platformRegister._mainWindowInstance             = platformRegister.CreateMainWindow();
                LibLoader.RootMethodItem.MenuElement             = platformRegister._mainMenuElement
                                                                 = platformRegister.CreateMainMenuItem(LibLoader.RootMethodItem);
                return(this);
            }
            else
            {
                throw new Exception();
            }
        }