Пример #1
0
        protected static void AddResourceKey(List <ResourceItem> keys, Screen screen, GridColumn Column, string Prefix, string ResourceKey, string DefaultValue)
        {
            ResourceItem key = new Core.ResourceItem();

            key.ResourceSet = String.Format("App/{0}/{1}", screen.Folder, screen.Name);
            string UniqueName = Column.UniqueName;

            if (String.IsNullOrEmpty(UniqueName))
            {
                UniqueName = Column.HeaderText;
            }

            if (String.IsNullOrEmpty(Prefix))
            {
                key.Key = String.Format("{0}.{1}", UniqueName, ResourceKey);
            }
            else
            {
                key.Key = String.Format("{0}.{1}.{2}", Prefix, UniqueName, ResourceKey);
            }
            key.Value = DefaultValue;

            if (!String.IsNullOrEmpty(DefaultValue))
            {
                keys.Add(key);
            }
        }
Пример #2
0
        public string CommitResourceitem(String revision, Core.ResourceItem resourceItem, string username, string password)
        {
            //Auth login and IP
            AuthorizeClient(username, password);

            RevisionStorage revstorage = new RevisionStorage();

            revstorage.SaveResourceItem(resourceItem, revision);
            revstorage.Dispose();


            return("woo");
        }
Пример #3
0
        protected static void AddResourceKey(List <ResourceItem> keys, Screen screen, string ResourceKey, string DefaultValue)
        {
            ResourceItem key = new Core.ResourceItem();

            key.ResourceSet = String.Format("App/{0}/{1}", screen.Folder, screen.Name);
            key.Key         = ResourceKey;
            key.Value       = DefaultValue;

            if (!String.IsNullOrEmpty(DefaultValue))
            {
                keys.Add(key);
            }
        }
Пример #4
0
        protected static void AddResourceKey(List <ResourceItem> keys, Screen screen, Widget control, string Prefix, string ResourceKey, string DefaultValue)
        {
            ResourceItem key = new Core.ResourceItem();

            key.ResourceSet = String.Format("App/{0}/{1}", screen.Folder, screen.Name);
            if (String.IsNullOrEmpty(Prefix))
            {
                key.Key = String.Format("Control.{0}.{1}", control.Name, ResourceKey);
            }
            else
            {
                key.Key = String.Format("{0}.Control.{1}.{2}", Prefix, control.Name, ResourceKey);
            }
            key.Value = DefaultValue;

            if (!String.IsNullOrEmpty(DefaultValue))
            {
                keys.Add(key);
            }
        }
Пример #5
0
        public static List <ResourceItem> GetResourceKeys(MenuItem item, string MenuName, string Prefix)
        {
            List <ResourceItem> retVal = new List <ResourceItem>();
            string newPrefix           = null;

            if (String.IsNullOrEmpty(Prefix))
            {
                ResourceItem key = new Core.ResourceItem();

                key.ResourceSet = String.Format("Menu.{0}", MenuName);
                key.Key         = String.Format("{0}.MenuItem.Name", item.Code);
                key.Value       = item.Name;

                retVal.Add(key);
                newPrefix = String.Format("{0}", item.Code);
            }
            else
            {
                ResourceItem key = new Core.ResourceItem();

                key.ResourceSet = String.Format("Menu.{0}", MenuName);
                key.Key         = String.Format("{0}.{1}.MenuItem.Name", Prefix, item.Code);
                key.Value       = item.Name;

                retVal.Add(key);

                newPrefix = String.Format("{0}.{1}", Prefix, item.Code);
            }



            foreach (MenuItem i in item.Items)
            {
                List <ResourceItem> childKeys = GetResourceKeys(i, MenuName, newPrefix);
                retVal.AddRange(childKeys);
            }

            return(retVal);
        }