Exemple #1
0
        private void UpdatePatch()
        {
            long lS;
            string lN;
            bool isCritical = false;
            var dict = UpdatingLib.DefineSizeOfFiles(out lS, out lN, out isCritical);
            if (dict.Count > 0)
            {
                if (isCritical)
                {
                    if (MessageBox.Show(
                        @"�������� ����� ����������� ���������� ����������." + Environment.NewLine +
                        @"�����!!! ��� ���� ����������� ��������� � ����� " + Furniture.Helpers.LocalAccounts.modelPathResult +
                        @" ����� �������!" + Environment.NewLine +
                        @"���������� ��������� ��� ���� ���������� � ���������� � ��������� �����!", @"MrDoors",
                        MessageBoxButtons.OK,
                        MessageBoxIcon.Question) == DialogResult.OK)
                    {
                        UpdatePatchAfterQuestion(dict, lS, lN);

                    }
                }
                else
                {
                    if (MessageBox.Show(
                        @"�������� ����� ���������� ����������. ��������?" + Environment.NewLine +
                        @"�����!!! ��� ���� ����������� ��������� � ����� " + Furniture.Helpers.LocalAccounts.modelPathResult +
                        @" ����� �������!" + Environment.NewLine +
                        @"���������� ��������� ��� ���� ���������� � ���������� � ��������� �����!", @"MrDoors",
                        MessageBoxButtons.YesNo,
                        MessageBoxIcon.Question) == DialogResult.Yes)
                    {
                        var listNameOfPatches = dict.Keys.ToList();
                        listNameOfPatches.Sort((x, y) => UpdatingLib.GetDate(x).CompareTo(UpdatingLib.GetDate(y)));
                        string lastPatch = listNameOfPatches.Last();
                        long sizePatches = dict.Sum(l => l.Value);
                        //if ((UpdatingLib.GetDate(lN) > UpdatingLib.GetDate(lastPatch)) ||
                        //    (UpdatingLib.GetDate(lN) == UpdatingLib.GetDate(lastPatch) && lS <= sizePatches))
                        if ((UpdatingLib.GetDate(lN) > UpdatingLib.GetDate(lastPatch)) && (lS <= sizePatches))
                        {
                            var f = new UpdatingLib("L");
                            f.Updating();
                        }
                        else
                        {
                            var f = new UpdatingLib("P");
                            f.Updating();
                        }
                    }
                    else
                        return;
                }
            }
            else
                if (lS > 0 &&
                MessageBox.Show(@"�������� ����� ���������� ����������. ��������?" + Environment.NewLine +
                    @"�����!!! ��� ���� ����������� ��������� � ����� " + Furniture.Helpers.LocalAccounts.modelPathResult +
                    @" ����� �������!" + Environment.NewLine +
                    @"���������� ��������� ��� ���� ���������� � ���������� � ��������� �����!", @"MrDoors", MessageBoxButtons.YesNo,
                    MessageBoxIcon.Question) == DialogResult.Yes)
                {
                    var f = new UpdatingLib("L");
                    f.Updating();
                }
        }
Exemple #2
0
 private static void UpdatePatchAfterQuestion(Dictionary<string, long> dict, long lS, string lN)
 {
     var listNameOfPatches = dict.Keys.ToList();
     listNameOfPatches.Sort((x, y) => UpdatingLib.GetDate(x).CompareTo(UpdatingLib.GetDate(y)));
     string lastPatch = listNameOfPatches.Last();
     long sizePatches = dict.Sum(l => l.Value);
     if ((UpdatingLib.GetDate(lN) > UpdatingLib.GetDate(lastPatch)) ||
         (UpdatingLib.GetDate(lN) == UpdatingLib.GetDate(lastPatch) && lS <= sizePatches))
     {
         var f = new UpdatingLib("L");
         f.Updating();
     }
     else
     {
         var f = new UpdatingLib("P");
         f.Updating();
     }
 }
Exemple #3
0
 private void btnIpdateLib_Click(object sender, EventArgs e)
 {
     var f = new UpdatingLib("L");
     f.Updating(true);
 }
Exemple #4
0
 public int UpdateLib()
 {
     if (MessageBox.Show(@"�������� ����������?", @"MrDoors", MessageBoxButtons.YesNo,
                         MessageBoxIcon.Question) == DialogResult.Yes)
     {
         var f = new UpdatingLib("L");
         SetParent(f.Handle, _swHandle);
         f.Updating();
     }
     return 1;
 }
Exemple #5
0
        private void LocalLibUpdatePath_Click(object sender, EventArgs e)
        {
            if (LocalLibUpdatePath.Text == "...")
            {
                if (openFileDialog.ShowDialog() == DialogResult.OK)
                {
                    LocalLibUpdatePath.Text = "Обновить";
                    PathTb.Text = openFileDialog.FileName;
                }
            }
            else
            {
                string tmp = PathTb.Text;
                Close();
                var ul = new UpdatingLib("L");
                ul.UpdateLibFromLocalFile(new FileInfo(tmp));

            }
        }