コード例 #1
0
    private void checkedListBox1_ItemCheck(object sender, ItemCheckEventArgs e)
    {
        //Should always be true,lt in logic though to allow for a option to control the box itself in case
        Transformation t = (Transformation)0x0;

        List <int> indexes = new List <int>();

        foreach (int index in this.checkedListBox1.CheckedIndices)
        {
            indexes.Add(index);
        }

        if (e.NewValue == CheckState.Checked)
        {
            indexes.Add(e.Index);
        }
        else if (e.NewValue == CheckState.Unchecked)
        {
            indexes.Remove(e.Index);
        }

        foreach (int index in indexes)
        {
            string s = this.checkedListBox1.Items[index].ToString();
            t |= UAUtilities.GetTransformationFromString(s);
        }

        view.ApplyFilter(delegate(ResponseResult rr) { return(((rr.Transformation) & t) > 0); });
        this.refreshBindings();
    }
コード例 #2
0
ファイル: XmlMappingLoader.cs プロジェクト: zjw0358/wtgw
        private static Transformation GetTransformationFromXmlNode(XmlNode TransformationNode)
        {
            Transformation t = Transformation.None;

            if (TransformationNode.Name == "Transformations")
            {
                //Next setup the transformations
                foreach (XmlAttribute attr in TransformationNode.Attributes)
                {
                    t |= UAUtilities.GetTransformationFromString(attr.Name.Trim());
                }
            }
            return(t);
        }