public void Visit(UIOptionCategoryType category, object context)
        {
            Category vwCat = context as Category;

            for (int i = category.SubCategories.Count - 1; i >= 0; i--)
            {
                Category vwSubCat = (from cat in vwCat.SubCategories
                                     where cat.Name.Equals(category.SubCategories[i].Name, StringComparison.InvariantCultureIgnoreCase)
                                     select cat).FirstOrDefault();

                if (vwSubCat == null)
                {
                    if (_bTrimUnchanged)
                    {
                        category.SubCategories.RemoveAt(i);
                    }
                    continue;
                }
                else
                {
                    category.SubCategories[i].Accept(this, vwSubCat);
                }

                if (_bTrimUnchanged && category.SubCategories[i].Options.Count == 0)
                {
                    category.SubCategories.RemoveAt(i);
                }
            }
        }
		/// <summary>
		/// 
		/// </summary>
		/// <param name="optionsRoot">The options root object</param>
		/// <param name="context">The file name for XML Document</param>
		void IVisitorWithContext.Visit(UIOptionRootType optionsRoot, object context)
		{
			XmlDocument xmlDoc = new XmlDocument();
			Stream stream = context as Stream;
			if (stream == null)
			{
				xmlDoc.Load((string) context);
			}
			else
			{
				xmlDoc.Load(stream);
			}

			XmlNamespaceManager nsmgr = new XmlNamespaceManager(xmlDoc.NameTable);
			nsmgr.AddNamespace("ws", "http://schemas.workshare.com/Workshare.OptionMap.xsd");

			string xpath = "ws:OptionMap/ws:Category";
			XmlNodeList categories = xmlDoc.SelectNodes(xpath, nsmgr);

			foreach (XmlNode node in categories)
			{
				UIOptionCategoryType category = new UIOptionCategoryType();
				optionsRoot.Categories.Add(category);
				category.Accept(this, node);
			}
		}
Example #3
0
		void IVisitor.Visit(UIOptionCategoryType category)
		{
			foreach (UIOptionSubCategoryType subCategory in category.SubCategories)
			{
				subCategory.Accept(this);
			}
		}
Example #4
0
		void IVisitor.Visit(UIOptionCategoryType category)
		{
			this._catergoryName = category.Name;
			foreach (UIOptionSubCategoryType subCategory in category.SubCategories)
			{
				subCategory.Accept(this);
			}
		}
		void IVisitorWithContext.Visit(UIOptionCategoryType category, object context)
		{
			XmlNode categoryNode = (XmlNode) context;

			category.Name = categoryNode.Attributes["ID"].Value;
			category.DisplayText = categoryNode.Attributes["DisplayText"].Value;

			foreach (XmlNode node in categoryNode.ChildNodes)
			{
				UIOptionSubCategoryType subCategory = new UIOptionSubCategoryType();
				category.SubCategories.Add(subCategory);
				subCategory.Accept(this, node);
			}			
		}
Example #6
0
		/// <summary>
		/// 
		/// </summary>
		/// <param name="optionsRoot">The options root object</param>
		/// <param name="context">The file name for XML Document</param>
		void IVisitorWithContext.Visit(UIOptionRootType optionsRoot, object context)
		{
			XmlDocument xmlDoc = new XmlDocument();
			xmlDoc.Load((string) context);

			XmlNode rootNode = xmlDoc.SelectSingleNode("OptionsRoot");

			foreach (XmlNode node in rootNode.ChildNodes)
			{
				UIOptionCategoryType category = new UIOptionCategoryType();
				optionsRoot.Categories.Add(category);
				category.Accept(this, node);
			}
		}
Example #7
0
		void IVisitorWithContext.Visit(UIOptionCategoryType category, object context)
		{
			XmlNode rootNode = (XmlNode)context;
			XmlNode categoryNode = _xmlDoc.CreateNode(XmlNodeType.Element, category.Name, this._namespaceURI);

			XmlAttribute displayText = _xmlDoc.CreateAttribute("DisplayText");
			displayText.Value = category.DisplayText;
			categoryNode.Attributes.Append(displayText);

			foreach (UIOptionSubCategoryType subCategory in category.SubCategories)
			{
				subCategory.Accept(this, categoryNode);
			}

			rootNode.AppendChild(categoryNode);
		}
Example #8
0
		void IVisitor.Visit(UIOptionCategoryType category)
		{
			if ( _namePred != null && !_namePred(category.Name))
				return;

			//Create Category category
			_admFileWriter.StartCategory(category.DisplayText);

			foreach (UIOptionSubCategoryType subCategory in category.SubCategories)
			{
				if (_namePred != null && !_namePred(subCategory.Name))
					continue;

				subCategory.Accept(this);
			}

			_admFileWriter.EndCategory();
		}
        internal void MergeDefaults(UIOptionCategoryType defaultCat)
        {
            foreach (UIOptionSubCategoryType defaultSubCat in defaultCat.SubCategories)
            {
                UIOptionSubCategoryType existingSubCat = SubCategories.Find(cat => defaultSubCat.Name == cat.Name);
                if (existingSubCat != null)
                {
                    existingSubCat.MergeDefaults(defaultSubCat);
                }
                else
                {
                    SubCategories.Add(defaultSubCat);
                }
            }

            // remove all subcategories we have loaded that aren't in the default options...
            SubCategories.RemoveAll(cat => defaultCat.SubCategories.Find(dcat => dcat.Name == cat.Name) == null);
        }
Example #10
0
		internal void UpdateInternalSubCategory(MainViewModel model, UIOptionCategoryType category,
		                                        UIOptionSubCategoryType internalSubCategory)
		{
			var shellCategory = model.GetCategory(category.Name) ?? BuildShellCategory(category);
			shellCategory.Model = model;

			ProcessInternalOptions(model, internalSubCategory);
			return;
		}
Example #11
0
		private Category BuildShellCategory(UIOptionCategoryType category)
		{
			var shellCategory = new Category
			                    	{
			                    		Name = category.Name,
			                    		DisplayName = category.DisplayText,
			                    		Order = GetOrderId(category.Name, string.Empty),
			                    	};
			return shellCategory;
		}
Example #12
0
		private void ProcessCategory(MainViewModel model, Dictionary<string, AreaOption> areas, UIOptionCategoryType category)
		{
			var shellCategory = model.GetCategory(category.Name) ?? BuildShellCategory(category);
			shellCategory.Model = model;

			foreach (var subCategory in category.SubCategories)
			{
				if (subCategory.Name == "Internal")
				{
					ProcessInternalOptions(model, subCategory);
					return;
				}
				ProcessSubCategory(model, areas, shellCategory, subCategory);
			}
		}
 public void Visit(UIOptionCategoryType category)
 {
     throw new NotImplementedException();
 }
		private static void FilterInterwoven(UIOptionCategoryType dmsCategory)
		{
			string[] filter = new string[] { "iManage" };
			if (!EnabledFeatures.InterwovenEnabled)
			{
				DeleteSubCatebory(dmsCategory, filter);
			}
		}
		private static void DeleteSubCatebory(UIOptionCategoryType category, string[] filter)
		{
			foreach (string s in filter)
			{
				category.SubCategories.RemoveAt(category.SubCategories.FindIndex(a => a.Name == s));
			}
		}
 private static void FilterSecureFileTransfer(UIOptionCategoryType ProtectCategory)
 {
     string[] filter = new string[] { "SendLink" };
     if (!EnabledFeatures.SecureFileTransferEnabled)
     {
         DeleteSubCatebory(ProtectCategory, filter);
     }
 }
		private static void FilterNetDocuments(UIOptionCategoryType dmsCategory)
		{
			string[] filter = new string[] { "NetDocuments" };
			if (!EnabledFeatures.NetDocumentsEnabled)
			{
				DeleteSubCatebory(dmsCategory, filter);
			}
		}
		private static void FilterSharePoint(UIOptionCategoryType dmsCategory)
		{
			string[] filter = new string[] { "SharePoint" };
			if (!EnabledFeatures.SharePointEnabled)
			{
				DeleteSubCatebory(dmsCategory, filter);
			}
		}
Example #19
0
 void IVisitor.Visit(UIOptionCategoryType category)
 {
     throw new NotImplementedException();
 }
		private static void FilterHummingbird(UIOptionCategoryType dmsCategory)
		{
			string[] filter = new string[] { "eDOCS" };
			if (!EnabledFeatures.HummingbirdEnabled)
			{
				DeleteSubCatebory(dmsCategory, filter);
			}
		}