示例#1
0
        private static void OnOrgFullNameChangedCallback(DependencyObject obj, DependencyPropertyChangedEventArgs arg)
        {
            FileNameInfo owner = (FileNameInfo)obj;

            owner.OrgName = Path.GetFileName(owner.OrgFullName);
            var strs = owner.OrgName.Split('-');

            if (strs.Count() >= 3 && strs[0] == "小样")
            {
                owner.Format = strs[1];
                owner.Disc   = strs[2];
                for (int i = 3; i < strs.Count(); i++)
                {
                    string fnc    = strs[i];
                    int    sindex = fnc.IndexOf('(');
                    int    eindex = fnc.IndexOf(')');
                    if (sindex > 0 && eindex > 0 && sindex < eindex)
                    {
                        string sfn    = fnc.Substring(0, sindex);
                        string sc     = fnc.Substring(sindex + 1, eindex - sindex - 1);
                        int    ncount = 0;
                        if (int.TryParse(sc, out ncount) && ncount > 0)
                        {
                            owner.FaceNameCounts.Add(new FaceNameCount()
                            {
                                FaceName = sfn, Count = ncount
                            });
                        }
                    }
                }
                owner.UpdateNewName();
            }
            else
            {
                owner.Format = Config.Settings.lstFormat.Count == 0 ? "" : Config.Settings.lstFormat[0];
            }
        }
示例#2
0
        private static void OnRefInfoChangedCallback(DependencyObject obj, DependencyPropertyChangedEventArgs arg)
        {
            FileNameInfo owner = (FileNameInfo)obj;

            owner.UpdateNewName();
        }