Пример #1
0
    private void DelProgress_FormClosing(object sender, FormClosingEventArgs e)
    {
        //Discarded unreachable code: IL_0030, IL_0052, IL_0054, IL_0064, IL_0086
        int num2 = default(int);
        int num3 = default(int);

        try
        {
            int num = 1;
            if (!LikeOperator.LikeString(Declarer.startPath, "*Debug", CompareMethod.Binary))
            {
                ProjectData.ClearProjectError();
                num2 = 1;
            }
            num = 3;
            if (_doing)
            {
                num      = 4;
                e.Cancel = true;
            }
        }
        catch (Exception obj) when((obj is Exception && num2 != 0) & (num3 == 0))
        {
            ProjectData.SetProjectError((Exception)obj);
            /*Error near IL_0084: Could not find block for branch target IL_0054*/;
        }
        if (num3 != 0)
        {
            ProjectData.ClearProjectError();
        }
    }
Пример #2
0
    private void lbSelected_KeyUp(object sender, KeyEventArgs e)
    {
        //Discarded unreachable code: IL_003c, IL_005e, IL_0060, IL_0070, IL_0092
        int num2 = default(int);
        int num3 = default(int);

        try
        {
            int num = 1;
            if (!LikeOperator.LikeString(Declarer.startPath, "*Debug", Microsoft.VisualBasic.CompareMethod.Binary))
            {
                ProjectData.ClearProjectError();
                num2 = 1;
            }
            num = 3;
            if (e.KeyCode == Keys.Delete)
            {
                num = 4;
                Buttons_Click(lRemove, new EventArgs());
            }
        }
        catch (Exception obj) when((obj is Exception && num2 != 0) & (num3 == 0))
        {
            ProjectData.SetProjectError((Exception)obj);
            /*Error near IL_0090: Could not find block for branch target IL_0060*/;
        }
        if (num3 != 0)
        {
            ProjectData.ClearProjectError();
        }
    }
Пример #3
0
    public static void Purchase()
    {
        //Discarded unreachable code: IL_002d, IL_004b, IL_004d, IL_005d, IL_007f
        int num2 = default(int);
        int num3 = default(int);

        try
        {
            int num = 1;
            if (!LikeOperator.LikeString(Declarer.startPath, "*Debug", CompareMethod.Binary))
            {
                ProjectData.ClearProjectError();
                num2 = 1;
            }
            num = 3;
            Interaction.Shell("explorer \"http://DuplicateFileFinder4PC.com/order-dpfp.htm?source=dpfp_inter\"", AppWinStyle.NormalFocus);
        }
        catch (Exception obj) when((obj is Exception && num2 != 0) & (num3 == 0))
        {
            ProjectData.SetProjectError((Exception)obj);
            /*Error near IL_007d: Could not find block for branch target IL_004d*/;
        }
        if (num3 != 0)
        {
            ProjectData.ClearProjectError();
        }
    }
Пример #4
0
    private void lv_DoubleClick(object sender, EventArgs e)
    {
        //Discarded unreachable code: IL_003b, IL_005d, IL_005f, IL_006f, IL_0091
        int num2 = default(int);
        int num3 = default(int);

        try
        {
            int num = 1;
            if (!LikeOperator.LikeString(Declarer.startPath, "*Debug", CompareMethod.Binary))
            {
                ProjectData.ClearProjectError();
                num2 = 1;
            }
            num = 3;
            if (lEdit.Enabled)
            {
                num = 4;
                Buttons_Click(lEdit, e);
            }
        }
        catch (Exception obj) when((obj is Exception && num2 != 0) & (num3 == 0))
        {
            ProjectData.SetProjectError((Exception)obj);
            /*Error near IL_008f: Could not find block for branch target IL_005f*/;
        }
        if (num3 != 0)
        {
            ProjectData.ClearProjectError();
        }
    }
Пример #5
0
        public static bool BkDXF_ValidHexNum(string vstrHexNum, ref int nrlngErrNum, ref string nrstrErrMsg)
        {
            nrlngErrNum = 0;
            nrstrErrMsg = null;
            if (Operators.CompareString(vstrHexNum, null, TextCompare: false) == 0)
            {
                nrlngErrNum = 13;
                nrstrErrMsg = "Typen unverträglich";
            }
            else if (LikeOperator.LikeString(vstrHexNum, "*[!0123456789ABCDEF]*", CompareMethod.Binary))
            {
                nrlngErrNum = 13;
                nrstrErrMsg = "Typen unverträglich";
            }
            else
            {
                if (Strings.Len(vstrHexNum) <= 8)
                {
                    return(true);
                }
                nrlngErrNum = 6;
                nrstrErrMsg = "Überlauf";
            }
            bool BkDXF_ValidHexNum = default(bool);

            return(BkDXF_ValidHexNum);
        }
Пример #6
0
    // Token: 0x0600035C RID: 860 RVA: 0x000140F8 File Offset: 0x000122F8
    public List <string> method_4(string string_0, string string_1)
    {
        string        text  = string_0 + string_1;
        bool          bool_ = Operators.CompareString(Conversions.ToString(text.Last <char>()), "C", false) == 0;
        List <string> list  = new List <string>();

        if (string_0.Contains("?") | string_0.Contains("["))
        {
            this.method_1(bool_);
        }
        else
        {
            this.method_2(Conversions.ToString(Conversions.ToUInteger(string_0)), bool_);
        }
        text = text.Replace("C", "?");
        checked
        {
            int num = this.list_0.Count - 1;
            for (int i = 0; i <= num; i++)
            {
                int index = this.random_0.Next(0, this.list_0.Count - 1);
                if (LikeOperator.LikeString(this.list_0[index], text, CompareMethod.Binary))
                {
                    list.Add(this.list_0[index]);
                }
                this.list_0.RemoveAt(index);
            }
            return(list);
        }
    }
Пример #7
0
    private void lOK_Click(object sender, EventArgs e)
    {
        //Discarded unreachable code: IL_0030, IL_004e, IL_0050, IL_0060, IL_0082
        int num2 = default(int);
        int num3 = default(int);

        try
        {
            int num = 1;
            if (!LikeOperator.LikeString(Declarer.startPath, "*Debug", CompareMethod.Binary))
            {
                ProjectData.ClearProjectError();
                num2 = 1;
            }
            num = 3;
            bOK_Click(bOK, new EventArgs());
        }
        catch (Exception obj) when((obj is Exception && num2 != 0) & (num3 == 0))
        {
            ProjectData.SetProjectError((Exception)obj);
            /*Error near IL_0080: Could not find block for branch target IL_0050*/;
        }
        if (num3 != 0)
        {
            ProjectData.ClearProjectError();
        }
    }
Пример #8
0
        private void CheckLatestVerOnStartup()
        {
            //Discarded unreachable code: IL_0025, IL_0043, IL_0045, IL_0055, IL_0077
            int num2 = default(int);
            int num3 = default(int);

            try
            {
                int num = 1;
                if (!LikeOperator.LikeString(Declarer.startPath, "*Debug", CompareMethod.Binary))
                {
                    ProjectData.ClearProjectError();
                    num2 = 1;
                }
                num = 3;
                SelfService.CheckLatestVer(silent: true);
            }
            catch (Exception obj) when((obj is Exception && num2 != 0) & (num3 == 0))
            {
                ProjectData.SetProjectError((Exception)obj);
                /*Error near IL_0075: Could not find block for branch target IL_0045*/;
            }
            if (num3 != 0)
            {
                ProjectData.ClearProjectError();
            }
        }
Пример #9
0
    private void lCancel_Click(object sender, EventArgs e)
    {
        //Discarded unreachable code: IL_0025, IL_0043, IL_0045, IL_0055, IL_0077
        int num2 = default(int);
        int num3 = default(int);

        try
        {
            int num = 1;
            if (!LikeOperator.LikeString(Declarer.startPath, "*Debug", Microsoft.VisualBasic.CompareMethod.Binary))
            {
                ProjectData.ClearProjectError();
                num2 = 1;
            }
            num = 3;
            Close();
        }
        catch (Exception obj) when((obj is Exception && num2 != 0) & (num3 == 0))
        {
            ProjectData.SetProjectError((Exception)obj);
            /*Error near IL_0075: Could not find block for branch target IL_0045*/;
        }
        if (num3 != 0)
        {
            ProjectData.ClearProjectError();
        }
    }
Пример #10
0
    private void tv_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e)
    {
        //Discarded unreachable code: IL_0048, IL_006a, IL_006c, IL_007c, IL_009e
        int num2 = default(int);
        int num3 = default(int);

        try
        {
            int num = 1;
            if (!LikeOperator.LikeString(Declarer.startPath, "*Debug", Microsoft.VisualBasic.CompareMethod.Binary))
            {
                ProjectData.ClearProjectError();
                num2 = 1;
            }
            num = 3;
            if (Microsoft.VisualBasic.FileIO.FileSystem.FileExists(e.Node.Name))
            {
                num = 4;
                TFile.ExecFileFolder(tv.SelectedNode.Name);
            }
        }
        catch (Exception obj) when((obj is Exception && num2 != 0) & (num3 == 0))
        {
            ProjectData.SetProjectError((Exception)obj);
            /*Error near IL_009c: Could not find block for branch target IL_006c*/;
        }
        if (num3 != 0)
        {
            ProjectData.ClearProjectError();
        }
    }
Пример #11
0
        protected override string LikeOperation(string val1, string val2, LikeOperator opt)
        {
            switch (opt)
            {
            case LikeOperator.Contains:
                return(string.Concat(val1, " LIKE '%' || ", val2, " || '%'"));

            case LikeOperator.StartWith:
                return(string.Concat(val1, " LIKE ", val2, " || '%'"));

            case LikeOperator.EndWith:
                return(string.Concat(val1, " LIKE '%' || ", val2));

            case LikeOperator.NotContains:
                return(string.Concat(val1, " NOT LIKE '%' || ", val2, " || '%'"));

            case LikeOperator.NotStartWith:
                return(string.Concat(val1, " NOT LIKE ", val2, " || '%'"));

            case LikeOperator.NotEndWith:
                return(string.Concat(val1, " NOT LIKE '%' || ", val2));

            default:
                throw new ArgumentOutOfRangeException("opt");
            }
        }
Пример #12
0
    private void Buttons_MouseLeave(object sender, EventArgs e)
    {
        //Discarded unreachable code: IL_002f, IL_004d, IL_004f, IL_005f, IL_0081
        int num2 = default(int);
        int num3 = default(int);

        try
        {
            int num = 1;
            if (!LikeOperator.LikeString(Declarer.startPath, "*Debug", Microsoft.VisualBasic.CompareMethod.Binary))
            {
                ProjectData.ClearProjectError();
                num2 = 1;
            }
            num = 3;
            ((Control)sender).BackColor = Declarer.lightGray;
        }
        catch (Exception obj) when((obj is Exception && num2 != 0) & (num3 == 0))
        {
            ProjectData.SetProjectError((Exception)obj);
            /*Error near IL_007f: Could not find block for branch target IL_004f*/
            ;
        }
        if (num3 != 0)
        {
            ProjectData.ClearProjectError();
        }
    }
Пример #13
0
    public static void UpgradeSettings()
    {
        //Discarded unreachable code: IL_0050, IL_007a, IL_007c, IL_008c, IL_00ae
        int num2 = default(int);
        int num3 = default(int);

        try
        {
            int num = 1;
            if (!LikeOperator.LikeString(Declarer.startPath, "*Debug", CompareMethod.Binary))
            {
                ProjectData.ClearProjectError();
                num2 = 1;
            }
            num = 3;
            if (!My.MySettingsProperty.Settings.upgraded)
            {
                num = 4;
                My.MySettingsProperty.Settings.Upgrade();
                num = 5;
                My.MySettingsProperty.Settings.upgraded = true;
                num = 6;
                My.MySettingsProperty.Settings.Save();
            }
        }
        catch (Exception obj) when((obj is Exception && num2 != 0) & (num3 == 0))
        {
            ProjectData.SetProjectError((Exception)obj);
            /*Error near IL_00ac: Could not find block for branch target IL_007c*/;
        }
        if (num3 != 0)
        {
            ProjectData.ClearProjectError();
        }
    }
Пример #14
0
    public static void AfterPrompt(ref Form f, ref Label l)
    {
        //Discarded unreachable code: IL_003d, IL_0063, IL_0065, IL_0075, IL_0097
        int num2 = default(int);
        int num3 = default(int);

        try
        {
            int num = 1;
            if (!LikeOperator.LikeString(Declarer.startPath, "*Debug", CompareMethod.Binary))
            {
                ProjectData.ClearProjectError();
                num2 = 1;
            }
            num            = 3;
            Cursor.Current = Cursors.Default;
            num            = 4;
            l.Visible      = false;
            num            = 5;
            f.Enabled      = true;
        }
        catch (Exception obj) when((obj is Exception && num2 != 0) & (num3 == 0))
        {
            ProjectData.SetProjectError((Exception)obj);
            /*Error near IL_0095: Could not find block for branch target IL_0065*/;
        }
        if (num3 != 0)
        {
            ProjectData.ClearProjectError();
        }
    }
Пример #15
0
        public static FilterData Like(string propertyName, object value, LikeOperator likeOperator = LikeOperator.None)
        {
            FilterData fd = DefaultSet(propertyName, value, FilterType.Like);

            fd._likeOperator = likeOperator;
            return(fd);
        }
Пример #16
0
        public static string BkDXF_LineWeightString(Enums.AcLineWeight vnumLineweight)
        {
            switch (vnumLineweight)
            {
            case Enums.AcLineWeight.acLnWtByLayer:
                return("ByLayer");

            case Enums.AcLineWeight.acLnWtByBlock:
                return("ByBlock");

            case Enums.AcLineWeight.acLnWtByLwDefault:
                return("Default");

            default:
            {
                string dstrValue = Strings.Replace(Support.Format(Operators.DivideObject((double)vnumLineweight, Interaction.IIf(Expression: false, new decimal(100L), 100.0)), "#.##"), ",", ".");
                if (LikeOperator.LikeString(dstrValue, ".*", CompareMethod.Binary))
                {
                    dstrValue = "0" + dstrValue;
                }
                if (Strings.Len(dstrValue) < 4)
                {
                    dstrValue += new string('0', checked (4 - Strings.Len(dstrValue)));
                }
                return(dstrValue + " mm");
            }
            }
        }
Пример #17
0
 public Types()
 {
     //Discarded unreachable code: IL_0187, IL_01d5, IL_01d7, IL_01e7, IL_0209
     base.KeyUp += Me_KeyUp;
     checked
     {
         int num2 = default(int);
         int num4 = default(int);
         try
         {
             int num = 1;
             if (!LikeOperator.LikeString(Declarer.startPath, "*Debug", CompareMethod.Binary))
             {
                 ProjectData.ClearProjectError();
                 num2 = 1;
             }
             num = 3;
             InitializeComponent();
             num = 4;
             if (Operators.CompareString(My.MySettingsProperty.Settings.lang, "ar", TextCompare: false) == 0)
             {
                 num         = 5;
                 RightToLeft = RightToLeft.Yes;
             }
             else
             {
                 num         = 7;
                 RightToLeft = RightToLeft.No;
             }
             num = 8;
             LoadTypes();
             num = 9;
             LoadLangText();
             num = 10;
             int num3 = tlv.Width - tlv.Columns[0].Width - tlv.Columns[1].Width - tlv.Columns[2].Width;
             num = 11;
             if (num3 > 40)
             {
                 num   = 12;
                 num3 -= 40;
                 num   = 13;
                 tlv.Columns[0].Width += (int)Math.Round((double)num3 * 0.4);
                 num = 14;
                 tlv.Columns[1].Width += (int)Math.Round((double)num3 * 0.4);
                 num = 15;
                 tlv.Columns[2].Width += (int)Math.Round((double)num3 * 0.2);
             }
         }
         catch (Exception obj) when((obj is Exception && num2 != 0) & (num4 == 0))
         {
             ProjectData.SetProjectError((Exception)obj);
             /*Error near IL_0207: Could not find block for branch target IL_01d7*/;
         }
         if (num4 != 0)
         {
             ProjectData.ClearProjectError();
         }
     }
 }
Пример #18
0
    private void Me_KeyUp(object sender, KeyEventArgs e)
    {
        //Discarded unreachable code: IL_00a8, IL_00f2, IL_00f4, IL_0104, IL_0126
        int num2 = default(int);
        int num3 = default(int);

        try
        {
            int num = 1;
            if (!LikeOperator.LikeString(Declarer.startPath, "*Debug", CompareMethod.Binary))
            {
                ProjectData.ClearProjectError();
                num2 = 1;
            }
            num = 3;
            if (e.Control)
            {
                num = 4;
                switch (e.KeyCode)
                {
                case Keys.N:
                    num = 6;
                    Buttons_Click(lAdd, new EventArgs());
                    break;

                case Keys.E:
                    num = 8;
                    if (lEdit.Enabled)
                    {
                        num = 9;
                        Buttons_Click(lEdit, new EventArgs());
                    }
                    break;
                }
            }
            else
            {
                num = 12;
                if (e.KeyCode == Keys.Delete)
                {
                    num = 13;
                    if (lDel.Enabled)
                    {
                        num = 14;
                        Buttons_Click(lDel, new EventArgs());
                    }
                }
            }
        }
        catch (Exception obj) when((obj is Exception && num2 != 0) & (num3 == 0))
        {
            ProjectData.SetProjectError((Exception)obj);
            /*Error near IL_0124: Could not find block for branch target IL_00f4*/;
        }
        if (num3 != 0)
        {
            ProjectData.ClearProjectError();
        }
    }
Пример #19
0
 public static bool Like(this string source, string pattern, CompareMethod compareOption)
 {
     try {
         return(LikeOperator.LikeString(source, pattern, (Microsoft.VisualBasic.CompareMethod)(int) compareOption));
     } catch {
         throw;
     }
 }
Пример #20
0
    public static void ReloadInterfacesWithLang()
    {
        //Discarded unreachable code: IL_0121, IL_017b, IL_017d, IL_018d, IL_01af
        int num2 = default(int);
        int num3 = default(int);

        try
        {
            int num = 1;
            if (!LikeOperator.LikeString(Declarer.startPath, "*Debug", CompareMethod.Binary))
            {
                ProjectData.ClearProjectError();
                num2 = 1;
            }
            num = 3;
            My.MyProject.Forms.About.Dispose();
            num = 4;
            My.MyProject.Forms.About = null;
            num = 5;
            My.MyProject.Forms.DrivesSelector.Dispose();
            num = 6;
            My.MyProject.Forms.DrivesSelector = null;
            num = 7;
            My.MyProject.Forms.FFSelector.Dispose();
            num = 8;
            My.MyProject.Forms.FFSelector = null;
            num = 9;
            My.MyProject.Forms.Options.Dispose();
            num = 10;
            My.MyProject.Forms.Options = null;
            num = 11;
            My.MyProject.Forms.Result.Dispose();
            num = 12;
            My.MyProject.Forms.Result = null;
            num = 13;
            My.MyProject.Forms.Types.Dispose();
            num = 14;
            My.MyProject.Forms.Types = null;
            num = 15;
            My.MyProject.Forms.DelProgress.Dispose();
            num = 16;
            My.MyProject.Forms.DelProgress = null;
            num = 17;
            My.MyProject.Forms.Main.LoadLangText();
            num = 18;
            Form inter = My.MyProject.Forms.Main;
            DisplayLicense(ref inter);
        }
        catch (Exception obj) when((obj is Exception && num2 != 0) & (num3 == 0))
        {
            ProjectData.SetProjectError((Exception)obj);
            /*Error near IL_01ad: Could not find block for branch target IL_017d*/;
        }
        if (num3 != 0)
        {
            ProjectData.ClearProjectError();
        }
    }
Пример #21
0
        internal static void WarnRegexSetLiteral(string FullText, int CurrentLineNumber)
        {
            string source = TokenText(FullText);

            if (LikeOperator.LikeString(source, "*[a-zA-Z]-[a-zA-Z]*", CompareMethod.Binary) | LikeOperator.LikeString(source, "*#-#*", CompareMethod.Binary))
            {
                BuilderApp.Log.Add(SysLogSection.Grammar, SysLogAlert.Warning, "The set literal " + FullText + " does not represent a set range", "The GOLD Builder interpreters sets like [A-Z] as three characters: 'A', '-', and 'Z'. Set ranges are supported, but use a different notation. Please consult the documentation.", Conversions.ToString(CurrentLineNumber));
            }
        }
Пример #22
0
        private void InternListSection(ref int rlngIdx)
        {
            AcadBlock dobjAcadBlock4 = (AcadBlock)mobjAcadBlocks.Item("*Model_Space");

            InternListBlockBegin(dobjAcadBlock4.BlockBegin, ref rlngIdx);
            InternListBlockData(dobjAcadBlock4, ref rlngIdx);
            InternListBlockEnd(dobjAcadBlock4.BlockEnd, ref rlngIdx);
            IEnumerator enumerator = default(IEnumerator);

            try
            {
                enumerator = mobjAcadBlocks.GetValues().GetEnumerator();
                while (enumerator.MoveNext())
                {
                    dobjAcadBlock4 = (AcadBlock)enumerator.Current;
                    if (LikeOperator.LikeString(dobjAcadBlock4.Name, "[*]Paper_Space*", CompareMethod.Binary))
                    {
                        InternListBlockBegin(dobjAcadBlock4.BlockBegin, ref rlngIdx);
                        InternListBlockData(dobjAcadBlock4, ref rlngIdx);
                        hwpDxf_List.BkDXFList_AcadBlockEntities(mstrAcadVer, dobjAcadBlock4, ref rlngIdx, ref mobjDictReadCodes, ref mobjDictReadValues);
                        InternListBlockEnd(dobjAcadBlock4.BlockEnd, ref rlngIdx);
                    }
                }
            }
            finally
            {
                if (enumerator is IDisposable)
                {
                    (enumerator as IDisposable).Dispose();
                }
            }
            IEnumerator enumerator2 = default(IEnumerator);

            try
            {
                enumerator2 = mobjAcadBlocks.GetValues().GetEnumerator();
                while (enumerator2.MoveNext())
                {
                    dobjAcadBlock4 = (AcadBlock)enumerator2.Current;
                    if (!LikeOperator.LikeString(dobjAcadBlock4.Name, "[*]Model_Space", CompareMethod.Binary) & !LikeOperator.LikeString(dobjAcadBlock4.Name, "[*]Paper_Space*", CompareMethod.Binary))
                    {
                        InternListBlockBegin(dobjAcadBlock4.BlockBegin, ref rlngIdx);
                        InternListBlockData(dobjAcadBlock4, ref rlngIdx);
                        hwpDxf_List.BkDXFList_AcadBlockEntities(mstrAcadVer, dobjAcadBlock4, ref rlngIdx, ref mobjDictReadCodes, ref mobjDictReadValues);
                        InternListBlockEnd(dobjAcadBlock4.BlockEnd, ref rlngIdx);
                    }
                }
            }
            finally
            {
                if (enumerator2 is IDisposable)
                {
                    (enumerator2 as IDisposable).Dispose();
                }
            }
            dobjAcadBlock4 = null;
        }
Пример #23
0
        //use regex or whatever fits your needs for subscription to topic matching
        //here we use the built in Like operator from VB.NET for this. just as an example
        public static EventStreamSubscription <object> SubscribeToTopic <T>(this EventStream self, string topic, Action <T> body) where T : ITopicMessage
        => self.Subscribe <T>(x => {
            if (!LikeOperator.LikeString(x.Topic, topic, CompareMethod.Binary))
            {
                return;
            }

            body(x);
        }
                              );
Пример #24
0
        /// <summary>
        /// Returns a value for the logical LIKE operator node.
        /// </summary>
        /// <param name="context">Context to evaluate expressions against.</param>
        /// <param name="evalContext">Current expression evaluation context.</param>
        /// <returns>
        /// true if the left operand matches the right operand, false otherwise.
        /// </returns>
        protected override object Get(object context, EvaluationContext evalContext)
        {
#if NET_2_0 && !MONO_2_0
            string text    = GetLeftValue(context, evalContext) as string;
            string pattern = GetRightValue(context, evalContext) as string;

            return(LikeOperator.LikeString(text, pattern, CompareMethod.Text));
#else
            throw new NotSupportedException("'like' operator is only supported in .NET 2.0 or higher.");
#endif
        }
Пример #25
0
        public static Stream GetFileFromAssembly(string fileMask)
        {
            fileMask = fileMask.ToLowerInvariant();

            var executingAssembly = Assembly.GetExecutingAssembly();

            return(executingAssembly.GetManifestResourceStream(executingAssembly.GetManifestResourceNames()
                                                               .Single(i =>
                                                                       LikeOperator.LikeString(i.ToLowerInvariant(),
                                                                                               fileMask,
                                                                                               CompareMethod.Text))));
        }
Пример #26
0
    private void LoadTypes()
    {
        //Discarded unreachable code: IL_0139, IL_017f, IL_0181, IL_0191, IL_01b3
        int num2 = default(int);
        int num3 = default(int);

        try
        {
            int num = 1;
            if (!LikeOperator.LikeString(Declarer.startPath, "*Debug", CompareMethod.Binary))
            {
                ProjectData.ClearProjectError();
                num2 = 1;
            }
            num = 3;
            tlv.ListViewItemSorter = null;
            num = 4;
            string[] array = My.MySettingsProperty.Settings.types.Split('|');
            num = 5;
            string[] array2 = array;
            foreach (string text in array2)
            {
                num = 6;
                ListViewItem listViewItem = tlv.Items.Add("." + text.Split(':')[2]);
                num = 7;
                listViewItem.SubItems.Add(text.Split(':')[1]);
                num = 8;
                if (Operators.CompareString(text.Split(':')[0], "P", TextCompare: false) == 0)
                {
                    num = 9;
                    listViewItem.SubItems.Add(SelfService.GetWord("yes"));
                }
                else
                {
                    num = 11;
                    listViewItem.SubItems.Add(SelfService.GetWord("no"));
                }
                num = 12;
            }
            num = 13;
            tlv.Items[0].Selected = true;
        }
        catch (Exception obj) when((obj is Exception && num2 != 0) & (num3 == 0))
        {
            ProjectData.SetProjectError((Exception)obj);
            /*Error near IL_01b1: Could not find block for branch target IL_0181*/;
        }
        if (num3 != 0)
        {
            ProjectData.ClearProjectError();
        }
    }
Пример #27
0
        void wild2()
        {
            txbResult.Text = "";
            d.ComeBack(); //khôi phục vị trí đầu danh sách data
            string   word = "", meaning = "";
            int      percent = 0, count = 0, total;
            string   pattern = txtPattern.Text;
            DateTime a       = DateTime.Now;

            total = MainDict.Dicts[MainDict.selected].totalWords + MainDict.Dicts[MainDict.selected].coincidentData;
            for (int i = 0; i < total; i++)
            {
                d.ReadNext(ref word, ref meaning);
                if (LikeOperator.LikeString(meaning, pattern, CompareMethod.Text))
                {
                    if (meaning.Length >= 50)
                    {
                        txbResult.AppendText(word + "   :   " + meaning.Substring(0, 50) + ".............\r\n");
                    }
                    else
                    {
                        txbResult.AppendText(word + "   :   " + meaning + "\r\n");
                    }
                    count++;
                    if (count >= 100)
                    {
                        txbResult.AppendText("Over 100 results, the application stopped searching");
                        turnOff           = true;
                        btnStop.Enabled   = false;
                        btnSearch.Enabled = true;
                        return;
                    }
                }
                percent = (int)((float)i / (MainDict.Dicts[MainDict.selected].totalWords - 1) * 100);
                if (percent != progressBar1.Value)
                {
                    progressBar1.Value = percent;
                }
                if (turnOff == true)
                {
                    progressBar1.Value = 0;
                    return;
                }
            }
            DateTime b = DateTime.Now;
            TimeSpan c = b.Subtract(a);

            txbResult.AppendText("Total searched time: " + c.TotalSeconds.ToString() + " second");
            turnOff           = true;
            btnStop.Enabled   = false;
            btnSearch.Enabled = true;
        }
Пример #28
0
 int GetEditableFileId(string url)
 {
     if (LikeOperator.LikeString(url, "fileid=*", CompareMethod.Binary))
     {
         var fileId = int.Parse(UrlUtils.GetParameterValue(url));
         var f      = FileManager.Instance.GetFile(fileId);
         if (Utilities.HasWritePermission(f.Folder, ModuleContext.PortalId))
         {
             return(fileId);
         }
     }
     return(-1);
 }
Пример #29
0
        public static bool Matches(this string s, string pattern, bool ignoreCase = false)
        {
            if (s == null || pattern == null)
            {
                return(false);
            }

            if (pattern == "*")
            {
                return(true); //shortcut, the method below is heavy!
            }
            return(LikeOperator.LikeString(s, pattern, ignoreCase ? Microsoft.VisualBasic.CompareMethod.Text : Microsoft.VisualBasic.CompareMethod.Binary));
        }
Пример #30
0
 public LikePredicate(Expr operand
                      , bool not
                      , LikeOperator op
                      , Expr pattern
                      , Expr escape)
 {
     this.Comments = new Comments((not ? 1 : 0) + (escape != null ? 1 : 0) + 1);
     this.Operand  = operand;
     this.Not      = not;
     this.Operator = op;
     this.Pattern  = pattern;
     this.Escape   = escape;
 }
Пример #31
0
 protected override string LikeOperation(string val1, string val2, LikeOperator opt)
 {
     switch (opt)
     {
         case LikeOperator.Contains:
             return string.Concat(val1, " LIKE '%' || ", val2, " || '%'");
         case LikeOperator.StartWith:
             return string.Concat(val1, " LIKE ", val2, " || '%'");
         case LikeOperator.EndWith:
             return string.Concat(val1, " LIKE '%' || ", val2);
         case LikeOperator.NotContains:
             return string.Concat(val1, " NOT LIKE '%' || ", val2, " || '%'");
         case LikeOperator.NotStartWith:
             return string.Concat(val1, " NOT LIKE ", val2, " || '%'");
         case LikeOperator.NotEndWith:
             return string.Concat(val1, " NOT LIKE '%' || ", val2);
         default:
             throw new ArgumentOutOfRangeException("opt");
     }
 }