private void CreateTextFrame() { string headerFooterWidth = GetHeaderFooterWidth(); ArrayList ReferenceNames = new ArrayList { "top-left", "top-center", "top-right", "bottom-left", "bottom-center", "bottom-right" }; float frameHeight = 24f;//20.0f Dictionary<string, string> classValues = _cssProperty[_pageClass]; float halfWidth = float.Parse(classValues["Page-Width"], CultureInfo.GetCultureInfo("en-US")) / 2; _x1 = halfWidth - float.Parse(classValues["Margin-Left"], CultureInfo.GetCultureInfo("en-US")); float halfHeight = float.Parse(classValues["Page-Height"], CultureInfo.GetCultureInfo("en-US")) / 2; yt1 = halfHeight - float.Parse(classValues["Margin-Top"], CultureInfo.GetCultureInfo("en-US")); ytr = yt1 += float.Parse(classValues["Margin-Top"], CultureInfo.GetCultureInfo("en-US")) / 2; // 4 inch = place header in 2 inch - Heade to center yt2 = ybl = yt1 + frameHeight; float y = halfHeight - float.Parse(classValues["Margin-Bottom"], CultureInfo.GetCultureInfo("en-US")); float yb1 = y + float.Parse(classValues["Margin-Bottom"], CultureInfo.GetCultureInfo("en-US")) / 2; // 4 inch = place header in 2 inch - Heade to center float yb2 = yb1 + frameHeight; float x2 = 22;// _x1 - float.Parse(headerFooterWidth); float x3 = 22;// float.Parse(headerFooterWidth) - (_x1 - float.Parse(headerFooterWidth));//x2 40 float x4 = _x1 + 1;// (_x1 - float.Parse(headerFooterWidth));// x3 + float.Parse(headerFooterWidth); + 18 // x1,y1 x2,y2 // // x2,y1 x2,y2 // float[,] sign = { {-1 * _x1, -1 * yt1, -1 * _x1, -1 * ybl, -1 * x2, -1 * yt2, -1 * x2, -1 * ytr}, {-1 * x2, -1 * ytr, -1 * x2, -1 * yt2, 1 * x3, -1 * yt2, 1 * x3, -1 * ytr}, {1 * x3, -1 * yt1, 1 * x3, -1 * ybl, 1 * x4, -1 * yt2, 1 * x4, -1 * ytr}, {-1 * _x1, 1 * yb1, -1 * _x1, 1 * yb2, -1 * x2, 1 * yb2, -1 * x2, 1 * yb1}, {1 * x3, 1 * yb1, 1 * x3, 1 * yb2, -1 * x2, 1 * yb2, -1 * x2, 1 * yb1}, {1 * x3, 1 * yb1, 1 * x3, 1 * yb2, 1 * x4, 1 * yb2, 1 * x4, 1 * yb1} }; for (int i = 0; i < ReferenceNames.Count; i++) { string parentStory = "u19c"; string className = _pageClass + "-" + ReferenceNames[i]; if (_cssProperty.ContainsKey(className)) { Dictionary<string, string> Properties = _cssProperty[className]; if (Properties.ContainsKey("content")) { string newStory = string.Empty; var inStoryHeaderFooter = new InStoryHeaderFooter(); string folderPath = _projectPath.Replace("MasterSpreads", "Stories"); string storyName = GetStoryName(_pageClass, ReferenceNames[i].ToString()); string property = Properties["content"].Replace("|", ""); string format = GetReferenceFormat(property); if (property.IndexOf("counter") >= 0) { newStory = inStoryHeaderFooter.CreateStoryforHeaderFooter(folderPath, storyName, "PageCount", className, _headwordStyles); } else if (format == "BF CF:VF-CL:VL" || format == "BF CF-CL" || format == "BF CF" || format == "BL CL" || format == "BF CF:VF" || format == "BL CL:VL" || format == "GF" || format == "GL") { newStory = inStoryHeaderFooter.CreateStoryforHeaderFooter(folderPath, storyName, format, className, _headwordStyles); } if (newStory.Length > 0) { if (!_masterPageList.Contains(newStory)) _masterPageList.Add(newStory); parentStory = newStory.Replace("Story_", "").Replace(".xml", ""); } } } string FrameName = ReferenceNames[i].ToString().Replace("-", ""); CreateMainFrameStaticMethod1(FrameName, parentStory); CreateReferenceFrameProperties(sign[i, 0], sign[i, 1], sign[i, 2], sign[i, 3], sign[i, 4], sign[i, 5], sign[i, 6], sign[i, 7]); CreateReferenceFramePreferenceforReferences(headerFooterWidth); CreateMainFrameStaticMethod2(); } }
private void CreateTextFrame() { string headerFooterWidth = GetHeaderFooterWidth(); ArrayList ReferenceNames = new ArrayList { "top-left", "top-center", "top-right", "bottom-left", "bottom-center", "bottom-right" }; float frameHeight = 24f;//20.0f Dictionary <string, string> classValues = _cssProperty[_pageClass]; float halfWidth = float.Parse(classValues["Page-Width"], CultureInfo.GetCultureInfo("en-US")) / 2; _x1 = halfWidth - float.Parse(classValues["Margin-Left"], CultureInfo.GetCultureInfo("en-US")); float halfHeight = float.Parse(classValues["Page-Height"], CultureInfo.GetCultureInfo("en-US")) / 2; yt1 = halfHeight - float.Parse(classValues["Margin-Top"], CultureInfo.GetCultureInfo("en-US")); ytr = yt1 += float.Parse(classValues["Margin-Top"], CultureInfo.GetCultureInfo("en-US")) / 2; // 4 inch = place header in 2 inch - Heade to center yt2 = ybl = yt1 + frameHeight; float y = halfHeight - float.Parse(classValues["Margin-Bottom"], CultureInfo.GetCultureInfo("en-US")); float yb1 = y + float.Parse(classValues["Margin-Bottom"], CultureInfo.GetCultureInfo("en-US")) / 2; // 4 inch = place header in 2 inch - Heade to center float yb2 = yb1 + frameHeight; float x2 = 22; // _x1 - float.Parse(headerFooterWidth); float x3 = 22; // float.Parse(headerFooterWidth) - (_x1 - float.Parse(headerFooterWidth));//x2 40 float x4 = _x1 + 1; // (_x1 - float.Parse(headerFooterWidth));// x3 + float.Parse(headerFooterWidth); + 18 // x1,y1 x2,y2 // // x2,y1 x2,y2 // float[,] sign = { { -1 * _x1, -1 * yt1, -1 * _x1, -1 * ybl, -1 * x2, -1 * yt2, -1 * x2, -1 * ytr }, { -1 * x2, -1 * ytr, -1 * x2, -1 * yt2, 1 * x3, -1 * yt2, 1 * x3, -1 * ytr }, { 1 * x3, -1 * yt1, 1 * x3, -1 * ybl, 1 * x4, -1 * yt2, 1 * x4, -1 * ytr }, { -1 * _x1, 1 * yb1, -1 * _x1, 1 * yb2, -1 * x2, 1 * yb2, -1 * x2, 1 * yb1 }, { 1 * x3, 1 * yb1, 1 * x3, 1 * yb2, -1 * x2, 1 * yb2, -1 * x2, 1 * yb1 }, { 1 * x3, 1 * yb1, 1 * x3, 1 * yb2, 1 * x4, 1 * yb2, 1 * x4, 1 * yb1 } }; for (int i = 0; i < ReferenceNames.Count; i++) { string parentStory = "u19c"; string className = _pageClass + "-" + ReferenceNames[i]; if (_cssProperty.ContainsKey(className)) { Dictionary <string, string> Properties = _cssProperty[className]; if (Properties.ContainsKey("content")) { string newStory = string.Empty; var inStoryHeaderFooter = new InStoryHeaderFooter(); string folderPath = _projectPath.Replace("MasterSpreads", "Stories"); string storyName = GetStoryName(_pageClass, ReferenceNames[i].ToString()); string property = Properties["content"].Replace("|", ""); string format = GetReferenceFormat(property); if (property.IndexOf("counter") >= 0) { newStory = inStoryHeaderFooter.CreateStoryforHeaderFooter(folderPath, storyName, "PageCount", className, _headwordStyles); } else if (format == "BF CF:VF-CL:VL" || format == "BF CF-CL" || format == "BF CF" || format == "BL CL" || format == "BF CF:VF" || format == "BL CL:VL" || format == "GF" || format == "GL") { newStory = inStoryHeaderFooter.CreateStoryforHeaderFooter(folderPath, storyName, format, className, _headwordStyles); } if (newStory.Length > 0) { if (!_masterPageList.Contains(newStory)) { _masterPageList.Add(newStory); } parentStory = newStory.Replace("Story_", "").Replace(".xml", ""); } } } string FrameName = ReferenceNames[i].ToString().Replace("-", ""); CreateMainFrameStaticMethod1(FrameName, parentStory); CreateReferenceFrameProperties(sign[i, 0], sign[i, 1], sign[i, 2], sign[i, 3], sign[i, 4], sign[i, 5], sign[i, 6], sign[i, 7]); CreateReferenceFramePreferenceforReferences(headerFooterWidth); CreateMainFrameStaticMethod2(); } }