public static bool operator >=(FlowVersion o1, FlowVersion o2) { if (o1 == null && o2 == null) { return(false); } FlowVersion o = o1; FlowVersion oo = o2; if (o.Main >= oo.Main) { if (o.Sub >= oo.Sub) { var cresult = o.Extention.CompareTo(oo.Extention); if (cresult >= 0) { return(true); } else { return(false); } } else { return(false); } } else { return(false); } }
public static bool operator ==(FlowVersion o1, FlowVersion o2) { if (o1 == null && o2 == null) { return(false); } FlowVersion o = o1; FlowVersion oo = o2; if (o.Main == oo.Main && o.Sub == oo.Sub) { return(true); } else { return(false); } }
public static FlowVersion Parse(string str) { FlowVersion rtn = new FlowVersion(); if (ComFunc.nvl(str) != "") { var ss = str.Split('.'); if (ss.Length >= 2) { if (IntStd.IsInt(ss[0])) { rtn.Main = IntStd.ParseStd(ss[0]); } else { throw new InvalidCastException("flow version formated failed:lack of main"); } if (IntStd.IsInt(ss[1])) { rtn.Sub = IntStd.ParseStd(ss[1]); } else { throw new InvalidCastException("flow version formated failed:lack of sub"); } if (ss.Length > 2) { rtn.Extention = ss[2]; } } else { throw new InvalidCastException("flow version formated failed:the string's format is not \"main.sub[.extention]\""); } } return(rtn); }