public static Fraction Subtract(Fraction frac1, Fraction frac2)
 {
     return(!((Fraction)null != frac1) || !((Fraction)null != frac2) ? (Fraction)null : Fraction.Add(frac1, -frac2));
 }
 public static Fraction Divide(Fraction frac1, Fraction frac2)
 {
     return(!((Fraction)null != frac1) || !((Fraction)null != frac2) ? (Fraction)null : Fraction.Multiply(frac1, Fraction.Inverse(frac2)));
 }
 public static Fraction Negate(Fraction frac1)
 {
     return((object)frac1 != null ? new Fraction(-frac1.Numerator, frac1.Denominator) : (Fraction)null);
 }
 private void Initialize(long iNumerator, long iDenominator)
 {
     this.Numerator   = iNumerator;
     this.Denominator = iDenominator;
     Fraction.ReduceFraction(this);
 }
 public static Fraction operator /(Fraction frac1, double dbl)
 {
     return(!((Fraction)null != frac1) ? (Fraction)null : Fraction.Multiply(frac1, Fraction.Inverse(Fraction.ToFraction(dbl))));
 }
        public Fraction(string strValue)
        {
            Fraction fraction = Fraction.ToFraction(strValue);

            this.Initialize(fraction.Numerator, fraction.Denominator);
        }
        public Fraction(double dDecimalValue)
        {
            Fraction fraction = Fraction.ToFraction(dDecimalValue);

            this.Initialize(fraction.Numerator, fraction.Denominator);
        }
 public static Fraction operator /(Fraction frac1, int iNo)
 {
     return(!((Fraction)null != frac1) ? (Fraction)null : Fraction.Multiply(frac1, Fraction.Inverse(new Fraction((long)iNo))));
 }
 public static Fraction operator *(Fraction frac1, Fraction frac2)
 {
     return(!((Fraction)null != frac1) || !((Fraction)null != frac2) ? (Fraction)null : Fraction.Multiply(frac1, frac2));
 }
Esempio n. 10
0
 public static Fraction operator *(int iNo, Fraction frac1)
 {
     return(!((Fraction)null != frac1) ? (Fraction)null : Fraction.Multiply(frac1, new Fraction((long)iNo)));
 }
Esempio n. 11
0
 public static Fraction operator -(Fraction frac1, double dbl)
 {
     return(!((Fraction)null != frac1) ? (Fraction)null : Fraction.Add(frac1, -Fraction.ToFraction(dbl)));
 }
Esempio n. 12
0
 public static Fraction operator -(Fraction frac1, int iNo)
 {
     return(!((Fraction)null != frac1) ? (Fraction)null : Fraction.Add(frac1, -new Fraction((long)iNo)));
 }
Esempio n. 13
0
 public static Fraction operator -(Fraction frac1, Fraction frac2)
 {
     return(!((Fraction)null != frac1) || !((Fraction)null != frac2) ? (Fraction)null : Fraction.Add(frac1, -frac2));
 }
Esempio n. 14
0
 public static Fraction operator -(Fraction frac1)
 {
     return(!((Fraction)null != frac1) ? (Fraction)null : Fraction.Negate(frac1));
 }
Esempio n. 15
0
        public static void Main(string[] args)
        {
            Directory.SetCurrentDirectory(AppDomain.CurrentDomain.BaseDirectory);
            App.InitExceptionAndLogging();
            ProcessUtils.LogParentProcessDetails();
            if (args != null)
            {
                App.ParseWebMagnetArgs(ref args);
                Opt.Instance.Parse(args);
            }
            string path = Path.Combine(Path.Combine(Directory.GetParent(AppDomain.CurrentDomain.BaseDirectory.Trim('\\')).FullName, "Engine"), "Oem.cfg");

            Oem.CurrentOemFilePath = System.IO.File.Exists(path) ? path : Path.Combine(RegistryManager.Instance.EngineDataDir, "Oem.cfg");
            PortableInstaller.CheckAndRunPortableInstaller();
            if (!RegistryManager.Instance.Guest.ContainsKey(Opt.Instance.vmname))
            {
                Opt.Instance.vmname = "Android";
            }
            BlueStacks.Common.Strings.CurrentDefaultVmName = Opt.Instance.vmname;
            if (Opt.Instance.mergeCfg)
            {
                KMManager.MergeConfig(Opt.Instance.newPDPath);
                Environment.Exit(0);
            }
            string mBSTProcessIdentifier = "Bluestacks/" + RegistryManager.Instance.ClientVersion;

            if (!string.Join(string.Empty, args).Contains(mBSTProcessIdentifier))
            {
                Logger.Info("BOOT_STAGE: Client starting");
                if (Oem.IsOEMDmm)
                {
                    Logger.Info("checking DMMGamePlayer process");
                    if (!ProcessUtils.FindProcessByName("DMMGamePlayer") && !ProcessUtils.FindProcessByName("dmmemulatorsandboxlauncher"))
                    {
                        Logger.Info("DMM game player not running, so exiting");
                        Environment.Exit(0);
                    }
                }
                RegistryManager.ClientThemeName = RegistryManager.Instance.GetClientThemeNameFromRegistry();
                if (Oem.IsOEMDmm || !BlueStacksUpdater.CheckIfDownloadedFileExist())
                {
                    App app = new App();
                    app.Startup     += new StartupEventHandler(App.Application_Startup);
                    app.ShutdownMode = ShutdownMode.OnExplicitShutdown;
                    app.InitializeComponent();
                    App.CheckIfAlreadyRunning();
                    RegistryManager.Instance.ClientLaunchParams = Opt.Instance.Json;
                    App.defaultResolution = new Fraction((long)RegistryManager.Instance.Guest[BlueStacks.Common.Strings.CurrentDefaultVmName].GuestWidth, (long)RegistryManager.Instance.Guest[BlueStacks.Common.Strings.CurrentDefaultVmName].GuestHeight);
                    SystemEvents.DisplaySettingsChanged += new EventHandler(App.HandleDisplaySettingsChanged);
                    BGPHelper.InitHttpServerAsync();
                    BlueStacksUIUtils.RunInstance(BlueStacks.Common.Strings.CurrentDefaultVmName, Opt.Instance.h, Opt.Instance.Json);
                    AppUsageTimer.SessionEventHandler();
                    if (!Oem.IsOEMDmm)
                    {
                        PromotionManager.ReloadPromotionsAsync();
                        GrmManager.UpdateGrmAsync((IEnumerable <string>)null);
                        GuidanceCloudInfoManager.Instance.AppsGuidanceCloudInfoRefresh();
                    }
                    if (!FeatureManager.Instance.IsHtmlHome)
                    {
                        BlueStacksUIUtils.DictWindows[BlueStacks.Common.Strings.CurrentDefaultVmName].CreateFirebaseBrowserControl();
                    }
                    MemoryManager.TrimMemory(true);
                    app.Run();
                }
                else
                {
                    BlueStacksUpdater.HandleUpgrade(RegistryManager.Instance.DownloadedUpdateFile);
                }
            }
            else
            {
                CefHelper.InitCef(args, mBSTProcessIdentifier);
            }
            AppUsageTimer.DetachSessionEventHandler();
            CefRuntime.Shutdown();
            App.ExitApplication();
        }