Пример #1
0
        public override void UpdateProps()
        {
            string ext = null;

            if (m_ExplicitFileType != null)
            {
                SetPropertyString("explicitFileType", m_ExplicitFileType);
            }
            else if (m_LastKnownFileType != null)
            {
                SetPropertyString("lastKnownFileType", m_LastKnownFileType);
            }
            else
            {
                if (name != null)
                {
                    ext = Path.GetExtension(name);
                }
                else if (m_Path != null)
                {
                    ext = Path.GetExtension(m_Path);
                }
                if (ext != null)
                {
                    if (FileTypeUtils.IsFileTypeExplicit(ext))
                    {
                        SetPropertyString("explicitFileType", FileTypeUtils.GetTypeName(ext));
                    }
                    else
                    {
                        SetPropertyString("lastKnownFileType", FileTypeUtils.GetTypeName(ext));
                    }
                }
            }

            if (m_Path == name)
            {
                SetPropertyString("name", null);
            }
            else
            {
                SetPropertyString("name", name);
            }
            if (m_Path == null)
            {
                SetPropertyString("path", "");
            }
            else
            {
                SetPropertyString("path", m_Path);
            }
            SetPropertyString("sourceTree", FileTypeUtils.SourceTreeDesc(tree));
        }
Пример #2
0
 public override void UpdateVars()
 {
     children = GetPropertyList("children");
     path     = GetPropertyString("path");
     name     = GetPropertyString("name");
     if (name == null)
     {
         name = path;
     }
     if (path == null)
     {
         path = "";
     }
     tree = FileTypeUtils.ParseSourceTree(GetPropertyString("sourceTree"));
 }
Пример #3
0
 public override void UpdateVars()
 {
     name   = GetPropertyString("name");
     m_Path = GetPropertyString("path");
     if (name == null)
     {
         name = m_Path;
     }
     if (m_Path == null)
     {
         m_Path = "";
     }
     tree = FileTypeUtils.ParseSourceTree(GetPropertyString("sourceTree"));
     m_ExplicitFileType  = GetPropertyString("explicitFileType");
     m_LastKnownFileType = GetPropertyString("lastKnownFileType");
 }
Пример #4
0
 public override void UpdateProps()
 {
     // The name property is set only if it is different from the path property
     SetPropertyList("children", children);
     if (name == path)
     {
         SetPropertyString("name", null);
     }
     else
     {
         SetPropertyString("name", name);
     }
     if (path == "")
     {
         SetPropertyString("path", null);
     }
     else
     {
         SetPropertyString("path", path);
     }
     SetPropertyString("sourceTree", FileTypeUtils.SourceTreeDesc(tree));
 }