Exemplo n.º 1
0
        /// <summary>
        /// Load Meta Data
        /// </summary>
        /// <param name="ctx"></param>
        /// <returns></returns>
        protected override POInfo InitPO(Ctx ctx)
        {
            PropertiesWrapper wrapper = (PropertiesWrapper)ctx;

            p_ctx     = wrapper.source;
            tableName = wrapper.tableName;
            tableID   = MTable.Get_Table_ID(tableName);
            // log.info("Table_ID: "+Table_ID);
            POInfo poi = POInfo.GetPOInfo(ctx, tableID);

            return(poi);
        }
        public PropertiesWrapper GetPropertiesWrapper(string template)
        {
            string            templateDirectory = GetDataDirectory() + "\\Templates";
            string            templatePath      = Directory.GetFiles(templateDirectory).FirstOrDefault(x => Path.GetFileName(x) == template);
            PropertiesWrapper ret = new PropertiesWrapper();

            using (ZipArchive archive = ZipFile.OpenRead(templatePath))
            {
                foreach (ZipArchiveEntry entry in archive.Entries)
                {
                    if (entry.FullName.EndsWith("Properties.json", StringComparison.OrdinalIgnoreCase))
                    {
                        ret = _json.DeserializeObject <PropertiesWrapper>(new StreamReader(entry.Open()).ReadToEnd());
                        break;
                    }
                }
            }
            ret.TemplateZip = templatePath;
            return(ret);
        }
 public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
 {
     if (context != null && context.Instance != null && provider != null)
     {
         IWindowsFormsEditorService edSvc = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));
         if (edSvc != null)
         {
             IInlineActionHolder iah = context.Instance as IInlineActionHolder;
             if (iah == null)
             {
                 PropertiesWrapper pw = context.Instance as PropertiesWrapper;
                 if (pw != null)
                 {
                     iah = pw.Owner as IInlineActionHolder;
                 }
             }
             if (iah != null && iah.Method != null)
             {
                 InlineAction ia  = value as InlineAction;
                 IAction      act = null;
                 if (ia != null)
                 {
                     act = ia.Action;
                 }
                 FrmObjectExplorer dlg = DesignUtil.CreateSelectActionDialog(iah.Method, act, null, false);
                 if (dlg != null)
                 {
                     if (edSvc.ShowDialog(dlg) == System.Windows.Forms.DialogResult.OK)
                     {
                         value = new InlineAction(dlg.SelectedAction);
                     }
                 }
             }
         }
     }
     return(value);
 }
Exemplo n.º 4
0
 public SitecoreResourceManagerArgs(Dictionary <string, DefaultCollector> properties, PropertiesWrapper wrapper) : base(properties)
 {
     Wrapper = wrapper;
 }