示例#1
0
        private void Done()
        {
            // update label parameters and report page layout
            XmlItem labelParameters = lbxLabels.SelectedItem as XmlItem;

            SetReportPageLayout(labelParameters, FReport.Pages[0] as ReportPage);

            // save user-defined labels to config file
            XmlItem customManufacturer = FLabels.Root[FLabels.Root.Count - 1];
            XmlItem configLabels       = Config.Root.FindItem("LabelWizard");

            configLabels.Clear();
            for (int i = 0; i < customManufacturer.Count; i++)
            {
                XmlItem addItem = configLabels.Add();
                addItem.Name = "CustomLabel";
                addItem.Text = customManufacturer[i].Text;
            }

            // write last used items
            configLabels.SetProp("Manufacturer", SelectedManufacturer);
            configLabels.SetProp("Label", SelectedLabelName);

            // tell the designer to reflect changes
            FReport.Designer.SetModified(null, "ChangeReport");
        }
示例#2
0
 public void Add(string text, int pageNo, float offsetY)
 {
     curItem      = curItem.Add();
     curItem.Name = "item";
     curItem.SetProp("Text", text);
     curItem.SetProp("Page", pageNo.ToString());
     curItem.SetProp("Offset", Converter.ToString(offsetY));
 }
示例#3
0
 public void Save(XmlItem rootItem)
 {
     rootItem.Clear();
     for (int i = 0; i < FNames.Count; i++)
     {
         XmlItem xi = rootItem.Add();
         xi.Name = FNames.Keys[i];
         xi.Text = "name=\"" + FNames.Values[i].SourceName + "\"";
     }
 }
示例#4
0
 public void Save(XmlItem rootItem)
 {
     rootItem.Clear();
     for (int i = 0; i < pages.Count; i++)
     {
         using (FRWriter writer = new FRWriter(rootItem.Add()))
         {
             writer.Write(pages[i]);
         }
     }
 }
示例#5
0
 public void Save(XmlItem rootItem)
 {
     rootItem.Clear();
     foreach (BookmarkItem item in FItems)
     {
         XmlItem xi = rootItem.Add();
         xi.Name = "item";
         xi.SetProp("Name", Converter.ToXml(item.Name));
         xi.SetProp("Page", item.PageNo.ToString());
         xi.SetProp("Offset", Converter.ToString(item.OffsetY));
     }
 }
示例#6
0
        private void Init()
        {
            // load standard labels
            FLabels = new XmlDocument();
            using (Stream labelStream = ResourceLoader.UnpackStream("labels.dat"))
            {
                FLabels.Load(labelStream);
            }

            // add user-defined labels
            XmlItem customManufacturer = FLabels.Root.Add();

            customManufacturer.SetProp("Name", Res.Get("Forms,LabelWizard,Custom"));

            // get the list of user labels from config file
            XmlItem configLabels = Config.Root.FindItem("LabelWizard");

            for (int i = 0; i < configLabels.Count; i++)
            {
                XmlItem addItem = customManufacturer.Add();
                addItem.Text = configLabels[i].Text;
            }

            // make a list of manufacturers
            lbxLabels.ItemHeight = DrawUtils.DefaultItemHeight;
            for (int i = 0; i < FLabels.Root.Count; i++)
            {
                cbxLabels.Items.Add(FLabels.Root[i].GetProp("Name"));
            }

            // position to last used items
            int index = cbxLabels.Items.IndexOf(configLabels.GetProp("Manufacturer"));

            if (index >= 0)
            {
                cbxLabels.SelectedIndex = index;

                for (int i = 0; i < lbxLabels.Items.Count; i++)
                {
                    XmlItem item = lbxLabels.Items[i] as XmlItem;
                    if (item.GetProp("Name") == configLabels.GetProp("Label"))
                    {
                        lbxLabels.SelectedIndex = i;
                        break;
                    }
                }
            }
            else
            {
                cbxLabels.SelectedIndex = 0;
            }
        }
示例#7
0
 private void UpdateUnlimitedPage(Base obj, XmlItem item)
 {
     item.Clear();
     using (FRWriter writer = new FRWriter(item))
     {
         writer.SerializeTo  = SerializeTo.Preview;
         writer.SaveChildren = false;
         writer.BlobStore    = preparedPages.BlobStore;
         writer.Write(obj);
     }
     foreach (Base child in obj.ChildObjects)
     {
         UpdateUnlimitedPage(child, item.Add());
     }
 }
示例#8
0
        public override void Done(DialogResult result)
        {
            if (result == DialogResult.OK)
            {
                FDesigner.UIStyle = (UIStyle)cbxUIStyle.SelectedIndex;
                Config.UIStyle    = FDesigner.UIStyle;

                XmlItem pluginsItem = Config.Root.FindItem("Plugins");
                pluginsItem.Clear();

                foreach (object item in lbPlugins.Items)
                {
                    XmlItem xi = pluginsItem.Add();
                    xi.Name = "Plugin";
                    xi.SetProp("Name", item.ToString());
                }
            }
        }
示例#9
0
        public void Save(XmlItem rootItem)
        {
            rootItem.Clear();
            foreach (KeyValuePair <string, DictionaryItem> pair in names)
            {
                XmlItem xi = rootItem.Add();
                xi.Name = pair.Key;
                xi.ClearProps();
                xi.SetProp("name", pair.Value.SourceName);
                //xi.Text = String.Concat("name=\"", pair.Value.SourceName, "\"");
            }

            //for (int i = 0; i < FNames.Count; i++)
            //{
            //  XmlItem xi = rootItem.Add();
            //  xi.Name = FNames.Keys[i];
            //  xi.Text = "name=\"" + FNames.Values[i].SourceName + "\"";
            //}
        }
示例#10
0
        private bool DoAdd(Base c, XmlItem item)
        {
            if (c == null)
            {
                return(false);
            }
            ReportEngine engine    = Report.Engine;
            bool         isRunning = Report.IsRunning && engine != null;

            if (c is ReportComponentBase)
            {
                if (isRunning && !engine.CanPrint(c as ReportComponentBase))
                {
                    return(false);
                }
            }

            item = item.Add();
            using (FRWriter writer = new FRWriter(item))
            {
                writer.SerializeTo  = SerializeTo.Preview;
                writer.SaveChildren = false;
                writer.BlobStore    = preparedPages.BlobStore;
                writer.Write(c);
            }
            if (isRunning)
            {
                engine.AddObjectToProcess(c, item);
            }

            if ((c.Flags & Flags.CanWriteChildren) == 0)
            {
                ObjectCollection childObjects = c.ChildObjects;
                foreach (Base obj in childObjects)
                {
                    DoAdd(obj, item);
                }
            }

            return(true);
        }