public static IEncodeInstance GetEncodeInstance(int verbosity, HBConfiguration configuration, ILog logService, IUserSettingService userSettingService, IPortService portService)
        {
            lock (ProcessingLock)
            {
                if (!HandBrakeUtils.IsInitialised())
                {
                    throw new Exception("Please call Init before Using!");
                }

                IEncodeInstance newInstance;

                if (userSettingService.GetUserSetting <bool>(UserSettingConstants.ProcessIsolationEnabled) &&
                    Portable.IsProcessIsolationEnabled())
                {
                    newInstance = new RemoteInstance(logService, userSettingService, portService);
                }
                else
                {
                    if (encodeInstance != null && !encodeInstance.IsRemoteInstance)
                    {
                        encodeInstance.Dispose();
                        encodeInstance = null;
                    }

                    newInstance = new HandBrakeInstance();
                    HandBrakeUtils.SetDvdNav(
                        !userSettingService.GetUserSetting <bool>(UserSettingConstants.DisableLibDvdNav));
                    encodeInstance = newInstance;
                }

                newInstance.Initialize(verbosity, noHardware);
                return(newInstance);
            }
        }
Пример #2
0
        /// <summary>
        /// Perform an update check at application start, but only daily, weekly or monthly depending on the users settings.
        /// </summary>
        /// <param name="callback">
        /// The callback.
        /// </param>
        public void PerformStartupUpdateCheck(Action <UpdateCheckInformation> callback)
        {
            if (UwpDetect.IsUWP())
            {
                return; // Disable Update checker if we are in a UWP container.
            }

            if (Portable.IsPortable() && !Portable.IsUpdateCheckEnabled())
            {
                return; // Disable Update Check for Portable Mode.
            }

            // Make sure it's running on the calling thread
            if (this.userSettingService.GetUserSetting <bool>(UserSettingConstants.UpdateStatus))
            {
                DateTime lastUpdateCheck = this.userSettingService.GetUserSetting <DateTime>(UserSettingConstants.LastUpdateCheckDate);
                int      checkFrequency  = this.userSettingService.GetUserSetting <int>(UserSettingConstants.DaysBetweenUpdateCheck) == 0 ? 7 : 30;

                if (DateTime.Now.Subtract(lastUpdateCheck).TotalDays > checkFrequency)
                {
                    this.userSettingService.SetUserSetting(UserSettingConstants.LastUpdateCheckDate, DateTime.Now);

                    this.CheckForUpdates(callback);
                }
            }
        }
Пример #3
0
        /// <summary>
        /// Perform an update check at application start, but only daily, weekly or monthly depending on the users settings.
        /// </summary>
        /// <param name="callback">
        /// The callback.
        /// </param>
        public void PerformStartupUpdateCheck(Action <UpdateCheckInformation> callback)
        {
            if (Portable.IsPortable() && !Portable.IsUpdateCheckEnabled())
            {
                return; // Disable Update Check for Portable Mode.
            }

            // Make sure it's running on the calling thread
            if (this.userSettingService.GetUserSetting <bool>(UserSettingConstants.UpdateStatus))
            {
                // If a previous update check detected an update, don't bother calling out to the HandBrake website again. Just return the result.
                int lastLatestBuildNumberCheck = this.userSettingService.GetUserSetting <int>(UserSettingConstants.IsUpdateAvailableBuild);
                if (lastLatestBuildNumberCheck != 0 && lastLatestBuildNumberCheck > HandBrakeVersionHelper.Build)
                {
                    callback(new UpdateCheckInformation {
                        NewVersionAvailable = true, Error = null
                    });
                    return;
                }

                DateTime lastUpdateCheck = this.userSettingService.GetUserSetting <DateTime>(UserSettingConstants.LastUpdateCheckDate);
                int      checkFrequency  = this.userSettingService.GetUserSetting <int>(UserSettingConstants.DaysBetweenUpdateCheck) == 0 ? 7 : 30;

                if (DateTime.Now.Subtract(lastUpdateCheck).TotalDays > checkFrequency)
                {
                    this.userSettingService.SetUserSetting(UserSettingConstants.LastUpdateCheckDate, DateTime.Now);

                    this.CheckForUpdates(callback);
                }
            }
        }
Пример #4
0
    public virtual Portable getReference()
    {
        global::System.IntPtr cPtr = yarpPINVOKE.ConnectionReader_getReference(swigCPtr);
        Portable ret = (cPtr == global::System.IntPtr.Zero) ? null : new Portable(cPtr, false);

        return(ret);
    }
Пример #5
0
        public void setUp()
        {
            // todo remove i18n from application / ui, so it can be tested in a modular way
            new App();

            Constant.Initialize();
            ImageLoader.Initialize();

            Updater  updater  = new Updater("");
            Portable portable = new Portable();
            SettingWindowViewModel settingsVm = new SettingWindowViewModel(updater, portable);
            Settings settings = settingsVm.Settings;

            Alphabet alphabet = new Alphabet();

            alphabet.Initialize(settings);
            StringMatcher stringMatcher = new StringMatcher(alphabet);

            StringMatcher.Instance = stringMatcher;
            stringMatcher.UserSettingSearchPrecision = settings.QuerySearchPrecision;

            PluginManager.LoadPlugins(settings.PluginSettings);
            MainViewModel     mainVm = new MainViewModel(settings, false);
            PublicAPIInstance api    = new PublicAPIInstance(settingsVm, mainVm, alphabet);

            PluginManager.InitializePlugins(api);
        }
Пример #6
0
        /// <summary>
        /// Override the startup behavior to handle files dropped on the app icon.
        /// </summary>
        /// <param name="e">
        /// The StartupEventArgs.
        /// </param>
        protected override void OnStartup(StartupEventArgs e)
        {
            // We don't support Windows XP / 2003 / 2003 R2 / Vista / 2008
            OperatingSystem os = Environment.OSVersion;

            if (((os.Platform == PlatformID.Win32NT) && (os.Version.Major == 5)) || ((os.Platform == PlatformID.Win32NT) && (os.Version.Major == 6 && os.Version.Minor < 1)))
            {
                MessageBox.Show(HandBrakeWPF.Properties.Resources.OsVersionWarning, HandBrakeWPF.Properties.Resources.Warning, MessageBoxButton.OK, MessageBoxImage.Warning);
                Application.Current.Shutdown();
                return;
            }

            if (!Environment.Is64BitOperatingSystem)
            {
                MessageBox.Show(HandBrakeWPF.Properties.Resources.OsBitnessWarning, HandBrakeWPF.Properties.Resources.Warning, MessageBoxButton.OK, MessageBoxImage.Warning);
                Application.Current.Shutdown();
                return;
            }

            if (e.Args.Any(f => f.Equals("--reset")))
            {
                HandBrakeApp.ResetToDefaults();
                Application.Current.Shutdown();
                return;
            }

            if (e.Args.Any(f => f.StartsWith("--recover-queue-ids")))
            {
                string command = e.Args.FirstOrDefault(f => f.StartsWith("--recover-queue-ids"));
                if (!string.IsNullOrEmpty(command))
                {
                    command = command.Replace("--recover-queue-ids=", string.Empty);
                    List <string> processIds = command.Split(',').ToList();
                    StartupOptions.QueueRecoveryIds = processIds;
                }
            }

            if (e.Args.Any(f => f.Equals("--auto-start-queue")))
            {
                StartupOptions.AutoRestartQueue = true;
            }

            // Portable Mode
            if (Portable.IsPortable())
            {
                Portable.Initialise();
            }

            base.OnStartup(e);

            // If we have a file dropped on the icon, try scanning it.
            string[] args = e.Args;
            if (args.Any() && (File.Exists(args[0]) || Directory.Exists(args[0])))
            {
                IMainViewModel mvm = IoC.Get <IMainViewModel>();
                mvm.StartScan(args[0], 0);
            }
        }
        private void ExportToBriefcaseFile()
        {
            SaveFileDialog sfdlg = new SaveFileDialog();

            sfdlg.Filter = "(briefcase files *.sdf)|*.sdf";
            if (DialogResult.OK == sfdlg.ShowDialog())
            {
                if (this.dataGridViewVIQRegistry.SelectedRows.Count > 0)
                {
                    try
                    {
                        Portable.SaveSchema(sfdlg.FileName, ApplicationInfo.bfpassword);
                    }
                    catch (Exception e2)
                    {
                        MessageBox.Show("Metadata failed to be exported :" + e2.Message);
                        return;
                    }

                    if (!Questionnaire.TransferRegistryInfoToBriefcase(MyConnection.GetConnection(), sfdlg.FileName, ApplicationInfo.bfpassword))
                    {
                        MessageBox.Show("Registry data failed to be transfered.");

                        return;
                    }
                    foreach (DataGridViewRow dgv in this.dataGridViewVIQRegistry.SelectedRows)
                    {
                        var drv = (DataRowView)dgv.DataBoundItem;
                        int qid = (int)drv["Qid"];
                        try
                        {
                            if ((byte)drv["finalized"] != 1)
                            {
                                throw new Exception("not finalized");
                            }
                        }
                        catch (Exception e3)
                        {
                            MessageBox.Show(drv["Qid"].ToString() + " skipped :not finalized");
                            continue;
                        }


                        try
                        {
                            Portable.TransferQuestionnaireTemplate(MyConnection.GetConnection(), qid, sfdlg.FileName, ApplicationInfo.bfpassword);
                        }
                        catch (Exception e2)
                        {
                            MessageBox.Show("Questionnaire export failed :" + e2.Message);
                        }
                    }
                    MessageBox.Show(string.Format("Briefcase file {0} created.", sfdlg.FileName));
                }
            }
        }
Пример #8
0
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            OptionsTab[] tabs = value as OptionsTab[];
            if (tabs != null && !Portable.IsUpdateCheckEnabled())
            {
                return(tabs.Where(s => s != OptionsTab.Updates).ToArray());
            }

            return(value);
        }
Пример #9
0
    public static bool writePair(ConnectionWriter connection, Portable head, Portable body)
    {
        bool ret = yarpPINVOKE.PortablePairBase_writePair(ConnectionWriter.getCPtr(connection), Portable.getCPtr(head), Portable.getCPtr(body));

        if (yarpPINVOKE.SWIGPendingException.Pending)
        {
            throw yarpPINVOKE.SWIGPendingException.Retrieve();
        }
        return(ret);
    }
Пример #10
0
    public bool setEnvelope(Portable data)
    {
        bool ret = yarpPINVOKE.Contactable_setEnvelope__SWIG_1(swigCPtr, Portable.getCPtr(data));

        if (yarpPINVOKE.SWIGPendingException.Pending)
        {
            throw yarpPINVOKE.SWIGPendingException.Retrieve();
        }
        return(ret);
    }
Пример #11
0
 void OnTriggerExit(Collider other)
 {
     if (other.GetComponentInParent <Portable>() != null)
     {
         currentlyOverlappingObject = null;
     }
     else if (other.GetComponent <Portable>() != null)
     {
         currentlyOverlappingObject = null;
     }
 }
Пример #12
0
        public void GenerateDevices()
        {
            #region Sample Single Initialization
            IElectronics Device1 = new Portable
            {
                Type    = "Portable",
                Name    = "ThinkPad X1",
                Company = "Lenovo"
            };
            IElectronics Device2 = new Computer
            {
                Type    = "Computer",
                Name    = "Mark 1.5x",
                Company = "Dell"
            };

            IElectronics Device3 = new Computer
            {
                Type    = "Console",
                Name    = "Playstation 4",
                Company = "Sony"
            };
            DeviceType.Add(Device1);
            DeviceType.Add(Device2);
            DeviceType.Add(Device3);

            #endregion

            #region Sample Group Initialization

            /* for (int i = 2; i < 100; i++)
             * {
             *   if (i % 2 == 0)
             *   {
             *       Studentet.Add(new Computer
             *       {
             *           Type = "Master",
             *           Name = "St" + i.ToString() + "Name",
             *           Surname = "St" + i.ToString() + "Surname"
             *       }); ; ;
             *   }
             *   else
             *   {
             *       Studentet.Add(new Laptop
             *       {
             *           Type = "Bachelor",
             *           Name = "St" + i.ToString() + "Name",
             *           Surname = "St" + i.ToString() + "Surname"
             *       });
             *   }
             * }*/
            #endregion
        }
Пример #13
0
        private static void CheckForUpdateCheckPermission(IUserSettingService userSettingService)
        {
            if (Portable.IsPortable() && !Portable.IsUpdateCheckEnabled())
            {
                return; // If Portable Mode has disabled it, don't bother the user. Just accept it's disabled.
            }

            MessageBoxResult result = MessageBox.Show(HandBrakeWPF.Properties.Resources.FirstRun_EnableUpdateCheck, HandBrakeWPF.Properties.Resources.FirstRun_EnableUpdateCheckHeader, MessageBoxButton.YesNo, MessageBoxImage.Question);

            // Be explicit setting it to true/false as it may have been turned on during first-run.
            userSettingService.SetUserSetting(UserSettingConstants.UpdateStatus, result == MessageBoxResult.Yes);
        }
Пример #14
0
        protected bool CheckFreeSpace(string path, long extraSpace)
        {
            try {
                long freeSpace = Portable.GetAvailableDiskSpace(path);
                //System.Console.WriteLine("CFS {0}: {1}+{2} {3}", path, freeSpace, extraSpace, byteBuffer.Size);

                return(freeSpace + extraSpace >= byteBuffer.Size);
            }
            catch (NotImplementedException) {
                return(true);
            }
        }
        private void FormBriefcaseVLog_Load(object sender, EventArgs e)
        {
            vtbl = Portable.GetVersion(this.filepath, this.password);

            Binding bnd = new Binding("Text", vtbl, "VersionCode");

            this.tb_versioncode.DataBindings.Add(bnd);
            this.lb_filename.Text = this.filepath;
            DataTable tbl = Portable.GetVisitLog(this.filepath, this.password);

            this.dataGridView1.DataSource = tbl;
        }
 private void FormBriefcaseVessels_Load(object sender, EventArgs e)
 {
     // TODO: This line of code loads data into the 'attendance_rdbms.Vessel' table. You can move, or remove it, as needed.
     Vessel.FillVesselTable(MyConnection.GetConnection(), this.attendance_rdbms.Vessel);
     try
     {
         Portable.FillVesselTable(this.m_filepath, this.m_password, this.attendance_briefcase.Vessel);
     }
     catch (Exception e1)
     {
         MessageBox.Show(e1.Message);
     }
 }
Пример #17
0
    void FixedUpdate()
    {
        if (currentlyOverlappingObject != null)
        {
            var currentDot = Vector3.Dot(transform.up, currentlyOverlappingObject.transform.position - transform.position);

            if (currentDot < 0) // only transport the player once he's moved across plane
            {
                currentlyOverlappingObject.Teleport(this.transform, receiver.transform);
                currentlyOverlappingObject = null;
            }
        }
    }
Пример #18
0
 void OnTriggerEnter(Collider other)
 {
     // This will break if two portable objects are passing through the same portal at the same time
     // TODO: Reimplement in Portable script
     if (other.GetComponentInParent <Portable>() != null)
     {
         currentlyOverlappingObject = other.GetComponentInParent <Portable>();
     }
     else if (other.GetComponent <Portable>() != null)
     {
         currentlyOverlappingObject = other.GetComponent <Portable>();
     }
 }
Пример #19
0
        private void bt_Transfer_Click(object sender, EventArgs e)
        {
            if (this.dataGridView1.SelectedRows.Count > 0)
            {
                foreach (DataGridViewRow dgv in this.dataGridView1.SelectedRows)
                {
                    var drv = (DataRowView)dgv.DataBoundItem;
                    int qid = (int)drv["Qid"];


                    Portable.TransferQuestionnaireTemplate(MyConnection.GetConnection(), qid, this.m_FilePath, this.m_password);
                }
            }
        }
        public async Task<Portable.Models.Expense> SaveExpense(Portable.Models.Expense expense)
        {

            var ex = await GetExpense(expense.Id);
            if (ex == null)
            {
                expense.Id = Expenses.Count;
                Expenses.Add(expense);
            }
            else
            {
                Expenses.Remove(ex);
                Expenses.Add(expense);
            }
            return expense;
        }
Пример #21
0
 private void bt_removequestionnaire_Click(object sender, EventArgs e)
 {
     if (this.dataGridViewQuestionnaires.SelectedRows.Count > 0)
     {
         foreach (DataGridViewRow dgvr in this.dataGridViewQuestionnaires.SelectedRows)
         {
             var drv = (DataRowView)dgvr.DataBoundItem;
             int qid = (int)drv["Qid"];
             if (Portable.RemoveQuestionnaire(qid, this.m_filepath, this.m_password))
             {
                 drv.Row.Delete();
                 this.attendance.VIQInfo.AcceptChanges();
             }
         }
     }
 }
Пример #22
0
    public override void FixedUpdate()
    {
        base.FixedUpdate();

        Portable portable = mEntity.GetComponent <Portable>();

        if (portable == null || !portable.IsHeld())
        {
            mRigidbody.AddForce(Vector3.up * sLevitationForce, ForceMode.Acceleration);
            if (!mScored)
            {
                mScored = true;

                Score();

                Object.Destroy(mEntity.gameObject, sTimeout);
            }
        }
    }
Пример #23
0
        public void Setup()
        {
            Settings.Initialize();
            Portable portable = new Portable();
            SettingWindowViewModel settingsVm    = new SettingWindowViewModel(portable);
            StringMatcher          stringMatcher = new StringMatcher();

            StringMatcher.Instance = stringMatcher;
            stringMatcher.UserSettingSearchPrecision = Settings.Instance.QuerySearchPrecision;
            PluginManager.LoadPlugins(Settings.Instance.PluginSettings);
            MainViewModel     mainVm = new MainViewModel(false);
            PublicAPIInstance api    = new PublicAPIInstance(settingsVm, mainVm);

            plugin = new Plugin.Program.Main();
            plugin.InitSync(new PluginInitContext()
            {
                API = api,
            });
        }
        /// <summary>
        /// Initialize this serializer with <see cref="ITypeMetadata{PT}"/> pertaining to the
        /// specified class.
        /// </summary>
        /// <param name="typeId">
        /// POF type id that uniquely identifies this type.
        /// </param>
        /// <param name="type">
        /// Type this serializer is aware of.
        /// </param>
        /// <param name="autoIndex">
        /// Turns on the auto index feature.
        /// </param>
        /// <exception cref="ArgumentException">
        /// If annotation is not present on <c>type</c>.
        /// </exception>
        private void Initialize(int typeId, Type type, bool autoIndex)
        {
            Portable portable = Attribute.GetCustomAttribute(type, typeof(Portable)) as Portable;

            if (portable == null)
            {
                throw new ArgumentException(string.Format(
                                                "Attempting to use {0} for a class ({1}) that has no {2} annotation",
                                                GetType().Name,
                                                type.Name,
                                                typeof(Portable).Name));
            }

            // via the builder create the type metadata
            TypeMetadataBuilder <object> builder = new TypeMetadataBuilder <object>()
                                                   .SetTypeId(typeId);

            builder.Accept(new AnnotationVisitor <TypeMetadataBuilder <object>, object>(autoIndex), type);
            m_tmd = builder.Build();
        }
Пример #25
0
        void FormQuestionnaire__FormClosed(object sender, FormClosedEventArgs e)
        {
            FormQuestionnaire frmq = (FormQuestionnaire)sender;

            if (frmq.NewAttendance)
            {
                Portable.LoadVettingInfo(this.m_filepath, this.m_password, this.attendance.VettingInfo, frmq.VetId);
            }
            else if (frmq.UpdatedAttendance)
            {
                DataRow [] dr = this.attendance.VettingInfo.Select("VETID = " + frmq.VetId.ToString());
                if (dr.GetLength(0) == 1)
                {
                    int   total = 0;
                    float perc  = 0;
                    dr[0]["NumAnswer"] = Portable.GetVettingStatistics(this.m_filepath, this.m_password, frmq.VetId, out total, out perc);
                    dr[0].AcceptChanges();
                }
            }
        }
Пример #26
0
        /// <summary>
        /// Override the startup behavior to handle files dropped on the app icon.
        /// </summary>
        /// <param name="e">
        /// The StartupEventArgs.
        /// </param>
        protected override void OnStartup(StartupEventArgs e)
        {
            // We don't support Windows XP / 2003 / 2003 R2 / Vista / 2008
            OperatingSystem os = Environment.OSVersion;

            if ((os.Platform == PlatformID.Win32NT) && (os.Version.Major == 5) ||
                (os.Platform == PlatformID.Win32NT) && (os.Version.Major == 6 && os.Version.Minor < 1))
            {
                MessageBox.Show("HandBrake requires Windows 7 or later to run. Version 0.9.9 (XP) and 0.10.5 (Vista) was the last version to support these versions.", "Warning", MessageBoxButton.OK, MessageBoxImage.Warning);
                Application.Current.Shutdown();
                return;
            }

            if (e.Args.Any(f => f.Equals("--reset")))
            {
                HandBrakeApp.ResetToDefaults();
                Application.Current.Shutdown();
                return;
            }

            if (e.Args.Any(f => f.Equals("--auto-start-queue")))
            {
                StartupOptions.AutoRestartQueue = true;
            }

            // Portable Mode
            if (Portable.IsPortable())
            {
                Portable.Initialise();
            }

            base.OnStartup(e);

            // If we have a file dropped on the icon, try scanning it.
            string[] args = e.Args;
            if (args.Any() && (File.Exists(args[0]) || Directory.Exists(args[0])))
            {
                IMainViewModel mvm = IoC.Get <IMainViewModel>();
                mvm.StartScan(args[0], 0);
            }
        }
Пример #27
0
        public void setUp()
        {
            // todo remove i18n from application / ui, so it can be tested in a modular way
            new App();
            Settings.Initialize();
            ImageLoader.Initialize();

            Portable portable = new Portable();
            SettingWindowViewModel settingsVm = new SettingWindowViewModel(portable);

            StringMatcher stringMatcher = new StringMatcher();

            StringMatcher.Instance = stringMatcher;
            stringMatcher.UserSettingSearchPrecision = Settings.Instance.QuerySearchPrecision;

            PluginManager.LoadPlugins(Settings.Instance.PluginSettings);
            MainViewModel     mainVm = new MainViewModel(false);
            PublicAPIInstance api    = new PublicAPIInstance(settingsVm, mainVm);

            PluginManager.InitializePlugins(api);
        }
Пример #28
0
        private void FormBriefcase_Load(object sender, EventArgs e)
        {
            // TODO: This line of code loads data into the 'attendance.VIQInfo' table. You can move, or remove it, as needed.
            //this.vIQInfoTableAdapter.Fill(this.attendance.VIQInfo);
            if (this.m_filepath != "")
            {
                try
                {
                    Portable.LoadQuestionnaires(this.m_filepath, this.m_password, this.attendance.VIQInfo);
                    Portable.LoadAllVettingInfos(this.m_filepath, this.m_password, this.attendance.VettingInfo);
                }
                catch (Exception e2)
                {
                    MessageBox.Show(e2.Message);

                    this.Hide();
                    this.Dispose();
                }
            }
            this.Text = "Briefcase { " + this.m_filepath + " }";
        }
Пример #29
0
    void UpdateLift(float dT)
    {
        bool checkLift = controls.IsLift();

        if (checkLift)
        {
            if (IsLifting())
            {
                liftTarget.Drop();
                liftTarget = null;
            }
            else
            {
                Portable curTarget = GetClosestPortable(liftDistanceSquared);
                if (curTarget)
                {
                    liftTarget = curTarget.Lift();
                }
            }
        }

        if (liftTarget != null)
        {
            Rigidbody liftRb = liftTarget.GetComponent <Rigidbody>();

            Quaternion rotationA = avatar.transform.rotation * Quaternion.Euler(0, 90, 0);
            float      angleA    = Quaternion.Angle(liftRb.transform.rotation, rotationA);

            Quaternion rotationB = avatar.transform.rotation * Quaternion.Euler(0, -90, 0);
            float      angleB    = Quaternion.Angle(liftRb.transform.rotation, rotationB);

            Quaternion targetRotation = angleA < angleB ? rotationA : rotationB;
            liftRb.transform.rotation = targetRotation;

            // TODO: Figure out why this has to be stored in a variable, otherwise Portable position doesn't update
            Vector3 liftRBPosition = liftRb.position;
            liftRb.MovePosition(avatarLiftPosition);
        }
    }
Пример #30
0
        /// <summary>
        /// Override the startup behavior to handle files dropped on the app icon.
        /// </summary>
        /// <param name="e">
        /// The StartupEventArgs.
        /// </param>
        protected override void OnStartup(StartupEventArgs e)
        {
            OperatingSystem OS = Environment.OSVersion;

            if ((OS.Platform == PlatformID.Win32NT) && (OS.Version.Major == 5 && OS.Version.Minor <= 1))
            {
                MessageBox.Show("Windows XP and earlier are no longer supported. Version 0.9.9 was the last version to support these versions. ", "Notice", MessageBoxButton.OK, MessageBoxImage.Warning);
                Application.Current.Shutdown();
                return;
            }

            if (e.Args.Any(f => f.Equals("--reset")))
            {
                HandBrakeApp.ResetToDefaults();
                Application.Current.Shutdown();
                return;
            }

            if (e.Args.Any(f => f.Equals("--auto-start-queue")))
            {
                StartupOptions.AutoRestartQueue = true;
            }

            // Portable Mode
            if (Portable.IsPortable())
            {
                Portable.Initialise();
            }

            base.OnStartup(e);

            // If we have a file dropped on the icon, try scanning it.
            string[] args = e.Args;
            if (args.Any() && (File.Exists(args[0]) || Directory.Exists(args[0])))
            {
                IMainViewModel mvm = IoC.Get <IMainViewModel>();
                mvm.StartScan(args[0], 0);
            }
        }
        private void bt_save_Click(object sender, EventArgs e)
        {
            try
            {
                this.Validate();
                this.tb_versioncode.DataBindings[0].WriteValue();
                Portable.UpdateVersion(this.filepath, this.password, vtbl);
            }
            catch (Exception e2)
            {
                MessageBox.Show(e2.Message);
            }
            try{
                Portable.UpdateVisitLogInfo(this.filepath, this.password, this.dataGridView1.DataSource as DataTable);
                MessageBox.Show("Attendance updated successfully");
            }

            catch (Exception e1)
            {
                MessageBox.Show(e1.Message);
            }
        }
Пример #32
0
 public Task UpdateExpenseAsync(Portable.Models.Expense expense)
 {
   return new Task(() => { });
 }
Пример #33
0
 public AngleAdapter(Portable robot)
 {
     this.robot = robot;
     manager = robot.motors();
     posCalc = robot.positions();
 }
Пример #34
0
 internal static HandleRef getCPtr(Portable obj)
 {
     return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
 }
Пример #35
0
 /// <summary>
 /// Opens a stream to write to a file in the persistence store
 /// </summary>
 /// <param name="pathName"></param>
 /// <param name="mode">The mode used to open the file</param>
 /// <returns></returns>
 public Stream GetOutputStream(string pathName, Portable.Compatibility.FileMode mode)
 {
     switch (mode)
     {
         case Portable.Compatibility.FileMode.Append:
             return _isolatedStorage.OpenFile(pathName, FileMode.Append, FileAccess.Write, FileShare.Read);
         case Portable.Compatibility.FileMode.Create:
             return _isolatedStorage.OpenFile(pathName, FileMode.Create, FileAccess.Write, FileShare.Read);
         case Portable.Compatibility.FileMode.CreateNew:
             return _isolatedStorage.OpenFile(pathName, FileMode.CreateNew, FileAccess.Write, FileShare.Read);
         case Portable.Compatibility.FileMode.Open:
             return _isolatedStorage.OpenFile(pathName, FileMode.Open, FileAccess.Write, FileShare.Read);
         case Portable.Compatibility.FileMode.OpenOrCreate:
             return _isolatedStorage.OpenFile(pathName, FileMode.OpenOrCreate, FileAccess.Write, FileShare.Read);
         case Portable.Compatibility.FileMode.Truncate:
             return _isolatedStorage.OpenFile(pathName, FileMode.Truncate, FileAccess.Write, FileShare.Read);
         default:
             throw new ArgumentException("Invalid file mode");
     }
 }
        /// <summary>
        /// Manual distributed transaction enlistment support
        /// </summary>
        /// <param name="transaction">The distributed transaction to enlist in</param>
        public override void EnlistTransaction(Portable.Transactions.Transaction transaction) {
            if (_transactionLevel > 0 && transaction != null)
                throw new ArgumentException("Unable to enlist in transaction, a local transaction already exists");

            if (_enlistment != null && transaction != _enlistment._scope)
                throw new ArgumentException("Already enlisted in a transaction");

            _enlistment = new SqliteEnlistment(this, transaction);
        }
 void websocket_MessageReceived(Portable.Interfaces.IWebSocketMessage obj)
 {
     Debug.WriteLine(obj.ToString());
 }
Пример #38
0
 public Task UpdateExpenseAsync(Portable.Models.Expense expense)
 {
     return Task.FromResult<object>(null);
 }
Пример #39
0
 public bool setEnvelope(Portable data)
 {
     bool ret = yarpPINVOKE.Contactable_setEnvelope__SWIG_1(swigCPtr, Portable.getCPtr(data));
     if (yarpPINVOKE.SWIGPendingException.Pending) throw yarpPINVOKE.SWIGPendingException.Retrieve();
     return ret;
 }
Пример #40
0
 public string ReadString(int startByte, int byteCount, Portable.Text.Encoding encoding)
 {
     byte[] bytes = ReadBytes(startByte, byteCount);
     string str = encoding.GetString(bytes);
     return str;
 }
 public virtual void setReference(Portable obj)
 {
     yarpPINVOKE.ConnectionWriter_setReference(swigCPtr, Portable.getCPtr(obj));
 }
 public static bool writePair(ConnectionWriter connection, Portable head, Portable body)
 {
     bool ret = yarpPINVOKE.PortablePairBase_writePair(ConnectionWriter.getCPtr(connection), Portable.getCPtr(head), Portable.getCPtr(body));
     if (yarpPINVOKE.SWIGPendingException.Pending) throw yarpPINVOKE.SWIGPendingException.Retrieve();
     return ret;
 }